-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated datasets.py #31
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
for more information, see https://pre-commit.ci
thanks for the PR 🥳 comments in the files! |
And add the 3 datasets in pytest: |
@@ -0,0 +1 @@ | |||
CARE_SITE_ID,CARE_SITE_NAME,PLACE_OF_SERVICE_CONCEPT_ID,LOCATION_ID,CARE_SITE_SOURCE_VALUE,PLACE_OF_SERVICE_SOURCE_VALUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no csv files stored here, rather download from external :)
@@ -62,7 +62,7 @@ def mimic_iv_omop(backend_handle: DuckDBPyConnection, data_path: Path | None = N | |||
>>> con.execute("SHOW TABLES;").fetchall() | |||
""" | |||
if data_path is None: | |||
data_path = "ehrapy_data/mimic-iv-demo-data-in-the-omop-common-data-model-0.9" | |||
data_path = Path("ehrapy_data/mimic-iv-demo-data-in-the-omop-common-data-model-0.9") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep good one
extracted_folder = next( | ||
(folder for folder in data_path.iterdir() if folder.is_dir() and "_csv" in folder.name), data_path | ||
) | ||
return _set_up_duckdb(extracted_folder, backend_handle) | ||
|
||
|
||
def gibleed_omop(backend_handle: DuckDBPyConnection, data_path: Path | None = None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding more information to the docstrings would be great; see e.g. other ehrapy datasets that we already have, with links to where the data is from, and that this is in the omop data format with maybe a link to the omop data description
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Fixed in #62. Worked locally, failed on CI; best guess is that Ubuntu acts more strictly than macOS on capitalization of files to read. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just random things I saw
shutil.rmtree(TEST_DATA_DIR) | ||
|
||
|
||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think that this is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think so either, thx for the looking over, appreciate!
if data_path is None: | ||
data_path = Path("ehrapy_data/Synthea27Nj") | ||
|
||
if data_path.exists(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have a general downloading function that you can reuse. Just steal the one from ehrapy. Consider not printing but use proper logging.
Datasets implementation