Repository navigation
Fix the OMOPDataset and LengthOfStayPredictionOMOP docstrings - #1604
Open
chenyangsu wants to merge 1 commit into
Open
chenyangsu wants to merge 1 commit into
chenyangsu wants to merge 1 commit into
Conversation
The OMOPDataset example called dataset.stat() and dataset.info(), which do not exist, and the docstring listed a refresh_cache argument that raises TypeError and four 1.x attributes the class does not have. It also said the condition and procedure tables hold ICD and CPT codes, but the dataset loads their standard concept IDs. The LengthOfStayPredictionOMOP example passed code_mapping to OMOPDataset, which raises TypeError, pointed at sample data whose .csv files are tab-separated, and showed an outdated sample.
Test CoverageTotal: 86.36% (46310 / 53625 lines)
|
This branch has not been deployed
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.
Contributor: Chen-Yang Su
Contribution Type: Documentation
Description:
Two OMOP docstrings have examples and arguments that fail when copied. On master:
OMOPDataset: the example callsdataset.stat()(AttributeError: 'OMOPDataset' object has no attribute 'stat') anddataset.info(), which also does not exist.refresh_cacheis listed under Args, butOMOPDataset(..., refresh_cache=True)raisesTypeError: BaseDataset.__init__() got an unexpected keyword argument 'refresh_cache'. The Attributes section liststask,samples,patient_to_indexandvisit_to_index, which the class does not have.LengthOfStayPredictionOMOP: the example passescode_mapping={}toOMOPDataset, which raises the sameTypeError. Without it, the sample data atstorage.googleapis.com/pyhealth/synpuf1k_omop_cdm_5.2.2fails withColumnNotFoundError: ['year_of_birth'], because its.csvfiles are tab-separated. The printed sample uses the old nested-list format.This PR fixes the example calls, removes the argument and attributes that do not exist, and points the example at
/path/to/omop/datalike the other OMOP tasks. It also corrects the table list:condition_occurrenceandprocedure_occurrenceare loaded as standard concept IDs (condition_concept_id,procedure_concept_id), mostly SNOMED CT, not as ICD or CPT codes.Files to Review:
pyhealth/datasets/omop.py:OMOPDatasetdocstringpyhealth/tasks/length_of_stay_prediction.py:LengthOfStayPredictionOMOPdocstring exampleTesting: Docstring-only change.
test_omop.pyandtest_omop_null_datetime.pypass: 20 passed.tools/check_pr_rules.pypasses.