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

[FEATURE] close and normalise functions in pyrolite.comp.codata #103

Open
sarahshi opened this issue Apr 27, 2024 · 2 comments
Open

[FEATURE] close and normalise functions in pyrolite.comp.codata #103

sarahshi opened this issue Apr 27, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@sarahshi
Copy link
Contributor

Hi Morgan! I am working on some codata functions and thought I'd provide a very small patch for a note in the close function. I added a UserWarning for when negative values are in either the array for close or in the dataframe for normalise.

Is your feature request related to a problem? Please describe.
This feature request addresses a comment in the documentation for pyrolite.comp.codata

Describe the solution you'd like
Provide warnings when negative values are found in the close and normalise functions, explicitly replace zeros in division with NaN

Describe alternatives you've considered
Solution provided in commit 267de50

@sarahshi sarahshi added the enhancement New feature or request label Apr 27, 2024
@morganjwilliams
Copy link
Owner

Hey @sarahshi! Apologies, I've been on a long block of leave. Thanks for adding an issue, this will be a nice little quality of life addition. Happy for you to open a PR onto to develop, otherwise I can just replicate the commit. l take a look now, and send through any comments.

@sarahshi
Copy link
Contributor Author

Hi @morganjwilliams. No worries at all! I incorporated your suggested logic, made small modifications to codata.py to have the renormalise function replace negative values with np.nan, and altered the UserWarning accordingly. See commit
58329ee for the new updates. I will open a pull request onto the develop branch now. Please let me know if you have any further suggested modifications to the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants