Skip to content

Accessor: add methods to write or clear CRS info#20

Merged
benbovy merged 9 commits intomainfrom
write-clear-crs-info
Jan 9, 2025
Merged

Accessor: add methods to write or clear CRS info#20
benbovy merged 9 commits intomainfrom
write-clear-crs-info

Conversation

@benbovy
Copy link
Copy Markdown
Member

@benbovy benbovy commented Jan 9, 2025

Add these two methods (and their DataArray equivalents):

  • Dataset.proj.write_crs_info()
  • Dataset.proj.clear_crs_info()

It is possible to customize how a CRS is translated into coordinate attributes by passing a callable to .proj.write_crs_info(). Two builtin callables are provided:

  • format_compact_cf: just write a crs_wkt attribute (default)
  • format_full_cf_gdal: write crs_wkt, spatial_ref and all CF grid mapping variable attributes

@benbovy benbovy mentioned this pull request Jan 9, 2025
5 tasks
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.37%. Comparing base (66d3c7d) to head (87b6516).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
+ Coverage   98.21%   98.37%   +0.16%     
==========================================
  Files           9       10       +1     
  Lines         559      614      +55     
==========================================
+ Hits          549      604      +55     
  Misses         10       10              

☔ 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.

@benbovy benbovy merged commit def3b33 into main Jan 9, 2025
@benbovy benbovy deleted the write-clear-crs-info branch January 9, 2025 13:20
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.

1 participant