Skip to content

Refactor REACTER file handling and simplify data storage - #107

Merged
janitha-mahanthe merged 22 commits into
0.3-devfrom
0.3-dev-refacter-lmp-files
Aug 17, 2026
Merged

Refactor REACTER file handling and simplify data storage#107
janitha-mahanthe merged 22 commits into
0.3-devfrom
0.3-dev-refacter-lmp-files

Conversation

@janitha-mahanthe

@janitha-mahanthe janitha-mahanthe commented Aug 17, 2026

Copy link
Copy Markdown
Member

This pull request introduces several enhancements and refactorings to the vinyl and tetrafluoroethylene (TFE) polymerization reaction templates, input parsing, and simulation setup configuration in AutoREACTER. The main focus is on improving reaction template specificity, expanding configurability for simulation setup, and clarifying code structure and documentation. Below are the most important changes grouped by theme:

Vinyl and TFE Polymerization Reaction Templates

  • Refactored and expanded the vinyl polymerization reaction templates in vinyl_polymers.py to clarify atom mapping, add detailed comments, and introduce new templates for copolymerization initiation and TFE (PTFE) polymerization. Some reactions (e.g., radical coupling termination) are now provided as commented-out options with thorough documentation for user control. [1] [2] [3]
  • Updated TFE (PTFE) polymerization to distinguish between initiation, propagation, and termination steps, with clearer atom mapping and chain growth logic.

Input Parsing and Simulation Configuration

  • Extended the SimulationSetup dataclass to support new configuration options: deep_search, reaction_iteration_depth, wildcards, deduplicate_reaction_templates, and write_second_reaction_stage, with sensible defaults and improved documentation. [1] [2]
  • Enhanced input validation in InputParser to parse and validate the new simulation options, supporting multiple aliases for each option and setting up loop/iteration logic based on reaction_iteration_depth. [1] [2]

Monomer and File Handling

  • Added a new optional field lmp_molecule_file to the MonomerEntry class to track the LAMMPS molecule file path, with updated docstrings to clarify file generation responsibilities.

CLI and Reaction Preparation

  • Moved the generation of highlighted reaction template images from prepare_reactions to the main process method in arx_cli.py, ensuring images are only generated during the main workflow and not during preparation. [1] [2]

These changes improve the clarity, flexibility, and extensibility of reaction handling and simulation setup in AutoREACTER, making it easier for users to configure advanced polymerization workflows and maintain control over reaction selection and simulation stages.

Removes intermediate LMPMoleculeFiles, MoleculeFile, and TemplateFile dataclasses. LAMMPS molecule file paths are now stored directly on MonomerEntry, and reaction template/map file paths are stored on ReactionMetadata. REACTERFiles is simplified accordingly.
Update REACTER file preparation to copy LUNAR molecule files directly onto the matching monomer entries instead of returning a separate molecule file list. This also removes unused template/molecule data from the generated REACTERFiles payload and replaces an improper cross-module logger import with a local module logger.
@janitha-mahanthe janitha-mahanthe added this to the v0.3-beta milestone Aug 17, 2026
@janitha-mahanthe
janitha-mahanthe requested a balanced review from Copilot August 17, 2026 21:23
@janitha-mahanthe janitha-mahanthe self-assigned this Aug 17, 2026
@janitha-mahanthe janitha-mahanthe added the enhancement New feature or request label Aug 17, 2026
@read-the-docs-community

read-the-docs-community Bot commented Aug 17, 2026

Copy link
Copy Markdown

Documentation build overview

📚 AutoREACTER | 🛠️ Build #34109316 | 📁 Comparing 48b2114 against latest (14c029c)

  🔍 Preview build  

3 files changed
± change_log.html
± overview.html
± supported-reactions.html

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors reaction metadata/file storage, expands polymerization templates, and adds configurable reaction progression and simulation stages.

Changes:

  • Stores generated files directly on monomer/reaction metadata.
  • Adds workflow, deduplication, wildcard, and second-stage options.
  • Expands vinyl, TFE, epoxy, styrene, and IPN examples.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
examples/test.json Updates the default epoxy example.
examples/test_styrene.json Adds varied styrene systems.
examples/test_ethelene.json Replaces ethene with styrene data.
examples/test_epoxy.json Updates the diepoxy structure.
examples/test_epoxy_dgeba_dds.json Adds a DGEBA/DDS example.
examples/DGEBA_MMA_IPN.json Adds an IPN example.
examples/DGEBA_MMA_IPN_homo2.json Adds an MMA homopolymer example.
examples/DGEBA_MMA_IPN_homo1.json Adds a TEGDMA homopolymer example.
AutoREACTER/sim_setup/writers/writer.py Makes stage two optional.
AutoREACTER/sim_setup/writers/rxn_second_stage_writer.py Refactors second-stage generation.
AutoREACTER/sim_setup/writers/rxn_first_stage_writer.py Uses direct reaction file paths.
AutoREACTER/sim_setup/writers/post_eq_writer.py Selects the final enabled stage.
AutoREACTER/sim_setup/writers/densification_writer.py Uses direct monomer file paths.
AutoREACTER/session.py Expands structured workflow state.
AutoREACTER/reaction_preparation/reaction_processor/reaction_progression.py Uses configured iteration depth.
AutoREACTER/reaction_preparation/reaction_processor/prepare_reactions.py Adds paths and active-template filtering.
AutoREACTER/reaction_preparation/ff_wrapper/REACTER_files_builder.py Simplifies REACTER file storage.
AutoREACTER/reaction_preparation/deduplication_detector.py Adds wildcard-aware deduplication.
AutoREACTER/input_parser.py Parses new workflow options.
AutoREACTER/detectors/reactions_library/vinyl_polymers.py Expands vinyl and TFE reactions.
AutoREACTER/arx_cli.py Moves template image generation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AutoREACTER/detectors/reactions_library/vinyl_polymers.py Outdated
Comment thread AutoREACTER/detectors/reactions_library/vinyl_polymers.py
Comment thread AutoREACTER/input_parser.py
Comment thread AutoREACTER/reaction_preparation/reaction_processor/reaction_progression.py Outdated
Comment thread examples/test_ethelene.json Outdated
@janitha-mahanthe
janitha-mahanthe merged commit b4c5626 into 0.3-dev Aug 17, 2026
1 of 2 checks passed
Copilot stopped work on behalf of janitha-mahanthe due to an error August 17, 2026 21:42
@janitha-mahanthe
janitha-mahanthe deleted the 0.3-dev-refacter-lmp-files branch August 19, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants