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 a bug with DataQualityFlag subtraction & revise a few tests #1703

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

asouthgate
Copy link
Contributor

@asouthgate asouthgate commented Oct 24, 2023

This fixes a bug in DataQualityFlag subtraction (https://github.com/gwpy/gwpy/issues/1700) documentation and improves the test for it.

This also changes a few other test assertions in DataQualityDict which I believe were not testing correct elements.

E.g.

    def __isub__(self, other):
        for key, value in other.items():
            if key in self:
                self[key] -= value
        return self

Subtraction is based on keys. However, the tests were testing on order, which was not the same thing.

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #1703 (03804e9) into main (bc48f2c) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@          Coverage Diff          @@
##            main   #1703   +/-   ##
=====================================
  Coverage   94.3%   94.3%           
=====================================
  Files        239     239           
  Lines      18560   18575   +15     
=====================================
+ Hits       17517   17533   +16     
+ Misses      1043    1042    -1     
Flag Coverage Δ
Conda 94.1% <100.0%> (+<0.1%) ⬆️
Linux 94.3% <100.0%> (+<0.1%) ⬆️
Windows 84.7% <100.0%> (+<0.1%) ⬆️
macOS 93.6% <100.0%> (+<0.1%) ⬆️
python3.10 94.1% <100.0%> (+0.5%) ⬆️
python3.11 94.1% <100.0%> (+0.4%) ⬆️
python3.8 94.3% <100.0%> (+<0.1%) ⬆️
python3.9 94.1% <100.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
gwpy/segments/tests/test_flag.py 100.0% <100.0%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

1 participant