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
Fix issue 153 #154
Fix issue 153 #154
Conversation
- Factor some complexity out of make_mth5_from_fdsn_client - factor (duplicated code) into stream_boundaries [Issue(s): #156]
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## fix_issue_147 #154 +/- ##
=================================================
+ Coverage 59.73% 59.79% +0.06%
=================================================
Files 128 128
Lines 13019 13022 +3
=================================================
+ Hits 7777 7787 +10
+ Misses 5242 5235 -7
☔ View full report in Codecov by Sentry. |
Six instances of the same block of three lines replaced with one call. [Issue(s): #153]
Also, in loop where there is only 1 run in runlist, but multiple streams from FDSN, cast start,end from times[0],[1] so that the rest of the logic is same as other cases [Issue(s): #153]
Clean up logic for case n_runs==1 We were checking n_times > 1, with an elif n_times == 1 BUT this logic lay within an elif following a check that n_runs==n_times Since to be in this block at all, means that n_runs!=n_times, then if n_runs==1 we know that n_times!=1, so we don't need to check/handle that [Issue(s): #153]
This method is key to merging wrangle_runs_into_containers_v1 and wrangle_runs_into_containers_v2, because a v1 mth5 object can get a survey group with the same method as can a v2 survey_group Thus we can replace: run_group = m.stations_group.get_station(station_id).add_run(run_id) & run_group = survey_group.stations_group.get_station(station_id).add_run(run_id) with: run_group = mth5_obj_or_survey.stations_group.get_station(station_id).add_run(run_id) [Issue(s): #153]
- cast start_times and end_times to UTCDateTime in stream_boundaries, as they are only accessed in that form later - add run_timings_match_stream_timing method to greatly simplify len(run_list) != n_times case logic. [Issue(s): #153]
replaced with get_station_streams method [Issue(s): #153
also simplify interact logic at end of make [Issue(s): #153]
Remove cruft. [Issue(s): #153]
This is ready to merge - if possible adding test coverage would be nice, but not required. |
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.
Looks like a good refactor. Not sure about the one test that fails. Looking into it.
While fixing this, may as well fix issue #147 (its probably related)
Also, we should
mth5.clients.fdsn