Skip to content
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

Fixing up readthedocs -- still in progress. #35

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

docs/source/generated
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ This repository consists of two key pieces:
what is more advanced is the efficient construction, storage, and loading of tabular features for the
candidate AutoML models, enabling a far more extensive search over different featurization strategies.

### Scripts and Examples
## Scripts and Examples

See `tests/test_integration.py` for an example of the end-to-end pipeline being run on synthetic data. This
script is a functional test that is also run with `pytest` to verify the correctness of the algorithm.

For an end to end example over MIMIC-IV, see the [companion repository](https://github.com/mmcdermott/MEDS_TAB_MIMIC_IV)
For an end to end example over Philips eICU, see the [eICU companion repository](https://github.com/mmcdermott/MEDS_TAB_EICU).

### Core CLI Scripts Overview
## Core CLI Scripts Overview

1. **`meds-tab-describe`**: This command processes MEDS data shards to compute the frequencies of different code-types

Expand Down Expand Up @@ -124,7 +124,7 @@ For an end to end example over Philips eICU, see the [eICU companion repository]

6. **`meds-tab-xgboost-sweep`**: Conducts an Optuna hyperparameter sweep to optimize over `window_sizes`, `aggregations`, and `min_code_inclusion_frequency`, aiming to enhance model performance and adaptability.

### Additional CLI Scripts
## Additional CLI Scripts

1. **`generate-permutations`**: Generates and prints a sorted list of all permutations from a comma separated input. This is provided for the convenience of sweeping over all possible combinations of window sizes and aggregations.

Expand All @@ -149,7 +149,7 @@ For an end to end example over Philips eICU, see the [eICU companion repository]

# How does MEDS-Tab Work?

#### What do you mean "tabular pipelines"? Isn't _all_ structured EHR data already tabular?
## What do you mean "tabular pipelines"? Isn't _all_ structured EHR data already tabular?

This is a common misconception. _Tabular_ data refers to data that can be organized in a consistent, logical
set of rows/columns such that the entirety of a "sample" or "instance" for modeling or analysis is contained
Expand Down
38 changes: 33 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import shutil
import sys

# Configuration file for the Sphinx documentation builder.
Expand All @@ -10,15 +11,24 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "MEDS-Tab"
copyright = "2024, Matthew McDermott, Nassim Oufattole, Teya Bergamaschi"
author = "Matthew McDermott, Nassim Oufattole, Teya Bergamaschi"
release = "0.0.1"
version = "0.0.1"
copyright = "2024, Nassim Oufattole, Matthew McDermott, Teya Bergamaschi, Aleksia Kolo, Hyewon Jeong"
author = "Nassim Oufattole, Matthew McDermott, Teya Bergamaschi, Aleksia Kolo, Hyewon Jeong"
release = "0.0.2"
version = "0.0.2"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

sys.path.insert(0, os.path.abspath("../.."))
# -- Path setup
from pathlib import Path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving the Path import to the top to adhere to PEP 8 guidelines.

- from pathlib import Path
+ import os
+ import sys
+ from pathlib import Path

Committable suggestion was skipped due to low confidence.

Tools
Ruff

23-23: Module level import not at top of file (E402)


__location__ = Path(os.path.dirname(__file__))
__src__ = __location__ / "../.."

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, str(__src__))

extensions = [
"sphinx.ext.duration",
Expand All @@ -38,6 +48,24 @@
".md": "markdown",
}

# -- Run sphinx-apidoc
# This ensures we don't need to run apidoc manually.

# TODO: use https://github.com/sphinx-extensions2/sphinx-autodoc2

from sphinx.ext import apidoc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the apidoc import to the top of the file to adhere to PEP 8 guidelines.

- from sphinx.ext import apidoc
+ import os
+ import sys
+ from sphinx.ext import apidoc

Committable suggestion was skipped due to low confidence.

Tools
Ruff

56-56: Module level import not at top of file (E402)


output_dir = __location__ / "generated"
module_dir = __src__ / "src/MEDS_tabular_automl"
if output_dir.is_dir():
shutil.rmtree(output_dir)

try:
cmd_line = f"--implicit-namespaces -e -f -o {output_dir} {module_dir}"
apidoc.main(cmd_line.split(" "))
except Exception as e: # pylint: disable=broad-except
print(f"Running `sphinx-apidoc {cmd_line}` failed!\n{e}")
Comment on lines +63 to +67
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider refining the exception handling to catch more specific exceptions rather than a broad catch. This will help in diagnosing specific issues more effectively.

- except Exception as e:  # pylint: disable=broad-except
+ except (IOError, OSError) as e:
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
try:
cmd_line = f"--implicit-namespaces -e -f -o {output_dir} {module_dir}"
apidoc.main(cmd_line.split(" "))
except Exception as e: # pylint: disable=broad-except
print(f"Running `sphinx-apidoc {cmd_line}` failed!\n{e}")
try:
cmd_line = f"--implicit-namespaces -e -f -o {output_dir} {module_dir}"
apidoc.main(cmd_line.split(" "))
except (IOError, OSError) as e:
print(f"Running `sphinx-apidoc {cmd_line}` failed!\n{e}")


intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
Expand Down
30 changes: 0 additions & 30 deletions docs/source/generated/src.MEDS_tabular_automl.configs.rst

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions docs/source/generated/src.MEDS_tabular_automl.describe_codes.rst

This file was deleted.

18 changes: 0 additions & 18 deletions docs/source/generated/src.MEDS_tabular_automl.file_name.rst

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions docs/source/generated/src.MEDS_tabular_automl.mapper.rst

This file was deleted.

38 changes: 0 additions & 38 deletions docs/source/generated/src.MEDS_tabular_automl.rst

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

34 changes: 0 additions & 34 deletions docs/source/generated/src.MEDS_tabular_automl.scripts.rst

This file was deleted.

Loading
Loading