galactic-forensics / iniabu Goto Github PK
View Code? Open in Web Editor NEWPython package for automatic handling of solar system initial abundance files
Home Page: https://iniabu.readthedocs.io
License: GNU General Public License v2.0
Python package for automatic handling of solar system initial abundance files
Home Page: https://iniabu.readthedocs.io
License: GNU General Public License v2.0
When a pandas series is passed to iniabu
as the vector for isotope ratios, it will turn it into a numpy array and return it. However, if a Series is passed, it would be great if a Series would be returned and no change takes place. Might also need some documentation changes.
Labeling this an enhancement instead of a bug since the docs at the moment state that an np.ndarray
will be returned.
Add support to get isotope and element masses in an easy way.
Wanted feature:
>>> from iniabu import ini
>>> ini.mass('Si')
28.084
>>> ini.mass('Si-30')
29.973770136
Or somehow similar. Open questions / tasklist:
Currently, the isotope names must be given in the iniabu
default format, i.e., as "Si-28"
.
Enhancement requested:
Requested additional formats (based on above example):
"28Si"
"Si28"
Please feel free to add additional formats that would be useful!
Abundances return nan in the following example:
from iniabu import inimf
inimf.database = "asplund09"
inimf.ele["Al"].abu_solar
However, the inimf.ele_dict
clearly shows that an abundance is given, why is this the case?
Before release, should rename the routines. Names are simply too long.
Proton number Z can currently not be accessed directly from the element and isotope menus, even though the data is loaded. the same is true for total number of nucleons for isotopes.
Proposal: Add functions to get the following behavior to iniabu
(here for neon as an example)
>>> from iniabu import ini
>>> ini.ele["Ne"].z
10
>>> ini.iso["Ne-20"].z
10
>>> ini.iso["Ne-20"].a
20
For reasons of numerical precisions solar abundances are used when calculating isotope ratios. However, the NIST database does not contain any solar abundances. Still, it contains relative isotope abundances and thus, isotope ratios should be possible.
Proposal: When NIST database is loaded, calculate isotope ratios from relative abundances of isotopes and not from solar abundances.
Goal: isotope ratios, and associated functions don't return nan
when NIST database is loaded.
Currently, relative abundances are used for isotope ratio building. However, this is less precise, especially in the "num_lin" mode, since less significant figures are given in the database. Think about switching over to using solar_abundance
.
Maybe should be mode dependent?
Proposed by ML:
Add capability for internal normalization of some measurements. Would need an array of at least 3 isotope ratios, two will be in the "denominator" part in this case. This would allow to return normalized values, which would be great. Could be very useful for measurements, but also for models.
Needs possibility to select at least exponential and linear normalization.
For details, see this paper, eqn (2) - (4).
This will need excellent documentation with descriptions on what it exactly does. Would play well into documentation enhancement #3.
More details on databases necessary in documentation.
Also need to clarify the following question by @marcop46:
Quick question: your solar system abundances are given as present solar abundances, or initial solar abundances, or both are given?
This is probably best done in the documentation, need clearer instructions on what the databases are.
Testing should not need the dev-requirements.txt
for the installation, but only the pyproject.toml
file with the added options in square brackets.
With the release of Python 3.10, iniabu
should also support it and be tested on 3.10. It is anticipated that all other python versions will still be supported in for the foreseeable future, down to 3.6.
ToDo:
Create an explanation section in the documentation that is outside of Usage
and explains the different notations in detail. For example, need to have clearer definition on how to calculate epsilon and mu values, etc.
Also need to have a good description on what the ratios actually mean, especially for delta and bracket (those are the only two current ones).
Might want to give a bit of the scientific background as well (brief) to make it clearer.
Proposed by ML
Giving iniabu
a list of isotope names with alternative spelling will change that list. This should not be the case, seems like a .copy()
is missing.
Minimal example to demonstrate the bug:
from iniabu import ini
isos = ["46Ti", "47Ti"] # a list of alternative spellings
ini.iso[isos]
print(isos)
Prints out:
['Ti-46', 'Ti-47']
Currently the package is using the isotope abundances of Lodders et al. (2009), Table 10. This contains rounding errors such that the total abundance of Si is not 106 but slightly below.
Better / ToDo: Should use the elemental abundances and then calculate the isotope abundances from the isotope fractions in Table 10. Also update the docs.
Two workflows currently set up, one for xdoctests separately of package testing. This ends up running xdoctest twice...
Test suite is currently poorly written. Needs to be extended with parameterized testing, use hypothesis to randomly pick stuff.
Also include specific pytest
markers to check for database integrity. Integrity doesn't need to be tested every time when developing, so that would help to make it faster (in the long run)... This has lower priority...
Implement the possibility to return element / isotope abundances as mass fractions.
Maybe put a general mass_fraction
toggle in there that can be called like the one for units and then set the mass_fraction
bool by default for the future routines from this?
Proposed by: @OClarkson @ubattino
Question: How would the abundance look like in number and in logarithmic space?
Number space:
Logarithmic space:
Would this be reasonable?
Need a more inclusive list of isotopes for the NIST database, such that masses can easily be queried. For example,
iniabu can currently not query the mass for "Pu-244" but simply raises an IndexError
. However, this isotope does exist and is measured in mass spectrometers, therefore it should at least be returned when queried for the mass.
Use the NIST table: https://www.nist.gov/pml/atomic-weights-and-isotopic-compositions-relative-atomic-masses
Note: Need to find out how to best query a given element for all its isotopes. For example consider the following:
>>> ini.iso["U"].abu_solar
array([4.9e-07, 5.8e-03, 1.8e-02])
>>> ini.iso["U"].name
['U-234', 'U-235', 'U-238']
In the future, with the extension, this should still return the same. Maybe add a second proxy list where we say something like:
>>> ini.iso["U"].name_all
['U-217', ... 'U-243']
>>> ini.iso["U"].mass_all
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.