bluemira.codes.process.api

PROCESS api

Attributes

OBS_VARS

ENABLED

Classes

MFile

Dummy MFile Class. Replaced by PROCESS import if PROCESS installed.

InDat

Dummy InDat Class. Replaced by PROCESS import if PROCESS installed.

_INVariable

Process io.in_dat.INVariable replica

Impurities

PROCESS impurities Enum

Functions

update_obsolete_vars(→ str | list[str] | None)

Check if the bluemira variable is up to date using the OBS_VAR dict.

_nested_check(process_name)

Recursively checks for obsolete variable names

Module Contents

class bluemira.codes.process.api.MFile(filename)

Dummy MFile Class. Replaced by PROCESS import if PROCESS installed.

filename
class bluemira.codes.process.api.InDat(filename)

Dummy InDat Class. Replaced by PROCESS import if PROCESS installed.

filename
bluemira.codes.process.api.OBS_VARS
bluemira.codes.process.api.ENABLED = True
class bluemira.codes.process.api._INVariable

Process io.in_dat.INVariable replica

Used to simulate what process does to input variables for the InDat input file writer

This allows the defaults to imitate the same format as PROCESS’ InDat even if PROCESS isn’t installed. Therefore they will work the same in all cases and we dont always need to be able to read a PROCESS input file.

name: str
_value: float | list | dict
v_type: TypeVar('InVarValueType')
parameter_group: str
comment: str
property get_value: float | list | dict

Return value in correct format

Return type:

float | list | dict

property value: str | list | dict

Return the string of a value if not a Dict or a List

Return type:

str | list | dict

class bluemira.codes.process.api.Impurities

Bases: enum.IntEnum

Inheritance diagram of bluemira.codes.process.api.Impurities

PROCESS impurities Enum

H
He
Be
C
N
O
Ne
Si
Ar
Fe
Ni
Kr
Xe
W
files() dict[str, pathlib.Path]

Get PROCESS impurity data file path

Returns:

The available file paths

Raises:

CodesError – Impurity directory not found

Return type:

dict[str, pathlib.Path]

id()
Returns:

The variable string for impurity fraction

read_impurity_files(filetype: collections.abc.Sequence[Literal['lz', 'z2', 'z']]) tuple[list[process.impurity_radiation.ImpurityDataHeader], Ellipsis]
Returns:

Contents of impurity data files

Parameters:

filetype (collections.abc.Sequence[Literal['lz', 'z2', 'z']])

Return type:

tuple[list[process.impurity_radiation.ImpurityDataHeader], Ellipsis]

bluemira.codes.process.api.update_obsolete_vars(process_map_name: str) str | list[str] | None

Check if the bluemira variable is up to date using the OBS_VAR dict. If the PROCESS variable name has been updated in the installed version this function will provide the updated variable name.

Parameters:

process_map_name (str) – PROCESS variable name.

Returns:

PROCESS variable names valid for the install (if OBS_VAR is updated correctly). Returns a list if an obsolete variable has been split into more than one new variable (e.g., a thermal shield thickness is split into ib/ob thickness). Returns None if there is no alternative.

Return type:

str | list[str] | None

bluemira.codes.process.api._nested_check(process_name)

Recursively checks for obsolete variable names

Returns:

The newest process name