Skip to content

Refine Crop transform documentation and enhance CI workflows#104

Merged
GabrielBG0 merged 9 commits into
discovery-unicamp:mainfrom
GabrielBG0:main
May 11, 2026
Merged

Refine Crop transform documentation and enhance CI workflows#104
GabrielBG0 merged 9 commits into
discovery-unicamp:mainfrom
GabrielBG0:main

Conversation

@GabrielBG0
Copy link
Copy Markdown
Collaborator

@GabrielBG0 GabrielBG0 commented Apr 16, 2026

Describe your changes

  • Fix outdated pip install minerva-ml references and update Crop transform tests
  • Updated installation instructions to use the correct package name (minerva) and fixed the Crop transform tests to match the CHW format introduced in commit 8d12499.
  • Add auto format CI step

Changes:

  • README.md and docs/installation.md: replaced all pip install minerva-ml references with pip install minerva, and updated PyPI links from /project/minerva-ml/ to /project/minerva/.
  • tests/transforms/test_transform.py: updated test_crop_output_shape and test_crop_with_padding to use CHW-format arrays (C, H, W) instead of HWC (H, W, C), matching the updated Crop implementation. Added test_crop_2d_input and test_crop_bbox to cover the 2D path and the bbox parameter, both of which were also changed in the same refactor.
  • Add auto-format.yml to auto format code on PR.

Issue ticket number and link (If apply)

N/A

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have added tests to this functionality.
  • All tests are passing.
  • I have updated the documentation as needed.
  • I have followed the project's coding guidelines.

Summary by CodeRabbit

  • New Features

    • Enhanced Crop transform to support channel-first (CHW) image format alongside 2D inputs with improved coordinate handling.
  • Documentation

    • Updated installation instructions: package name changed to minerva (from minerva-ml).
    • Expanded Crop class documentation with detailed parameter and shape guidance.
  • Chores

    • Added GitHub Actions workflow for automated code formatting on pull requests.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

📝 Walkthrough

Walkthrough

This PR adds automated code formatting via GitHub Actions, updates documentation to reflect the package name change from minerva-ml to minerva, and modifies the Crop transform class to properly support channel-first (CHW) image format while clarifying coordinate semantics from (X, Y) to (row, col).

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/auto-format.yml, .github/workflows/continuous-testing.yml
Added new auto-format workflow that runs black on PRs targeting main; updated continuous-testing to ignore markdown files and registered trigger for auto-format workflow completion.
Documentation
README.md, docs/installation.md
Updated PyPI package name from minerva-ml to minerva in installation commands and PyPI links.
Crop Transform Logic
minerva/transforms/transform.py
Modified Crop class to support channel-first (CHW) format by computing spatial dimensions from last two axes, updating bbox slicing to use ellipsis notation for 3D support, and changing coordinate semantics from (X, Y) to (row, col). Enhanced docstrings with expected input formats and parameter/return shapes.
Transform Tests
tests/transforms/test_random_transforms.py, tests/transforms/test_transform.py
Updated crop tests to use CHW input format (C, H, W) instead of HWC; added new test coverage for 2D inputs and bbox parameter validation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: refining the Crop transform documentation and enhancing CI workflows with auto-format.
Description check ✅ Passed The description is mostly complete with clear sections describing changes, completed checklist items, and proper formatting matching the template structure.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (2)
.github/workflows/continuous-testing.yml (1)

7-10: Note: "*.md" only ignores root-level markdown files.

The pattern "*.md" won't match markdown files in subdirectories (e.g., docs/installation.md). If the intent is to ignore all markdown files, use "**/*.md" instead. If this is intentional to still trigger on documentation changes, the current pattern is fine.

Optional: Ignore all markdown files
     paths-ignore:
-      - "*.md"
+      - "**/*.md"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/continuous-testing.yml around lines 7 - 10, The ignore
pattern "*.md" only matches root-level markdown files; if you intend to ignore
all markdown files across the repo, replace the pattern string "*.md" with
"**/*.md" in the continuous-testing workflow so markdown files in subdirectories
(e.g., docs/installation.md) are also excluded; if you intentionally want to
trigger CI on doc changes, leave the current "*.md" pattern as-is.
.github/workflows/auto-format.yml (1)

52-61: Consider adding [skip ci] to prevent potential workflow loops.

While commits made by github-actions[bot] typically don't trigger workflows, adding [skip ci] to the commit message provides an extra safeguard against infinite loops if that behavior ever changes.

Optional: Add skip ci to commit message
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"
          git add -A
-          git commit -m "formatted: $COMMIT_MSG"
+          git commit -m "formatted: $COMMIT_MSG [skip ci]"
          git push
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/auto-format.yml around lines 52 - 61, Update the "Commit
formatted code" step to append "[skip ci]" to the commit message so CI isn't
triggered by the bot commit; specifically change how COMMIT_MSG is used in the
git commit invocation in that step (the env COMMIT_MSG and the run lines where
git commit -m "formatted: $COMMIT_MSG" is executed) to include the suffix (for
example "formatted: $COMMIT_MSG [skip ci]") before pushing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/auto-format.yml:
- Around line 52-61: Update the "Commit formatted code" step to append "[skip
ci]" to the commit message so CI isn't triggered by the bot commit; specifically
change how COMMIT_MSG is used in the git commit invocation in that step (the env
COMMIT_MSG and the run lines where git commit -m "formatted: $COMMIT_MSG" is
executed) to include the suffix (for example "formatted: $COMMIT_MSG [skip ci]")
before pushing.

In @.github/workflows/continuous-testing.yml:
- Around line 7-10: The ignore pattern "*.md" only matches root-level markdown
files; if you intend to ignore all markdown files across the repo, replace the
pattern string "*.md" with "**/*.md" in the continuous-testing workflow so
markdown files in subdirectories (e.g., docs/installation.md) are also excluded;
if you intentionally want to trigger CI on doc changes, leave the current "*.md"
pattern as-is.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 197445df-0395-4c9d-ac07-d33ea97e7c56

📥 Commits

Reviewing files that changed from the base of the PR and between 4070d4f and af70d5a.

📒 Files selected for processing (7)
  • .github/workflows/auto-format.yml
  • .github/workflows/continuous-testing.yml
  • README.md
  • docs/installation.md
  • minerva/transforms/transform.py
  • tests/transforms/test_random_transforms.py
  • tests/transforms/test_transform.py

@GabrielBG0 GabrielBG0 requested a review from otavioon April 16, 2026 21:04
@GabrielBG0 GabrielBG0 merged commit 7df0485 into discovery-unicamp:main May 11, 2026
5 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.

1 participant