Open pll001 opened 1 month ago
It looks like the code here implements min
properly, what versions of NumPy and Pint are you using?
Interesting. Works fine for me on Python 3.9.16 with NumPy 1.26.4 and pint 0.23
>>> np.min(pint.Quantity(np.array([250, 700, 1500, 3100, 5720, 7120]), "meter"))
<Quantity(250, 'meter')>
Is there something keeping you from upgrading NumPy or Pint?
I'm unable to reproduce this on my macOS machine with Python 3.9 + Pint 0.20.1 and Numpy 1.21.2 with current MetPy main. I don't think we've changed anything relevant since 1.6.2, so I'm guessing this is an issue with your environment.
I would double check what versions of pint and numpy are being picked up with python -c 'import pint; print(pint.__version__); import numpy; print(numpy.__version__)'
, and consider rebuilding your environment.
Does conda env create -n metpy_test metpy numpy pint && conda activate metpy_test && python "D:\python\3.10 fog\5.py"
run into the same problem?
conda env create -n metpy_test2 metpy==1.6.2 numpy==1.21.2 pint==0.20.1 python==3.9 && conda activate metpy_test2 && python "D:\python\3.10 fog\5.py"
?
If those fail with conda: No program or batch file with that name
or similar errors ("Program not found" is also likely), replacing conda env create -n
with pip install --force-reinstall
and skipping the conda activate
part should work.
I think getting rid of those would be conda env remove -n metpy_test && conda env remove -n metpy_test2
What went wrong?
I copied the example code of this function, but when it runs, an error occurs. What is the problem![1723278732507](https://github.com/user-attachments/assets/efdbb320-f1ca-4490-a091-4e23b2f272ba)
Operating System
Windows
Version
1.6.2
Python Version
3.9
Code to Reproduce
Errors, Traceback, and Logs