Skip to content

Commit 45abaf7

Browse files
committed
do not run pyupgrade on dataclasses, remove sphinx-autosummary-accessors, use sphinx-autodoc, add module API to docs, remove numpydoc from sphinx extensions, docstring fixes
1 parent 65bd84b commit 45abaf7

File tree

11 files changed

+30
-25
lines changed

11 files changed

+30
-25
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ repos:
77
hooks:
88
- id: pyupgrade
99
args: [ '--py39-plus' ]
10+
exclude: 'src/xncml/generated/ncml_2_2.py'
1011
- repo: https://github.com/pre-commit/pre-commit-hooks
1112
rev: v5.0.0
1213
hooks:

CI/environment-docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dependencies:
1818
- jupyter_client
1919
- nbsphinx >=0.9.5
2020
- sphinx >=7.0.0
21-
# - sphinx-autosummary-accessors
2221
- sphinx-codeautolink >=0.16.2
2322
- sphinx-copybutton
2423
- sphinx-rtd-theme >=1.0

CONTRIBUTING.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Ready to contribute? Here's how to set up ``xncml`` for local development.
122122
#. When you're done making changes, we **strongly** suggest running the tests in your environment or with the help of ``tox``:
123123

124124
.. code-block:: console
125+
125126
make lint
126127
python -m pytest
127128
# Or, to run multiple build tests

docs/apidoc/xncml.generated.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ xncml.generated package
33

44
.. automodule:: xncml.generated
55
:members:
6-
:undoc-members:
7-
:show-inheritance:
86
:private-members:
7+
:show-inheritance:
8+
:undoc-members:
99

1010
Submodules
1111
----------
@@ -15,6 +15,6 @@ xncml.generated.ncml\_2\_2 module
1515

1616
.. automodule:: xncml.generated.ncml_2_2
1717
:members:
18-
:undoc-members:
19-
:show-inheritance:
2018
:private-members:
19+
:show-inheritance:
20+
:undoc-members:

docs/apidoc/xncml.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ xncml package
33

44
.. automodule:: xncml
55
:members:
6-
:undoc-members:
7-
:show-inheritance:
86
:private-members:
7+
:show-inheritance:
8+
:undoc-members:
99

1010
Subpackages
1111
-----------
@@ -23,15 +23,15 @@ xncml.core module
2323

2424
.. automodule:: xncml.core
2525
:members:
26-
:undoc-members:
27-
:show-inheritance:
2826
:private-members:
27+
:show-inheritance:
28+
:undoc-members:
2929

3030
xncml.parser module
3131
-------------------
3232

3333
.. automodule:: xncml.parser
3434
:members:
35-
:undoc-members:
36-
:show-inheritance:
3735
:private-members:
36+
:show-inheritance:
37+
:undoc-members:

docs/conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,16 @@
3535
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3636
extensions = [
3737
'sphinx.ext.autodoc',
38-
'sphinx.ext.viewcode',
39-
'sphinx.ext.autosummary',
38+
'sphinx.ext.autosectionlabel',
4039
'sphinx.ext.doctest',
41-
'sphinx.ext.intersphinx',
4240
'sphinx.ext.extlinks',
43-
'numpydoc',
41+
'sphinx.ext.intersphinx',
42+
'sphinx.ext.napoleon',
43+
'sphinx.ext.todo',
44+
'sphinx.ext.viewcode',
4445
'IPython.sphinxext.ipython_console_highlighting',
4546
'IPython.sphinxext.ipython_directive',
4647
'nbsphinx',
47-
'sphinx.ext.autosectionlabel',
48-
'sphinx.ext.todo',
4948
'sphinx_codeautolink',
5049
'sphinx_copybutton',
5150
]

docs/index.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. module:: xncml
2-
31
Xncml Documentation
42
===================
53

@@ -14,6 +12,12 @@ Xncml Documentation
1412
authors
1513
changelog
1614

15+
.. toctree::
16+
:maxdepth: 1
17+
:caption: API Reference:
18+
19+
apidoc/modules
20+
1721
`xncml` adds NcML support to xarray. It includes utilities to modify NcML documents, and open NcML files as `xarray.Dataset`.
1822
For more information on NcML, take a look at `tutorials and examples <https://docs.unidata.ucar.edu/netcdf-java/current/userguide/basic_ncml_tutorial.html>`_
1923
and the `annotated schema <https://docs.unidata.ucar.edu/netcdf-java/current/userguide/annotated_ncml_schema.html>`_.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ max-complexity = 15
307307
[tool.ruff.lint.per-file-ignores]
308308
"docs/**" = ["E402"]
309309
"src/xncml/**/__init__.py" = ["F401", "F403"]
310-
"src/xncml/generated/*.py" = ["D"]
310+
"src/xncml/generated/*.py" = ["D", "UP"]
311311
"src/xncml/parser.py" = ["C901"] # To be added
312312
"tests/**" = ["D100", "D101", "D102", "D103", "S101"]
313313

src/xncml/generated/ncml_2_2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from dataclasses import dataclass, field
44
from enum import Enum
5+
from typing import Type
56

67
__NAMESPACE__ = "http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"
78

@@ -314,7 +315,7 @@ class Meta:
314315
"choices": (
315316
{
316317
"name": "enum",
317-
"type": type["EnumTypedef.EnumType"],
318+
"type": Type["EnumTypedef.EnumType"],
318319
},
319320
),
320321
},
@@ -475,7 +476,7 @@ class Meta:
475476
},
476477
{
477478
"name": "group",
478-
"type": type["Group"],
479+
"type": Type["Group"],
479480
},
480481
{
481482
"name": "remove",

src/xncml/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ def read_enum(obj: EnumTypedef) -> dict[str, list]:
453453
dict:
454454
A dictionary describing the Enum.
455455
456-
Example
457-
-------
456+
Examples
457+
--------
458458
.. code-block: xml
459459
<enumTypedef name="trilean" type="enum1">
460460
<enum key="0">false</enum>

0 commit comments

Comments
 (0)