testpackage for comparing hashes of outputs and saving them as reference data + vlsvrs testing#450
Open
lassejsc wants to merge 39 commits intofmihpc:devfrom
Open
testpackage for comparing hashes of outputs and saving them as reference data + vlsvrs testing#450lassejsc wants to merge 39 commits intofmihpc:devfrom
lassejsc wants to merge 39 commits intofmihpc:devfrom
Conversation
analysator.vlsvreader and hashing of outputs from either one for making reference data for CI
…dling stuff to the hash testpackage
…ed the name of the variable those are saved as for interpolationtest2d()
…log the cluster otherwise
…or some tests (might invert the default behavior later)
… for when loaded dictionary is empty in comparison case
…ust testing in an if False: , will be enabled later
…aders (read_velocity_cell and read_vdf_sparse) and general cleanup
…vant and cleaned up the code in general
This file contains hidden or 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
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.
wip
Testpackage_hashes for generating and comparing hashes from the outputs of functions, currently used for vlsvreader's
read_variableandread_interpolated_variable.This will also be used for testing vlsvrs from backend later when that is added to dev proper. The current gitlab runners cannot see the reference data on turso for testing and such for now the vlsvrs is tested more robustly in the analysator side. (Backend repo does have one vlsv file for doing basic read test with vlsvrs)
In
testpackage_hashes.pyis classTesterthat can dump and load hashes and check them etc. Basic usage isThe
ciTester.hashcan accept function object or name of the function as string, note in the latter case it has to be part of the vlsvobj given to it (either VlsvReader instance or VlsvFile instance for vlsvrs)The function can also do operations on the return values and by default whatever is returned is "flattened", so the return value shape is not taken into account by default. (This is due to the vlsvrs and vlsvreader having differences in the calls and the array shape changing is not the biggest issue IF the return values are fine imo).
"flattening" is whether or not the shape of the array is added to the bytedata when making the hash of it
Example of doing operations on the return value for shaping what gets hashed, trivial example:
This will hash the return value of:
Also note that arguments given to the function call can be either list (params) or dict (kwargs).
More documentation to come
Other additions unrelated to this that were fixed while doing this: