-
Notifications
You must be signed in to change notification settings - Fork 5
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
New Python interface #71
Draft
austinschneider
wants to merge
85
commits into
main
Choose a base branch
from
dev/python_interface
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
austinschneider
force-pushed
the
dev/python_interface
branch
from
June 6, 2024 13:36
5e98e1c
to
7bde698
Compare
It's been a while since I have touched on the DarkNews loading logic in detail, and it still remains untested end-to-end, but I think the logic is mostly there. It might be worth looking through the contents of |
…_module with the actual module. Swap the argument order in load_resource. Fix variable names in load_resource.
…king. non-zero CDF check.
austinschneider
force-pushed
the
dev/python_interface
branch
from
September 15, 2024 21:24
f366e51
to
1a35e9d
Compare
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 PR moves logic for loading fluxes, cross sections, and detector models into the resources directory. With the idea that the logic for manipulating files, importing other packages, building tables, etc. should be relegated to python code that lives outside of siren itself. This changes the way we treat the tabulated fluxes a little bit since we don't expect the code within the resources directory to generate a file for us, but rather we expect it to return a siren.distributions.PrimaryEnergyDistribution object (that in this case happens to be a tabulated flux). This also involves essentially decoupling DarkNews from siren, since all the DarkNews-specific logic would then live within a file in the resources directory. Finally for the detector models, this means that a detector model can now take parameters since we're always calling a function to load the detector model rather than just pointing to a file.