Skip to content

Commit 612c926

Browse files
authored
Add pixel_ratio option to .to_raster() (#1354)
* Add `pixel_ratio` to `.to_raster` * Really float * Add a way to pass in known pixel mapping if plotting same scene again, say or tweaking a plot * Add some geoax annotations * Doc new parameters in the public docstring * Add example * Fix numba source * fmt * Remove extent prints * Add Cartopy intersphinx * Ignore more files generated in the docs build * Add a few exclude patterns mainly for temporary notebook files that may be around * Add some cross refs * Add pixel ratio test * Expand mapping description * Add DPI note * Update internal docstrings * Test consistent nan frac * Simplify gallery gitignore a bit * sp * Update caution note * More intersphinx etc. * Fix the PolyCollection example for now . #1356 * More gitignore * Add subset -> PolyCollection example * flatnonzero applies ravel * Move the degenerate poly filter into the polycollection func * Set up API * Ensure passing ndarray; check pixel_ratio * cleanup * Add example * Add some tests * TypeError seems more appropriate * Fix ref * Update Cartopy intersphinx * stable intersphinx what the majority of users (and devs, I would think), would want the redirects are not followed, for example: intersphinx inventory 'https://numba.readthedocs.io/objects.inv' not fetchable due to <class 'requests.exceptions.HTTPError'>: 404 Client Error: Not Found for url: https://numba.readthedocs.io/objects.inv * Validate the pixel mapping for usage with ax and encapsulate note that `ccrs.CRS(str(ax.projection))` can recover the proj in many cases, but not all * Move some comparison code to the class * Add some docstrings; test attr recovery
1 parent e7ce266 commit 612c926

File tree

8 files changed

+567
-123
lines changed

8 files changed

+567
-123
lines changed

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ test/dask-worker-space/
141141
/dask-worker-space/
142142
.vscode/
143143
generated/
144+
.ipynb_checkpoints/
144145

145146
# Test grid files.
146147
test/meshfiles/*.g
@@ -150,9 +151,13 @@ test/write_*
150151

151152
# Autogenerated docs
152153
docs/user_api/_autosummary/
153-
154154
docs/notebook-examples.txt
155-
155+
docs/*-examples-gallery.txt
156+
docs/user-guide/oQU120.data.nc
157+
docs/user-guide/oQU120.grid.nc
158+
docs/user-guide/oQU480.data.nc
159+
docs/user-guide/oQU480.grid.nc
160+
docs/user-guide/psi_healpix.nc
156161

157162
# benchmarking
158163
benchmarks/env

docs/conf.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,18 @@ def __getattr__(cls, name):
7474

7575
intersphinx_mapping = {
7676
"python": ("https://docs.python.org/3/", None),
77-
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
78-
"iris": ("https://scitools-iris.readthedocs.io/en/latest", None),
79-
"numpy": ("https://numpy.org/doc/stable", None),
80-
"scipy": ("https://docs.scipy.org/doc/scipy", None),
81-
"numba": ("https://numba.pydata.org/numba-doc/latest", None),
77+
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
78+
"iris": ("https://scitools-iris.readthedocs.io/en/stable/", None),
79+
"numpy": ("https://numpy.org/doc/stable/", None),
80+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
81+
"numba": ("https://numba.readthedocs.io/en/stable/", None),
8282
"matplotlib": ("https://matplotlib.org/stable/", None),
83-
"dask": ("https://docs.dask.org/en/latest", None),
84-
"cftime": ("https://unidata.github.io/cftime", None),
85-
"rasterio": ("https://rasterio.readthedocs.io/en/latest", None),
86-
"sparse": ("https://sparse.pydata.org/en/latest/", None),
87-
"xarray": ("http://xarray.pydata.org/en/stable/", None),
83+
"dask": ("https://docs.dask.org/en/stable/", None),
84+
"cftime": ("https://unidata.github.io/cftime/", None),
85+
"rasterio": ("https://rasterio.readthedocs.io/en/stable/", None),
86+
"sparse": ("https://sparse.pydata.org/en/stable/", None),
87+
"xarray": ("https://docs.xarray.dev/en/stable/", None),
88+
"cartopy": ("https://cartopy.readthedocs.io/stable/", None),
8889
}
8990

9091

@@ -136,7 +137,7 @@ def __getattr__(cls, name):
136137
# List of patterns, relative to source directory, that match files and
137138
# directories to ignore when looking for source files.
138139
# This pattern also affects html_static_path and html_extra_path.
139-
exclude_patterns = []
140+
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
140141

141142
# The name of the Pygments (syntax highlighting) style to use.
142143
pygments_style = "sphinx"

0 commit comments

Comments
 (0)