Skip to content

Commit

Permalink
Added deepcopy around variables to prevent next line to set their fir…
Browse files Browse the repository at this point in the history
…st element to zero.
  • Loading branch information
SebastienJoly authored and SebastienJoly committed Nov 5, 2024
1 parent b58d83b commit 0c12d7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pySC/lattice_properties/response_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ def SCgetModelRING(SC: SimulatedCommissioning, includeAperture: bool =False) ->
ring = SC.IDEALRING.deepcopy()
for ord in range(len(SC.RING)):
if hasattr(SC.RING[ord], 'SetPointA') and hasattr(SC.RING[ord], 'SetPointB'):
ring[ord].PolynomA = SC.RING[ord].SetPointA
ring[ord].PolynomB = SC.RING[ord].SetPointB
ring[ord].PolynomA = copy.deepcopy(SC.RING[ord].SetPointA)
ring[ord].PolynomB = copy.deepcopy(SC.RING[ord].SetPointB)
ring[ord].PolynomA[0] = 0.0
ring[ord].PolynomB[0] = 0.0
if includeAperture:
Expand Down

0 comments on commit 0c12d7b

Please sign in to comment.