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.
Python 3.11 brought under-the-hood changes to the Enum library, breaking ASTERIA's interaction handling. In brief, ASTERIA's EnumMeta-based
Interactions
class was designed to be a mutable Enum-based object. This contradicts Enum's design, which is meant to be immutable. ASTERIA's implementation of the Interaction object was flawed, and obtusely written.This branch converts
Interactions
to a custom class that does not depend on the Enum class. A private member contains the interaction objects and a custom iteration function to handle them. This member may be modified, but not directly. A setter method or similar should be used to modify the interaction list. The user should be able to request specific interactions be activated or deactivated.The customizable functionality was intended to make interactions other than the defaults more accessible. Currently, only one such class (
InvBetaTab
) exists, but axion-ice or other interaction channels may be useful for future ASTERIA simulations.Currently, this branch implements a functional version of the
Interactions
object. A default iterable of interactions is available on the class, and a customizable iterable of interactions is available upon instantiation. Example usage is provided below.This implementation is imperfect, and has not been fully tested against other modules of ASTERIA. Of particular note is the flaw that a user must pass an iterable of the interactions to the
Interactions
object to receive an iterable of interactions from theInteractions
object.Additional development may be required, and alternatives to this implementation are welcome.