mapstp.cli package

Submodules

mapstp.cli.logging module

Intercept log messages from the used libraries and pass them to loguru.

See https://github.com/Delgan/loguru

class mapstp.cli.mapstp_logging.InterceptHandler[source]

Bases: Handler

Send events from standard logging to loguru.

emit(record)[source]

See logging.Handler.emit().

Parameters:
Return type:

None

mapstp.cli.mapstp_logging.init_logger(*, stderr_format='<green>{time:YYYY-MM-DD HH:mm:ss}</green> | <level>{level: <8}</level> | <level>{message}</level>', log_path=PosixPath('mapstp.log'))[source]

Configure logger with given parameters.

Parameters:
  • stderr_format (str | None) – log message format for stderr handler, if None, no stderr logging.

  • log_path (Path | None) – path to file for logging, if None, no file logging.

Return type:

None

mapstp.cli.runner module

Application to transfer meta information from STP.

For given STP file creates Excel table with a list of STP paths to STP components, corresponding to cells in MCNP model, would it be generated from the STP with SuperMC.

The Excel also contains material numbers, densities, correction factors, and RWCL(RadWaste Check List) id. The values can be specified in the names of STP components as special tags. A tag is denoted with bracket enclosed specification at the end of component name: “Component name [<spec>]”. The spec may contain space separated entries:

  • m-<mnemonic> - first column in a special material-index.xlxs file.

  • f-<factor> - float number for density correction factor

  • r-<rwcl> - any label to categorize the components for RWCL

If MCNP file is also specified as the second mcnp argument, then produces output MCNP file with STP paths inserted as end of line comments after corresponding cells with prefix “sep:”. The material numbers and densities are set according to the meta information provided in the STP.

class mapstp.cli.runner.Config[source]

Bases: object

Shared configuration.

__init__(override=False)
Parameters:

override (bool)

Return type:

None

override: bool = False

Module contents

Command line interface code.

mapstp.cli.init_logger(*, stderr_format='<green>{time:YYYY-MM-DD HH:mm:ss}</green> | <level>{level: <8}</level> | <level>{message}</level>', log_path=PosixPath('mapstp.log'))[source]

Configure logger with given parameters.

Parameters:
  • stderr_format (str | None) – log message format for stderr handler, if None, no stderr logging.

  • log_path (Path | None) – path to file for logging, if None, no file logging.

Return type:

None