-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bugfix 250 test event equalize #255
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bikegeek. Unfortunately, when I checkout and run run_basic.sh on Acorn I get one failed test (test_lon_from_360_to_180) due to "AttributeError: module 'numpy' has no attribute 'float'". Do you know what might be going wrong?
================================================================================== FAILURES ===================================================================================
__________________________________________________________________________ test_lon_from_360_to_180 ___________________________________________________________________________
def test_lon_from_360_to_180():
# Verify that longitude type is maintained, ie an int isn't converted to
# a float when converting coord values.
i_lon = [i_lon for i_lon in range (0, 359)]
np_lon = np.linspace(0, 359, 360)
i_west_east = utils.convert_lon_360_to_180(i_lon)
np_west_east = utils.convert_lon_360_to_180(np_lon)
assert isinstance(i_west_east[0], np.int64)
> assert isinstance(np_west_east[0], np.float)
test_lon_360_to_180.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
attr = 'float'
def __getattr__(attr):
# Warn for expired attributes, and return a dummy function
# that always raises an exception.
import warnings
try:
msg = __expired_functions__[attr]
except KeyError:
pass
else:
warnings.warn(msg, DeprecationWarning, stacklevel=2)
def _expired(*args, **kwds):
raise RuntimeError(msg)
return _expired
# Emit warnings for deprecated attributes
try:
val, msg = __deprecated_attrs__[attr]
except KeyError:
pass
else:
warnings.warn(msg, DeprecationWarning, stacklevel=2)
return val
if attr in __future_scalars__:
# And future warnings for those that will change, but also give
# the AttributeError
warnings.warn(
f"In the future `np.{attr}` will be defined as the "
"corresponding NumPy scalar. (This may have returned Python "
"scalars in past versions.", FutureWarning, stacklevel=2)
# Importing Tester requires importing all of UnitTest which is not a
# cheap import Since it is mainly used in test suits, we lazy import it
# here to save on the order of 10 ms of import time for most users
#
# The previous way Tester was imported also had a side effect of adding
# the full `numpy.testing` namespace
if attr == 'testing':
import numpy.testing as testing
return testing
elif attr == 'Tester':
from .testing import Tester
return Tester
> raise AttributeError("module {!r} has no attribute "
"{!r}".format(__name__, attr))
E AttributeError: module 'numpy' has no attribute 'float'
/u/julie.prestopnik/.local/lib/python3.8/site-packages/numpy/__init__.py:284: AttributeError
=========================================================================== short test summary info ===========================================================================
FAILED test_lon_360_to_180.py::test_lon_from_360_to_180 - AttributeError: module 'numpy' has no attribute 'float'
============================================================================== 1 failed in 0.99s ==============================================================================
* Remove Python 3.8.6 and 3.8.12 and use Python 3.8 instead. The latest version of ubuntu no longer has python 3.8.6 available. * Update unit_tests.yml replace 3.8.6 and 3.8.12 with 3.8 for Python because latest version of ubuntu does not have support for python 3.8.6 * Issue #250 fix the test_equalize_axis_data_no_fcst_var fixture * Added ending asterisks for end bold to fix these warnings: WARNING: Inline strong start-string without end-string. * #251 allow test to run check on numpy types regardless of numpy version Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy to report that the test no longer fails. Thank you! I approve this request.
…tcenter/METcalcpy into bugfix_250_test_event_equalize
Pull Request Testing
Create a python 3.8 conda environment with these NCO metcalcpy minimal requirements:
Run tests using this script (to run only the 'basic' tests that don't use image comparison 3rd party packages):
run_basics.sh.txt
Verified that the specified tests passed (some tests are skipped in test_agg_stats_and_boots.py because they take a very long time to run) .
NOTE test_scorecard.py tests will fail because there is another Github issue #251 for addressing the SettingWithCopyWarning category (that has been removed from pandas versions that are >1.3.x).
Follow the steps above on 'acorn' and verify same results.
Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [NA]
Do these changes include sufficient testing updates? [Yes ]
Will this PR result in changes to the test suite? [No ]
If yes, describe the new output and/or changes to the existing output:
Please complete this pull request review by [Before bugfix release ].
Pull Request Checklist
See the METplus Workflow for details.
Select: Reviewer(s)
Select: Organization level software support Project or Repository level development cycle Project
Select: Milestone as the version that will include these changes