Closed morganjwilliams closed 5 years ago
The pyrolite.geochem.pyrochem dataframe accessor was expanded with f95c8c4d4084c676dafd9850d3e5ba5f15dcdbd4. This includes an interface to common index subsets (e.g. df.pyrochem.get_elements) and quick interfaces to access the subset dataframe (e.g. df.pyrochem.elements, df.pyrochem.oxides and df.pyrochem.REE).
Docstrings still need to be updated/linked to relevant pyrolite.geochem functions, and the test suite still consists mainly of stubs for individual functions.
These elements have now been completed, along with relevant test suites to parallel the non pandas-based equivalent functions.
Similar to the pyrolite.plot pyroplot dataframe accessor, a df.pyrochem accessor would provide a pandas-based API for common geochemical functions and indexes.
This would be particularly useful for both selections (e.g. subset with df.pyrochem.elements, df.pyrochem.oxides etc) and for transformations (e.g. df.pyrochem.convert_chemistry).
This would in effect replace the unofficial pandas-flavour API (used to decorate some functions) with the official pandas accessor API and remove a dependency.
A stub for this API has recently been included in pyrolite.geochem.init, and can be developed without removing existing functionality until ready for release (at which point documentation will need to be updated).