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

Conversation

mmcdermott
Copy link
Owner

@mmcdermott mmcdermott commented Jun 13, 2024

Summary by CodeRabbit

  • Documentation

    • Enhanced README for better clarity and organization of scripts and examples.
    • Updated project authors and release version in documentation configuration.
  • Chores

    • Added docs/source/generated directory to .gitignore.
  • Refactor

    • Standardized import paths to use relative imports for improved module structure.
  • Release Management

    • Updated release version to 0.0.2.

@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.72%. Comparing base (cfba4ae) to head (e39b934).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #35   +/-   ##
=======================================
  Coverage   91.72%   91.72%           
=======================================
  Files          13       13           
  Lines         822      822           
=======================================
  Hits          754      754           
  Misses         68       68           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

coderabbitai bot commented Jun 13, 2024

Walkthrough

These changes introduce several improvements, including enhanced import structure using relative paths in various scripts within the MEDS_tabular_automl package, updates to documentation for better clarity, including the .gitignore for generated docs, and author/release updates in conf.py using Path for better path handling. These changes collectively aim at better code organization, maintainability, and updated project metadata without altering core functionalities.

Changes

Files Summary
.gitignore Added docs/source/generated directory to ignore list.
README.md Restructured documentation sections for better clarity and organization.
docs/source/conf.py Updated authors, release version, and path setup logic using Path.
src/MEDS_tabular_automl/scripts/... Switched from absolute imports to relative imports for improved module structure.
src/MEDS_tabular_automl/utils.py Updated OmegaConf.register_new_resolver call to include replace=True.

Poem

In the land of code where changes rhyme,
Paths now relative, in perfect time,
Docs are brighter, clear as day,
Authors' names in grand display.
Ignore the generated, let it pass,
MEDS-Tab grows, like springtime grass.
🌼🐇🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cfba4ae and adf93b0.

Files selected for processing (9)
  • .gitignore (1 hunks)
  • README.md (3 hunks)
  • docs/source/conf.py (1 hunks)
  • src/MEDS_tabular_automl/scripts/cache_task.py (1 hunks)
  • src/MEDS_tabular_automl/scripts/describe_codes.py (1 hunks)
  • src/MEDS_tabular_automl/scripts/launch_xgboost.py (1 hunks)
  • src/MEDS_tabular_automl/scripts/tabularize_static.py (1 hunks)
  • src/MEDS_tabular_automl/scripts/tabularize_time_series.py (1 hunks)
  • src/MEDS_tabular_automl/utils.py (1 hunks)
Files skipped from review due to trivial changes (2)
  • .gitignore
  • src/MEDS_tabular_automl/scripts/describe_codes.py
Additional context used
Ruff
docs/source/conf.py

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

src/MEDS_tabular_automl/scripts/tabularize_time_series.py

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


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


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


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


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


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


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


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


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


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


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


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


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


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


94-94: Function definition does not bind loop variable agg (B023)


101-101: Function definition does not bind loop variable window_size (B023)


102-102: Function definition does not bind loop variable agg (B023)

src/MEDS_tabular_automl/scripts/tabularize_static.py

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


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


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


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


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


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


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


142-142: Function definition does not bind loop variable agg (B023)

src/MEDS_tabular_automl/scripts/launch_xgboost.py

90-90: Remove unnecessary True if ... else False (SIM210)

Remove unnecessary True if ... else False

LanguageTool
README.md

[uncategorized] ~59-~59: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...pts Overview 1. meds-tab-describe: This command processes MEDS data shards...


[uncategorized] ~72-~72: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...``` 2. meds-tab-tabularize-static: Filters and processes the dataset based...


[typographical] ~72-~72: The word “thus” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence. (THUS_SENTENCE)
Context: ...o a unique patient_id and timestamp combination, thus rows are duplicated across multiple tim...


[uncategorized] ~84-~84: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...3. meds-tab-tabularize-time-series: Iterates through combinations of a shar...


[uncategorized] ~99-~99: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...ax] ``` 4. meds-tab-cache-task: Aligns task-specific labels with the ne...


[grammar] ~101-~101: Possible subject-verb agreement error detected. (PLURAL_THAT_AGREEMENT)
Context: ...a specific task $TASK and labels that has pulled from [ACES](https://github.com/j...


[uncategorized] ~112-~112: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...e/max] ``` 5. meds-tab-xgboost: Trains an XGBoost model using user-spec...


[uncategorized] ~125-~125: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... ``` 6. meds-tab-xgboost-sweep: Conducts an Optuna hyperparameter sweep...


[uncategorized] ~129-~129: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... Scripts 1. generate-permutations: Generates and prints a sorted list of a...


[typographical] ~131-~131: After the expression ‘for example’ a comma is usually used. (COMMA_FOR_EXAMPLE)
Context: ... window sizes and aggregations. For example you can directly call **`generate-permu...

Markdownlint
README.md

19-19: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document


36-36: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document


150-150: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document


167-167: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document


169-169: null (MD025, single-title, single-h1)
Multiple top-level headings in the same document


23-23: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


29-29: null (MD036, no-emphasis-as-heading)
Emphasis used instead of a heading


31-31: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


68-68: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


76-76: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


88-88: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


103-103: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


114-114: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified

Additional comments not posted (11)
docs/source/conf.py (2)

13-16: Updated metadata reflects new project details and version correctly.


24-30: The updated path setup using Path from pathlib enhances readability and maintainability.

src/MEDS_tabular_automl/scripts/cache_task.py (1)

13-15: Switching to relative imports enhances modularity and consistency across the project.

src/MEDS_tabular_automl/scripts/tabularize_time_series.py (1)

18-23: Adopting relative imports for internal modules is a good practice for ensuring better project structure.

Tools
Ruff

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


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


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


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


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

src/MEDS_tabular_automl/scripts/tabularize_static.py (1)

17-26: The use of relative imports for internal modules is consistent with best practices and improves maintainability.

Tools
Ruff

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


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


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


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

README.md (4)

49-49: Reorganization of the Scripts and Examples section enhances clarity and accessibility.


57-57: The description of core CLI scripts is clear and well-detailed.


127-127: The addition of the "Additional CLI Scripts" section is a useful resource for users, providing practical examples of how to use the generate-permutations command.
[APROVED]


152-152: The explanation under "What do you mean 'tabular pipelines'?" provides a good clarification on the misconception about structured EHR data.

src/MEDS_tabular_automl/utils.py (1)

81-81: Adding replace=True to OmegaConf.register_new_resolver ensures that the resolver can be redefined without a conflict, which is a good practice when configurations might be dynamically reloaded or tested repeatedly.

src/MEDS_tabular_automl/scripts/launch_xgboost.py (1)

16-18: Switching to relative imports enhances modularity and makes the codebase more maintainable by reducing dependency on the absolute structure of the project.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between adf93b0 and e39b934.

Files selected for processing (1)
  • docs/source/conf.py (3 hunks)
Additional context used
Ruff
docs/source/conf.py

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


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

Additional comments not posted (3)
docs/source/conf.py (3)

14-17: Updated project information looks accurate and reflects the new version and additional authors.


25-31: The use of Path for directory manipulations enhances readability and reliability of the path setup.


51-51: Sphinx extension configurations are correctly set up.


# 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)

Comment on lines +63 to +67
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}")
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}")


# -- 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)

@mmcdermott mmcdermott closed this Jun 13, 2024
@mmcdermott mmcdermott deleted the readthedocs_improvements branch August 10, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants