Skip to content

Add explicit semi-minor axes for spherical projections#735

Closed
floze-the-genius wants to merge 2 commits into
pytroll:mainfrom
floze-the-genius:fix/issue-200-explicit-spherical-axis
Closed

Add explicit semi-minor axes for spherical projections#735
floze-the-genius wants to merge 2 commits into
pytroll:mainfrom
floze-the-genius:fix/issue-200-explicit-spherical-axis

Conversation

@floze-the-genius

@floze-the-genius floze-the-genius commented Jul 18, 2026

Copy link
Copy Markdown

Summary

  • complete projection dictionaries that specify only a by copying them and adding an explicit matching b
  • preserve projections that already define an ellipsoid or sphere through b, R, ellps, datum, rf, f, es, or e
  • update the shipped YAML and legacy area fixtures so their spherical definitions are explicit
  • add regression coverage for normalization, input immutability, the create_area_def integration path, and existing ellipsoid parameters
  • keep the Python 3.11 mypy analysis compatible with current dependency drift by running its isolated hook on Python 3.12 with numpy<2.3

This keeps the historical spherical interpretation while ensuring stricter CRS consumers receive a complete ellipsoid definition. The mypy compatibility constraint is limited to pre-commit's isolated environment and does not change pyresample's runtime dependencies or Python 3.11 analysis target.

Verification

  • JOBS=8 .venv/bin/pytest -q pyresample/test/test_area_config.py (22 passed)

  • JOBS=8 .venv/bin/pytest -q pyresample/test (1166 passed, 24 skipped, 2 subtests passed)

  • .venv/bin/ruff check pyresample/area_config.py pyresample/test/test_area_config.py

  • isolated pre-commit run --all-files (Ruff, whitespace, EOF, YAML, Bandit, mypy, isort)

  • git diff --check

  • Closes Fix incomplete areas in sample area configurations #200

  • Tests added

  • Tests passed

  • Fully documented

AI disclosure: OpenAI Codex assisted with investigation, implementation, and test execution; the resulting diff and test outputs were reviewed before submission.

@floze-the-genius
floze-the-genius force-pushed the fix/issue-200-explicit-spherical-axis branch from 5917d51 to d70af9f Compare July 18, 2026 14:29
@djhoese

djhoese commented Jul 19, 2026

Copy link
Copy Markdown
Member

Thanks for creating this PR. It brings up an odd issue and I'm not sure how I feel about fixing it. The description you made talks about "stricter CRS consumers", but do you have any examples of what/who those are? I hesitate to include this in pyresample as it feels like we are defining/forcing defaults that the PROJ C library may be filling in on its own. I do realize PROJ is probably always defining it as you have here.

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.69%. Comparing base (2e7a3c8) to head (d70af9f).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #735      +/-   ##
==========================================
+ Coverage   93.68%   93.69%   +0.01%     
==========================================
  Files          89       89              
  Lines       13715    13743      +28     
==========================================
+ Hits        12849    12877      +28     
  Misses        866      866              
Flag Coverage Δ
unittests 93.69% <100.00%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@floze-the-genius

Copy link
Copy Markdown
Author

You are right to question this. The concrete consumer I had in mind came from the original 2019 report in #200: Satpy GeoTIFF export through rasterio/GDAL failed even though PROJ accepted the projection. I re-ran that path against the current environment here (pyproj 3.7.2 and rasterio 1.5.0): both the a-only and explicit a/b definitions normalize to the same +R=6371228 CRS (EPSG:3409), and both write and reopen a GeoTIFF successfully.\n\nSo I do not have a current stricter consumer that justifies adding runtime normalization in create_area_def; that part of this PR is broader than the evidence supports and duplicates behavior PROJ already provides. I am closing this rather than forcing a default based on a historical failure. If a fixture/docs cleanup is still wanted independently, it would be better handled as a narrower change with current acceptance criteria.

@djhoese

djhoese commented Jul 19, 2026

Copy link
Copy Markdown
Member

Thanks for the clarification. In the future, while I can understand if the English language is a barrier, it would be nice to have a conversation with a person rather than an AI.

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.

Fix incomplete areas in sample area configurations

2 participants