BifrostScrVarPathsManager

class PlasmaCalcs.hookups.bifrost.bifrost_io_tools.BifrostScrVarPathsManager(snap, calc)

Bases: BifrostVarPathsManager

manages filepaths (as abspaths) and readable vars for a SCR_SNAP

self.kind2path = {kind: path}
self.kind2vars = {kind: [list of readable vars]}
self.var2kind = {var: kind}
self.var2path = {var: path}
self.path2kind = {path: kind}
self.path2vars = {path: [list of readable vars]}
self.var2index = {var: index of var in its path’s list of vars}
self.kinds: tuple of kinds with any vars in self.
self.vars: tuple of all vars in self.
self.paths: tuple of all paths with any vars in self.
kinds are: ‘snap’, ‘aux’, ‘hion’, ‘helium’, ‘ooe’.
if kind has no vars, do not include it in results.
snap: BifrostSnap
calc: BifrostCalculator

Methods

help()

print docstring of self...

init_aux_kind()

vars stored in snapname_NNN.aux file.

init_convenience()

initialize convenience tuples.

init_helium_kind()

vars stored in snapname.helium_NNN.snap file.

init_hion_kind()

vars stored in snapname.hion_NNN.snap file.

init_kinds()

initialize all kinds in self, filling in all the details for self's storage dicts.

init_ooe_kind()

out of equilibrium vars.

init_snap_kind()

vars stored in snapname_NNN.snap file.

init_storage()

initialize storage dicts.

kind2filebase(kind)

returns file basename for this kind.

snappath(filename)

returns os.path.join(self.snapdir, filename)

_init_kind_vars_path(kind, vars, path)

updates self with corresponding kind, vars, and path.

_repr_contents()

contents for repr(self), as list of strings

Attributes

KIND2FILEBASE

KINDS

NNN

(str) the NNN part of the snapname_NNN.idl filename.

aux_todo

list of all vars in 'aux' not yet handled by this VarPathsManager instance.

calc

gets self._calc(), or just self._calc if not self._calc_is_weakref.

params

alias to self.snap.params

snap

gets self._snap(), or just self._snap if not self._snap_is_weakref.

snapdir

alias to self.calc.snapdir

snapname

alias to self.params['snapname']

property NNN

(str) the NNN part of the snapname_NNN.idl filename.

_init_kind_vars_path(kind, vars, path)

updates self with corresponding kind, vars, and path.

_repr_contents()

contents for repr(self), as list of strings

property aux_todo

list of all vars in ‘aux’ not yet handled by this VarPathsManager instance.

Presently, this means the list of all vars containing ‘xy’, ‘yz’, or ‘xz’.
property calc

gets self._calc(), or just self._calc if not self._calc_is_weakref.

help()

print docstring of self…

init_aux_kind()

vars stored in snapname_NNN.aux file.

init_convenience()

initialize convenience tuples.

init_helium_kind()

vars stored in snapname.helium_NNN.snap file.

init_hion_kind()

vars stored in snapname.hion_NNN.snap file.

init_kinds()

initialize all kinds in self, filling in all the details for self’s storage dicts.

init_ooe_kind()

out of equilibrium vars.

init_snap_kind()

vars stored in snapname_NNN.snap file.

init_storage()

initialize storage dicts.

kind2filebase(kind)

returns file basename for this kind.

Equivalent: self.KIND2FILEBASE[kind].format(snapname=self.snapname, NNN=self.NNN)
property params

alias to self.snap.params

property snap

gets self._snap(), or just self._snap if not self._snap_is_weakref.

property snapdir

alias to self.calc.snapdir

property snapname

alias to self.params[‘snapname’]

snappath(filename)

returns os.path.join(self.snapdir, filename)