mf6rtm.config package

Submodules

mf6rtm.config.config module

class mf6rtm.config.config.ConfigSchema(group, toml_name=None)

Bases: object

Schema definition for configuration grouping.

group: str
toml_name: str | None = None
class mf6rtm.config.config.MF6RTMConfig(**kwargs)

Bases: object

MF6RTM Configuration class similar to FloPy package structure. This class provides a FloPy-style interface for configuring MF6RTM reaction timing parameters.

Parameters:
  • reaction_timing (str, optional) – Controls when reactions are calculated. Options: - ‘all’ : Calculate reactions at all time steps (default) - ‘user’ : Calculate reactions only at user-specified time steps - ‘adaptive’ : Use adaptive timing based on convergence criteria

  • tsteps (List[Tuple[int, int]], optional) – List of (kper, kstp) tuples specifying when reactions should be calculated. Only used when reaction_timing=’user’. Default is empty list. kper is stress period (1-based), kstp is time step (1-based).

reaction_timing

Current reaction timing strategy.

Type:

str

tsteps

List of time steps for reaction calculations.

Type:

List[Tuple[int, int]]

add_new_configuration(**kwargs)

Add new configuration parameters dynamically.

classmethod from_dict(config_dict)
Return type:

MF6RTMConfig

classmethod from_toml_file(filepath)

Load configuration from TOML file.

Parameters:

filepath (str) – Path to TOML configuration file.

Returns:

New configuration instance loaded from file.

Return type:

MF6RTMConfig

get_tsteps_for_period(kper)

Get time steps for a specific stress period.

Parameters:

kper (int) – Stress period number (1-based).

Returns:

List of time step numbers for the given stress period.

Return type:

List[int]

Examples

>>> config = MF6RTMConfig(reactive_timing='user',
...                       reactive_tsteps=[(1, 1), (1, 10), (2, 5)])
>>> config.get_tsteps_for_period(1)
[1, 10]
is_reaction_tstep(kper, kstp)

Check if reactions should be calculated at a specific time step.

Parameters:
  • kper (int) – Stress period number (1-based).

  • kstp (int) – Time step number (1-based).

Returns:

True if reactions should be calculated at this time step.

Return type:

bool

Examples

>>> config = MF6RTMConfig(reaction_timing='user', tsteps=[(1, 1)])
>>> config.is_reaction_tstep(1, 1)
True
>>> config.is_reaction_tstep(1, 2)
False
save_to_file(filepath)

Save configuration to TOML file.

Parameters:

filepath (str) – Path where TOML file should be saved.

to_dict()

Convert configuration to dictionary for TOML output with nested structure.

Return type:

Dict[str, Any]

mf6rtm.config.yaml_reader module

mf6rtm.config.yaml_reader.load_yaml_to_phreeqcrm(yaml_file_path)

Load a YAML file and reconstruct a YAMLPhreeqcRM instance.

Parameters:

yaml_file_path (str) – Path to the YAML file

Returns:

Reconstructed instance

Return type:

YAMLPhreeqcRM