Skip to content

Commit

Permalink
Merge pull request #21 from austin-hoover/typo
Browse files Browse the repository at this point in the history
Fix typos in LinacTransportMatrixGenNodes.py
  • Loading branch information
azukov authored Jun 20, 2024
2 parents b284793 + 70746d3 commit 4d826b4
Show file tree
Hide file tree
Showing 6 changed files with 694 additions and 690 deletions.
1,082 changes: 543 additions & 539 deletions examples/SNS_Linac/pyorbit3_transport_matrix_gen/pyorbit_transport_mtrx.dat

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
sys.path.append("../pyorbit3_linac_model")
from sns_linac_bunch_generator import SNS_Linac_BunchGenerator

from orbit.py_linac.lattice import LinacTrMatricesContrioller
from orbit.py_linac.lattice import LinacTrMatricesController

from orbit.core.orbit_utils import Matrix

Expand Down Expand Up @@ -148,7 +148,7 @@

print("===== Aperture Nodes Added =======")

trMatricesGenerator = LinacTrMatricesContrioller()
trMatricesGenerator = LinacTrMatricesController()

# ----- prepare the nodes
# ----- They could be just several nodes of interest or many nodes
Expand All @@ -165,7 +165,7 @@
# node1 = accLattice.getNodeForName("MEBT_Mag:QH14")
# parent_tr_mtrx_nodes = [node0,node1]

trMatrices = trMatricesGenerator.addTrMatrxGenNodes(accLattice, parent_tr_mtrx_nodes)
trMatrices = trMatricesGenerator.addTrMatrixGenNodes(accLattice, parent_tr_mtrx_nodes)

# ---- The use of Twiss weights makes transport matrices more accurate.
for trMtrx in trMatrices:
Expand Down
16 changes: 8 additions & 8 deletions py/orbit/py_linac/lattice/LinacTransportMatrixGenNodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def setInternalIndex(self, ind):

def getTrMatricesController(self):
"""
Returns the LinacTrMatricesContrioller that keeps the references to the TrMatrxGenNodes.
Returns the LinacTrMatricesController that keeps the references to the TrMatrxGenNodes.
"""
return self.trMatricesController

Expand Down Expand Up @@ -179,9 +179,9 @@ def printMatrix(self):
print("")


class LinacTrMatricesContrioller:
class LinacTrMatricesController:
"""
LinacTrMatricesContrioller keeps the references to the LinacTrMatrixGenNode
LinacTrMatricesController keeps the references to the LinacTrMatrixGenNode
instances.
"""

Expand All @@ -208,7 +208,7 @@ def init(self):
node = self.trMatrxNodes[node_ind]
node.setInternalIndex(node_ind)

def addTrMatrxGenNodes(self, accLattice, node_or_nodes, place=MarkerLinacNode.ENTRANCE):
def addTrMatrixGenNodes(self, accLattice, node_or_nodes, place=MarkerLinacNode.ENTRANCE):
"""
Adds the LinacTrMatrixGenNode to the nodes as child nodes.
"""
Expand Down Expand Up @@ -239,14 +239,14 @@ def accNodeExitAction(paramsDict):
self.init()
return self.trMatrxNodes

def addTrMatrxGenNodesAtEntrance(self, accLattice, node_or_node):
def addTrMatrixGenNodesAtEntrance(self, accLattice, node_or_nodes):
"""
Adds the LinacTrMatrixGenNode to the nodes as child nodes at the entrance.
"""
self.addTrMatrxGenNodes(accLattice, node_or_nodes, MarkerLinacNode.ENTRANCE)
self.addTrMatrixGenNodes(accLattice, node_or_nodes, MarkerLinacNode.ENTRANCE)

def addTrMatrxGenNodesAtExit(self, accLattice, node_or_node):
def addTrMatrixGenNodesAtExit(self, accLattice, node_or_nodes):
"""
Adds the LinacTrMatrixGenNode to the nodes as child nodes at the exit.
"""
self.addTrMatrxGenNodes(accLattice, node_or_nodes, MarkerLinacNode.EXIT)
self.addTrMatrixGenNodes(accLattice, node_or_nodes, MarkerLinacNode.EXIT)
4 changes: 2 additions & 2 deletions py/orbit/py_linac/lattice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from orbit.py_linac.lattice.LinacAccLatticeFunc import getAllMagnetsInLattice

from orbit.py_linac.lattice.LinacTransportMatrixGenNodes import LinacTrMatrixGenNode
from orbit.py_linac.lattice.LinacTransportMatrixGenNodes import LinacTrMatricesContrioller
from orbit.py_linac.lattice.LinacTransportMatrixGenNodes import LinacTrMatricesController

from orbit.py_linac.lattice.LinacDiagnosticsNodes import LinacBPM

Expand Down Expand Up @@ -86,6 +86,6 @@
__all__.append("getAllMagnetsInLattice")

__all__.append("LinacTrMatrixGenNode")
__all__.append("LinacTrMatricesContrioller")
__all__.append("LinacTrMatricesController")

__all__.append("LinacBPM")
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def getBunch(self, nParticles=0, distributorClass=WaterBagDist3D, cut_off=-1.0):

script_dir = os.path.dirname(__file__)

from orbit.py_linac.lattice import LinacTrMatricesContrioller
from orbit.py_linac.lattice import LinacTrMatricesController

random.seed(100)

Expand Down Expand Up @@ -240,7 +240,7 @@ def read_lines(file):

print("===== Aperture Nodes Added =======")

trMatricesGenerator = LinacTrMatricesContrioller()
trMatricesGenerator = LinacTrMatricesController()

# ----- prepare the nodes
# ----- They could be just several nodes of interest or many nodes
Expand All @@ -257,7 +257,7 @@ def read_lines(file):
# node1 = accLattice.getNodeForName("MEBT_Mag:QH14")
# parent_tr_mtrx_nodes = [node0,node1]

trMatrices = trMatricesGenerator.addTrMatrxGenNodes(accLattice, parent_tr_mtrx_nodes)
trMatrices = trMatricesGenerator.addTrMatrixGenNodes(accLattice, parent_tr_mtrx_nodes)

# ---- The use of Twiss weights makes transport matrices more accurate.
for trMtrx in trMatrices:
Expand Down

0 comments on commit 4d826b4

Please sign in to comment.