-
Notifications
You must be signed in to change notification settings - Fork 422
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
Prototype systematic data type testing #1388
Conversation
This pull request introduces 2 alerts when merging c77d930 into 3cd8bd0 - view on LGTM.com new alerts:
|
The most recent commit is incomplete, but contains all of the pieces for systematic data type testing. I am seeking comments on the design (@dopplershift, @dcamron) as I move forward with implementing this for all existing functions (i.e., adding new entries to the list in data_basic.py). Specific questions I'd like to address are:
I just noticed that the current dask tests are only xfailing due to a missing import statement, and the dask import in test_basic is not needed. I'll fix those in the next commit. |
This pull request introduces 2 alerts when merging a602729 into 3cd8bd0 - view on LGTM.com new alerts:
|
This pull request introduces 4 alerts when merging 9e50ae3 into f29088e - view on LGTM.com new alerts:
|
I have a few things I could add here before you take a serious look at this @dopplershift, however this was opened before the cartopy 0.18 fix and is generally far behind master. Should I push changes despite expecting many of the tests to fail? Or is a rebase/something else appropriate at the moment? |
A rebase probably isn't a bad idea. |
This commit is a draft of implementing unit tests for data types in each calc function and parameterizing tests for edge cases. - Add fixtures in conftest.py containing test data for each supported data type. - Add/update tests for individual data types using fixtures. - Group tests into a class. - Add fixture for truth values specific to the test class. - Parameterize the edge case. Makes progress toward closing Unidata#1214
Organize tests for `wind_components`, `wind_speed`, `wind_direction`, and `windchill` into classes for each. Add test data and truth data fixtures to each test class which contain arrays for dtype tests.
- Add support for testscenarios to test data types (conftest.py). - Add standardized tests for supported data types (scalars, arrays, masked arrays, nans, data arrays). - Add standardized tests that xfail for dask arrays. - Add TestDataTypes class to test_basic.py, which is an example of what would be included in all test modules. - Add data_basic.py, an example of adding test data for (new) functions
- Add test data for most functions in the basic module. - Add an optional argument, decimal, to specify precision of testing. - Handle testing of scalars when number of arguments and return values are different. - Handle modifying test values with nans when test values are integer arrays. - Add test for *computed* dask arrays. - Remove redundant tests covered by TestDataTypes class. - Skip dask array testing if the module is not loaded.
* Move data type testing utilities to their own module * Add a function to build the test scenarios from dictionaries of data * Refactor existing test data into a nested dictionary
* Create test_data_type_testing module * Add module_ext kwarg to build_scenarios so scenarios can be built and tests can be run against any MetPy module * Add utility tests to testing module
c11272a
to
2f6af13
Compare
This pull request introduces 5 alerts when merging 847705b into 86883d4 - view on LGTM.com new alerts:
|
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
* Require dask.array and Pint>=0.15 for tests * Build and test Quantity wrapped Dask Arrays * xfail functions that have known issues when computing on Dask Arrays
This is ready to be looked at, though there are couple of things I know are wrong.
|
This pull request introduces 1 alert when merging 2f5ce6a into febf451 - view on LGTM.com new alerts:
|
Closing in favor of #1935 |
Description Of Changes
This commit is a draft of implementing unit tests for data types in each
calc function and parameterizing tests for edge cases.
data type.
Makes progress toward closing #1214