-
Notifications
You must be signed in to change notification settings - Fork 0
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
[tests] numpydantic.testing
- exposing helpers for 3rd-party interface development & combinatoric testing
#31
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull Request Test Coverage Report for Build 11289913767Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Split out annotation dtype and shape, swap out all interface tests, fix numpy and dask model casting, make merging models more efficient, correctly parameterize and mark tests!
…the array we would generate
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently
we have fixtures for specifying a number of test cases for dtypes and shapes, and then each interface validates against those test cases.
To make that work, we..
ValidationCase
model that takes an annotation and a specification for an array to test against it.ValidationCase
model can generates a model with an annotation that matches the spec in the validation caseThe shape/dtype cases look something like this:
The numpy interface tests are like this
Problem
this is proving to be a little bit brittle, and we don't test against, eg, the product of the dtype and shape cases even though we should.
we also want to test behaviors that should be true for all generators, all dtypes, and all shapes, but currently we can only run those tests against a fixed model and array pair for each interface.
we also want to make it possible for people to develop their own interfaces, and so it would be nice if we could facilitate that by providing structure for testing them and a set of tests that need to pass in order for an interface to be added to the package. (or not if they don't want to idrc)
So this PR...
InterfaceTestHelper
that provides classmethods for generating an array from aValidationCase
and for validating the array against itnumpydantic.testing
module that containsproduct
iteratorsValidationCase
to take anInterfaceTestHelper
which generalizes what is currently repeated for each of the interfaces with a lot of boilerplate.merge
method to ValidationCase to allow multiple partial validation cases to be combined.Also