Skip to content

0.3 arx session - #100

Merged
janitha-mahanthe merged 61 commits into
0.3-devfrom
0.3-ARXSession
Jul 14, 2026
Merged

0.3 arx session#100
janitha-mahanthe merged 61 commits into
0.3-devfrom
0.3-ARXSession

Conversation

@janitha-mahanthe

Copy link
Copy Markdown
Member

This pull request introduces new functionality for index-based detection of functional groups and reactions, and extends the chemistry covered to include epoxy-amine polymerization. The main changes add support for identifying functional groups and possible reactions based on atom indices, and update the functional groups and reactions libraries to handle epoxy-related chemistry.

Index-based detection and role assignment:

  • Added index_based_functional_groups_detector and _detect_functional_groups_by_index methods to functional_groups_detector.py for detecting functional groups that overlap with specified atom indices, enabling more granular control for downstream reaction detection.
  • Updated MonomerRole and FunctionalGroupInfo dataclasses to include atom index information (fg_1_indexes, fg_2_indexes, indexes_in_template) and additional state flags (is_monomer, is_looped, rdkit_mol). [1] [2]

Epoxy-amine polymerization support:

  • Expanded the functional groups library to include epoxy and amine groups relevant for epoxy-amine polymerization, such as di_epoxy_monomer, primary_amine_monomer, and secondary_amine_monomer, with appropriate SMARTS patterns and documentation.
  • Added epoxy-amine polyaddition reactions to the reactions library, covering both primary and secondary amine additions to epoxides, with corresponding reaction SMARTS and comments.

Index-based reaction detection:

  • Introduced index_based_reaction_detector to reaction_detector.py, enabling reaction detection based on lists of monomer roles with index-specific functional group assignments, supporting both homo- and co-polymerization logic with looped-state tracking.

Codebase maintenance:

  • Updated imports and cleaned up unused imports in ff_wrapper.py and functional_groups_detector.py for improved clarity and maintainability. [1] [2]

These changes collectively enable the system to support more complex polymerization scenarios, especially for epoxy-amine chemistry, and provide finer control over which functional groups and atoms are considered in reaction detection.

janitha-mahanthe and others added 30 commits June 27, 2026 14:11
Introduces scaffold code for upcoming reaction workflow features: a new `ReactionProgression` processor module with a configurable `MAX_LOOP` constant and placeholder `reaction_progression` method, plus an `index_based_functional_groups_detector` placeholder in `FunctionalGroupsDetector`. These changes establish integration points without altering current behavior yet.
Introduce a new `species_pool.py` module with a `PoolSpecies` dataclass to represent reaction pool entries, including monomer flags, SMILES, RDKit molecule objects, and template atom indices. Add `_populate_mols(pool)` to build RDKit molecules from monomer SMILES and initialize `template_idxes` from atom indices, centralizing species preparation logic for downstream reaction processing.
Expand `PoolSpecies` docstring to list its key attributes, and clarify `_populate_mols` documentation to note that it fills both `mol` and `template_idxes` for monomer species derived from SMILES.
unit tests for input parser
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Rename AutoREACTER/test_input_parser.py to tests/test_input_parser.py (100% similarity — no content changes). This is a pure file move to consolidate tests under the tests/ directory for clearer project structure.
…-job-deploy

[WIP] Fix failing GitHub Actions job for deploy to GitHub Pages
- Add fg_1_indexes and fg_2_indexes fields to FunctionalGroupInfo for storing matched atom indices
- Expand functional group library with epoxy-amine polymerization entries (diepoxy, primary amine, secondary amine) with improved SMARTS and documentation
- Update reaction_rules.json with required_fgs field for epoxy_polymerization
- Add _add_progessive_chemistries stub in detected_chemistry_filter.py
- Add warning_asci.py with ASCII warning banner for reaction progression beta loop
Copy loop monomer roles before extending them, and strip atom maps/isotopes from product molecules before sanitizing or generating SMILES.
Improve `DeduplicationDetector` clarity and consistency by tightening docstrings, reorganizing helper sections, and cleaning formatting. Functional updates include initializing pair caches for both comparison groups, clearing the RDKit pair cache at the start of each `compare_graphs_mol` pass, and extracting index-source mapping logic into a dedicated helper for clearer validation and error messages.
Add a dedicated `ZeroActiveReactionsError` in reaction preparation and fail after building reaction metadata when none of the reactions include activity stats. This makes empty or invalid datasets surface as an explicit AutoREACTER error instead of continuing silently.
Clarify `ReactionProgression.progress_reaction_process` with a more focused docstring and explicit typing for the working reaction lists. The loop now counts active reactions from the current session state, deduplicates in-place without extra logging, and returns through `_store_reactions(...)` as soon as the break condition is met so the final reaction set is persisted consistently.
Update reaction progression to keep the session’s final deduplicated reaction list instead of extending it with newly generated reactions. Deduplication now clears the full comparison cache per pass, drops repeated references to the same ReactionMetadata object without disabling it, and compares relabeled product graphs in reactant index space. The change also refreshes inline documentation around progression flow and product handling.
Silences leftover print statements in functional group detection, reaction deduplication, and reaction progression. Also clears a few functional group library comments that were only carrying debug-style guidance.
@janitha-mahanthe janitha-mahanthe added this to the v0.3-beta milestone Jul 14, 2026
@janitha-mahanthe
janitha-mahanthe requested a review from Copilot July 14, 2026 16:51
@janitha-mahanthe janitha-mahanthe self-assigned this Jul 14, 2026
@janitha-mahanthe janitha-mahanthe added bug Something isn't working enhancement New feature or request labels Jul 14, 2026

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

