From cf52e25cdaca014c8fae419c8566348894e3f1a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:16:45 +0000 Subject: [PATCH 1/6] Bump ruff from 0.6.2 to 0.6.3 in /requirements (#2263) --- requirements/style.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/style.txt b/requirements/style.txt index 50e106f2d7b..ac3f7481740 100644 --- a/requirements/style.txt +++ b/requirements/style.txt @@ -1,3 +1,3 @@ # style mypy==1.11.2 -ruff==0.6.2 +ruff==0.6.3 From 16d90f29c85c657d33937c86142b937fd55aff59 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 30 Aug 2024 11:40:24 +0200 Subject: [PATCH 2/6] Alternatives: update metrics (#2259) * Alternatives: update metrics * Add TerraTorch * Don't include coverage of test files --- docs/user/alternatives.rst | 19 +++++++++---------- docs/user/downloads.csv | 10 ---------- docs/user/github.csv | 10 ---------- docs/user/metrics/downloads.csv | 9 +++++++++ docs/user/{ => metrics}/features.csv | 9 ++++----- docs/user/metrics/github.csv | 9 +++++++++ 6 files changed, 31 insertions(+), 35 deletions(-) delete mode 100644 docs/user/downloads.csv delete mode 100644 docs/user/github.csv create mode 100644 docs/user/metrics/downloads.csv rename docs/user/{ => metrics}/features.csv (76%) create mode 100644 docs/user/metrics/github.csv diff --git a/docs/user/alternatives.rst b/docs/user/alternatives.rst index a87bc2b8b2c..805ef6178cf 100644 --- a/docs/user/alternatives.rst +++ b/docs/user/alternatives.rst @@ -13,7 +13,7 @@ When deciding which library is most useful to you, it is worth considering the f Software is a living, breathing organism and is constantly undergoing change. If any of the above information is incorrect or out of date, or if you want to add a new project to this list, please open a PR! - *Last updated: 25 December 2023* + *Last updated: 28 August 2024* Features -------- @@ -22,7 +22,7 @@ Features .. csv-table:: :align: center - :file: features.csv + :file: metrics/features.csv :header-rows: 1 :widths: auto @@ -55,7 +55,7 @@ These are metrics that can be scraped from GitHub. .. csv-table:: :align: right - :file: github.csv + :file: metrics/github.csv :header-rows: 1 :widths: auto @@ -75,7 +75,7 @@ These are metrics that can be scraped from GitHub. **Commits**: The number of commits on the main development branch. This is another metric for how active development has been. However, this can vary a lot depending on whether PRs are merged with or without squashing first. -**Core SLOCs**: The number of source lines of code in the core library, excluding empty lines and comments. This tells you how large the library is, and how long it would take someone to write something like it themselves. We use `scc `_ to compute SLOCs. +**Core SLOCs**: The number of source lines of code in the core library, excluding empty lines and comments. This tells you how large the library is, and how long it would take someone to write something like it themselves. We use `scc `_ to compute SLOCs and exclude markdown languages from the count. **Test SLOCs**: The number of source lines of code in the testing suite, excluding empty lines and comments. This tells you how well tested the project is. A good goal to strive for is a similar amount of code for testing as there is in the core library itself. @@ -86,17 +86,17 @@ These are metrics that can be scraped from GitHub. Downloads --------- -These are download metrics for the project. Note that these numbers can be artificially inflated by installs during continuous integration. They give you a better idea of the number of projects that depend on a library than the number of users of that library. +These are download metrics for the project. Note that these numbers can be artificially inflated by mirrors and installs during continuous integration. They give you a better idea of the number of projects that depend on a library than the number of users of that library. .. csv-table:: :align: right - :file: downloads.csv + :file: metrics/downloads.csv :header-rows: 1 :widths: auto -**PyPI Downloads**: The number of downloads from the Python Packaging Index. PyPI download metrics are computed by `PePy `_. +**PyPI Downloads**: The number of downloads from the Python Packaging Index. PyPI download metrics are computed by `PyPI Stats `_ and `PePy `_. -**CRAN Downloads**: The number of downloads from the Comprehensive R Archive Network. CRAN download metrics are computed by `Meta CRAN `_. +**CRAN Downloads**: The number of downloads from the Comprehensive R Archive Network. CRAN download metrics are computed by `Meta CRAN `_ and `DataScienceMeta `_. **Conda Downloads**: The number of downloads from Conda Forge. Conda download metrics are computed by `Conda Forge `_. @@ -113,5 +113,4 @@ These are download metrics for the project. Note that these numbers can be artif .. _DeepForest: https://github.com/weecology/DeepForest .. _SITS: https://github.com/e-sensing/sits .. _segment-geospatial: https://github.com/opengeos/segment-geospatial -.. _GeoTorchAI: https://github.com/wherobots/GeoTorchAI -.. _Moonshine: https://github.com/moonshinelabs-ai/moonshine +.. _TerraTorch: https://github.com/IBM/terratorch diff --git a/docs/user/downloads.csv b/docs/user/downloads.csv deleted file mode 100644 index e82a1048255..00000000000 --- a/docs/user/downloads.csv +++ /dev/null @@ -1,10 +0,0 @@ -Library,PyPI/CRAN Last Week,PyPI/CRAN Last Month,PyPI/CRAN All Time,Conda All Time,Total All Time -`TorchGeo`_,"4,227","15,709","172,020","14,994","187,014" -`eo-learn`_,542,"2,224","119,657","29,806","149,463" -`Raster Vision`_,286,"1,446","53,029","2,211","55,240" -`PaddleRS`_,18,56,"1,196",0,"1,196" -`DeepForest`_,"2,429","11,092","686,997","48,368","735,365" -`SITS`_,128,728,"8,438","54,587","63,025" -`segment-geospatial`_,987,"6,088","64,067","8,226","72,293" -`GeoTorchAI`_,40,150,"2,210",0,"2,210" -`Moonshine`_,61,275,"6,243",0,"6,243" diff --git a/docs/user/github.csv b/docs/user/github.csv deleted file mode 100644 index 32a55c1c977..00000000000 --- a/docs/user/github.csv +++ /dev/null @@ -1,10 +0,0 @@ -Library,Contributors,Forks,Watchers,Stars,Issues,PRs,Releases,Commits,Core SLOCs,Test SLOCs,Test Coverage,License -`TorchGeo`_,56,243,44,"2,010",366,"1,315",10,"1,720","28,942","15,488",100%,MIT -`eo-learn`_,40,288,45,"1,058",159,622,40,"2,439","8,135","5,915",92%,MIT -`Raster Vision`_,30,375,74,"1,950",687,"1,220",19,"3,416","20,965","8,339",86%,Apache-2.0 -`PaddleRS`_,22,83,12,311,68,112,1,643,"21,859","2,156",48%,Apache-2.0 -`DeepForest`_,13,154,15,409,368,206,43,650,"2,375","1,149",86%,MIT -`SITS`_,13,74,29,415,564,495,41,"5,720","22,770","6,162",95%,GPL-2.0 -`segment-geospatial`_,11,244,51,"2,453",102,82,22,156,"5,355",92,22%,MIT -`GeoTorchAI`_,4,31,13,431,22,20,1,207,"6,153",550,38%,AGPL-3.0 -`Moonshine`_,1,1,4,121,2,5,1,48,245,56,69%,MIT diff --git a/docs/user/metrics/downloads.csv b/docs/user/metrics/downloads.csv new file mode 100644 index 00000000000..213f9c2a854 --- /dev/null +++ b/docs/user/metrics/downloads.csv @@ -0,0 +1,9 @@ +Library,PyPI/CRAN Last Week,PyPI/CRAN Last Month,PyPI/CRAN All Time,Conda All Time,Total All Time +`TorchGeo`_,"1,828","9,789","255,293","21,108","276,401" +`eo-learn`_,319,"1,560","141,983","36,205","178,188" +`Raster Vision`_,138,"652","61,938","3,254","65,192" +`PaddleRS`_,10,36,"1,642",0,"1,642" +`segment-geospatial`_,"1,553","7,363","117,664","18,147","135,811" +`DeepForest`_,564,"3,652","761,520","62,869","824,389" +`SITS`_,304,648,"12,767","78,976","91,743" +`TerraTorch`_,259,988,"2,378",0,"2,378" diff --git a/docs/user/features.csv b/docs/user/metrics/features.csv similarity index 76% rename from docs/user/features.csv rename to docs/user/metrics/features.csv index f9dc1b00dbe..d624504608c 100644 --- a/docs/user/features.csv +++ b/docs/user/metrics/features.csv @@ -1,10 +1,9 @@ Library,ML Backend,I/O Backend,Spatial Backend,Transform Backend,Datasets,Weights,CLI,Reprojection,STAC,Time-Series -`TorchGeo`_,PyTorch,"GDAL, h5py, laspy, OpenCV, pandas, pillow, scipy",R-tree,Kornia,71,43,✅,✅,❌,🚧 +`TorchGeo`_,PyTorch,"GDAL, h5py, laspy, OpenCV, pandas, pillow, scipy",R-tree,Kornia,82,68,✅,✅,❌,🚧 `eo-learn`_,scikit-learn,"GDAL, OpenCV, pandas",geopandas,numpy,0,0,❌,✅,❌,🚧 `Raster Vision`_,"PyTorch, TensorFlow*","GDAL, OpenCV, pandas, pillow, scipy, xarray",STAC,Albumentations,0,6,✅,✅,✅,✅ `PaddleRS`_,PaddlePaddle,"GDAL, OpenCV",shapely,numpy,7,14,🚧,✅,❌,🚧 -`DeepForest`_,PyTorch,"GDAL, OpenCV, pandas, pillow, scipy",R-tree,Albumentations,0,2,❌,❌,❌,❌ -`SITS`_,R Torch,GDAL,-,tidyverse,22,0,❌,✅,✅,✅ `segment-geospatial`_,PyTorch,"GDAL, OpenCV, pandas",geopandas,numpy,0,0,❌,✅,❌,❌ -`GeoTorchAI`_,PyTorch,"GDAL, pandas, xarray",Sedona,numpy,14,0,❌,❌,❌,🚧 -`Moonshine`_,PyTorch,-,-,numpy,0,3,❌,❌,❌,❌ +`DeepForest`_,PyTorch,"GDAL, OpenCV, pandas, pillow, scipy",R-tree,Albumentations,0,3,❌,❌,❌,❌ +`SITS`_,R Torch,GDAL,-,tidyverse,22,0,❌,✅,✅,✅ +`TerraTorch`_,PyTorch,"GDAL, h5py, pandas, xarray",R-tree,Albumentations,16,1,✅,✅,❌,🚧 diff --git a/docs/user/metrics/github.csv b/docs/user/metrics/github.csv new file mode 100644 index 00000000000..47b5798b7e7 --- /dev/null +++ b/docs/user/metrics/github.csv @@ -0,0 +1,9 @@ +Library,Contributors,Forks,Watchers,Stars,Issues,PRs,Releases,Commits,Core SLOCs,Test SLOCs,Test Coverage,License +`TorchGeo`_,72,308,44,"2,409",419,"1,714",11,"2,074","30,761","16,058",100%,MIT +`eo-learn`_,40,300,46,"1,108",159,638,44,"2,470","8,207","5,932",92%,MIT +`Raster Vision`_,32,381,71,"2,046",697,"1,382",22,"3,614","22,779","9,429",90%,Apache-2.0 +`PaddleRS`_,23,89,13,374,91,116,3,644,"21,859","3,384",48%,Apache-2.0 +`segment-geospatial`_,17,281,55,"2,834",129,104,27,186,"5,598",92,22%,MIT +`DeepForest`_,17,172,17,474,413,301,44,864,"3,357","1,794",86%,MIT +`SITS`_,14,76,28,451,622,583,44,"6,244","24,284","8,697",94%,GPL-2.0 +`TerraTorch`_,9,10,9,121,46,92,2,243,"10,101",583,44%,Apache-2.0 From c5380abe28a5c3ac20753231ae876a9df4481355 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 31 Aug 2024 14:38:28 +0200 Subject: [PATCH 3/6] Docs: fix broken links and redirects (#2267) --- docs/tutorials/pretrained_weights.ipynb | 2 +- docs/user/contributing.rst | 10 +++++----- docs/user/installation.rst | 6 +++--- pyproject.toml | 2 +- torchgeo/__init__.py | 4 ++-- torchgeo/datasets/advance.py | 4 ++-- torchgeo/datasets/cdl.py | 4 ++-- torchgeo/datasets/chesapeake.py | 4 ++-- torchgeo/datasets/deepglobelandcover.py | 2 +- torchgeo/datasets/dfc2022.py | 2 +- torchgeo/datasets/enviroatlas.py | 2 +- torchgeo/datasets/eudem.py | 13 ++----------- torchgeo/datasets/idtrees.py | 4 ++-- torchgeo/datasets/inaturalist.py | 2 +- torchgeo/datasets/loveda.py | 6 +++--- torchgeo/datasets/openbuildings.py | 10 +++++----- torchgeo/datasets/pastis.py | 2 +- torchgeo/datasets/reforestree.py | 2 +- torchgeo/datasets/seco.py | 6 +++--- torchgeo/datasets/sentinel.py | 22 +++++++++++----------- torchgeo/models/farseg.py | 2 +- torchgeo/models/resnet.py | 12 ++++++------ torchgeo/models/vit.py | 2 +- torchgeo/trainers/byol.py | 2 +- torchgeo/transforms/indices.py | 2 +- 25 files changed, 60 insertions(+), 69 deletions(-) diff --git a/docs/tutorials/pretrained_weights.ipynb b/docs/tutorials/pretrained_weights.ipynb index 28b354efee6..0c2c4a0fc48 100644 --- a/docs/tutorials/pretrained_weights.ipynb +++ b/docs/tutorials/pretrained_weights.ipynb @@ -215,7 +215,7 @@ "id": "dWidC6vDrMON" }, "source": [ - "If you do not want to utilize the `ClassificationTask` functionality for your experiments, you can also just create a [timm](https://github.com/rwightman/pytorch-image-models) model with pretrained weights from TorchGeo as follows:" + "If you do not want to utilize the `ClassificationTask` functionality for your experiments, you can also just create a [timm](https://github.com/huggingface/pytorch-image-models) model with pretrained weights from TorchGeo as follows:" ] }, { diff --git a/docs/user/contributing.rst b/docs/user/contributing.rst index 5e44212d884..91b8b4d3ab4 100644 --- a/docs/user/contributing.rst +++ b/docs/user/contributing.rst @@ -52,7 +52,7 @@ Tests TorchGeo uses `GitHub Actions `_ for Continuous Integration. We run a suite of unit tests on every commit to ensure that pull requests don't break anything. If you submit a pull request that adds or modifies any Python code, we require unit tests for that code before the pull request can be merged. -For example, if you add a new dataset in ``torchgeo/datasets/foo.py``, you'll need to create corresponding unit tests in ``tests/datasets/test_foo.py``. The easiest way to do this is to find unit tests for similar datasets and modify them for your dataset. These tests can then be run with `pytest `_: +For example, if you add a new dataset in ``torchgeo/datasets/foo.py``, you'll need to create corresponding unit tests in ``tests/datasets/test_foo.py``. The easiest way to do this is to find unit tests for similar datasets and modify them for your dataset. These tests can then be run with `pytest `_: .. code-block:: console @@ -79,7 +79,7 @@ For example, if you add a new dataset in ``torchgeo/datasets/foo.py``, you'll ne From this output, you can see that all tests pass, but many lines of code in ``torchgeo/datasets/foo.py`` are not being tested, including 376--403, 429--496, etc. In order for this pull request to be merged, additional tests will need to be added until there is 100% test coverage. -These tests require `pytest `_ and `pytest-cov `_ to be installed. +These tests require `pytest `_ and `pytest-cov `_ to be installed. .. note:: If you add a new dataset, the tests will require some form of data to run. This data should be stored in ``tests/data/``. Please don't include real data, as this may violate the license the data is distributed under, and can involve very large file sizes. Instead, create fake data examples using the instructions found `here `__. @@ -91,7 +91,7 @@ Linters In order to remain `PEP-8 `_ compliant and maintain a high-quality codebase, we use a couple of linting tools: * `ruff `_ for code formatting -* `mypy `_ for static type analysis +* `mypy `_ for static type analysis * `prettier `_ for code formatting These tools should be used from the root of the project to ensure that our configuration files are found. Ruff is relatively easy to use, and will automatically fix most issues it encounters: @@ -142,7 +142,7 @@ Now, every time you run ``git commit``, pre-commit will run and let you know if Documentation ------------- -All of our documentation is hosted on `Read the Docs `_. If you make non-trivial changes to the documentation, it helps to build the documentation yourself locally. To do this, make sure the dependencies are installed: +All of our documentation is hosted on `Read the Docs `_. If you make non-trivial changes to the documentation, it helps to build the documentation yourself locally. To do this, make sure the dependencies are installed: .. code-block:: console @@ -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 `_. These Jupyter notebooks are tested before each release to make sure that they still run properly. To test these locally, install `pytest `_ and `nbmake `_ and run: +TorchGeo has a number of tutorials included in the documentation that can be run in `Google Colab `_. These Jupyter notebooks are tested before each release to make sure that they still run properly. To test these locally, install `pytest `_ and `nbmake `_ and run: .. code-block:: console diff --git a/docs/user/installation.rst b/docs/user/installation.rst index 3dd5545b774..9a96af95534 100644 --- a/docs/user/installation.rst +++ b/docs/user/installation.rst @@ -1,7 +1,7 @@ Installation ============ -TorchGeo is simple and easy to install. We support installation using the `pip `_, `conda `_, and `spack `_ package managers. +TorchGeo is simple and easy to install. We support installation using the `pip `_, `conda `_, and `spack `_ package managers. pip --- @@ -34,7 +34,7 @@ By default, only required dependencies are installed. TorchGeo has a number of o $ pip install torchgeo[style,tests] $ pip install torchgeo[all] -See the ``pyproject.toml`` for a complete list of options. See the `pip documentation `_ for more details. +See the ``pyproject.toml`` for a complete list of options. See the `pip documentation `_ for more details. conda ----- @@ -82,4 +82,4 @@ Optional dependencies can be installed by enabling build variants: $ spack install py-torchgeo+datasets $ spack install py-torchgeo+style+tests -Run ``spack info py-torchgeo`` for a complete list of variants. See the `spack documentation `_ for more details. +Run ``spack info py-torchgeo`` for a complete list of variants. See the `spack documentation `_ for more details. diff --git a/pyproject.toml b/pyproject.toml index 66d10bab841..97d326961de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -189,7 +189,7 @@ filterwarnings = [ # https://github.com/pytorch/vision/pull/5898 "ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:torchvision.transforms.functional_pil", "ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:torchvision.transforms._functional_pil", - # https://github.com/rwightman/pytorch-image-models/pull/1256 + # https://github.com/huggingface/pytorch-image-models/pull/1256 "ignore:.* is deprecated and will be removed in Pillow 10:DeprecationWarning:timm.data", # https://github.com/pytorch/pytorch/issues/72906 # https://github.com/pytorch/pytorch/pull/69823 diff --git a/torchgeo/__init__.py b/torchgeo/__init__.py index 21e4dc5ee3f..5574da2f7eb 100644 --- a/torchgeo/__init__.py +++ b/torchgeo/__init__.py @@ -3,8 +3,8 @@ """TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data. -This library is part of the `PyTorch `_ project. PyTorch is an open -source machine learning framework. +This library is part of the `PyTorch `_ project. PyTorch is an +open source machine learning framework. The :mod:`torchgeo` package consists of popular datasets, model architectures, and common image transformations for geospatial data. diff --git a/torchgeo/datasets/advance.py b/torchgeo/datasets/advance.py index b46695957be..c9fcea22a01 100644 --- a/torchgeo/datasets/advance.py +++ b/torchgeo/datasets/advance.py @@ -64,8 +64,8 @@ class ADVANCE(NonGeoDataset): """ urls = ( - 'https://zenodo.org/record/3828124/files/ADVANCE_vision.zip?download=1', - 'https://zenodo.org/record/3828124/files/ADVANCE_sound.zip?download=1', + 'https://zenodo.org/records/3828124/files/ADVANCE_vision.zip?download=1', + 'https://zenodo.org/records/3828124/files/ADVANCE_sound.zip?download=1', ) filenames = ('ADVANCE_vision.zip', 'ADVANCE_sound.zip') md5s = ('a9e8748219ef5864d3b5a8979a67b471', 'a2d12f2d2a64f5c3d3a9d8c09aaf1c31') diff --git a/torchgeo/datasets/cdl.py b/torchgeo/datasets/cdl.py index 07bd8193b79..6cd2b483062 100644 --- a/torchgeo/datasets/cdl.py +++ b/torchgeo/datasets/cdl.py @@ -22,7 +22,7 @@ class CDL(RasterDataset): """Cropland Data Layer (CDL) dataset. The `Cropland Data Layer - `__, hosted on + `__, hosted on `CropScape `_, provides a raster, geo-referenced, crop-specific land cover map for the continental United States. The CDL also includes a crop mask layer and planting frequency layers, as well as @@ -37,7 +37,7 @@ class CDL(RasterDataset): If you use this dataset in your research, please cite it using the following format: - * https://www.nass.usda.gov/Research_and_Science/Cropland/sarsfaqs2.php#Section1_14.0 + * https://www.nass.usda.gov/Research_and_Science/Cropland/sarsfaqs2.php#what.1 """ filename_glob = '*_30m_cdls.tif' diff --git a/torchgeo/datasets/chesapeake.py b/torchgeo/datasets/chesapeake.py index 46dbaefc806..33a347576f9 100644 --- a/torchgeo/datasets/chesapeake.py +++ b/torchgeo/datasets/chesapeake.py @@ -330,7 +330,7 @@ class ChesapeakeCVPR(GeoDataset): additional layer of data to this dataset containing a prior over the Chesapeake Bay land cover classes generated from the NLCD land cover labels. For more information about this layer see `the dataset documentation - `_. + `_. If you use this dataset in your research, please cite the following paper: @@ -340,7 +340,7 @@ class ChesapeakeCVPR(GeoDataset): subdatasets = ('base', 'prior_extension') urls: ClassVar[dict[str, str]] = { 'base': 'https://lilablobssc.blob.core.windows.net/lcmcvpr2019/cvpr_chesapeake_landcover.zip', - 'prior_extension': 'https://zenodo.org/record/5866525/files/cvpr_chesapeake_landcover_prior_extension.zip?download=1', + 'prior_extension': 'https://zenodo.org/records/5866525/files/cvpr_chesapeake_landcover_prior_extension.zip?download=1', } filenames: ClassVar[dict[str, str]] = { 'base': 'cvpr_chesapeake_landcover.zip', diff --git a/torchgeo/datasets/deepglobelandcover.py b/torchgeo/datasets/deepglobelandcover.py index 51b82f9ff92..47ef6f15ce3 100644 --- a/torchgeo/datasets/deepglobelandcover.py +++ b/torchgeo/datasets/deepglobelandcover.py @@ -61,7 +61,7 @@ class DeepGlobeLandCover(NonGeoDataset): If you use this dataset in your research, please cite the following paper: - * https://arxiv.org/pdf/1805.06561.pdf + * https://arxiv.org/pdf/1805.06561 .. note:: diff --git a/torchgeo/datasets/dfc2022.py b/torchgeo/datasets/dfc2022.py index edc79d8ae2b..6886ea6b1d3 100644 --- a/torchgeo/datasets/dfc2022.py +++ b/torchgeo/datasets/dfc2022.py @@ -43,7 +43,7 @@ class DFC2022(NonGeoDataset): * DEMs collected from the `IGN RGE ALTI database `_ * Labels collected from the - `UrbanAtlas 2012 database `_ + `UrbanAtlas 2012 database `_ * Data collected from 19 regions in France Dataset format: diff --git a/torchgeo/datasets/enviroatlas.py b/torchgeo/datasets/enviroatlas.py index 5e6d4b80d99..b8af4aef70e 100644 --- a/torchgeo/datasets/enviroatlas.py +++ b/torchgeo/datasets/enviroatlas.py @@ -47,7 +47,7 @@ class EnviroAtlas(GeoDataset): .. versionadded:: 0.3 """ - url = 'https://zenodo.org/record/5778193/files/enviroatlas_lotp.zip?download=1' + url = 'https://zenodo.org/records/5778193/files/enviroatlas_lotp.zip?download=1' filename = 'enviroatlas_lotp.zip' md5 = 'bfe601be21c7c001315fc6154be8ef14' diff --git a/torchgeo/datasets/eudem.py b/torchgeo/datasets/eudem.py index 1d65a55f60c..765433bfc05 100644 --- a/torchgeo/datasets/eudem.py +++ b/torchgeo/datasets/eudem.py @@ -21,13 +21,8 @@ class EUDEM(RasterDataset): """European Digital Elevation Model (EU-DEM) Dataset. - The `EU-DEM - `__ - dataset is a Digital Elevation Model of reference for the entire European region. - The dataset can be downloaded from this `website - `_ - after making an account. A dataset factsheet is available - `here `__. + `EU-DEM `__ + is a Digital Elevation Model of reference for the entire European region. Dataset features: @@ -41,10 +36,6 @@ class EUDEM(RasterDataset): * DEMs are single-channel tif files - If you use this dataset in your research, please give credit to: - - * `Copernicus `_ - .. versionadded:: 0.3 """ diff --git a/torchgeo/datasets/idtrees.py b/torchgeo/datasets/idtrees.py index 6157579eb1b..28e890dc69f 100644 --- a/torchgeo/datasets/idtrees.py +++ b/torchgeo/datasets/idtrees.py @@ -137,12 +137,12 @@ class IDTReeS(NonGeoDataset): } metadata: ClassVar[dict[str, dict[str, str]]] = { 'train': { - 'url': 'https://zenodo.org/record/3934932/files/IDTREES_competition_train_v2.zip?download=1', + 'url': 'https://zenodo.org/records/3934932/files/IDTREES_competition_train_v2.zip?download=1', 'md5': '5ddfa76240b4bb6b4a7861d1d31c299c', 'filename': 'IDTREES_competition_train_v2.zip', }, 'test': { - 'url': 'https://zenodo.org/record/3934932/files/IDTREES_competition_test_v2.zip?download=1', + 'url': 'https://zenodo.org/records/3934932/files/IDTREES_competition_test_v2.zip?download=1', 'md5': 'b108931c84a70f2a38a8234290131c9b', 'filename': 'IDTREES_competition_test_v2.zip', }, diff --git a/torchgeo/datasets/inaturalist.py b/torchgeo/datasets/inaturalist.py index f33f2d14d57..bb5cfe3c8df 100644 --- a/torchgeo/datasets/inaturalist.py +++ b/torchgeo/datasets/inaturalist.py @@ -26,7 +26,7 @@ class INaturalist(GeoDataset): If you use an iNaturalist dataset in your research, please cite it according to: - * https://www.inaturalist.org/pages/help#cite + * https://help.inaturalist.org/en/support/solutions/articles/151000170344-how-should-i-cite-inaturalist- .. versionadded:: 0.3 """ diff --git a/torchgeo/datasets/loveda.py b/torchgeo/datasets/loveda.py index 0398410a674..93b6b18e455 100644 --- a/torchgeo/datasets/loveda.py +++ b/torchgeo/datasets/loveda.py @@ -63,17 +63,17 @@ class LoveDA(NonGeoDataset): info_dict: ClassVar[dict[str, dict[str, str]]] = { 'train': { - 'url': 'https://zenodo.org/record/5706578/files/Train.zip?download=1', + 'url': 'https://zenodo.org/records/5706578/files/Train.zip?download=1', 'filename': 'Train.zip', 'md5': 'de2b196043ed9b4af1690b3f9a7d558f', }, 'val': { - 'url': 'https://zenodo.org/record/5706578/files/Val.zip?download=1', + 'url': 'https://zenodo.org/records/5706578/files/Val.zip?download=1', 'filename': 'Val.zip', 'md5': '84cae2577468ff0b5386758bb386d31d', }, 'test': { - 'url': 'https://zenodo.org/record/5706578/files/Test.zip?download=1', + 'url': 'https://zenodo.org/records/5706578/files/Test.zip?download=1', 'filename': 'Test.zip', 'md5': 'a489be0090465e01fb067795d24e6b47', }, diff --git a/torchgeo/datasets/openbuildings.py b/torchgeo/datasets/openbuildings.py index f19f4c9a2ce..50b35ee39db 100644 --- a/torchgeo/datasets/openbuildings.py +++ b/torchgeo/datasets/openbuildings.py @@ -32,7 +32,7 @@ class OpenBuildings(VectorDataset): r"""Open Buildings dataset. The `Open Buildings - `__ dataset + `__ dataset consists of computer generated building detections across the African continent. Dataset features: @@ -48,10 +48,10 @@ class OpenBuildings(VectorDataset): * meta data geojson file The data can be downloaded from `here - `__. Additionally, the - `meta data geometry file - `_ also needs to be - placed in `root` as `tiles.geojson`. + `__. + Additionally, the `meta data geometry file + `_ + also needs to be placed in `root` as `tiles.geojson`. If you use this dataset in your research, please cite the following technical report: diff --git a/torchgeo/datasets/pastis.py b/torchgeo/datasets/pastis.py index 430a6330d89..06f716a9ffb 100644 --- a/torchgeo/datasets/pastis.py +++ b/torchgeo/datasets/pastis.py @@ -117,7 +117,7 @@ class PASTIS(NonGeoDataset): } directory = 'PASTIS-R' filename = 'PASTIS-R.zip' - url = 'https://zenodo.org/record/5735646/files/PASTIS-R.zip?download=1' + url = 'https://zenodo.org/records/5735646/files/PASTIS-R.zip?download=1' md5 = '4887513d6c2d2b07fa935d325bd53e09' prefix: ClassVar[dict[str, str]] = { 's2': os.path.join('DATA_S2', 'S2_'), diff --git a/torchgeo/datasets/reforestree.py b/torchgeo/datasets/reforestree.py index 930799ed205..1c46c450191 100644 --- a/torchgeo/datasets/reforestree.py +++ b/torchgeo/datasets/reforestree.py @@ -57,7 +57,7 @@ class ReforesTree(NonGeoDataset): """ classes = ('other', 'banana', 'cacao', 'citrus', 'fruit', 'timber') - url = 'https://zenodo.org/record/6813783/files/reforesTree.zip?download=1' + url = 'https://zenodo.org/records/6813783/files/reforesTree.zip?download=1' md5 = 'f6a4a1d8207aeaa5fbab7b21b683a302' zipfilename = 'reforesTree.zip' diff --git a/torchgeo/datasets/seco.py b/torchgeo/datasets/seco.py index 0d1df7f7bbe..c67fecb9c8e 100644 --- a/torchgeo/datasets/seco.py +++ b/torchgeo/datasets/seco.py @@ -35,7 +35,7 @@ class SeasonalContrastS2(NonGeoDataset): If you use this dataset in your research, please cite the following paper: - * https://arxiv.org/pdf/2103.16607.pdf + * https://arxiv.org/pdf/2103.16607 """ all_bands = ( @@ -56,13 +56,13 @@ class SeasonalContrastS2(NonGeoDataset): metadata: ClassVar[dict[str, dict[str, str]]] = { '100k': { - 'url': 'https://zenodo.org/record/4728033/files/seco_100k.zip?download=1', + 'url': 'https://zenodo.org/records/4728033/files/seco_100k.zip?download=1', 'md5': 'ebf2d5e03adc6e657f9a69a20ad863e0', 'filename': 'seco_100k.zip', 'directory': 'seasonal_contrast_100k', }, '1m': { - 'url': 'https://zenodo.org/record/4728033/files/seco_1m.zip?download=1', + 'url': 'https://zenodo.org/records/4728033/files/seco_1m.zip?download=1', 'md5': '187963d852d4d3ce6637743ec3a4bd9e', 'filename': 'seco_1m.zip', 'directory': 'seasonal_contrast_1m', diff --git a/torchgeo/datasets/sentinel.py b/torchgeo/datasets/sentinel.py index 3dc5fc31771..79637931adb 100644 --- a/torchgeo/datasets/sentinel.py +++ b/torchgeo/datasets/sentinel.py @@ -25,7 +25,7 @@ class Sentinel(RasterDataset): If you use this dataset in your research, please cite it using the following format: - * https://asf.alaska.edu/data-sets/sar-data-sets/sentinel-1/sentinel-1-how-to-cite/ + * https://asf.alaska.edu/datasets/daac/sentinel-1/ """ @@ -33,7 +33,7 @@ class Sentinel1(Sentinel): r"""Sentinel-1 dataset. The `Sentinel-1 mission - `_ comprises a + `_ comprises a constellation of two polar-orbiting satellites, operating day and night performing C-band synthetic aperture radar imaging, enabling them to acquire imagery regardless of the weather. @@ -50,16 +50,16 @@ class Sentinel1(Sentinel): Product Types: * `Level-0 - `_: + `_: Raw (RAW) * `Level-1 - `_: + `_: Single Look Complex (SLC) * `Level-1 - `_: + `_: Ground Range Detected (GRD) * `Level-2 - `_: + `_: Ocean (OCN) Polarizations: @@ -72,13 +72,13 @@ class Sentinel1(Sentinel): Acquisition Modes: * `Stripmap (SM) - `_ + `_ * `Interferometric Wide (IW) swath - `_ + `_ * `Extra Wide (EW) swatch - `_ + `_ * `Wave (WV) - `_ + `_ .. note:: At the moment, this dataset only supports the GRD product type. Data must be @@ -255,7 +255,7 @@ class Sentinel2(Sentinel): """Sentinel-2 dataset. The `Copernicus Sentinel-2 mission - `_ comprises a + `_ comprises a constellation of two polar-orbiting satellites placed in the same sun-synchronous orbit, phased at 180° to each other. It aims at monitoring variability in land surface conditions, and its wide swath width (290 km) and high revisit time (10 days diff --git a/torchgeo/models/farseg.py b/torchgeo/models/farseg.py index f57f59cde5f..dc25858abf6 100644 --- a/torchgeo/models/farseg.py +++ b/torchgeo/models/farseg.py @@ -36,7 +36,7 @@ class FarSeg(Module): If you use this model in your research, please cite the following paper: - * https://arxiv.org/pdf/2011.09766.pdf + * https://arxiv.org/pdf/2011.09766 """ def __init__( diff --git a/torchgeo/models/resnet.py b/torchgeo/models/resnet.py index 7429251c731..b61e816ea28 100644 --- a/torchgeo/models/resnet.py +++ b/torchgeo/models/resnet.py @@ -122,7 +122,7 @@ class ResNet18_Weights(WeightsEnum): # type: ignore[misc] """ResNet-18 weights. - For `timm `_ + For `timm `_ *resnet18* implementation. .. versionadded:: 0.4 @@ -301,7 +301,7 @@ class ResNet18_Weights(WeightsEnum): # type: ignore[misc] class ResNet50_Weights(WeightsEnum): # type: ignore[misc] """ResNet-50 weights. - For `timm `_ + For `timm `_ *resnet50* implementation. .. versionadded:: 0.4 @@ -597,7 +597,7 @@ class ResNet50_Weights(WeightsEnum): # type: ignore[misc] class ResNet152_Weights(WeightsEnum): # type: ignore[misc] """ResNet-152 weights. - For `timm `_ + For `timm `_ *resnet152* implementation. .. versionadded:: 0.6 @@ -663,7 +663,7 @@ def resnet18( If you use this model in your research, please cite the following paper: - * https://arxiv.org/pdf/1512.03385.pdf + * https://arxiv.org/pdf/1512.03385 .. versionadded:: 0.4 @@ -697,7 +697,7 @@ def resnet50( If you use this model in your research, please cite the following paper: - * https://arxiv.org/pdf/1512.03385.pdf + * https://arxiv.org/pdf/1512.03385 .. versionchanged:: 0.4 Switched to multi-weight support API. @@ -732,7 +732,7 @@ def resnet152( If you use this model in your research, please cite the following paper: - * https://arxiv.org/pdf/1512.03385.pdf + * https://arxiv.org/pdf/1512.03385 .. versionadded:: 0.6 diff --git a/torchgeo/models/vit.py b/torchgeo/models/vit.py index 1878883f484..13785af416e 100644 --- a/torchgeo/models/vit.py +++ b/torchgeo/models/vit.py @@ -37,7 +37,7 @@ class ViTSmall16_Weights(WeightsEnum): # type: ignore[misc] """Vision Transformer Small Patch Size 16 weights. - For `timm `_ + For `timm `_ *vit_small_patch16_224* implementation. .. versionadded:: 0.4 diff --git a/torchgeo/trainers/byol.py b/torchgeo/trainers/byol.py index 35243eaa545..38aac522b9d 100644 --- a/torchgeo/trainers/byol.py +++ b/torchgeo/trainers/byol.py @@ -286,7 +286,7 @@ class BYOLTask(BaseTask): Reference implementation: - * https://github.com/deepmind/deepmind-research/tree/master/byol + * https://github.com/google-deepmind/deepmind-research/tree/master/byol If you use this trainer in your research, please cite the following paper: diff --git a/torchgeo/transforms/indices.py b/torchgeo/transforms/indices.py index d04385d6ad1..ac3fee56fff 100644 --- a/torchgeo/transforms/indices.py +++ b/torchgeo/transforms/indices.py @@ -74,7 +74,7 @@ class AppendNBR(AppendNormalizedDifferenceIndex): If you use this index in your research, please cite the following paper: - * https://www.sciencebase.gov/catalog/item/4f4e4b20e4b07f02db6abb36 + * https://www.yumpu.com/en/document/view/24226870/the-normalized-burn-ratio-and-relationships-to-burn-severity-/7 .. versionadded:: 0.2 """ From 03faab9c5c048d2f324d6a1e8bb6f412b80a0b2a Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sun, 1 Sep 2024 11:43:07 +0200 Subject: [PATCH 4/6] DOFA: fix bug in patch embedding (#2256) * DOFA: fix bug in patch embedding * Update checkpoints --- docs/api/weights/agnostic.csv | 4 ++-- torchgeo/models/dofa.py | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/api/weights/agnostic.csv b/docs/api/weights/agnostic.csv index 5937da65018..e06f47e2dc8 100644 --- a/docs/api/weights/agnostic.csv +++ b/docs/api/weights/agnostic.csv @@ -1,5 +1,5 @@ Weight,Source,Citation,License,Spatial,Temporal,Spectral,m-bigearthnet,m-forestnet,m-brick-kiln,m-pv4ger,m-so2sat,m-eurosat,m-pv4ger-seg,m-nz-cattle,m-NeonTree,m-cashew-plant,m-SA-crop,m-chesapeake -DOFABase16_Weights.DOFA_MAE,`link `__,`link `__,CC-BY-4.0,implicit,-,explicit,63.8,45.3,94.7,96.9,52.1,92.2,94.7,81.6,58.6,48.3,31.3,65.4 -DOFALarge16_Weights.DOFA_MAE,`link `__,`link `__,CC-BY-4.0,implicit,-,explicit,64.4,47.4,95.1,97.3,59.3,93.8,95.0,81.7,59.1,53.8,32.1,66.3 +DOFABase16_Weights.DOFA_MAE,`link `__,`link `__,CC-BY-4.0,implicit,-,explicit,65.7,50.9,95.8,96.9,55.1,93.9,94.5,81.4,58.8,51.5,33.0,65.3 +DOFALarge16_Weights.DOFA_MAE,`link `__,`link `__,CC-BY-4.0,implicit,-,explicit,67.5,54.6,96.9,97.3,60.1,97.1,95.0,81.8,59.4,56.9,32.1,66.3 ResNet50_Weights.FMOW_RGB_GASSL,`link `__,`link `__,-,implicit,-,-,,,,,,,,,,,, ScaleMAE_ViTLarge16_Weights.FMOW_RGB_SCALEMAE,`link `__,`link `__,CC-BY-NC-4.0,explicit,-,-,,,,,,,,,,, diff --git a/torchgeo/models/dofa.py b/torchgeo/models/dofa.py index e82fbd574bd..cdbd8242873 100644 --- a/torchgeo/models/dofa.py +++ b/torchgeo/models/dofa.py @@ -203,8 +203,10 @@ def forward(self, x: Tensor, wavelengths: Tensor) -> tuple[Tensor, Tensor]: weight, bias = self.weight_generator(waves) # 3x3x3 dynamic_weight = weight.view( - self.embed_dim, inplanes, self.kernel_size, self.kernel_size - ) # 3xoutdx16x16 + inplanes, self.kernel_size, self.kernel_size, self.embed_dim + ) + dynamic_weight = dynamic_weight.permute([3, 0, 1, 2]) + if bias is not None: bias = bias.view([self.embed_dim]) * self.scaler @@ -384,7 +386,7 @@ class DOFABase16_Weights(WeightsEnum): # type: ignore[misc] """ DOFA_MAE = Weights( - url='https://hf.co/torchgeo/dofa/resolve/ade8745c5ec6eddfe15d8c03421e8cb8f21e66ff/dofa_base_patch16_224-7cc0f413.pth', + url='https://hf.co/torchgeo/dofa/resolve/b8db318b64a90b9e085ec04ba8851233c5893666/dofa_base_patch16_224-a0275954.pth', transforms=_dofa_transforms, meta={ 'dataset': 'SatlasPretrain, Five-Billion-Pixels, HySpecNet-11k', @@ -403,7 +405,7 @@ class DOFALarge16_Weights(WeightsEnum): # type: ignore[misc] """ DOFA_MAE = Weights( - url='https://hf.co/torchgeo/dofa/resolve/ade8745c5ec6eddfe15d8c03421e8cb8f21e66ff/dofa_large_patch16_224-fbd47fa9.pth', + url='https://hf.co/torchgeo/dofa/resolve/b8db318b64a90b9e085ec04ba8851233c5893666/dofa_large_patch16_224-0ff904d3.pth', transforms=_dofa_transforms, meta={ 'dataset': 'SatlasPretrain, Five-Billion-Pixels, HySpecNet-11k', From bcb959ab2da5ae199b750d518d7cf7ee487e2235 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sun, 1 Sep 2024 12:06:26 +0200 Subject: [PATCH 5/6] 0.6.0 release (#2265) * 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 --- .github/release.yml | 2 +- docs/conf.py | 3 +-- docs/user/contributing.rst | 6 +++--- pyproject.toml | 5 ++++- tests/conftest.py | 6 ++++++ torchgeo/__init__.py | 2 +- torchgeo/datamodules/digital_typhoon.py | 5 ++++- torchgeo/datamodules/geonrw.py | 2 +- torchgeo/datasets/eurocrops.py | 5 +++-- torchgeo/datasets/levircd.py | 2 -- torchgeo/trainers/byol.py | 4 ++-- torchgeo/trainers/segmentation.py | 4 ++-- 12 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index 76caf0a585e..8ca5b59679c 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,7 +1,7 @@ changelog: exclude: authors: - - dependabot[bot] + - app/dependabot categories: - title: Backwards-incompatible changes labels: diff --git a/docs/conf.py b/docs/conf.py index ec721bfff9d..4078970c2e4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 diff --git a/docs/user/contributing.rst b/docs/user/contributing.rst index 91b8b4d3ab4..2d5b173cc15 100644 --- a/docs/user/contributing.rst +++ b/docs/user/contributing.rst @@ -88,7 +88,7 @@ These tests require `pytest `_ and `pytest-c Linters ------- -In order to remain `PEP-8 `_ compliant and maintain a high-quality codebase, we use a couple of linting tools: +In order to remain `PEP-8 `_ compliant and maintain a high-quality codebase, we use a few linting tools: * `ruff `_ for code formatting * `mypy `_ for static type analysis @@ -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: @@ -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 `_. These Jupyter notebooks are tested before each release to make sure that they still run properly. To test these locally, install `pytest `_ and `nbmake `_ and run: +TorchGeo has a number of tutorials included in the documentation that can be run in `Lightning Studios `_ and `Google Colab `_. These Jupyter notebooks are tested before each release to make sure that they still run properly. To test these locally, install `pytest `_ and `nbmake `_ and run: .. code-block:: console diff --git a/pyproject.toml b/pyproject.toml index 97d326961de..3a2c2319ee6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index 7d622c3977c..1f5c09a8bb0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 @@ -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] diff --git a/torchgeo/__init__.py b/torchgeo/__init__.py index 5574da2f7eb..8b36139d831 100644 --- a/torchgeo/__init__.py +++ b/torchgeo/__init__.py @@ -11,4 +11,4 @@ """ __author__ = 'Adam J. Stewart' -__version__ = '0.6.0.dev0' +__version__ = '0.6.0' diff --git a/torchgeo/datamodules/digital_typhoon.py b/torchgeo/datamodules/digital_typhoon.py index 11874aba8de..ce799bf3d52 100644 --- a/torchgeo/datamodules/digital_typhoon.py +++ b/torchgeo/datamodules/digital_typhoon.py @@ -16,7 +16,10 @@ class DigitalTyphoonDataModule(NonGeoDataModule): - """Digital Typhoon Data Module.""" + """Digital Typhoon Data Module. + + .. versionadded:: 0.6 + """ valid_split_types = ('time', 'typhoon_id') diff --git a/torchgeo/datamodules/geonrw.py b/torchgeo/datamodules/geonrw.py index 8540b8276c2..c67753673ac 100644 --- a/torchgeo/datamodules/geonrw.py +++ b/torchgeo/datamodules/geonrw.py @@ -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__( diff --git a/torchgeo/datasets/eurocrops.py b/torchgeo/datasets/eurocrops.py index cb5bb2a5bc5..d2087e4b38d 100644 --- a/torchgeo/datasets/eurocrops.py +++ b/torchgeo/datasets/eurocrops.py @@ -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 """ diff --git a/torchgeo/datasets/levircd.py b/torchgeo/datasets/levircd.py index e664365ab2d..fdff569dc19 100644 --- a/torchgeo/datasets/levircd.py +++ b/torchgeo/datasets/levircd.py @@ -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' diff --git a/torchgeo/trainers/byol.py b/torchgeo/trainers/byol.py index 38aac522b9d..6cd4f50f8c5 100644 --- a/torchgeo/trainers/byol.py +++ b/torchgeo/trainers/byol.py @@ -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__( diff --git a/torchgeo/trainers/segmentation.py b/torchgeo/trainers/segmentation.py index afd71521002..9eccda2f0f8 100644 --- a/torchgeo/trainers/segmentation.py +++ b/torchgeo/trainers/segmentation.py @@ -77,7 +77,7 @@ 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. @@ -85,7 +85,7 @@ class and used with 'ce' loss. *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') From 370e460d2fee4f7d08ed78ce576fba239f359333 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sun, 1 Sep 2024 12:37:30 +0200 Subject: [PATCH 6/6] Bump torchgeo version to 0.7.0.dev0 (#2268) --- torchgeo/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchgeo/__init__.py b/torchgeo/__init__.py index 8b36139d831..fb5ca15dd9c 100644 --- a/torchgeo/__init__.py +++ b/torchgeo/__init__.py @@ -11,4 +11,4 @@ """ __author__ = 'Adam J. Stewart' -__version__ = '0.6.0' +__version__ = '0.7.0.dev0'