Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve resolution of Sphinx-Gallery figures and pin max Python version for pip #613

Merged
merged 8 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

- [ ] Resolves #xxx,
- [ ] Tests added, otherwise issue #xxx opened,
- [ ] New optional dependencies added to both `dev-environment.yml` and `setup.cfg`,
- [ ] Fully documented, including `api/*.md` for new API.
- [ ] New optional dependencies or Python version support added to both `dev-environment.yml` and `setup.cfg`,
- [ ] If contributor workflow (test, doc, linting) or Python version support changed, update `CONTRIBUTING.md`.
2 changes: 1 addition & 1 deletion .github/workflows/pip-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
use-mamba: true
channel-priority: strict
activate-environment: geoutils-pip
python-version:
python-version: ${{ matrix.python-version }}

# Use pip install
- name: Install project
Expand Down
6 changes: 6 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
sys.path.append(os.path.abspath("../.."))
sys.path.append(os.path.abspath("../../geoutils/"))
sys.path.append(os.path.abspath(".."))
sys.path.insert(0, os.path.dirname(__file__))

from sphinx_gallery.sorting import ExampleTitleSortKey, ExplicitOrder

Expand Down Expand Up @@ -104,6 +105,11 @@
"backreferences_dir": "gen_modules/backreferences",
"doc_module": ("geoutils"), # Which function/class levels are used to create galleries
"remove_config_comments": True, # To remove comments such as sphinx-gallery-thumbnail-number (only works in code, not in text)
"reset_modules": (
"matplotlib",
"sphinxext.reset_mpl",
),
# To reset matplotlib for each gallery (and run custom function that fixes the default DPI)
}

extlinks = {
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GeoUtils is a Python package for **accessible**, **efficient** and **reliable**

```{important}
:class: margin
GeoUtils ``v0.1`` is released, with most features drafted 3 years ago now finalized 🎉! We are working on an **Xarray accessor** and a few other features for 2024.
GeoUtils ``v0.1`` is released, with most features drafted 3 years ago now finalized 🎉! We are working on an **Xarray accessor** and a few other features for 2025.
```

GeoUtils is built on top of core geospatial packages (Rasterio, GeoPandas, PyProj) and numerical packages
Expand Down
8 changes: 8 additions & 0 deletions doc/source/sphinxext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Functions for documentation configuration only, importable by sphinx"""
# To reset resolution setting for each sphinx-gallery example
def reset_mpl(gallery_conf, fname):
# To get a good resolution for displayed figures
from matplotlib import pyplot

pyplot.rcParams["figure.dpi"] = 600
pyplot.rcParams["savefig.dpi"] = 600
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ packages = find:
scripts = bin/geoviewer.py
zip_safe = False # https://mypy.readthedocs.io/en/stable/installed_packages.html
include_package_data = True
python_requires = >=3.9
python_requires = >=3.9,<3.13
# Avoid pinning dependencies in requirements.txt (which we don't do anyways, and we rely mostly on Conda)
# (https://caremad.io/posts/2013/07/setup-vs-requirement/, https://github.com/pypa/setuptools/issues/1951)
install_requires = file: requirements.txt
Expand Down
Loading