This pull request expands AutoREACTER’s chemistry/reaction-search capabilities by introducing index-scoped functional-group detection and iterative reaction progression, and by extending the built-in libraries to cover epoxy–amine polymerization (including progressive amine additions to epoxides).

Changes:

  • Add index-based functional-group and reaction detection to support iterative “reaction progression” workflows.
  • Extend functional-group and reaction libraries for epoxy–amine polyaddition chemistry.
  • Add graph-based reaction deduplication and supporting examples/tests/docs updates.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
tests/test_input_parser.py Adds unit tests covering input parsing/validation behaviors.
test.ipynb Adds a development notebook for progressive chemistry experimentation.
README.md Updates project status/version and points example invocation to examples/example_1.py.
examples/test_glycine.json Adds an example JSON input (currently epoxy/glycine naming mismatch).
examples/test_epoxy.json Adds an epoxy/amine example JSON input.
AutoREACTER/reaction_preparation/reaction_processor/warning_asci.py Adds a warning banner helper for the progression loop.
AutoREACTER/reaction_preparation/reaction_processor/reaction_progression.py Introduces the iterative reaction-progression loop coordinating FG detection → reaction detection → preparation → deduplication.
AutoREACTER/reaction_preparation/reaction_processor/prepare_reactions.py Extends preparation to support progression/forced-index handling and adds a “no active reactions” error.
AutoREACTER/reaction_preparation/reaction_processor/fragment_comparison.py Removes an old commented placeholder module.
AutoREACTER/reaction_preparation/ff_wrapper/lunar_client/config.py Changes LUNAR root configuration (currently hard-coded).
AutoREACTER/reaction_preparation/ff_wrapper/foyer_client/foyer_api_wrapper.py Updates docstrings to correctly describe the Foyer wrapper.
AutoREACTER/reaction_preparation/ff_wrapper/ff_wrapper.py Cleans up unused imports.
AutoREACTER/reaction_preparation/deduplication_detector.py Adds NetworkX/RDKit/LAMMPS graph-based deduplication.
AutoREACTER/detectors/reactions_library.py Adds epoxy–amine polyaddition reaction SMARTS entries.
AutoREACTER/detectors/reaction_detector.py Adds index-based reaction detection over MonomerRole lists with loop-aware skipping rules.
AutoREACTER/detectors/functional_groups_library.py Adds epoxy/amine functional group definitions (e.g., diepoxides, primary/secondary amines).
AutoREACTER/detectors/functional_groups_detector.py Adds index-based FG detection output (incl. matched atom indices) and extends MonomerRole to carry loop/template/index info.
AutoREACTER/cache.py Modifies staging-dir handling (currently removes per-run uniqueness).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AutoREACTER/reaction_preparation/reaction_processor/prepare_reactions.py Outdated
Comment thread AutoREACTER/reaction_preparation/reaction_processor/prepare_reactions.py Outdated
Comment thread AutoREACTER/reaction_preparation/ff_wrapper/lunar_client/config.py Outdated
Comment thread AutoREACTER/reaction_preparation/reaction_processor/warning_asci.py
Comment thread AutoREACTER/reaction_preparation/reaction_processor/warning_asci.py Outdated
Comment thread AutoREACTER/detectors/functional_groups_detector.py Outdated
Comment thread AutoREACTER/detectors/functional_groups_detector.py Outdated
Comment thread AutoREACTER/cache.py
Comment thread test.ipynb
Comment thread examples/test_glycine.json
janitha-mahanthe and others added 5 commits July 14, 2026 13:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
janitha-mahanthe and others added 3 commits July 14, 2026 13:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
janitha-mahanthe and others added 2 commits July 14, 2026 13:37
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@janitha-mahanthe
janitha-mahanthe merged commit d488f58 into 0.3-dev Jul 14, 2026
1 of 2 checks passed
Copilot stopped work on behalf of janitha-mahanthe due to an error July 14, 2026 17:39
@janitha-mahanthe
janitha-mahanthe deleted the 0.3-ARXSession branch August 7, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants