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

Use registry pattern for ClassificationMetricSet #40

Merged
merged 2 commits into from Jan 6, 2022

Conversation

cthoyt
Copy link
Contributor

@cthoyt cthoyt commented Jan 4, 2022

Summary

This PR upgrades the rexmex.utils.Annotator class to implement the registry pattern, which basically means it keeps track of all of the functions it gets applied to. This is actually the same thing that the ClassificationMetricSet class does in its __init__, so it can be used to reduce the hard-coded aspects there.

Previously existing tests should be sufficient to check that this still has the same functionality as before (with the added benefit of including all metrics instead of just a handful)

  • Code passes all tests
  • Unit tests provided for these changes
  • Documentation and docstrings added for these changes

Changes

  • Implement registry pattern in rexmex.utils.Annotator
  • Refactor rexmex.metricset.ClassificationMetricSet to use registry from rexmex.metrics.classification.classifications

@codecov-commenter
Copy link

Codecov Report

Merging #40 (b62e0ed) into main (d18c846) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #40   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files          16       16           
  Lines         884      886    +2     
=======================================
+ Hits          882      884    +2     
  Misses          2        2           
Impacted Files Coverage Δ
rexmex/metricset.py 98.24% <100.00%> (-0.09%) ⬇️
rexmex/utils.py 100.00% <100.00%> (ø)

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 d18c846...b62e0ed. Read the comment docs.

@benedekrozemberczki benedekrozemberczki merged commit 8fe5de1 into AstraZeneca:main Jan 6, 2022
@cthoyt cthoyt deleted the autocollect-reloaded branch January 6, 2022 10:28
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.

None yet

3 participants