Skip to content

PDF conversion 1/N: adopt nsls2-tools-template - #3

Merged
Anthony Sligar (sligara7) merged 2 commits into
NSLS2:pdf-profile-conversionfrom
sligara7:pdf-conv-01-template
Oct 23, 2026
Merged

Anthony Sligar (sligara7) merged 2 commits into
NSLS2:pdf-profile-conversionfrom
sligara7:pdf-conv-01-template

Conversation

@sligara7

Copy link
Copy Markdown

First step of converting pdf-profile-collection into pdftools, into the long-lived pdf-profile-conversion branch (main is untouched).

  • Applies nsls2-tools-template (copier, 2621848): pixi instead of uv, template pyproject/pre-commit/CI/publish/lockfile refresh, and the mockable profile src/pdftools/profiles/collection.py. .copier-answers.yml is included so pixi run -e dev update-template works later.
  • Existing modules only gain the docstrings the template's ruff rules require; no code changes.
  • test_xspd expects (1, 5, 3, 4): bluesky-tiled-plugins 2.0.11 made join_method="stack" the default (the old uv lock had 2.0.2).

Verified: mock tests only. pixi run -e dev lint (all hooks pass), pixi run -e dev tests (5 passed), the profile boots with --mock, hatch build succeeds. No beamline use.

Generated with copier from the template and merged into the existing package: pixi replaces uv (uv.lock and .python-version removed), template pyproject (hatch-vcs), pre-commit, CI, PyPI publish, lockfile refresh, dependabot, and the mockable collection profile in src/pdftools/profiles/collection.py. LICENSE year kept (copyright_year 2025 in .copier-answers.yml). Existing modules get the docstrings the template's ruff rules require; no code changes. h5py added to the dev feature for the XSP test.

test_xspd now expects the stacked layout (1, 5, 3, 4): bluesky-tiled-plugins 2.0.11 changed the default join_method from 'concat' to 'stack' (9cb0c0b); the old uv lock had 2.0.2.

Assisted-by: copilot:claude-opus-5-5
Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Dependency declarations permit older releases incompatible with the retained detector APIs and updated data-shape assertion.

2 open issues
What changed in this PR

This first conversion step adopts nsls2-tools-template for pdftools on the long-lived conversion branch, leaving main untouched.

Changes:

  • Replaces uv tooling with Pixi and Hatch, updating linting, CI, publishing, and dependency maintenance.
  • Adds a mockable collection profile and package-version tests.
  • Adds device docstrings and updates the detector test for event-stacked data.
File Description
tests/​test_version.py Tests package imports and installed version consistency.
tests/​test_detectors.py/​test_xspd.py Expects event-stacked detector data.
src/​pdftools/​sample_environment.py Adds and standardizes device docstrings.
src/​pdftools/​py.typed Marks the package as typed.
src/​pdftools/​profiles/​collection.py Adds a mockable acquisition profile.
src/​pdftools/​motors.py Adds motion-device docstrings.
src/​pdftools/​detectors/​xspd.py Adds and standardizes detector docstrings.
src/​pdftools/​detectors/​__init__.py Adds a module docstring.
src/​pdftools/​__init__.py Exposes the generated package version.
README.md Clarifies the beamline’s facility.
pyproject.toml Adopts Hatch and template dependency/tool settings.
pixi.toml Defines environments and development tasks.
.python-version Removes the standalone Python version pin.
.pre-commit-config.yaml Updates linting, typing, and formatting hooks.
.gitignore Expands generated-file and environment exclusions.
.github/​workflows/​refresh-lockfile.yml Adds automated Pixi lockfile refreshes.
.github/​workflows/​publish-pypi.yml Uses Pixi and Hatch for release builds.
.github/​workflows/​ci.yml Adds Pixi-based lint, test, and build jobs.
.github/​workflows/​ci.yaml Removes the previous uv-based workflow.
.github/​dependabot.yml Groups monthly GitHub Actions updates.
.copier-answers.yml Records template inputs for future updates.

Review effort: Balanced

Comment thread pyproject.toml Resolved
Comment thread tests/test_detectors.py/test_xspd.py Resolved
Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:45
Restore main's 0.21.3 minimum for ophyd-async. bluesky-tiled-plugins 2.0.11 made stacking the TiledWriter default that test_xspd asserts.

Assisted-by: copilot:claude-opus-5-5
@sligara7
Anthony Sligar (sligara7) merged commit b2c1cb7 into NSLS2:pdf-profile-conversion Oct 23, 2026
4 checks passed
@sligara7
Anthony Sligar (sligara7) deleted the pdf-conv-01-template branch October 23, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Automated lockfile PRs use the default token, preventing the configured CI checks from running on those updates.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Use a token that triggers CI for generated PRs

.github/​workflows/​refresh-lockfile.yml:37

Without a token input, create-pull-request uses GITHUB_TOKEN. As documented by the action, PR creation and branch updates made with this token do not trigger pull_request or push workflows. Generated lockfile PRs therefore receive no automatic lint, test, or build checks from ci.yml, which also lacks a manual dispatch trigger. Supply a GitHub App token or personal access token with the required permissions, or explicitly run CI against each generated PR head before merging.

2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 23, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

Remaining feedback is non-blocking, and no approval-blocking defects were identified within this template-adoption scope.

1 open issue

Review effort: Balanced

Comment thread .github/workflows/ci.yml
@@ -0,0 +1,62 @@
name: CI
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