Python interface#

Running the ReacNetGenerator#

You can use the Python interface:

from reacnetgenerator import ReacNetGenerator
ReacNetGenerator(
  inputfiletype="dump",
  inputfilename="dump.ch4",
  atomname=['C', 'H', 'O'],
  ).runanddraw()

See ReacNetGenerator class for detailed parameters.

Calculate rate constants#

An effiective tool is provided in reacnetgenerator.tools.calculate_rate to calculate rate constants.

Explicit output directory#

The convenience API returns semantic artifact paths and writes its default outputs below the requested directory.

from reacnetgenerator import run

result = run(
    input_path="trajectory.lammpstrj",
    output_dir="artifacts",
    input_type="dump",
    atomname=["C", "H", "O"],
    items=("species", "reactions", "network", "report"),
    runHMM=False,
)
print(result["artifacts"]["species"])
print(result["provenance"]["parameters"])

The existing ReacNetGenerator class accepts the same output_dir keyword and exposes the mapping as generator.artifacts. The convenience result also records the normalized/defaulted parameters, explicitly supplied parameter names, and requested items as JSON-serializable provenance.