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 exception with numpy 1.23 #97

Merged
merged 1 commit into from
Jun 30, 2022
Merged

Conversation

pblottiere
Copy link
Contributor

Hello,

Due to a recent change in numpy 1.23 (a DeprecationWarning is now a proper exception: https://numpy.org/devdocs/release/1.23.0-notes.html#expired-deprecations), an exception is raised in Wavelengths.run_wavelengths:

Traceback (most recent call last):
  File "venv/lib/python3.9/site-packages/Py6S/SixSHelpers/all_wavelengths.py", line 96, in run_wavelengths
    if len(wavelengths[0]) == 4:
TypeError: object of type 'numpy.float64' has no len()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
    wv, res = Wavelengths.run_wavelengths(s, self.wvrange, n=ncore)
  File "venv/lib/python3.9/site-packages/Py6S/SixSHelpers/all_wavelengths.py", line 102, in run_wavelengths
    return np.array(wavelengths), np.array(results)
  File "venv/lib/python3.9/site-packages/Py6S/outputs.py", line 113, in __getattr__
    raise OutputParsingError("The specifed output variable does not exist.")
Py6S.sixs_exceptions.OutputParsingError: The specifed output variable does not exist.

@codecov
Copy link

codecov bot commented Jun 30, 2022

Codecov Report

Merging #97 (debaa2a) into master (ea54398) will decrease coverage by 0.11%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
- Coverage   88.01%   87.89%   -0.12%     
==========================================
  Files          18       18              
  Lines        1719     1719              
==========================================
- Hits         1513     1511       -2     
- Misses        206      208       +2     
Impacted Files Coverage Δ
Py6S/outputs.py 78.72% <100.00%> (-0.71%) ⬇️
Py6S/sixs_exceptions.py 77.77% <0.00%> (-5.56%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea54398...debaa2a. Read the comment docs.

@robintw
Copy link
Owner

robintw commented Jun 30, 2022

Thank you very much for this - I'll do a new release later today to include this fix.

@robintw robintw merged commit 87039d5 into robintw:master Jun 30, 2022
@pblottiere
Copy link
Contributor Author

I'll do a new release later today to include this fix.

Awesome, thanks a lot for your work 👍!

@robintw
Copy link
Owner

robintw commented Jun 30, 2022

The new release (v1.9.2) is now on PyPI - a conda package will follow in the next couple of days.

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

Successfully merging this pull request may close these issues.

None yet

2 participants