jax_dna.simulators.oxdna.utils

Utilities for the oxDNA simulator.

Attributes

ERR_CANNOT_PROCESS_SRC_H

ERR_INVALID_HEADER_TYPE

SYMPY_EVAL_N

DEFAULT_OXDNA_VARIABLE_MAPPER

MIN_VALID_HEADER_TOKEN_COUNT

Functions

_parse_value_in(→ int | float | str)

_parse_value_out(→ str)

read_src_h(→ dict[str, int | float | str])

Parse the src/model.h file to get the parameters.

write_src_h(→ None)

Write the src/model.h file with the new parameters.

update_params(→ None)

Update the src/model.h file with the new parameters.

Module Contents

jax_dna.simulators.oxdna.utils.ERR_CANNOT_PROCESS_SRC_H = 'Cannot process src/model.h file. Failed parsing: {}'
jax_dna.simulators.oxdna.utils.ERR_INVALID_HEADER_TYPE = 'Invalid header value variable {} with value {}'
jax_dna.simulators.oxdna.utils.SYMPY_EVAL_N: int = 32
jax_dna.simulators.oxdna.utils.DEFAULT_OXDNA_VARIABLE_MAPPER
jax_dna.simulators.oxdna.utils.MIN_VALID_HEADER_TOKEN_COUNT = 3
jax_dna.simulators.oxdna.utils._parse_value_in(value: str) int | float | str[source]
jax_dna.simulators.oxdna.utils._parse_value_out(value: int | float | str) str[source]
jax_dna.simulators.oxdna.utils.read_src_h(src_h: pathlib.Path) dict[str, int | float | str][source]

Parse the src/model.h file to get the parameters.

jax_dna.simulators.oxdna.utils.write_src_h(src_h: pathlib.Path, params: dict[str, tuple[jax_dna.utils.types.oxDNAModelHType, int | float | str]]) None[source]

Write the src/model.h file with the new parameters.

jax_dna.simulators.oxdna.utils.update_params(src_h: pathlib.Path, new_params: list[jax_dna.utils.types.Params]) None[source]

Update the src/model.h file with the new parameters.