-
Notifications
You must be signed in to change notification settings - Fork 76
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
Changes to store interfaces and implementations #230
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main noisepy/NoisePy#230 +/- ##
==========================================
+ Coverage 68.31% 69.29% +0.97%
==========================================
Files 34 36 +2
Lines 3955 4074 +119
Branches 542 565 +23
==========================================
+ Hits 2702 2823 +121
+ Misses 1120 1118 -2
Partials 133 133
☔ View full report in Codecov by Sentry. |
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.
What a major body of work!
|
||
class ASDFStackStore(StackStore): | ||
def __init__(self, directory: str, mode: str = "a"): | ||
super().__init__() | ||
self.datasets = ASDFDirectory(directory, mode, _filename_from_stations, _parse_station_pair_h5file) | ||
|
||
def append(self, src: Station, rec: Station, stacks: List[Stack]): | ||
# TODO: Do we want to support storing stacks from different timespans in the same store? |
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.
probably
for stack in stacks: | ||
self.datasets.add_aux_data((src, rec), stack.parameters, stack.name, stack.component, stack.data) | ||
|
||
def get_station_pairs(self) -> List[Tuple[Station, Station]]: | ||
return self.datasets.get_keys() | ||
|
||
def read_stacks(self, src: Station, rec: Station) -> List[Stack]: | ||
def get_timespans(self, src: Station, rec: Station) -> List[DateTimeRange]: | ||
# TODO: Do we want to support storing stacks from different timespans in the same store? |
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.
yes eventually, we might want to store all timestamp from a given channel pair into the same store. this would be especially true for the "monitoring" application of this package.
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.
Sounds good, added issue https://github.com/noisepy/NoisePy/issues/232 to track this
See discussion: #229
Summary of changes:
read_correlations
andread_stacks
are now bothread
contains()
methods