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

Clean up feature comparison operators #67

Merged
merged 2 commits into from
Jun 14, 2019
Merged

Clean up feature comparison operators #67

merged 2 commits into from
Jun 14, 2019

Conversation

standage
Copy link
Owner

@standage standage commented Jun 14, 2019

This update cleans up comparison operators for Feature objects. I had also planned on implementing __eq__ and __hash__ operators (see below), but this causes issues during traversal with duplicate features (such as exons defined multiple times; related to #30).

    def __eq__(self, other):
        if not isinstance(other, Feature):
            return False
        if self.seqid != other.seqid or self._range != other._range:
            return False
        if self.type != other.type or self.source != other.source:
            return False
        return True

    def __hash__(self):
        return hash((self.seqid, self.range, self.type, self.source))
  • Full test coverage? Any additional tests that could easily be added?
  • API documentation up-to-date? Docstring examples?
  • Is the CHANGELOG up-to-date?

@codecov-io
Copy link

codecov-io commented Jun 14, 2019

Codecov Report

Merging #67 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #67   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          18     18           
  Lines        1091   1073   -18     
  Branches      254    244   -10     
=====================================
- Hits         1091   1073   -18
Impacted Files Coverage Δ
tag/range.py 100% <100%> (ø) ⬆️
tag/feature.py 100% <100%> (ø) ⬆️

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 86ca8bf...52a9fce. Read the comment docs.

@standage standage merged commit 3682d43 into master Jun 14, 2019
@standage standage deleted the fix/featurecomp branch June 14, 2019 18:14
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