-
Notifications
You must be signed in to change notification settings - Fork 29
WIP: Isotopic data #42
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
Conversation
This feature would be very useful for me, I hope this could be merged. Thanks for working on this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a quick look at this PR and left a few concrete comments.
On a more general note, I think that it would be nice to have the "sources issue" figured out. I would imagine that parsing a PDF, while annoying, should be doable with something like https://github.com/sambitdash/PDFIO.jl.
Moreover, I was wondering whether from an API point of view the functionality to "convert" from elements to isotopes and backwards should (additionally?) be provided as functions. Personally, I think that isotopes(some_element)
and element(some_isotope)
are more Julian. But, of course, that's a matter of taste. What do you think?
@@ -0,0 +1,4847 @@ | |||
_isotopes_data = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be const
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gregstrq ☝️
The interface of elements is based on indexing, so for the reason of consistency, I kept the interfacing between elements and isotopes as the indexing operation as well. So, we can provide the functions, but additionally to the indexing interface. |
Yeah, maybe it's just me and indexing is fine here. @rahulkp220 What's your opinion on this? |
Hey, got a bit late here. I think I am okay with indexing :) |
Can you make Isotopes.jl that depends on PeriodicTable.jl instead? also why are there no tests and why CI didn't run? |
@Gregstrq Can you please add some tests? @anandijain Good question why CI didn't run... it should?! @rahulkp220 any idea / can you take care of this? |
We are not going to have complete data for ALL isotopes, so shouldn't it be OK to have some values as |
I have converted one of the tables to unicode tab-separated text. The workflow: Acrobat Pro:
MS Word:
MS Excel
I hope there were no other non-Latin characters in the texts, and that I didn't otherwise introduced any errors. The files are in https://github.com/Eben60/isotopic_data , I'm going to convert another PDF file too, but not right now. I'd leave the further processing to CSV.jl experts ;) EDIT: the second PDF file now converted, too |
I actually contacted the guys from the committee that created the pdf files I mentioned. They sent me csv files with recommended values of magnetic dipole and electric quadrupole moments. I am currently reworking my PR to accommodate new data. @anandijain, @carstenbauer, @rahulkp220 |
By the way, can anyone explain to me why |
Hi All, I'm the author of mendeleev. I wasn't aware of this effort until @Eben60 created a PR linked above. This looks really great, kudos. If you are interested I already have some isotope data parsed from CIAAW into a sqlite db. I wonder if there's some synergies here we could explore in order to not duplicate the efforts and share data? |
@Eben60, @Immentel Regarding the raw data, after my discussion with the INDC International Nuclear Data Committee, they have uploaded the csv files with recommended dipole and quadrupole moments to their web-page https://www-nds.iaea.org/nuclearmoments/. You need to look above the periodic table, there are buttons titled CSV file with recommended nuclear dipole moments and CSV file with recommended nuclear quadrupole moments. In principle, I have almost finished a separate package on Isotopes a couple of months ago, but wanted to add unit tests and got distracted by more pressing matters. I have compiled a dataframe with Isotopic information, which can be of use to you. I will upload it to https://github.com/Gregstrq/Isotope-data in the evening. @Eben60 I've made the static interface for the isotopes, but I wanted to provide the dataframe in the same repo as an alternative. Perhaps, I can still publish a package with static interface for the Isotopes, while the dataframe can be bundled as a part of db together with mendeleev.jl. |
@Eben60, @Immentel I have updated https://github.com/Gregstrq/Isotope-data repo. The dataframe with isotopic data is called "isotopes_data.jls". To load up the dataframe, just do
I did not save the data as a db because I wanted to keep the units of the physical data. |
Got it. I am currently keeping track of the units only in the docs layer, i.e. docstrings and curated documentation but it would probably be better to have that information in the db as well, I'll create an issue for it over at mendeleev. As mentioned in this comment I had some issues opening the isotope data but went ahead and parsed it myself and it should soon make it the the db and into the next release of mendeleev. |
I guess we need to close this PR. The registration of these packages should be finished tomorrow. (3 day waiting period.) |
This PR adresses issue #37.
It adds new structs called
Isotope
andIsotopes
which are analogues ofElement
andElements
. Also it defines the objectisotopes::Isotopes
which stores all the isotopic data. The indexing intoIsotopes
is based around the combination of the name or id of the element with the mass number. For example, to access tritium one can use either of the following options:It is also important to be able to access isotopes corresponding to the element, and vice versa. As such,
isotopes[elements[:H]]
returns an array, consisting of H1, deuterium and tritium. Analogously,elements[isotopes[:H3]]
returns the hydrogen.Important Disclaimer
I have generated the isotopic data as described in https://github.com/Gregstrq/Isotope-data. The scripts I used are stored there as well.
Currently, there is data only for 323 isotopes. The problem is, I pulled the data from the different sources, and the weakest link is the easyspin database, which I used to get the data for spins, g-factors and quadrupole moments. I can get the data for a much larger set of isotopes, but for that I need to parse the table from a pdf-file. I don't know how to do that. (I list this pdf sources on repo page.)
I have checked that it workes locally in my REPL. If the maintainers like this PR, I will work on the tests.