Skip to content

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Nov 22, 2024

Description of proposed changes

Fix doctest failure on ci_tests_legacy.yaml caused by the changes made in #3575/#3576 that made it incompatible with older versions of rasterio<1.4.2

_______________ [doctest] pygmt.datasets.tile_map.load_tile_map ________________
118     >>> raster.sizes
119     Frozen({'band': 3, 'y': 256, 'x': 512})
120     >>> raster.coords  # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
121     Coordinates:
122       * band         (band) uint8... 1 2 3
123       * y            (y) float64... -7.081e-10 -7.858e+04 ... -1.996e+07 -2.004e+07
124       * x            (x) float64... -2.004e+07 -1.996e+07 ... 1.996e+07 2.004e+07
125         spatial_ref  int... 0
126     >>> # CRS is set only if rioxarray is available
127     >>> if hasattr(raster, "rio"):
Expected:
    CRS.from_wkt(...)
Got:
    CRS.from_epsg(3857)
/home/runner/work/pygmt/pygmt/pygmt/datasets/tile_map.py:127: DocTestFailure

Fixes ##3641 (comment), patches #3576

Preview:

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

Use rio.crs.to_string() to get the 'EPSG:3857' string representation that should make the test compatible with rasterio 1.4.2 or older.
@weiji14 weiji14 added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Nov 22, 2024
@weiji14 weiji14 added this to the 0.14.0 milestone Nov 22, 2024
@weiji14 weiji14 mentioned this pull request Nov 22, 2024
7 tasks
This reverts commit 1bb9936.

Co-authored-by: Dongdong Tian <[email protected]>
@weiji14 weiji14 marked this pull request as ready for review November 22, 2024 02:19
@weiji14 weiji14 merged commit bad7943 into main Nov 22, 2024
14 of 22 checks passed
@weiji14 weiji14 deleted the rio/crs_to_string branch November 22, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants