fix: clean up __init__.py exports and fix invalid escape sequence#938
Open
haoyu-haoyu wants to merge 1 commit intosunlabuiuc:masterfrom
Open
fix: clean up __init__.py exports and fix invalid escape sequence#938haoyu-haoyu wants to merge 1 commit intosunlabuiuc:masterfrom
haoyu-haoyu wants to merge 1 commit intosunlabuiuc:masterfrom
Conversation
models/__init__.py: - Remove duplicate MedLink import (was on lines 18 and 45) - Sort imports alphabetically for consistency - Add __all__ list to make the public API explicit processors/__init__.py: - Add 6 missing processors to __all__: BinaryLabelProcessor, MultiClassLabelProcessor, MultiLabelProcessor, RegressionLabelProcessor, DeepNestedFloatsProcessor, DeepNestedSequenceProcessor, IgnoreProcessor - Remove non-existent "LabelProcessor" from __all__ - Sort __all__ entries alphabetically metrics/calibration.py: - Fix invalid escape sequence \c (backslash-c) in docstring math formula -- use \\cdot for LaTeX multiplication dot (triggers DeprecationWarning in Python 3.12, SyntaxError in 3.14)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three housekeeping fixes found via codebase audit:
1.
pyhealth/models/__init__.pyMedLinkwas imported on both line 18 and line 45__all__list (47 entries) to make the public API explicit — previously all imports were implicitly exported, making the API surface unclear for IDE autocompletion andfrom pyhealth.models import *2.
pyhealth/processors/__init__.py__all__:BinaryLabelProcessor,MultiClassLabelProcessor,MultiLabelProcessor,RegressionLabelProcessor,DeepNestedFloatsProcessor,DeepNestedSequenceProcessor,IgnoreProcessor"LabelProcessor"was in__all__but no such class exists (the actual classes areBinaryLabelProcessor,MultiClassLabelProcessor, etc.)3.
pyhealth/metrics/calibration.py\c(backslash-c) in docstring LaTeX formula →\\cdotDeprecationWarningin Python 3.12 and will becomeSyntaxErrorin Python 3.14All changes are non-behavioral (imports, exports, docstrings only).