Skip to content

Mapset#36

Merged
bnlawrence merged 9 commits intomainfrom
mapset
Mar 20, 2026
Merged

Mapset#36
bnlawrence merged 9 commits intomainfrom
mapset

Conversation

@bnlawrence
Copy link
Copy Markdown
Contributor

This addresses #21. Most options work, at least partially. There are upstream issues unfortunately #35, but we can't fix those now. We need to get the basic structure in to guide eventual code restructuring, here, and in cfplot itself.

Copy link
Copy Markdown
Contributor

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

Adds a first-pass “Mapset” structure and export workflow so the GUI can configure cf-plot map projections and export plot/data/code outputs, while also improving plot viewport sizing and resilience to some backend read errors.

Changes:

  • Introduces contour map projection options (projection, bbox/boundinglat, resolution) and wires them into worker-side plotting via cfp.mapset(...).
  • Adds an “Export” control that supports saving Plot / Data / Code / All, including worker-side data export via cf.write.
  • Adds a toggle to show/hide the selection info panel and refines plot-window aspect/letterboxing behavior.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
xconv2/xconv_cf_interface.py Adds backend-tolerant range calculation, data saving helper, and mapset handling in contour plotting.
xconv2/cf_templates.py Extends generated worker code to support mapset options and data-save code paths.
xconv2/main_window.py Adds UI→worker requests for saving data and “save all”; adjusts emit-image logic accordingly.
xconv2/ui/contour_options_controller.py Adds GUI controls for map projection + bbox/boundinglat + resolution and stores them in contour options.
xconv2/ui/plot_view_controller.py Reworks save UI into Export + mode selector; improves plot resizing/aspect fitting.
xconv2/ui/selection_controller.py Centralizes enabling/disabling save/export controls and updates summary formatting.
xconv2/core_window.py Adds selection info panel toggle button + state management hooks.
xconv2/ui/settings_store.py Persists last_save_data_dir.
xconv2/ui/plot_options_shared.py Small layout tweaks for titles/annotations option sections.
tests/test_contour.py Updates tests for new save behavior and contour-range fallback path.
tests/test_cf_interface.py Updates contour-save expectations and adds test for save_selected_field_data.
tests/test_coordinate_flow.py Adds coverage for selection-info toggle and plot-window width heuristics.
pyproject.toml Adds pytest warning filters for known upstream deprecations.
environment.yml Adds cartopy/udunits2 and editable install for local development.
environment-integration.yml Adds editable install for integration environment.

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

Copy link
Copy Markdown
Contributor

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10/10

@bnlawrence
Copy link
Copy Markdown
Contributor Author

Despite the failure to build 3.14, I'm going to merge this, as the right fix for that is really here NCAS-CMS/cfdm#395

@bnlawrence bnlawrence merged commit 4a9f565 into main Mar 20, 2026
2 of 3 checks passed

dependencies:
- python >=3.12
- python >=3.12,<3.14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnlawrence any reason you pinned to <3.14?

@valeriupredoi
Copy link
Copy Markdown
Contributor

when the PR affects maintenance, can I please be included for a review as well? 🍺

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