-
Notifications
You must be signed in to change notification settings - Fork 284
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
Rationalise CML Testing #6244
Comments
Hashing arrays may be a solution, so long as the hashing is tolerant of minor changes. |
From discussion with @HGWright and @ESadek-MO and @trexfeathers: string representation of NumPy arrays is not expected to be stable - there is no 'contract' for this, so long as a human can read the string then it's fine. That is not a sensible basis for consistent testing. The So: we could keep the CML format, but each CML file should be stored in a directory, together with As well as removing vulnerability to breaking changes in string format, storing NumPy arrays natively would allow use of |
TBH I don't think this preserves the basic utility of what CML offers. |
I realise I'm not sure if we're comparing really big arrays in this way, or is it "just" coordinates etc. Or maybe we just avoid anything too big. In which case all points might make good sense, |
@pp-mo to provide tolerance while still providing human readability, I think we would need to write our own parser, perhaps based on I'm sceptical on whether this would be worth the extra effort. In the graphics tests we have a well established precedent for tests that need 5mins extra work to see what has changed, and that workflow is easy enough to cope with. It would be similarly easy to work out changes in NumPy arrays by running the offending test locally. I'd also argue that our current printing of arrays in CML files actually harms readability in some cases. Once an array gets beyond 2 dimensions it is tricky to understand the differences I am looking at. Maybe I need more practice. |
assert_CML()
andassert_CML_approx_data()
are great conveniences for capturing Known Good Output - "we are happy with the way thisCube
looks right now, and don't want it to change".But there are some problems to address:
approx_data
for everything, which would reduce our complexity?(I believe the current mix is not by design, but mostly due to us copying patterns from existing tests)
The text was updated successfully, but these errors were encountered: