Skip to content

add more police functions on groupings files and on statuses#123

Merged
gipert merged 6 commits intomainfrom
police_updates
Apr 4, 2026
Merged

add more police functions on groupings files and on statuses#123
gipert merged 6 commits intomainfrom
police_updates

Conversation

@ggmarshall
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 2, 2026 22:21
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 44.49153% with 131 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.46%. Comparing base (0869644) to head (7ab4b01).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/legendmeta/police.py 43.51% 122 Missing ⚠️
src/legendmeta/utils.py 55.00% 9 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (0869644) and HEAD (7ab4b01). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (0869644) HEAD (7ab4b01)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #123      +/-   ##
==========================================
- Coverage   64.34%   58.46%   -5.89%     
==========================================
  Files           8        9       +1     
  Lines         561      797     +236     
==========================================
+ Hits          361      466     +105     
- Misses        200      331     +131     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 extends legendmeta.police with additional CLI validators for calibration/physics groupings and status files, adding shared validation utilities and corresponding tests.

Changes:

  • Added validate-cal-groupings, validate-phy-groupings, and validate-statuses CLI entry points.
  • Implemented shared groupings validation logic (ordering, naming conventions, overridden-run checks) plus run-override window detection.
  • Introduced legendmeta.utils.expand_runs() to expand run ranges/lists, with new unit tests covering override and sorting behavior.

Reviewed changes

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

File Description
tests/test_police.py Adds unit tests for overridden-run detection and groupings-file validation rules.
src/legendmeta/utils.py Adds expand_runs() and run-spec regex helpers used by groupings validation.
src/legendmeta/police.py Adds new validators (validate_statuses, groupings validators) and shared helper functions.
pyproject.toml Registers new CLI scripts for the added validators.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gipert
Copy link
Copy Markdown
Member

gipert commented Apr 3, 2026

you also need to register them as pre-commit hooks in the config file. there's also a way in pre-commit to use a local repository for the hooks, you can use it to test the hooks before we release a new version

@gipert gipert mentioned this pull request Apr 3, 2026
@ggmarshall
Copy link
Copy Markdown
Contributor Author

ggmarshall commented Apr 3, 2026

Ok this all runs locally, it is going to raise some errors when run but these are things that should be fixed, in particular, enforcing the addition of reason fields to sipm and pmt statuses and enforcing the partitions file is sorted

@ggmarshall ggmarshall mentioned this pull request Apr 3, 2026
@gipert gipert merged commit 3360584 into main Apr 4, 2026
15 checks passed
@gipert gipert deleted the police_updates branch April 4, 2026 16:06
@gipert
Copy link
Copy Markdown
Member

gipert commented Apr 4, 2026

now you have to run pre-commit autoupdate in legend-datasets

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.

4 participants