EducationalTestingService / skll

SciKit-Learn Laboratory (SKLL) makes it easy to run machine learning experiments.
http://skll.readthedocs.org
Other
550 stars 69 forks source link

Add type hints to `skll.data` module & improve types in `skll.config` #730

Closed desilinguist closed 1 year ago

desilinguist commented 1 year ago
  1. Update pre-commit checks to include a check for commit message format and to exclude missing imports from the mypy check.
  2. Add new custom types to skll.types module.
  3. Add type hints to skll.data module
    • Refactor code to ensure correct types.
    • Add a lot of checks for labels, features, vectorizer being None that was previously unhandled.
    • Update docstrings to use the type hints.
  4. Improve type hints in config/__init__.py
    • Use new ClassMap custom type.
    • Make sure pos_label is typed correctly.
    • Fix incorrect default value for sampler parameters.
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 92.44% and project coverage change: -0.22 :warning:

Comparison is base (d7f0eb2) 95.37% compared to head (482f4df) 95.16%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #730 +/- ## ========================================== - Coverage 95.37% 95.16% -0.22% ========================================== Files 29 29 Lines 3415 3451 +36 ========================================== + Hits 3257 3284 +27 - Misses 158 167 +9 ``` | [Impacted Files](https://app.codecov.io/gh/EducationalTestingService/skll/pull/730?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EducationalTestingService) | Coverage Δ | | |---|---|---| | [skll/data/featureset.py](https://app.codecov.io/gh/EducationalTestingService/skll/pull/730?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EducationalTestingService#diff-c2tsbC9kYXRhL2ZlYXR1cmVzZXQucHk=) | `90.00% <86.04%> (-0.57%)` | :arrow_down: | | [skll/data/writers.py](https://app.codecov.io/gh/EducationalTestingService/skll/pull/730?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EducationalTestingService#diff-c2tsbC9kYXRhL3dyaXRlcnMucHk=) | `93.65% <93.93%> (-0.76%)` | :arrow_down: | | [skll/data/readers.py](https://app.codecov.io/gh/EducationalTestingService/skll/pull/730?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EducationalTestingService#diff-c2tsbC9kYXRhL3JlYWRlcnMucHk=) | `90.36% <98.33%> (ø)` | | | [skll/config/\_\_init\_\_.py](https://app.codecov.io/gh/EducationalTestingService/skll/pull/730?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EducationalTestingService#diff-c2tsbC9jb25maWcvX19pbml0X18ucHk=) | `94.75% <100.00%> (-0.02%)` | :arrow_down: | | [skll/types.py](https://app.codecov.io/gh/EducationalTestingService/skll/pull/730?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EducationalTestingService#diff-c2tsbC90eXBlcy5weQ==) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/EducationalTestingService/skll/pull/730/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=EducationalTestingService)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

desilinguist commented 1 year ago

This is part of #561.