Skip to content

Commit

Permalink
update from variables
Browse files Browse the repository at this point in the history
  • Loading branch information
lfarv committed Dec 19, 2023
1 parent 89f646b commit 580bc07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pyat/at/latticetools/response_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@
from ..lattice import AtError, Lattice, Refpts, Orbit, AxisDef, plane_
from .observables import ObservableList, OrbitObservable, LatticeObservable
from .observables import TrajectoryObservable
from ..lattice.variables import Variable, VariableList
from ..lattice.element_variables import RefptsVariable
from ..lattice.variables import VariableBase, VariableList
from ..lattice.lattice_variables import RefptsVariable

_globring = None
_globobs = None


def _resp_one(ring: Lattice, observables: ObservableList, variable: Variable):
def _resp_one(ring: Lattice, observables: ObservableList, variable: VariableBase):
variable.step_up(ring=ring)
observables.evaluate(ring)
op = observables.flat_weighted_values
variable.step_down(ring=ring)
observables.evaluate(ring)
om = observables.flat_weighted_values
variable.set_initial(ring=ring)
variable.reset(ring=ring)
return 0.5 * (op - om)


def _resp_one_fork(variable: Variable):
def _resp_one_fork(variable: VariableBase):
# noinspection PyTypeChecker
return _resp_one(_globring, _globobs, variable)

Expand Down

0 comments on commit 580bc07

Please sign in to comment.