-
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
base: main
Are you sure you want to change the base?
Conversation
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.
* Injector serialization via pickle working * Remove cruft * Undo addition to DecaySignature * Remove printouts in DetectorModel serialization * Remove unnecessary cereal macros * Revert changes to link ordering * Remove comments * Don't need global FPIC now that it is handled with an INTERFACE target * Attempt to perform explicit template instantiation for interpolator templates * CMake fixes * Improve logic for finding cfitsio. Make an IMPORT target for cfitsio * Use lists for find_path * Search all paths in secondary searches * Remove printouts * Remove redundant paths for find_library * Link photospline with CFITSIO. Use generator expressions for -s and -stdlib=libc++ * Set policies for macos * Use photospline from icecube git repo. Update photospline and cereal * Remove printouts * Upgrade pybind11 * Use shared_ptr for compatibility of classes without a default constructor * Pickle weighter * Move external headers * pybind11 used in pickle serialization * Pickle serialization for dataclasses * Revert "Upgrade pybind11" This reverts commit add5a6a.
…DarkNews tables and objects. still some issues in the pickling
@austinschneider I made some changes to get example 1 working, but example 2 is a bit trickier. I now am able to save and load the cross section and decay tables, but I have not been able to pickle the (py)DarkNewsCrossSection and (py)DarkNewsDecay objects themselves. I am a bit unclear on what changed in our serialization scheme w.r.t. the trampoline classes that would have produced errors like:
Do you have any ideas as to what changed? I still see the |
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.