pyextal.jaxJoint.engine¶
Keeping the Fortran engine on the dataset being worked on.
bloch_parse loads one .dat into the engine’s module state, and several
things the refinement needs read that state rather than anything passed to
them: get_bloch_constants, the symmetry operations (spgr, used by
GroupSymmetry and appliedSymmetry), lookupSF/defaultsf, and
beamcheck – which calculate_tilt_dependent_values calls per tilt, at
setup and at every geometry rebuild. With several datasets the engine must hold
the right one whenever any of these runs, so every such step goes through
EngineSwitch.activate.
Re-parsing is safe: the engine’s allocators release the previous arrays first.
terminate() is not: it ends the engine for the life of the process, so it
must never run between datasets. jaxJoint never calls bloch_run, so there is
nothing to terminate at the end either.
Attributes¶
Classes¶
Parses each dataset's |
Module Contents¶
- pyextal.jaxJoint.engine.MAX_DAT_PATH = 120¶
- class pyextal.jaxJoint.engine.EngineSwitch¶
Parses each dataset’s
.datinto the engine on demand.Datasets are added in order; activate re-parses only when the engine holds a different
.dat, so two datasets built against the same file never re-parse between them.- _dats = []¶
- _params¶
- _beams¶
- _loaded = None¶
- _tmp = None¶
- parses = 0¶
- add(dat)¶
Registers a dataset’s
.datand returns its index.
- _short(dat)¶
- record(d, constants)¶
Remembers the beam list dataset
d’s setup was built with.
- activate(d)¶
Makes the engine hold dataset
d’s.dat.- Parameters:
d (int) – Dataset index.
- Returns:
From that dataset’s
bloch_parse.- Return type:
- Raises:
RuntimeError – If the re-parsed beam list differs from the one the dataset was set up with.
- _check(d)¶