Skip to content

Clean up feature sets and labels flag#55

Merged
benedekrozemberczki merged 11 commits intoAstraZeneca:mainfrom
cthoyt:cleanup-features
Jan 19, 2022
Merged

Clean up feature sets and labels flag#55
benedekrozemberczki merged 11 commits intoAstraZeneca:mainfrom
cthoyt:cleanup-features

Conversation

@cthoyt
Copy link
Contributor

@cthoyt cthoyt commented Jan 19, 2022

Summary

This PR removes the redundant re-definition of dictionary functions in the drug feature set and context feature set. It also removes the label flag, which is always true. This PR cleans up the LabeledTriples class to also be more contained. This PR finally also turns on MyPy checks.

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

Changes

  • Replace superclass for DrugFeatureSet with UserDict and remove redundant functions
  • Replace superclass for ContextFeatureSet with UserDict and remove redundant functions
  • Replaced unnecessary abstractions for feature set classes that were never used
  • Remove label flag from all classes since it's always true
  • Update LabeledTriples class to be more contained (e.g., better pythonic style)
  • Turn on MyPy checking in CI

@codecov-commenter
Copy link

Codecov Report

Merging #55 (6322506) into main (5dc39bb) will decrease coverage by 0.22%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
- Coverage   97.83%   97.60%   -0.23%     
==========================================
  Files          28       28              
  Lines         739      669      -70     
==========================================
- Hits          723      653      -70     
  Misses         16       16              
Impacted Files Coverage Δ
chemicalx/pipeline.py 88.70% <ø> (ø)
chemicalx/data/batchgenerator.py 98.30% <100.00%> (-0.06%) ⬇️
chemicalx/data/contextfeatureset.py 100.00% <100.00%> (ø)
chemicalx/data/datasetloader.py 91.02% <100.00%> (-0.55%) ⬇️
chemicalx/data/drugfeatureset.py 100.00% <100.00%> (ø)
chemicalx/data/labeledtriples.py 97.36% <100.00%> (-0.51%) ⬇️
tests/unit/test_batching.py 100.00% <100.00%> (ø)
tests/unit/test_dataset.py 100.00% <100.00%> (ø)
tests/unit/test_datastructures.py 100.00% <100.00%> (ø)
tests/unit/test_models.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 5dc39bb...6322506. Read the comment docs.

@benedekrozemberczki benedekrozemberczki merged commit 806aa1d into AstraZeneca:main Jan 19, 2022
@benedekrozemberczki
Copy link
Contributor

Thank you @cthoyt looks great!

@cthoyt cthoyt deleted the cleanup-features branch January 19, 2022 15:20
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.

3 participants