orbithunter.core.Orbit.__getattr__

Orbit.__getattr__(attr)[source]

Allows parameters, discretization variables to be retrieved by label directly

Notes

This is setup to allow easy reference of parameters without adding to the Orbit namespace. It also increases readability in mathematical statements

Examples

For an Orbit type with parameter labels ( “t”, “x”, “y”, “z”) the spacetime volume could be written

>>> Orbit.t * Orbit.x * Orbit.y * Orbit.z

Instead of

>>> Orbit.parameters[0] *  Orbit.parameters[1] *  Orbit.parameters[2] *  Orbit.parameters[3]

Although to be fair I would probably just use np.prod in this case. This also goes for discretization parameters.