Major package rewrite: structure, formatting, testing etc...#23
Open
martinjohndyer wants to merge 40 commits intomainfrom
Open
Major package rewrite: structure, formatting, testing etc...#23martinjohndyer wants to merge 40 commits intomainfrom
martinjohndyer wants to merge 40 commits intomainfrom
Conversation
This file contains hidden or 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
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 is the big package rewrite and tidy up.
Some highlights are:
snf_simulations.data: handles loading data files and spectrasnf_simulations.spec: functions for creating spectrasnf_simulations.cask: contains the function for calculating the total spectrum of an SNF casksnf_simulations.physics: various functions to do with nuclear physics calculationscommand_line.pyscript is now package entry pointsnf-sim, which should be available on the command line when the package is installed.mendeleevpackage (Clarify atomic/molar masses and find better source #21).ruff format&ruff check).ty check), but there are a lot of outstanding errors due to ROOT. Reading around, I think [ty] Addreplace-imports-with-anyoption astral-sh/ruff#23122 is what we'd need, but if we're aiming to drop ROOT anyway (Look at removing the dependency on ROOT #14) it's not an issue.command_line.pyscript, which can't be tested since its main purpose is to produce ROOT windows. Coverage of the rest of the package is 95%+, with the exceptions being somewhat awkward cases like data files being unavailable (which again should be reworked in the future).There were also a handful of new bugs I came across while putting this together, which are all now fixed:
max_Eis determined for scaled histograms #20 (the spectra are now scaled automatically to the maximum energy bin)Some things I didn't get around to doing:
Spectrumclass for the basic unit and then aCaskclass which could combine spectra (you can see the idea in how the modules are named). I did start working on this, but a lot of it would be built around the ROOT classes, especiallyROOT.TH1DandROOT.TList. So rather than doing a load of work now that would end up being removed, I'll wait until Look at removing the dependency on ROOT #14 which I think deserves its own PR (and is probably the next task anyway).command_line.pyscript with something like a Jupyter Notebook, since it's really more of a demo of the various features of the package. But again that doesn't really work with ROOT plots. So thesnf-simscript works for now, and when ROOT is replaced that can be reworked into a more general command line interface (which might also include launching the actual GUI too).