Skip to content

Comments

numpy.trapz bug#626

Merged
sadrasabouri merged 2 commits intodevfrom
trapz
Jan 4, 2026
Merged

numpy.trapz bug#626
sadrasabouri merged 2 commits intodevfrom
trapz

Conversation

@sepandhaghighi
Copy link
Owner

@sepandhaghighi sepandhaghighi commented Jan 3, 2026

Reference Issues/PRs

What does this implement/fix? Explain your changes.

  • numpy.trapz deprecation bug fixed

Any other comments?

@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.41%. Comparing base (3f9db11) to head (2ec0690).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
pycm/curve.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #626      +/-   ##
==========================================
- Coverage   99.47%   99.41%   -0.05%     
==========================================
  Files          15       15              
  Lines        3347     3351       +4     
  Branches      446      446              
==========================================
+ Hits         3329     3331       +2     
- Misses         12       14       +2     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sepandhaghighi sepandhaghighi self-assigned this Jan 3, 2026
@sepandhaghighi sepandhaghighi added the bug Something isn't working label Jan 3, 2026
@sepandhaghighi sepandhaghighi added this to the PYCM v4.6 milestone Jan 3, 2026
@sepandhaghighi sepandhaghighi marked this pull request as ready for review January 4, 2026 05:50
Comment on lines +537 to +538
except AttributeError:
trapezoid_function = numpy.trapz
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a unit-test (probably with patching or removing numpy.trapezoid)?

Copy link
Owner Author

Choose a reason for hiding this comment

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

It's not straightforward, different versions of numpy behave inconsistently; some have both methods while others have only one. We might work on this later to increase coverage.

Comment on lines 540 to 541
if isinstance(area, numpy.memmap):
area = area.dtype.type(area)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this might be out-of-scope for this PR, but if we can trigger this line in unit-test that's also good (only if it's easy-fix).

Copy link
Owner Author

Choose a reason for hiding this comment

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

I don't have any idea why the check for numpy.memmap was added here.

@sadrasabouri sadrasabouri merged commit 66d75bb into dev Jan 4, 2026
27 checks passed
@sadrasabouri sadrasabouri deleted the trapz branch January 4, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants