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#
- symlinks: List[str]#
- 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#
- symlink: bool = False#
- class pymchelper.utils.mcscripter.Template(files: ~typing.List[~pymchelper.utils.mcscripter.McFile] = <factory>)[source]#
Bases:
object
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.