Skip to content
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 data gap #508

Merged
merged 7 commits into from
Feb 18, 2024
Merged

Fix data gap #508

merged 7 commits into from
Feb 18, 2024

Conversation

pavlis
Copy link
Collaborator

@pavlis pavlis commented Feb 11, 2024

This started out as a simple bug fix for a mistake in the pybind11 code for this auxiliary class. I realized, however, that in working with a prototype for surgical mutes that this was a very useful container that might work well as a component of a generic surgical mute algorithm. Working on the prototype with a data set from Homestake I realized it lacked a couple important capabilities:

  1. The previous version required gaps intervals to not overlap. An attempt to add a gap definition that overlapped an existing one would cause nothing to happen. That happened because the original concept was recorded data gaps, which are effectively always immutable. For a more generic use that needed to be relaxed. I did that here by adding some minor complexity to the add_gaps method. Tests show it that functionality now works.
  2. I saw a need for the C++ operator += (need for the using += in python of course) that would cleanly merge two different DataGap containers. Once functionality 1 was added this was trivial. Well, not really as there was an odd property of the std::set container that complicated the code requiring a complete copy of the left hand side before merging the right hand side. What I did works, but I'm not quite sure why it was necessary. I considered it harmless, however, as this container should rarely be huge enough that such a copy operation is a serous performance problem.

Copy link

codecov bot commented Feb 11, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (23b0dc5) 55.01% compared to head (7d7cc0a) 55.08%.

Files Patch % Lines
cxx/src/lib/seismic/DataGap.cc 90.00% 4 Missing ⚠️
cxx/include/mspass/seismic/TimeSeriesWGaps.h 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #508      +/-   ##
==========================================
+ Coverage   55.01%   55.08%   +0.07%     
==========================================
  Files         144      144              
  Lines       22382    22429      +47     
==========================================
+ Hits        12313    12356      +43     
- Misses      10069    10073       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pavlis
Copy link
Collaborator Author

pavlis commented Feb 11, 2024

Looks like these changes all passed the tests clean as I expected. Wanted to comment that the lines Codecov flags are harmless. They are present because I intentionally omitted the list list of TimeWindow constructor. It was a relic of the older seispp api and seemed less useful for the python api. If you, @wangyinz, think it would be useful thing to add it wouldn't be hard. More important is the TODO you will see the pybind11 code - this should really have a pickle api. Won't really need that, however, unless I decide to move forward with this prototype surgical mute using this as the container. Until then I'd suggest this thing is kind of a niche component.

@wangyinz wangyinz merged commit b45b04c into master Feb 18, 2024
12 checks passed
@wangyinz wangyinz deleted the fix_DataGap branch February 18, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants