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

added storage functionality for raw windows #121

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

Oufattole
Copy link
Contributor

@Oufattole Oufattole commented Aug 27, 2024

Resolves issue #97

Summary by CodeRabbit

  • New Features

    • Introduced configuration options for specifying a directory and filename for exporting window statistics.
    • Enhanced functionality to export window statistics to a specified location based on user configuration.
  • Tests

    • Added a new test function to validate the command-line interface functionality for processing medication data.

Copy link
Contributor

coderabbitai bot commented Aug 27, 2024

Walkthrough

The changes introduce new configuration options for specifying a directory and filename for storing window statistics, enhancing output handling capabilities. The main function has been updated to include logic for creating directories and writing the result DataFrame to a Parquet file when specified paths are provided. Additionally, a new test function has been implemented to validate the command-line interface for processing medication data and ensure the correct functionality of output file generation.

Changes

File Change Summary
src/aces/__main__.py Added conditional blocks to check for window_stats_filepath and window_stats_dir, writing result DataFrame to a specified Parquet file.
src/aces/configs/aces.yaml Introduced window_stats_dir, window_stats_filename, and modified window_stats_filepath for configurable output file handling.
tests/test_meds.py Added test_meds_window_storage function to validate CLI handling of medication data and output file generation.

Poem

🐇 In the fields where data flows,
A new path for stats now grows.
With files that gleam in Parquet's light,
Our rabbit code hops to new heights.
Testing the meds with joy and cheer,
Output's clear, the vision's near! 🥕✨


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 Configuration 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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 28bf935 and 410468d.

Files selected for processing (3)
  • src/aces/main.py (1 hunks)
  • src/aces/configs/aces.yaml (1 hunks)
  • tests/test_meds.py (1 hunks)
Additional comments not posted (5)
src/aces/configs/aces.yaml (2)

15-15: LGTM!

The comment is clear and provides necessary context for the new configuration option.

The code changes are approved.


16-16: LGTM!

The new configuration option window_stats_filepath is correctly added and follows the existing structure.

The code changes are approved.

src/aces/__main__.py (2)

176-176: LGTM!

The conditional check for cfg.window_stats_filepath is correctly implemented and follows the existing structure.

The code changes are approved.


177-177: LGTM!

The logic to write the result DataFrame to a Parquet file if cfg.window_stats_filepath is specified is correctly implemented and follows the existing structure.

The code changes are approved.

tests/test_meds.py (1)

373-458: LGTM!

The new test function test_meds_window_storage is comprehensive and correctly validates the functionality of the CLI related to processing medication data. The use of a temporary directory for managing input and output files is a good practice.

The code changes are approved.

tests/test_meds.py Outdated Show resolved Hide resolved
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

Outside diff range, codebase verification and nitpick comments (1)
tests/test_meds.py (1)

373-376: Consider adding a docstring.

Adding a docstring to the function will improve readability and maintainability by explaining the purpose and functionality of the test.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 410468d and 76a1ca2.

Files selected for processing (3)
  • src/aces/main.py (1 hunks)
  • src/aces/configs/aces.yaml (1 hunks)
  • tests/test_meds.py (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • src/aces/main.py
  • src/aces/configs/aces.yaml
Additional context used
Ruff
tests/test_meds.py

409-409: Use key in dict instead of key in dict.keys()

Remove .keys()

(SIM118)

Additional comments not posted (2)
tests/test_meds.py (2)

384-388: LGTM!

The setup of input files, task configurations, and expected outputs is correctly implemented.


389-425: LGTM!

The logic for managing the temporary directory, writing input files, and task configurations is correctly implemented. The command setup is also appropriate.

Tools
Ruff

409-409: Use key in dict instead of key in dict.keys()

Remove .keys()

(SIM118)

tests/test_meds.py Outdated Show resolved Hide resolved
tests/test_meds.py Outdated Show resolved Hide resolved
tests/test_meds.py Outdated Show resolved Hide resolved
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 76a1ca2 and fa413de.

Files selected for processing (1)
  • tests/test_meds.py (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/test_meds.py

src/aces/configs/aces.yaml Outdated Show resolved Hide resolved
tests/test_meds.py Show resolved Hide resolved
@justin13601
Copy link
Owner

justin13601 commented Aug 27, 2024

This is meant to save the original structs for the contrastive learning use case mentioned earlier right?

Edit: oops sorry, I missed this at the top, yes it resolves #97.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fa413de and 41f8bde.

Files selected for processing (3)
  • src/aces/main.py (1 hunks)
  • src/aces/configs/aces.yaml (1 hunks)
  • tests/test_meds.py (3 hunks)
Files skipped from review as they are similar to previous changes (3)
  • src/aces/main.py
  • src/aces/configs/aces.yaml
  • tests/test_meds.py

@mmcdermott mmcdermott merged commit 3006041 into justin13601:main Aug 28, 2024
3 checks passed
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.

3 participants