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

CI workflow #22

Merged
merged 34 commits into from
Jul 23, 2024
Merged

CI workflow #22

merged 34 commits into from
Jul 23, 2024

Conversation

jf514
Copy link
Contributor

@jf514 jf514 commented Jul 18, 2024

Implemented CI via GitHub Actions:

  • Added ci.yml + other package related files (pyproject.toml, __init__.py, version.py, codecov.yml)
  • Fixed 60+ pydocs violations
  • Fixed black violations

NOTE: Many docstrings added were minimally descriptive. Issue 24 was created to address this.

Summary by CodeRabbit

  • New Features

    • Introduced a Continuous Integration (CI) workflow for automated code quality checks and testing.
    • Added a new configuration file for coverage reporting, ensuring code quality metrics are maintained.
  • Documentation

    • Updated README with revised command for running scripts.
    • Enhanced docstrings across various modules, improving clarity and context for function purposes.
  • Chores

    • Added dependencies for code formatting and testing tools to improve development environment.
    • Created a dummy test to verify the CI pipeline functionality.

Copy link
Contributor

@talmo talmo left a comment

Choose a reason for hiding this comment

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

Rename core/ -> stac_mjx/. This is needed since python module names can't have hyphen (-) so we replace that with _. The package name is still stack-mjx.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jul 23, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

README.md Outdated Show resolved Hide resolved
videos/direct_render.mp4 Outdated Show resolved Hide resolved
viz_usage.ipynb Outdated Show resolved Hide resolved
version.py Outdated Show resolved Hide resolved
Copy link
Contributor

coderabbitai bot commented Jul 23, 2024

Walkthrough

This update introduces a comprehensive Continuous Integration (CI) setup for the project, enhancing code quality through linting and testing. Key enhancements include the addition of configuration files for coverage reporting and a new module for versioning. Documentation improvements across various modules clarify function purposes, while a simple test ensures CI functionality. Overall, these changes streamline development and maintainability, establishing a solid foundation for future enhancements.

Changes

