BifrostScrVarPathsManager

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

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 bcalc: BifrostCalculator

Methods

help()

print docstring of self...

init_all()

init all KINDS in self.

init_aux_kind()

vars stored in snapname_NNN.aux file.

init_helium_kind()

vars stored in snapname.helium_NNN.snap file.

init_hion_kind()

vars stored in snapname.hion_NNN.snap file.

init_ooe_kind()

out of equilibrium vars.

init_snap_kind()

vars stored in snapname_NNN.snap file.

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.

Attributes

KIND2FILEBASE

KINDS

NNN

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

bcalc

gets self._bcalc(), or just self._bcalc if not self._bcalc_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.bcalc.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.

property bcalc

gets self._bcalc(), or just self._bcalc if not self._bcalc_is_weakref.

help()

print docstring of self…

init_all()

init all KINDS in self.

init_aux_kind()

vars stored in snapname_NNN.aux file.

init_helium_kind()

vars stored in snapname.helium_NNN.snap file.

init_hion_kind()

vars stored in snapname.hion_NNN.snap file.

init_ooe_kind()

out of equilibrium vars.

init_snap_kind()

vars stored in snapname_NNN.snap file.

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.bcalc.snapdir

property snapname

alias to self.params[‘snapname’]

snappath(filename)

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