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

Support both & and | for metasets #69

Open
wants to merge 5 commits into
base: add-tests-frost
Choose a base branch
from

Conversation

frostming
Copy link
Member

Fix #68

@frostming frostming changed the base branch from master to add-tests-frost October 1, 2019 12:48
@codecov
Copy link

codecov bot commented Oct 1, 2019

Codecov Report

Merging #69 into add-tests-frost will increase coverage by 2.74%.
The diff coverage is 72.52%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           add-tests-frost     #69      +/-   ##
==================================================
+ Coverage            54.96%   57.7%   +2.74%     
==================================================
  Files                   42      42              
  Lines                 2700    2757      +57     
  Branches               475     495      +20     
==================================================
+ Hits                  1484    1591     +107     
+ Misses                1100    1024      -76     
- Partials               116     142      +26
Impacted Files Coverage Δ
src/passa/internals/markers.py 55.05% <59.18%> (+1.37%) ⬆️
src/passa/internals/specifiers.py 66.37% <76.92%> (+20.22%) ⬆️
src/passa/models/metadata.py 85.93% <93.1%> (+1.38%) ⬆️
src/passa/models/caches.py 68.8% <0%> (+0.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4097493...38472b2. Read the comment docs.

return str(self) == str(other)

def __lt__(self, other):
return hash(self) < hash(other)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m cool with &, |, and bool, but not sure about the others. == could work, but I’m hesitant since it can result in false negative. I don’t get why < is needed at all, and the implementation even less.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== is used for deduplicating markers, false negatives(if there are any) won't do harm, while false positives will. < is a somewhat dirty hack to make sorting work, but I suspect we need sorting at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using a regular function with proper docstring instead (say a.is_identical_to(b)) since == has the potential to be misused in the future. I don’t think in-class sorting makes sense here since the logic is completely arbitrary; it’s better to pass in a custom key= argument when sorting instead.

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