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

Pip package #6

Closed
wants to merge 8 commits into from
Closed

Pip package #6

wants to merge 8 commits into from

Conversation

php1ic
Copy link
Owner

@php1ic php1ic commented Mar 16, 2025

As suggested by @e-eight in both #4 and #5 let's make this project into to a pip installable package.

As this is a major change, I will take the opportunity to drop the plotting part of the package. If people need it, it can be added back in, but I believe focussing on the parsing of the data files should be the core of the packages functionality.

php1ic added 7 commits March 7, 2025 16:23
The GUI part has been removed entirely, a new pyproject file created and
all the data files moved to allow installation with the package.
The use of LICENSE looks to be more common than COPYING so lets use
that.
While we are updating the pipeline, use latest actions from the
marketplace and test with all currently supported versions of python.
We are using functionality from importlib.resource that arrived in
version 3.10. As support for 3.9 will soon(ish) stop, lets not do
anything special.
Changing the project to a package was his idea and he did a lot of the
leg work in PR #5 so should be in the authors list.
Copy link

codecov bot commented Mar 16, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@php1ic php1ic mentioned this pull request Mar 16, 2025
To align with AME, always refer to NUBASE in all capital letters.
@e-eight
Copy link

e-eight commented Mar 16, 2025

I noticed that the the atomic mass in the AME mass files are actually given as 1 008664.91590. I think in the parser only selects the part after the space, i.e. starting with 0 instead of 1.

@e-eight
Copy link

e-eight commented Mar 16, 2025

Also I found that read_fwf from Pandas can read these files pretty easily, without needing any regex selections. What it needs are the start and end positions for each column, like in ame_mass_file.py. Of course the data then needs to be post-processed to remove non-numeral entries and other such things. But with read_fwf you can do the post-processing on the Pandas DataFrame directly.

For a small dataset like this, I do not suppose there is any performance benefit of doing it one way or the other. But since you mentioned the possibility of archiving this and creating a new project in #8, maybe we can try read_fwf approach if you are interested.

@php1ic
Copy link
Owner Author

php1ic commented Mar 21, 2025

Good find! I think a new package is going to be created so might as well start using that function.

Not sure why the initial value is ignored when reading the atomic mass. I'll fix that in the new package.

@e-eight
Copy link

e-eight commented Mar 21, 2025

I wrote some code with read_fwf after writing that comment. If you make a new package, I can add my code there.

@e-eight
Copy link

e-eight commented Mar 23, 2025

@php1ic I added the code for AME (1993 - 2020) in commit 19c024c in the read_fwf branch I made in my fork. The files need to be arranged properly for the new package, and we need to add tests and everything. This is just to demonstrate the function. But this style should work for both AME and NUBASE for all the years, though NUBASE will need more involved error handling.

@php1ic
Copy link
Owner Author

php1ic commented Mar 23, 2025

Thanks for looking into the usage of read_fwf and earlier years data.

I'm going to move all development to the new package and not merge this PR, leaving the repo in the pre-package state. Hopefully see you over there 👍

@php1ic php1ic closed this Mar 23, 2025
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