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

Fix deprecation warnings #33

Merged
merged 5 commits into from
Apr 9, 2024
Merged

Conversation

ericpre
Copy link
Member

@ericpre ericpre commented Mar 17, 2024

Progress of the PR

  • Fix scipy deprecation warnings,
  • Fix numpy deprecation warning,
  • Use new and recommended numpy polynomial API,
  • Use hyperspy public API in favour of private API,
  • [n/a] docstring updated (if appropriate),
  • [n/a] update user guide (if appropriate),
  • [n/a] added tests,
  • add a changelog entry in the upcoming_changes folder (see upcoming_changes/README.rst),
  • Check formatting of the changelog entry (and eventual user guide changes) in the docs/readthedocs.org:exspy build of this PR (link in github checks)
  • ready for review.

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

Attention: Patch coverage is 78.04878% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 88.47%. Comparing base (c37013c) to head (bae3882).

Files Patch % Lines
exspy/misc/eels/tools.py 0.00% 5 Missing ⚠️
exspy/signals/eels.py 66.66% 2 Missing and 1 partial ⚠️
exspy/components/eels_vignetting.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
+ Coverage   88.45%   88.47%   +0.01%     
==========================================
  Files          67       67              
  Lines        7295     7287       -8     
  Branches     1179     1179              
==========================================
- Hits         6453     6447       -6     
+ Misses        573      571       -2     
  Partials      269      269              

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

@ericpre
Copy link
Member Author

ericpre commented Mar 31, 2024

exspy/signals/eels.py Outdated Show resolved Hide resolved
exspy/signals/eels.py Outdated Show resolved Hide resolved
exspy/signals/eels.py Outdated Show resolved Hide resolved
exspy/misc/eels/tools.py Outdated Show resolved Hide resolved
@@ -60,16 +60,14 @@ def _estimate_gain(
variance2fit = variance
average2fit = average

fit = np.polyfit(average2fit, variance2fit, pol_order)
fit = np.polynomial.Polynomial.fit(average2fit, variance2fit, pol_order)
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole function seems to be missing a test as all touched lines raise a warning.

@@ -46,7 +46,7 @@ def __init__(self):
self.right.value = np.nan
self.side_vignetting = False
self.fix_side_vignetting()
self.gaussian = Gaussian()
self.gaussian = hs.model.components1D.Gaussian()
Copy link
Contributor

Choose a reason for hiding this comment

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

no test for this component?

@ericpre
Copy link
Member Author

ericpre commented Apr 1, 2024

For the missing tests, I had a look and I have no idea, what these functions are supposed to do! I would suggest to leave it for another PR which will need help from @francisco-dlp.

@ericpre ericpre requested a review from jlaehne April 1, 2024 10:13
@ericpre
Copy link
Member Author

ericpre commented Apr 3, 2024

@jlaehne, do you want to have another look at this PR?
I would be quite keen to finish the scipy/numpy deprecation and get them out of the way! :)

@jlaehne jlaehne merged commit cbb3785 into hyperspy:main Apr 9, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants