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

Checks for negative entries in close and normalise functions of codata.py #104

Merged
merged 3 commits into from
May 17, 2024

Conversation

sarahshi
Copy link
Contributor

@sarahshi sarahshi commented May 15, 2024

Description

I modified functions within codata.py to return a UserWarning for when negative values are in either the array for the close function or in the dataframe for the normalise function.

Related Issue

See enhancement described here:
#103

Motivation and Context

This is a small quality of life improvement for these functions.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Add warning for non-positive values (addressing note in close function), explicitly treat zeros as NaN in division
@coveralls
Copy link

coveralls commented May 15, 2024

Pull Request Test Coverage Report for Build 9114710863

Details

  • 14 of 15 (93.33%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 91.635%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyrolite/comp/codata.py 14 15 93.33%
Files with Coverage Reduction New Missed Lines %
pyrolite/util/plot/interpolation.py 1 95.24%
Totals Coverage Status
Change from base Build 8074334577: -0.03%
Covered Lines: 6211
Relevant Lines: 6778

💛 - Coveralls

@morganjwilliams morganjwilliams self-assigned this May 16, 2024
@morganjwilliams morganjwilliams added the enhancement New feature or request label May 16, 2024
Copy link
Owner

@morganjwilliams morganjwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just needs a little reordering for the below-zero replacement/warning and should be good to go.

pyrolite/comp/codata.py Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@morganjwilliams
Copy link
Owner

Thanks @sarahshi, I'll merge this one in now.

@morganjwilliams morganjwilliams merged commit 45bb627 into morganjwilliams:develop May 17, 2024
8 of 21 checks passed
morganjwilliams added a commit that referenced this pull request May 17, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants