Skip to content

gh-201: Spins from fields for transforms - #411

Merged
JaimeRZP merged 3 commits into
mainfrom
201-jrz
Jun 30, 2026
Merged

gh-201: Spins from fields for transforms#411
JaimeRZP merged 3 commits into
mainfrom
201-jrz

Conversation

@JaimeRZP

@JaimeRZP JaimeRZP commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fixes: #201

@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.35% <100.00%> (+0.05%) ⬆️
py3.11 83.35% <100.00%> (+0.05%) ⬆️
py3.12 83.32% <100.00%> (+0.05%) ⬆️
py3.13 82.89% <100.00%> (+0.05%) ⬆️
py3.9 83.56% <100.00%> (+0.05%) ⬆️

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

Files with missing lines Coverage Δ
heracles/ducc.py 56.60% <ø> (+2.05%) ⬆️
heracles/fields.py 96.45% <100.00%> (ø)
heracles/healpy.py 96.29% <100.00%> (-0.05%) ⬇️
heracles/mapper.py 100.00% <100.00%> (ø)
heracles/mapping.py 94.64% <100.00%> (+0.09%) ⬆️
🚀 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 #201 by making mapper spin handling explicit: Mapper.transform() (and map_values()) now accept a spin argument, and heracles.mapping.transform() passes the spin from each Field instead of relying on input-array dtype metadata.

Changes:

  • Add spin parameters to the Mapper protocol and mapper implementations (healpy, ducc), and thread spin through mapping/field call sites.
  • Update HEALPix transform tests to pass explicit spin.
  • Pass Field.spin into map_values() during catalog mapping.

Reviewed changes

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

Show a summary per file
File Description
tests/test_healpy.py Updates HEALPix transform tests to pass explicit spin.
heracles/mapping.py Passes Field.spin into mapper.transform(...) when transforming mapped data to alms.
heracles/mapper.py Extends the Mapper protocol API with spin parameters for map_values() and transform().
heracles/healpy.py Updates HealpixMapper.transform() signature and removes spin inference from dtype metadata.
heracles/fields.py Threads Field.spin into mapper.map_values(...) calls.
heracles/ducc.py Updates DiscreteMapper.map_values() / transform() signatures to accept explicit spin.

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

Comment thread heracles/ducc.py
Comment thread heracles/mapper.py
Comment thread heracles/healpy.py
@JaimeRZP
JaimeRZP merged commit 3172c32 into main Jun 30, 2026
11 checks passed
@JaimeRZP
JaimeRZP deleted the 201-jrz branch June 30, 2026 14:49
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.

Transforms get spin weight from field instead of metadata

2 participants