at.lattice.options#
Global set of constants.
Module Attributes
Functions
Return the test mode value. |
|
|
Context manager to set a "test mode" integer value. |
- set_test_mode(mode=1)[source]#
Context manager to set a "test mode" integer value.
- Parameters:
mode (int) – a non-zero value which will be returned by the
test_mode()
function.
Example
>>> assert not test_mode(), "test mode should not be set" >>> with set_test_mode(): ... assert test_mode(), "test mode should be set"
Test mode contexts can be nested:
>>> with set_test_mode(1): ... assert test_mode() == 1, "outer context" ... with set_test_mode(2): ... assert test_mode() == 2, "inner context" ... assert test_mode() == 1, "back to outer context"
- test_mode()[source]#
Return the test mode value.
- Returns:
test_mode – 0 outside a
set_test_mode()
context. Within such context, return its non-zero value
- DConstant = <at.lattice.options._Dst object>#
Default values for AT algorithms
- XYStep#
Coordinate step for differentiation
- DPStep#
Momentum step for dispersion and chromaticity
- OrbConvergence#
Convergence criterion for orbit
- OrbMaxIter#
Max. number of iterations for orbit
- omp_num_threads#
Default number of OpenMP threads
- patpass_poolsize#
Default size of multiprocessing pool
- patpass_startmethod#
Default start method for the multiprocessing
- reset(attrname)#
Reset the attribute to its default value
- random = <at.lattice.options._Random object>#
Random generators for AT
- reset(seed=None)#
Reset the generators.
Examples
>>> at.random.common.random() 0.8699988509120198
Generates a random number in [0, 1) which is identical in all threads
>>> at.random.thread.normal(size=5) array([-0.02326275, -0.89806482, -1.69086929, -0.74399398, 0.70156743])
Generates an array of Gaussian random values which is specific to each thread