Ebysus_eParamTable

class PlasmaCalcs.hookups.ebysus.ebysus_io_tools.Ebysus_eParamTable(filename)

Bases: EbysusParamTable

multifluid params table for Ebysus, from mf_eparam_file (e.g. mf_eparams.in).

instance behaves like dict of params:
self[key] <–> self.params[key]
self.params.keys() <–> self.params.keys()
self.raw saves basic cleaned file contents,
while self.params is more ready-to-use and has slightly different names,
e.g. convert ints to ints, and rename keys to:
‘nspecies_max’ (NSPECIES_MAX), ‘collcross_tables’ (CROSS_SECTIONS_TABLES).
filename: str
path to file. Internally stored as abspath.
Parsed as follows (ignoring comments (# or ;), trimming whitespace and blank lines):
KEY
SOME WHITESPACE SEPARATED VALUES # repeated any number of times, same size each time.
# repeat any number of times (different key each time). Keys can be in any order.
# do NOT include quotation marks, even for string-valued quantities like file paths.
Here is a description of possible keys and the expected formats within each:
NSPECIES_MAX: maximum number of spcies allowed. Also determines COLISIONS_MAP shape in file.
N # (only 1 integer, only 1 row.) Example: N=10
CROSS_SECTIONS_TABLES: charged-neutral collision cross section tables.
SS CROSSFILE
01 e-h-bruno-fits.txt # (example)
02 e-he-bruno-fits.txt # (example)
COLISIONS_MAP: obsolete. Will still be read into self.raw, if it exists.
For backwards compatibility, ensure it is the “default” value,
i.e. a single row, with NSPECIES_MAX values, all > 0.

Methods

__getitem__(key)

return self.params[key].

__iter__()

raises TypeError; use .keys(), .values(), or .items() instead.

__repr__()

repr(self).

__setitem__(key, value)

set self.params[key] = value.

get(key[, default])

return self[key].

init_from_raw()

initialize stuff from self.raw.

init_params()

initialize self.params.

items()

return tuple of (key, value) pairs corresponding to self.keys() and self.values().

keys()

return keys of self.params.

parse_file()

parse file, returning dict of list of lists of values.

values()

return tuple of values corresponding to self.keys().

_assert_default_COLISIONS_MAP()

assert self.raw['COLISIONS_MAP'] is the default value; crash otherwise.

_assert_ncols_matches_nspecies_max(key)

asserts (ncols for this key) == NSPECIES_MAX, else raise FileContentsConflictError.

Attributes

nspecies_max

alias to self['nspecies_max'], equivalent to self.params['nspecies_max'].

sizes

dict of lengths of keys' values from self, except for nspecies_max.

__getitem__(key)

return self.params[key].

__iter__()

raises TypeError; use .keys(), .values(), or .items() instead.

__repr__()

repr(self).

__setitem__(key, value)

set self.params[key] = value.

_assert_default_COLISIONS_MAP()

assert self.raw[‘COLISIONS_MAP’] is the default value; crash otherwise.

_assert_ncols_matches_nspecies_max(key)

asserts (ncols for this key) == NSPECIES_MAX, else raise FileContentsConflictError.

get(key, default=UNSET)

return self[key]. if default is provided and self[key] doesn’t exist, return default.

init_from_raw()

initialize stuff from self.raw.

init_params()

initialize self.params. Includes ‘nspecies_max’ key.

All other keys expected to be added by subclass during init_from_raw().
items()

return tuple of (key, value) pairs corresponding to self.keys() and self.values().

keys()

return keys of self.params.

property nspecies_max

alias to self[‘nspecies_max’], equivalent to self.params[‘nspecies_max’].

parse_file()

parse file, returning dict of list of lists of values.

property sizes

dict of lengths of keys’ values from self, except for nspecies_max.

values()

return tuple of values corresponding to self.keys().