Files Change Summary
.github/workflows/ci.yml New CI workflow for linting and testing, triggered by PRs and pushes to main.
codecov.yml New configuration for Codecov coverage reporting, specifying thresholds for project and patch coverage.
environment.yml Added new dependencies (black, pytest, pytest-cov) to improve code quality and testing capabilities.
pyproject.toml New file defining project metadata, dependencies, and configurations for packaging.
stac_mjx/__init__.py New module initializer for managing high-level APIs.
stac_mjx/* (multiple files) Documentation updates for clarity and consistency across various functions.
tests/io/test_dummy.py New basic unit test to verify CI setup functionality.

Sequence Diagram(s)

sequenceDiagram
    participant CI as Continuous Integration
    participant L as Linting Job
    participant T as Testing Job
    participant C as Codecov

    CI->>L: Trigger on PR or push
    L->>L: Lint code
    L->>CI: Lint results
    CI->>T: Trigger testing
    T->>T: Run tests and collect coverage
    T->>C: Upload coverage results
    C->>CI: Coverage report
Loading

🐰
In the burrow where code does hop,
A CI sprouted, never to stop.
With tests and lint, it brings delight,
As rabbits code through day and night.
Hooray for clarity, neat and fine,
Our project blooms, a joy divine! 🌼


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

Outside diff range, codebase verification and nitpick comments (1)
pyproject.toml (1)

5-16: Define project metadata.

The [project] section provides essential metadata, including the project name, authors, description, Python version requirement, keywords, license, and classifiers. Ensure the description and keywords are updated to reflect the project's purpose accurately.

- description="TBD"
- keywords = ["TBD"]
+ description="A brief description of the project"
+ keywords = ["keyword1", "keyword2"]
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5a8f4c0 and bffe62c.

Files selected for processing (15)
  • .github/workflows/ci.yml (1 hunks)
  • README.md (1 hunks)
  • codecov.yml (1 hunks)
  • environment.yml (1 hunks)
  • pyproject.toml (1 hunks)
  • stac_mjx/init.py (1 hunks)
  • stac_mjx/compute_stac.py (3 hunks)
  • stac_mjx/controller.py (9 hunks)
  • stac_mjx/main.py (4 hunks)
  • stac_mjx/operations.py (8 hunks)
  • stac_mjx/stac_base.py (6 hunks)
  • stac_mjx/utils.py (5 hunks)
  • stac_mjx/version.py (1 hunks)
  • stac_mjx/viz.py (4 hunks)
  • tests/io/test_dummy.py (1 hunks)
Files skipped from review due to trivial changes (8)
  • README.md
  • stac_mjx/init.py
  • stac_mjx/compute_stac.py
  • stac_mjx/controller.py
  • stac_mjx/main.py
  • stac_mjx/operations.py
  • stac_mjx/version.py
  • tests/io/test_dummy.py
Additional context used
yamllint
codecov.yml

[error] 12-12: no new line character at the end of file

(new-line-at-end-of-file)

Additional comments not posted (29)
environment.yml (3)

12-12: Add black dependency for code formatting.

The addition of black ensures consistent code formatting across the codebase, which is a good practice for maintaining code quality.


16-16: Add pytest dependency for testing.

The addition of pytest facilitates the implementation of unit tests, which is essential for ensuring code correctness.


17-17: Add pytest-cov dependency for code coverage.

The addition of pytest-cov enables code coverage reporting, which helps in identifying untested parts of the codebase.

codecov.yml (1)

1-12: Configure code coverage reporting.

The codecov.yml file is well-structured and sets up code coverage reporting for the project. It defines coverage targets for both the overall project and individual patches, which helps in maintaining code quality.

Tools
yamllint

[error] 12-12: no new line character at the end of file

(new-line-at-end-of-file)

pyproject.toml (10)

1-3: Set up build system requirements.

The [build-system] section correctly specifies setuptools as the requirement and setuptools.build_meta as the build backend.


17-23: Specify project dependencies.

The dependencies listed are appropriate for the project. Ensure that any additional dependencies are added as needed.


24-28: Configure dynamic attributes for version and readme.

The [tool.setuptools.dynamic] section correctly sets up dynamic attributes for the version and readme file.


30-39: Define optional development dependencies.

The [project.optional-dependencies] section lists development dependencies, which are essential for testing, documentation, and packaging. Ensure that only necessary dependencies are included.


41-43: Add project URLs.

The [project.urls] section provides links to the project's homepage and repository, which is useful for users and contributors.


45-46: Exclude specific directories from the package.

The [tool.setuptools.packages.find] section excludes the site directory, which is appropriate for this project.


48-50: Configure Black code formatter.

The [tool.black] section sets the line length to 88, which is a common practice for maintaining readable code.


51-53: Configure Pydocstyle for docstring conventions.

The [pydocstyle] section sets the convention to "google" and matches the directory stac_mjx, which is appropriate for enforcing documentation standards.


55-56: Set up coverage tool configuration.

The [tool.coverage.run] section specifies the source directory for coverage measurement.


58-59: Configure pytest options for coverage reporting.

The [tool.pytest.ini_options] section adds options for coverage reporting, which is essential for maintaining code quality.

stac_mjx/utils.py (5)

13-15: Docstring update approved.

The updated docstring for loadmat improves clarity and conciseness.


25-27: Docstring update approved.

The updated docstring for _check_keys improves clarity and conciseness.


36-36: Docstring update approved.

The updated docstring for _todict improves clarity and conciseness.


61-61: New docstring approved.

The new docstring for init_params provides useful context for the function's usage.


71-71: Docstring update approved.

The updated docstring for save improves clarity and conciseness.

.github/workflows/ci.yml (3)

1-19: Configuration approved.

The name and on sections are correctly configured to trigger the workflow on pull requests and pushes to the main branch.


21-54: Configuration approved.

The lint job is correctly configured to run linting with Black and docstring style checking with pydocstyle.


55-100: Configuration approved.

The tests job is correctly configured to run tests with pytest and upload coverage reports using Codecov.

stac_mjx/stac_base.py (4)

19-19: Docstring update approved.

The updated docstring for huber improves clarity and conciseness.


26-26: Docstring update approved.

The updated docstring for squared_error improves clarity and conciseness.


Line range hint 121-138:
Docstring and parameter updates approved.

The updated docstring for m_loss improves clarity and conciseness. The parameter name change from offset to offsets improves clarity. The new parameters mjx_model and mjx_data expand the function's functionality.


199-199: Docstring update approved.

The updated docstring for m_opt improves clarity and conciseness.

stac_mjx/viz.py (3)

197-202: Docstring added for overlay_viz function.

The added docstring provides a clear and concise explanation of the function's purpose and functionality.


313-313: Docstring added for mujoco_viz function.

The added docstring succinctly states the function's purpose and is clear and to the point.


400-400: Docstring added for mujoco_pair_viz function.

The added docstring provides a clear and concise explanation of the function's purpose and functionality.

codecov.yml Show resolved Hide resolved
Copy link
Contributor

@talmo talmo left a comment

Choose a reason for hiding this comment

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

Ok, this LGTM so I'll approve but I think we might still have a couple of dangling files that should be removed if they're not used:

  • setup_new.py
  • viz_usage.ipynb

@jf514 jf514 merged commit 7fd7aa3 into main Jul 23, 2024
4 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Sep 8, 2024
@jf514 jf514 deleted the jason-ci branch October 25, 2024 19:20
@coderabbitai coderabbitai bot mentioned this pull request Oct 25, 2024
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