Remove dead pre-2.0 VAE and Graph_TorchvisionModel - #1210
Open
fbonc wants to merge 1 commit into
Open
Conversation
Both call BaseModel.__init__ with the pre-2.0 (dataset, feature_keys, label_key, mode) signature and always raise TypeError on construction; they also use other removed pre-2.0 APIs and are referenced nowhere in the library or tests. Remove the modules, their exports, and the dangling VAE autodoc page.
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.
Issue
VAE (vae.py) and Graph_TorchvisionModel (graph_torchvision_model.py) call BaseModel.__init__ with the pre-2.0 signature (dataset, feature_keys, label_key, mode), but the current BaseModel.__init__ accepts only dataset. Instantiating either class therefore always raises TypeError, so both are unusable. They are pre-2.0 dead code: beyond the constructor, Graph_TorchvisionModel also calls get_label_tokenizer(), get_output_size(tokenizer), and prepare_labels(), none of which exist on the current BaseModel. Both classes are exported from pyhealth.models but referenced nowhere in the library or test suite.
Fix
Removed the two dead modules (pyhealth/models/vae.py, pyhealth/models/graph_torchvision_model.py) and their exports in pyhealth/models/__init__.py. Also removed the now-dangling VAE autodoc page (docs/api/models/pyhealth.models.VAE.rst) and its toctree entry in docs/api/models.rst, which would otherwise break the docs build.
Notes
Two example files still reference the removed classes: examples/cxr/chextXray_image_generation_VAE.py and examples/graph_torchvision_model.ipynb. They were already non-functional (their models could never be constructed) and were left in place to keep this change scoped to the dead library code; porting or removing those examples is recommended follow-up. Historical mentions in docs/log.rst (changelog) and docs/tutorials.rst (example listing) were intentionally left untouched as they are historical records and do not break the build. No other unrelated issues were discovered.