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

ENH: add xvec accessor and to_crs, set_crs, geom_coords_names #11

Merged
merged 12 commits into from
Dec 6, 2022
2 changes: 2 additions & 0 deletions ci/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
# to build from source
- cython
- geos
- proj
# testing
- pytest
- pytest-cov
Expand All @@ -16,3 +17,4 @@ dependencies:
- pip:
- git+https://github.com/shapely/shapely.git@main
- git+https://github.com/pydata/xarray.git@main
- git+https://github.com/pyproj4/pyproj.git
1 change: 1 addition & 0 deletions ci/latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
# required
- shapely=2
- xarray
- pyproj
# testing
- pytest
- pytest-cov
Expand Down
65 changes: 65 additions & 0 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
API reference
=============

The API reference provides an overview of all public objects, functions and
methods and Xarray accessors implemented in Xvec.

Indexing
--------

Expand All @@ -15,3 +18,65 @@ Indexing
GeometryIndex
GeometryIndex.crs
GeometryIndex.sindex


.. currentmodule:: xarray

Dataset.xvec
------------

.. _dsattr:

Properties
~~~~~~~~~~

.. autosummary::
:toctree: generated/
:template: autosummary/accessor_attribute.rst

Dataset.xvec.geom_coords
Dataset.xvec.geom_coords_indexed


.. _dsmeth:

Methods
~~~~~~~

.. autosummary::
:toctree: generated/
:template: autosummary/accessor_method.rst

Dataset.xvec.is_geom_variable
Dataset.xvec.set_crs
Dataset.xvec.to_crs


DataArray.xvec
--------------

.. _daattr:

Properties
~~~~~~~~~~

.. autosummary::
:toctree: generated/
:template: autosummary/accessor_attribute.rst

DataArray.xvec.geom_coords
DataArray.xvec.geom_coords_indexed


.. _dameth:

Methods
~~~~~~~

.. autosummary::
:toctree: generated/
:template: autosummary/accessor_method.rst

DataArray.xvec.is_geom_variable
DataArray.xvec.to_crs
DataArray.xvec.set_crs
16 changes: 15 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
import sys

import sphinx_autosummary_accessors


sys.path.insert(0, os.path.abspath("../xvec/"))

import xvec # noqa

project = "Xvec"
copyright = "2022, Xvec developers"
Expand All @@ -20,9 +29,13 @@
"sphinx.ext.intersphinx",
"myst_nb",
"sphinx_copybutton",
"sphinx_autosummary_accessors",
]

templates_path = ["_templates"]
templates_path = [
"_templates",
sphinx_autosummary_accessors.templates_path,
]
exclude_patterns = []

intersphinx_mapping = {
Expand All @@ -42,3 +55,4 @@
"github_url": "https://github.com/martinfleis/xvec",
}
nb_execution_mode = "off"
autodoc_typehints = "none"
3 changes: 3 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dependencies:
- flake8
- black
- isort
- pip
- pip:
- sphinx_autosummary_accessors
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers = [
]
requires-python = ">=3.8"
dependencies = [
"xarray >= 2022.11.0",
"xarray >= 2022.12.0",
"pyproj >= 3.0.0",
"shapely >= 2.0b1",
]
Expand Down
1 change: 1 addition & 0 deletions xvec/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from importlib.metadata import PackageNotFoundError, version

from .accessor import XvecAccessor # noqa
from .index import GeometryIndex # noqa

try:
Expand Down
Loading