-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improving API: part 1: functionality for input pyfive.high_level.Dataset #241
Merged
+174
−86
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
97d6360
start api changes
valeriupredoi d4f0588
start api changes
valeriupredoi 3b6f0ce
set structure
valeriupredoi bf0c3fd
add test
valeriupredoi 35a29d5
actual test with pyfive variable
valeriupredoi 28d97e5
actual test with pyfive variable
valeriupredoi 25668bd
clean up
valeriupredoi 8cdd4cb
clean up and add bits
valeriupredoi a2f41ab
add chunking test case
valeriupredoi e471dee
add exception if not pyfive dataset
valeriupredoi 620e2b6
test for that exception
valeriupredoi dca443f
start reduce chunk with correct syntax
valeriupredoi 1bd40f5
it bloody works
valeriupredoi 0bdc310
it bloody works
valeriupredoi 9f46ab9
add inline comment
valeriupredoi 0c562e1
correct handling for s3
valeriupredoi 74f0c26
run s3 tests
valeriupredoi 51e27ca
add real world s3 dataset test
valeriupredoi 2499066
add note to test
valeriupredoi c495019
remove leftover
valeriupredoi ad3fb54
unused import
valeriupredoi 9bf31bd
unused return
valeriupredoi 61cf5dd
add correct function docstring
valeriupredoi 4cdeb1b
removed obsolete inline
valeriupredoi 9aca259
remove obsolete inline
valeriupredoi 2507fe4
Update activestorage/active.py
valeriupredoi 17684aa
Update activestorage/active.py
valeriupredoi b80862d
Update activestorage/active.py
valeriupredoi ebd54e8
fix test
valeriupredoi 050bc8f
test mock s3 dataset
valeriupredoi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import os | ||
import numpy as np | ||
|
||
from activestorage.active import Active | ||
from activestorage.active import load_from_s3 | ||
|
||
S3_BUCKET = "bnl" | ||
|
||
# TODO Remove after full testing and right before deployment | ||
def test_s3_dataset(): | ||
"""Run somewhat as the 'gold' test.""" | ||
storage_options = { | ||
'key': "f2d55c6dcfc7618b2c34e00b58df3cef", | ||
'secret': "$/'#M{0{/4rVhp%n^(XeX$q@y#&(NM3W1->~N.Q6VP.5[@bLpi='nt]AfH)>78pT", | ||
'client_kwargs': {'endpoint_url': "https://uor-aces-o.s3-ext.jc.rl.ac.uk"}, # old proxy | ||
# 'client_kwargs': {'endpoint_url': "https://uor-aces-o.ext.proxy.jc.rl.ac.uk"}, # new proxy | ||
} | ||
active_storage_url = "https://192.171.169.113:8080" | ||
# bigger_file = "ch330a.pc19790301-bnl.nc" # 18GB 3400 HDF5 chunks | ||
bigger_file = "ch330a.pc19790301-def.nc" # 17GB 64 HDF5 chunks | ||
# bigger_file = "da193a_25_day__198808-198808.nc" # 3GB 30 HDF5 chunks | ||
|
||
test_file_uri = os.path.join( | ||
S3_BUCKET, | ||
bigger_file | ||
) | ||
print("S3 Test file path:", test_file_uri) | ||
dataset = load_from_s3(test_file_uri, storage_options=storage_options) | ||
av = dataset['UM_m01s16i202_vn1106'] | ||
|
||
# big file bnl: 18GB/3400 HDF5 chunks; def: 17GB/64 HDF5 chunks | ||
active = Active(av, storage_type="s3", | ||
storage_options=storage_options, | ||
active_storage_url=active_storage_url) | ||
active._version = 2 | ||
active._method = "min" | ||
|
||
# result = active[:] | ||
result = active[0:3, 4:6, 7:9] # standardized slice | ||
|
||
print("Result is", result) | ||
assert result == 5098.625 |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Why don't we import the class so it's more obvious what it's for?
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.
I tried this just now, there is unfortunately flakiness involved:
with implement:
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.
StoreInfo
does not seem to be a safe class the way it is implemented at the moment, since it gets frozen in at times, and doesn't update on the go