Skip to content

Bug-fix/photo reaction detection#103

Merged
markkrumholz merged 87 commits into
jaff-chemistry:mainfrom
XRByte:bug/fix_photo_reaction_detection
Jul 10, 2026
Merged

Bug-fix/photo reaction detection#103
markkrumholz merged 87 commits into
jaff-chemistry:mainfrom
XRByte:bug/fix_photo_reaction_detection

Conversation

@XRByte

@XRByte XRByte commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Fixes #101 and #102

The previous photo reaction detection mechanism was only able to detect prizmo reactions and some krome reacrtions. The mechanism was loose and didn't depend on the reactants but on the rates containing a single "photo" string which is inconsistent with other reaction formats. A proper "non patchy" implementation was required for which required a fundamental architectural change. The changes are as follows:

  1. Reactions didn't contain any information about special species. This required a format for special species which would be easily detectable without breaking code generation. The format implemented is _<specie>. The choice of a _ doesn't break any code generation capabilities.
  2. The above consideration required a change the the reaction serialization algorithm since in this case A -> B + C and A + B -> C will be indistinguishable. The new serialization format implemented is A.B__C.D where reactants and products are separated by . and either side is separated by __.
  3. The above consideration also allowed the solution of Mutilple reactions produces same serialized strings #102
  4. These changes unfortunately required a significant refactor. However the resulting structure is much cleaner
  5. Parsing for each format has been separated into their specific folders where the module uses a pre-templated abstract class. This allows significant flexibility and treat format dependent gotchas in a clean way. A result is that extension for future formats is completely decoupled from other parsing logic and is extremely straight forward.
  6. All special reaction detection has been moved to these format specific classes which takes out the guesswork which was previously carried out in the reaction class
  7. All reactants and products now contain the special species and these can be filtered out using species.core and species.special. However, network.species only contain the core species to avoid further cascade of problems.
  8. The shielding functionality now also follows the abstract class templating strategy. This was required since the new serialization format broke module importing. The good news is that a separate shielding table is no longer present in the database which reduces maintenance and future extension of shielding functionality are now completely decoupled.
  9. Since a lot of breaking changes have been introduced, I have thoroughly tested out the code with bitwise comparison of every network on every template with the previous version. The only results that defer are when I switch on radiation. That's because most photo reactions were note being detected previously which are being correctly detected now.

@XRByte
XRByte marked this pull request as ready for review July 2, 2026 12:13
@XRByte XRByte added bug Something isn't working enhancement New feature or request labels Jul 4, 2026
@markkrumholz
markkrumholz merged commit 69be53c into jaff-chemistry:main Jul 10, 2026
14 checks passed
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.

Photo reactions undetected

2 participants