Skip to content

PDep explorer cannot read any RMG-written network file (bath-gas rule enforced on the wrong file) #183

Description

@alongd

The Arkane PES-explorer path added in #179 rejects every network file RMG writes. Not an edge case — the whole feature path, for real RMG output.

The rule, and where it is enforced

write_arkane_explorer_input_file requires every bath-gas label to resolve to a species() block carrying a literal reactive=False (t3/pdep/explorer/input_file.py:703-745, ~line 748):

Bath gas label '{label}' is a species() block that does not carry a literal 'reactive=False' keyword.

The intent is correct. Arkane identifies the bath gas as the unreactive species, and a bath-gas species left reactive makes Arkane try to generate statmech for it (arkane/input.py:207-217, whose own error text says "If it is a bath gas, set reactive = False to avoid generating…").

Why no RMG file can satisfy it

arkane/pdep.py:654 PressureDependenceJob.save_input_file() — the function RMG calls at rmgpy/rmg/pdep.py:869 to write pdep/network<i>_<n>.py — writes species blocks containing exactly: label, structure, E0, modes, spinMultiplicity, opticalIsomers, molecularWeight, collisionModel, energyTransferModel, thermo.

reactive is never written, for any species. There is no code path in that writer that emits it.

Confirmed on this repo's own real fixture: in tests/data/pdep_network/iteration_1/RMG/pdep/network4_2.py, He (line 225) and Ne (line 237) are named as bathGas in the network(...) block (line 438) while their species() blocks carry no reactive keyword at all. tests/test_pdep/test_explorer_input_file.py:11-14 already concedes the fixture "cannot exercise the bath-gas-refusal … paths" — the tests pass because they use hand-built strings that real RMG never produces.

The information is present, in the other block

The same save_input_file does write the bath gas, into network(...):

f.write('    bathGas = {\n')
for spec, frac in self.network.bath_gas.items():

populated upstream from rmgpy/rmg/pdep.py:856-858:

bath_gas = [spec for spec in reaction_model.core.species if not spec.reactive]
assert len(bath_gas) > 0, 'No unreactive species to identify as bath gas'

So the bath-gas identity is authoritative and always present — in network(...), which T3's writer deliberately drops.

Suggested direction

Treat the source's network(...) bathGas as the authoritative declaration, and emit reactive=False on those species in the file T3 generates. That is a faithful translation between two encodings of the same fact in a T3-authored file, not a rewrite of user input. It would also let bath_gas default sensibly instead of the current trap where PDepExplorerConfig(bath_gas=None) passes construction-time validation (config.py:202-213) and only raises at write time (input_file.py:703-707), after the run directory has been claimed.

Design questions worth settling before implementing: whether to default config.bath_gas from the network block, inject reactive=False on write, or both; and what should happen when a source species carries an explicit reactive=True while being named as bath gas (conflict → refuse, presumably).

Related

  • run_arkane_job has no timeout and no kill path (t3/pdep/explorer/arkane.py:381-399, noted in a comment there); a hung Arkane hangs the campaign.
  • Separately: RMG's assert len(bath_gas) > 0 means a pdep run with no declared inert dies deep inside network generation. A T3 schema validator refusing that at input time is worth adding — this was the one surviving idea from the now-closed Pdep fixes #60.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions