AstraZeneca / chemicalx

A PyTorch and TorchDrug based deep learning library for drug pair scoring. (KDD 2022)
https://chemicalx.readthedocs.io
Apache License 2.0
708 stars 87 forks source link

Clean up feature sets and labels flag #55

Closed cthoyt closed 2 years ago

cthoyt commented 2 years ago

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.

Changes

codecov-commenter commented 2 years ago

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%) :arrow_down:
chemicalx/data/contextfeatureset.py 100.00% <100.00%> (ø)
chemicalx/data/datasetloader.py 91.02% <100.00%> (-0.55%) :arrow_down:
chemicalx/data/drugfeatureset.py 100.00% <100.00%> (ø)
chemicalx/data/labeledtriples.py 97.36% <100.00%> (-0.51%) :arrow_down:
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 commented 2 years ago

Thank you @cthoyt looks great!