Closed BenSmithers closed 2 years ago
It looks like it failed while importing stages relying on photospline, LeptonWeighter, and/or nuSQuIDS
Great, thanks for the PR, i will take a look shortly. About the errors, I'd just make your code exit gracefully if leptonweighter et. al cannot be imported. (try import, except warn and terminate)
Is that preferable to adding LeptonWeighter and Photospline to the list of optional modules in the unit tests? If so I'll go ahead and push a commit to this PR so the relevant scripts terminate with a sys.exit()
if they fail to import a module.
Ah, if those can be declared to unit test to not make it fail, it will be even better. Do you want to give this a try?
Also, the optional modules should be mentioned here: https://github.com/icecube/pisa/blob/master/INSTALL.md
There we go. Updated the INSTALL file and added photospline, LeptonWeighter, and the alternate spelling of nuSQuIDS
' python package to the ok-to-ignore list. Sorry for the test-fail spam after all the silly mistakes in my commits!
Great! The new stages and code changes look good to me, so from my side we should be able to merge. But let's give @atrettin a chance to comment too
Great! If @BenSmithers could make these small changes suggested by @atrettin (remove future imports, run through black formatter), we will merge this PR
Sorry we just merged #689 now resulting in a conflict. So one more todo before we merge this one
I removed the from __future__
imports from and applied the black formatter on the files I worked with. Doing so on the rest of the repository (and without messing with the git-blame) seems like it would be quite substantial, and I think it would merit a PR on its own.
cool! Yeah if you are eager to run black over the whole repo, please make a separate PR for it! :) Going to merge this one now
A lot of these additions are a work-in-progress, but I didn't want my fork getting too out-of-sync with the master branch! Also want to be sure my changes so far don't cause any conflicts.
Changes
stages/osc/nusquids.py
-> Including taus now, added toggle to turn taus on or off. Defaults to off
pisa/scripts/create_barr_sys_tables_mceq.py
-> now also calculates the gradients including tau contributions
stages/utils/hist.py
-> when getting weights, now checks if there is an
astro_weights
container. Sumsweights
andastro_weights
containers if soutils/flux_weights.py
-> a bool can be passed to the
load_2d_honda_table
function to switch behavior between the standard honda table files and the hillas-gaisser h3a flux tables (see additions)-> Also modified the
load_2d_table
function to allow for flux files with "hillas" in the name instead of only "honda" or "bartol". These fluxes are loaded in and splined similarly to how the honda fluxes are.Additions
stages/flux/hillasg.py
->Almost identical to flux stage
honda_ip
. This explicitly requries three flavors in the flux. Added as separate stage since making the honda_ip one backwards-compatible seemed uglystages/data/meows_loader.py
-> stage to load in an hdf5 file with all the MEOWS MC
stages/flux/airs.py
-> Implements new parameter from atmospheric uncertainty splines
stages/flux/astrophysical.py
-> Incorporates a separately weightable astrophysical neutrino weight. Adds parameters for the normalization and spectral index uncertainties
stages/data/licloader_weighter.py
Still a work in progress, this is to load in LeptonInjector MC