Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested restructuring of snewpy.flavor_transformations submodules #367

Conversation

JostMigenda
Copy link
Member

See discussion in #351 for context.

This is mostly moving existing code around; the only actual change is that I removed the special case where TransformationChain(in_sn=None) would return NoTransformation. This wasn’t documented in the doc string or type information anyway; and I think it’s a bit dangerous, since it would lead to unexpected results if a user tried TransformationChain(in_sn=None, in_earth=EarthMatter); so I think it’s reasonably to drop it and require users to use NoTransformation explicitly.

* move transformation presets to __init__.py
* move FlavorTransformation base class to base.py
Better reflects the contents of the file.
@JostMigenda JostMigenda requested a review from Sheshuk November 21, 2024 14:00
Copy link
Contributor

@Sheshuk Sheshuk left a comment

Choose a reason for hiding this comment

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

Thanks you, that's a good solution!
I totally agree, this is better.

Also I agree with removing in_sn == None case. Moreover I just noticed that I implemented it by returning from __init__... 🤦🏻

@Sheshuk Sheshuk merged commit 3629a90 into Sheshuk/FlavorTransformations_with_FlavorMatrices Nov 22, 2024
@JostMigenda JostMigenda deleted the JostMigenda/FlavorTransformations_suggested_restructuring branch November 22, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants