-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add integration tests for bit shift functionality #153
base: DSEGOG-325-Update-ingestion-to-support-epac_ops_data_version-1.1
Are you sure you want to change the base?
Add integration tests for bit shift functionality #153
Conversation
Hi, Just picking this up as well as I thought it'd be a good idea to pull down the bit shift code and try and run some tests against it.
|
Yeah sorry I'm only looking at this comment now. I know we spoke about this earlier but to reiterate:
Happy to discuss and clarify more if needed. |
It's all good. I should've realised that it was taken from the other branch. I'm happy to wait until everything is approved for merging/adding the hdf file to the bucket. If this happens again, I think we should check the tests and maybe refactor anything that checks for an exact number of test files. I've spun up the API, ingested the hdf file and am just running the nox stages now 👍 |
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.
Tests look good. The only thing i can't see is if the code coverage has changed. I'm happy to approve so we can get the CI working with the new test data, and then create a separate PR for any code coverage concerns if needed.
This adds "integration" tests for the bit depth changes in #151 . It will require a single hdf5 file, generated with v1.1 of the simulated data tool for the timestamp 20230606120000 to be ingested into the bucket the tests run against. This has not yet been added to the CI to avoid failing other branches, so as a result the tests on this branch will fail. I haven't attached this file as it's fairly large, but can circulate if others want to test locally or put it into the CI bucket when we're ready.
New tests:
Two new test cases for
test_valid_get_records
:bit_depth
does not appear in the metadata for old data (v1.0)bit_depth
does appear in the metadata for new data (v1.1)Three new test cases for
test_valid_get_image
:12 bit original image:
![20230606120000_CM-202-CVC-CAM-1_None](https://private-user-images.githubusercontent.com/61705287/407707275-9565957f-f40b-45ab-a7f6-cb941975375f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMzg3NTgsIm5iZiI6MTczOTIzODQ1OCwicGF0aCI6Ii82MTcwNTI4Ny80MDc3MDcyNzUtOTU2NTk1N2YtZjQwYi00NWFiLWE3ZjYtY2I5NDE5NzUzNzVmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAxNDczOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY4ZDJiZDE4Y2YyZjdlNDNiNGI1YzA3YWM1OTc1OGFhMGI4M2NmYzk3N2UwN2M1N2EwZDEyYTJlN2ZjZDdjNjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.gZVagUq-B6e1zlV4GYPD3UasPK-KCqGEGLNkgL3mz1g)
12 bit image with 8 bit limits applied:
![20230606120000_CM-202-CVC-CAM-1_8](https://private-user-images.githubusercontent.com/61705287/407707338-33031ba8-f4ca-42bf-9059-949f265b66b7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMzg3NTgsIm5iZiI6MTczOTIzODQ1OCwicGF0aCI6Ii82MTcwNTI4Ny80MDc3MDczMzgtMzMwMzFiYTgtZjRjYS00MmJmLTkwNTktOTQ5ZjI2NWI2NmI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAxNDczOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM0NWNiYzg2MzNlM2M2NjNlOWVlODgzMzA1ZmI1ZTM1NDg0ZDBiYjM1Yjg5N2M2YWViZTU2ODg0OTc0ZDJkOWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.goCFk3sTnGI2hZl3UFYJFiyjp-REPug5dK18c3dx_eU)
12 bit image with 12 bit limits applied (this should result in the same image as in both cases these values are scaled up to the "storage" bit depth, which is 16 bits, before being applied):
![20230606120000_CM-202-CVC-CAM-1_12](https://private-user-images.githubusercontent.com/61705287/407707431-cd56c50e-dd57-47a5-b2e1-01f406f7f685.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMzg3NTgsIm5iZiI6MTczOTIzODQ1OCwicGF0aCI6Ii82MTcwNTI4Ny80MDc3MDc0MzEtY2Q1NmM1MGUtZGQ1Ny00N2E1LWIyZTEtMDFmNDA2ZjdmNjg1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAxNDczOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQxOTQ3MmM3ZGUzMmE2Nzk2NjZhZGRiZWRiYmFlZDJiNjNlZThiYjYxZjExMzBjZjQ0ZTg2Y2UyMmIwNDQ3NGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.r8Wiu7Z890x8SmfndSugOoBjQeP6zH_CZvQ-xT9hdR4)
Unit test of
_bit_shift_to_storage
as not all lines were covered by the above testExisting tests updated:
most_recent_date
andrecent_sample
include values for the new timestamp