Skip to content

Onboard repository to Copilot cloud agent with accurate instructions and setup steps#365

Merged
alexlib merged 2 commits into
masterfrom
copilot/add-copilot-instructions-file
May 15, 2026
Merged

Onboard repository to Copilot cloud agent with accurate instructions and setup steps#365
alexlib merged 2 commits into
masterfrom
copilot/add-copilot-instructions-file

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

Adds the files needed for Copilot cloud agent to work efficiently in this repo from first launch.

.github/copilot-instructions.md — corrected & expanded

  • Version: 0.25.30.25.4
  • Test count: "198 pass, 12 skipped" → "216 passed"; runtime ~10 s
  • Python support: 3.10–3.123.10–3.14 (matches pyproject.toml and testing.yml)
  • Module list: added lib.py (NaN inpainting), settings.py (PIVSettings dataclass), phase_separation.py, PIV_3D_plotting.py
  • API docs: documented process_pair(), get_coordinates(), transform_coordinates(), windef.piv(settings) including the required PIVSettings configuration pattern
  • Cython: added explicit note that all .pyx files have been removed — build_ext --inplace is a no-op
  • importlib: corrected importlib_resources → stdlib importlib.resources.files()

.github/workflows/copilot-setup-steps.yml — new

Pre-installs Poetry and all project dependencies before the agent starts, avoiding slow/unreliable cold-start dependency discovery:

steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-python@v5
    with: { python-version: "3.12" }
  - run: pip install poetry
  - run: poetry install

Summary by Sourcery

Update Copilot agent instructions and add a dedicated setup workflow to ensure reliable, fast environment bootstrapping for this repository.

CI:

  • Introduce a Copilot setup workflow that pre-installs Python 3.12, Poetry, and project dependencies to optimize Copilot cloud agent startup.

Documentation:

  • Refresh Copilot instructions with current version, supported Python range, repository structure, key APIs, runtime expectations, and removal of Cython extensions.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 15, 2026

Reviewer's Guide

Updates Copilot cloud agent documentation to reflect the current OpenPIV Python APIs and environment, and adds a dedicated GitHub Actions workflow that pre-installs Python, Poetry, and project dependencies for Copilot runs.

File-Level Changes

Change Details Files
Refresh Copilot instructions to match current project structure, APIs, and environment expectations.
  • Clarified that OpenPIV is now a pure Python package and documented that Cython .pyx files have been removed, making build_ext a no-op.
  • Updated test suite guidance to reflect ~10s runtime, 216 passing tests, and aligned timeout recommendations.
  • Expanded the repository structure section to list additional modules (lib.py, settings.py, phase_separation.py, PIV_3D_plotting.py) and annotate key responsibilities of each file.
  • Documented key APIs such as process_pair(), get_coordinates(), transform_coordinates(), and windef.piv(settings), including expected inputs/outputs and workflow usage patterns.
  • Added explicit documentation for the PIVSettings dataclass configuration pattern for windef batch processing.
  • Aligned documented Python support and CI matrix to Python 3.10–3.14 and bumped documented package version to 0.25.4 with updated dependency versions.
  • Clarified use of stdlib importlib.resources.files() instead of the third‑party importlib_resources and expanded notes on how bundled data and tests are configured.
.github/copilot-instructions.md
Introduce a Copilot-specific setup workflow that pre-installs the Python environment and project dependencies.
  • Added a GitHub Actions workflow that runs on dispatch, push, and PR changes to itself, with a dedicated copilot-setup-steps job on ubuntu-latest.
  • Configured the job to check out the repository, set up Python 3.12, install Poetry via pip, and run poetry install to warm the dependency cache for Copilot cloud agent runs.
  • Restricted permissions to read-only repository contents to minimize workflow scope.
.github/workflows/copilot-setup-steps.yml

Possibly linked issues

  • #✨ Set up Copilot instructions: PR implements the requested Copilot onboarding by adding detailed instructions and a Copilot setup workflow.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@alexlib alexlib marked this pull request as ready for review May 15, 2026 20:43
Copilot AI review requested due to automatic review settings May 15, 2026 20:43
@alexlib alexlib merged commit f6e9767 into master May 15, 2026
10 of 11 checks passed
@alexlib alexlib deleted the copilot/add-copilot-instructions-file branch May 15, 2026 20:43
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/copilot-setup-steps.yml" line_range="30-31" />
<code_context>
+        with:
+          python-version: "3.12"
+
+      - name: Install Poetry
+        run: pip install poetry
+
+      - name: Install project dependencies
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Consider pinning the Poetry version instead of installing the latest each run.

Using `pip install poetry` without a version pin makes the workflow sensitive to upstream releases and can cause unexpected CI failures. Please pin Poetry to a specific version or range (e.g. `pip install "poetry==1.8.*"`) so upgrades are intentional.

```suggestion
      - name: Install Poetry
        run: pip install "poetry==1.8.*"
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +30 to +31
- name: Install Poetry
run: pip install poetry
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (bug_risk): Consider pinning the Poetry version instead of installing the latest each run.

Using pip install poetry without a version pin makes the workflow sensitive to upstream releases and can cause unexpected CI failures. Please pin Poetry to a specific version or range (e.g. pip install "poetry==1.8.*") so upgrades are intentional.

Suggested change
- name: Install Poetry
run: pip install poetry
- name: Install Poetry
run: pip install "poetry==1.8.*"

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds and updates Copilot cloud agent onboarding materials so agents can install dependencies and follow repository-specific development instructions more reliably.

Changes:

  • Adds a Copilot setup workflow that checks out the repo, installs Python 3.12, Poetry, and project dependencies.
  • Refreshes .github/copilot-instructions.md with current project structure, APIs, dependency versions, Python support, and validation commands.
  • Documents current pure-Python status and updated import/resource handling guidance.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/copilot-setup-steps.yml Adds the setup workflow used by Copilot cloud agent environments.
.github/copilot-instructions.md Updates repository instructions, API references, setup commands, and project metadata for Copilot agents.

- **Filtering**: `filters.replace_outliers()` for cleaning velocity fields
- **Simple PIV** (quickest path): `piv.simple_piv(frame_a, frame_b, plot=False)` → `(x, y, u, v, s2n)`
- **Complete workflow**: `piv.process_pair(frame_a, frame_b)` → `(x, y, u, v, mask)`
- **Core cross-correlation**: `pyprocess.extended_search_area_piv(im1, im2, window_size, overlap, search_area_size)` → `(u, v, s2n)`

### PIVSettings (for windef batch processing)
`settings.PIVSettings` is a dataclass with defaults that point to the bundled test data. Key fields:
```python
- **Core cross-correlation**: `pyprocess.extended_search_area_piv(im1, im2, window_size, overlap, search_area_size)` → `(u, v, s2n)`
- **Coordinates**: `pyprocess.get_coordinates(image_size, search_area_size, overlap)` → `(x, y)`
- **Window deformation (batch)**: `windef.piv(settings)` where `settings` is a `PIVSettings` instance
- **File I/O**: `tools.imread(path)`, `tools.save(x, y, u, v, mask, filename)`, `tools.display_vector_field(filename)`
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