Skip to content

gh-413: Impose spin#414

Merged
JaimeRZP merged 11 commits into
mainfrom
201-jrz
Jul 1, 2026
Merged

gh-413: Impose spin#414
JaimeRZP merged 11 commits into
mainfrom
201-jrz

Conversation

@JaimeRZP

Copy link
Copy Markdown
Contributor

Fixes: #413
This should allow people to use our methods with their own maps without having to worry about metadata.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
py3.10 83.39% <100.00%> (+0.03%) ⬆️
py3.11 83.39% <100.00%> (+0.03%) ⬆️
py3.12 83.35% <100.00%> (+0.03%) ⬆️
py3.13 82.92% <100.00%> (+0.03%) ⬆️
py3.9 83.60% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
heracles/mapping.py 95.16% <100.00%> (+0.51%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Pull request overview

This PR addresses issue #413 by making heracles.mapping.transform() impose (write) the expected spin into a map’s dtype metadata when it is missing, enabling callers to pass in their own maps without pre-populating metadata.

Changes:

  • Update transform() to fill missing spin metadata from the corresponding Field.spin, and raise a clear ValueError on spin mismatch.
  • Add/adjust tests to cover: normal transform behavior, filling missing spin metadata, and mismatch error behavior.

Reviewed changes

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

File Description
heracles/mapping.py Ensures transform() enforces/repairs spin metadata consistency before calling the mapper transform.
tests/test_mapping.py Adds targeted test coverage for missing-spin fill and mismatch error handling.

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

@JaimeRZP JaimeRZP merged commit 942f831 into main Jul 1, 2026
10 checks passed
@JaimeRZP JaimeRZP deleted the 201-jrz branch July 1, 2026 09:42
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.

Transform should impose fields spin if empty

2 participants