Skip to content

Commit

Permalink
0.6.0 release (#2265)
Browse files Browse the repository at this point in the history
* 0.6.0 release

* Fix versionadded

* Update docs on ruff

* EuroCrops: consistent citation message

* Attempt to remove fully qualified type hints

* Silence test warnings

* Undo digital typhoon changes

* Undo sphinx req changes

* Automatically delete downloaded models after successful tests to avoid OOM

* Silence mypy warning

* Skip dependabot in auto-generated release notes
  • Loading branch information
adamjstewart authored Sep 1, 2024
1 parent 03faab9 commit bcb959a
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
changelog:
exclude:
authors:
- dependabot[bot]
- app/dependabot
categories:
- title: Backwards-incompatible changes
labels:
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build']

# Sphinx 3.0+ required for:
# autodoc_typehints_description_target = "documented"
# Sphinx 4.0+ required for autodoc_typehints_description_traget
needs_sphinx = '4.0'

nitpicky = True
Expand Down
6 changes: 3 additions & 3 deletions docs/user/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ These tests require `pytest <https://docs.pytest.org/en/stable/>`_ and `pytest-c
Linters
-------

In order to remain `PEP-8 <https://peps.python.org/pep-0008/>`_ compliant and maintain a high-quality codebase, we use a couple of linting tools:
In order to remain `PEP-8 <https://peps.python.org/pep-0008/>`_ compliant and maintain a high-quality codebase, we use a few linting tools:

* `ruff <https://docs.astral.sh/ruff/>`_ for code formatting
* `mypy <https://mypy.readthedocs.io/en/stable/>`_ for static type analysis
Expand All @@ -98,8 +98,8 @@ These tools should be used from the root of the project to ensure that our confi

.. code-block:: console
$ ruff check
$ ruff format
$ ruff check
Mypy won't fix your code for you, but will warn you about potential issues with your code:
Expand Down Expand Up @@ -164,7 +164,7 @@ The resulting HTML files can be found in ``_build/html``. Open ``index.html`` in
Tutorials
---------

TorchGeo has a number of tutorials included in the documentation that can be run in `Google Colab <https://colab.research.google.com/>`_. These Jupyter notebooks are tested before each release to make sure that they still run properly. To test these locally, install `pytest <https://docs.pytest.org/en/stable/>`_ and `nbmake <https://github.com/treebeardtech/nbmake>`_ and run:
TorchGeo has a number of tutorials included in the documentation that can be run in `Lightning Studios <https://lightning.ai/studios>`_ and `Google Colab <https://colab.research.google.com/>`_. These Jupyter notebooks are tested before each release to make sure that they still run properly. To test these locally, install `pytest <https://docs.pytest.org/en/stable/>`_ and `nbmake <https://github.com/treebeardtech/nbmake>`_ and run:

.. code-block:: console
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ docs = [
"nbsphinx>=0.8.5",
# release versions missing files, must install from master
"pytorch-sphinx-theme",
# sphinx 4+ required for autodoc_typehints_description_target = documented
# sphinx 4+ required for autodoc_typehints_description_target
# sphinx 6+ is incompatible with pytorch-sphinx-theme
# https://github.com/pytorch/pytorch_sphinx_theme/issues/175
"sphinx>=4,<6",
Expand Down Expand Up @@ -226,12 +226,15 @@ filterwarnings = [
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning",
"ignore:pkg_resources is deprecated as an API.:DeprecationWarning:lightning_utilities.core.imports",
"ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated:DeprecationWarning:jsonargparse",
"ignore:`ModuleAvailableCache` is a special case of `RequirementCache`.:DeprecationWarning:lightning.fabric.plugins.environments.xla",
# https://github.com/pytorch/pytorch/issues/110549
"ignore:allow_ops_in_compiled_graph failed to import torch:ImportWarning:einops",
# https://github.com/rr-/docstring_parser/pull/82
"ignore:ast.* is deprecated and will be removed in Python 3.14:DeprecationWarning:docstring_parser.attrdoc",
# https://github.com/python/cpython/pull/102953
"ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning:torchgeo.datasets.utils",
"ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning:torchgeo.datasets.digital_typhoon",
"ignore:Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata:DeprecationWarning:torchvision.datasets.utils",
# https://github.com/kornia/kornia/pull/2967
"ignore:`torch.cuda.amp.custom_fwd\\(args...\\)` is deprecated.:FutureWarning:kornia.feature.lightglue",
# https://github.com/kornia/kornia/pull/2981
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from pathlib import Path
from typing import Any

import pytest
Expand All @@ -16,3 +17,8 @@ def load(*args: Any, progress: bool = False, **kwargs: Any) -> Any:
@pytest.fixture
def load_state_dict_from_url(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setattr(torchvision.models._api, 'load_state_dict_from_url', load)


@pytest.fixture(autouse=True)
def torch_hub(tmp_path: Path) -> None:
torch.hub.set_dir(tmp_path) # type: ignore[no-untyped-call]
2 changes: 1 addition & 1 deletion torchgeo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"""

__author__ = 'Adam J. Stewart'
__version__ = '0.6.0.dev0'
__version__ = '0.6.0'
5 changes: 4 additions & 1 deletion torchgeo/datamodules/digital_typhoon.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@


class DigitalTyphoonDataModule(NonGeoDataModule):
"""Digital Typhoon Data Module."""
"""Digital Typhoon Data Module.
.. versionadded:: 0.6
"""

valid_split_types = ('time', 'typhoon_id')

Expand Down
2 changes: 1 addition & 1 deletion torchgeo/datamodules/geonrw.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GeoNRWDataModule(NonGeoDataModule):
Implements 80/20 train/val splits based on city locations.
See :func:`setup` for more details.
.. versionadded: 0.6
.. versionadded:: 0.6
"""

def __init__(
Expand Down
5 changes: 3 additions & 2 deletions torchgeo/datasets/eurocrops.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ class EuroCrops(VectorDataset):
is tagged with a "EC_hcat_n" attribute indicating the harmonized crop name grown
within the polygon in the year associated with the shapefile.
If you use this dataset in your research, please follow the citation guidelines at
https://github.com/maja601/EuroCrops#reference.
If you use this dataset in your research, please follow the citation guidelines at:
* https://github.com/maja601/EuroCrops#reference.
.. versionadded:: 0.6
"""
Expand Down
2 changes: 0 additions & 2 deletions torchgeo/datasets/levircd.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@ class LEVIRCDPlus(LEVIRCDBase):
If you use this dataset in your research, please cite the following paper:
* https://arxiv.org/abs/2107.09244
.. versionchanged:: 0.6
"""

url = 'https://drive.google.com/file/d/1JamSsxiytXdzAIk6VDVWfc-OsX-81U81'
Expand Down
4 changes: 2 additions & 2 deletions torchgeo/trainers/byol.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ class BackboneWrapper(nn.Module):
* The output of the encoding layer is passed through the projection head
* The forward call returns the output of the projection head
.. versionchanged 0.4: Name changed from *EncoderWrapper* to
*BackboneWrapper*.
.. versionchanged:: 0.4
Name changed from *EncoderWrapper* to *BackboneWrapper*.
"""

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions torchgeo/trainers/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ class and used with 'ce' loss.
were renamed to *model*, *backbone*, and *weights*.
.. versionadded:: 0.5
The *class_weights*, *freeze_backbone*, and *freeze_decoder* parameters.
The *class_weights*, *freeze_backbone*, and *freeze_decoder* parameters.
.. versionchanged:: 0.5
The *weights* parameter now supports WeightEnums and checkpoint paths.
*learning_rate* and *learning_rate_schedule_patience* were renamed to
*lr* and *patience*.
.. versionchanged:: 0.6
The *ignore_index* parameter now works for jaccard loss.
The *ignore_index* parameter now works for jaccard loss.
"""
self.weights = weights
super().__init__(ignore='weights')
Expand Down

0 comments on commit bcb959a

Please sign in to comment.