Refactor REACTER file handling and simplify data storage - #107
Merged
Conversation
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.
Documentation build overview
|
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
vinyl_polymers.pyto 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]Input Parsing and Simulation Configuration
SimulationSetupdataclass to support new configuration options:deep_search,reaction_iteration_depth,wildcards,deduplicate_reaction_templates, andwrite_second_reaction_stage, with sensible defaults and improved documentation. [1] [2]InputParserto parse and validate the new simulation options, supporting multiple aliases for each option and setting up loop/iteration logic based onreaction_iteration_depth. [1] [2]Monomer and File Handling
lmp_molecule_fileto theMonomerEntryclass to track the LAMMPS molecule file path, with updated docstrings to clarify file generation responsibilities.CLI and Reaction Preparation
prepare_reactionsto the mainprocessmethod inarx_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.