pymchelper.utils package#

Subpackages#

Submodules#

pymchelper.utils.mcscripter module#

Tool for creating MC input files using user-specified tables and ranges.

2019 - Niels Bassler

class pymchelper.utils.mcscripter.Config(const_dict: ~typing.Dict[str, str] = <factory>, table_dict: ~typing.Dict[str, ~typing.List[str]] = <factory>, path: ~pathlib.Path = <factory>, files: ~typing.List[str] = <factory>, symlinks: ~typing.List[str] = <factory>)[source]#

Bases: object

Description needed.

const_dict: Dict[str, str]#
files: List[str]#
path: Path#
table_dict: Dict[str, List[str]]#
class pymchelper.utils.mcscripter.McFile(path: ~pathlib.Path = <factory>, symlink: bool = False, lines: ~typing.List[str] = <factory>)[source]#

Bases: object

General MC single file object. This will be used for the template files as well as the generated output files.

property fname#

Description needed

lines: List[str]#
path: Path#
read()[source]#

Description needed

write()[source]#

Description needed

class pymchelper.utils.mcscripter.Template(files: ~typing.List[~pymchelper.utils.mcscripter.McFile] = <factory>)[source]#

Bases: object

Description needed.

files: List[McFile]#
static prepare(cfg: Config) Generator[source]#

Description needed.

write(working_directory: PathLike, cfg: Config, quiet: bool = True)[source]#

Description needed.

pymchelper.utils.mcscripter.lreplace(text: str, old: str, new: str) str[source]#

Left adjusted replacement of string f with string r, in string s.

This function is implemented in order to fill in data in FORTRAN77 fields, which are tied to certain positions on the line, i.e. subsequent values may not be shifted.

Finds string f in string s and replaces it with string r, but left adjusted, retaining line length. If length of r is shorter than length of f, remaining chars will be space padded. If length of r is larger than length of f, then characters will be overwritten. A copy of s with the replacement is returned.

pymchelper.utils.mcscripter.main(args=None)[source]#

Main function.

pymchelper.utils.mcscripter.read_config(path: PathLike, quiet: bool = True) Config[source]#

Description needed

pymchelper.utils.mcscripter.read_template(cfg: Config) Template[source]#

Description needed.

pymchelper.utils.runmc module#

pymchelper.utils.runmc.main(args=None)[source]#

Entry point to the runmc script: argument parsing and calling run method

pymchelper.utils.runmc.set_logger_level(args)[source]#

Set logger verbosity and quietness based on parsed arguments Checks for presence of quiet (-q) and verbose (-v) switches

Module contents#