Giter VIP home page Giter VIP logo

iniabu's People

Contributors

pre-commit-ci[bot] avatar trappitsch avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

iniabu's Issues

pd.Series are converted to np.ndarray

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.

ENH: Mass querying of elements and isotopes

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:

  • What database to use for masses
  • Mass of element should be calculated based on isotope mass and loaded abundances!
  • Multiple queries returns numpy array

Isotope naming

Currently, the isotope names must be given in the iniabu default format, i.e., as "Si-28".

Enhancement requested:

  • Allow automatically for other isotope formats to have wider compatibility with different naming schemes.
  • Have this feature written in a way that it can be easily extended if required.

Requested additional formats (based on above example):

  • "28Si"
  • "Si28"
  • Ensure that naming scheme is not case sensitive!

Please feel free to add additional formats that would be useful!

Asplund 2009: Read error

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?

Rename routines

Before release, should rename the routines. Names are simply too long.

  • solar_abundance -> sol_abu
  • relative_abundance -> rel_abu
  • isotope -> iso
  • element -> ele
    ...

Access to proton and number of nucleons

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

NIST database - Ability to calculate isotope ratios

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.

Use isotope solar abundance for ratio building

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?

Double / internal normalization capability

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.

DOC: More details on databases

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.

Add support / testing for Python 3.10

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:

  • Add test suite for Python 3.10 to Actions
  • Add support in readme, docs, ...
  • Ensure tests actually pass

DOC: Create section in documentation with details on notations

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

List of isotopes with alternative spelling is changed in place

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']

Lodders et al. (2009) data cleanup

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.

Improve test suite

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...

Capability to return abundances as mass fractions

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?

Add full list of isotopes for NIST database

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
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.