Skip to content

Commit 8ac823c

Browse files
committed
Run mdformat and generalize noxfile.py
1 parent 10f29b6 commit 8ac823c

File tree

11 files changed

+112
-97
lines changed

11 files changed

+112
-97
lines changed

.mdformat.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
number = true
2+
extensions = ["gfm", "gfm_alerts"]

.pre-commit-config.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exclude: ^docs/|/migrations/|Makefile*
1+
exclude: "^docs/|/migrations/|Makefile*"
22
default_stages: [ commit ]
33

44
repos:
@@ -56,6 +56,21 @@ repos:
5656
hooks:
5757
- id: flynt
5858

59+
- repo: https://github.com/tcort/markdown-link-check
60+
rev: v3.13.7
61+
hooks:
62+
- id: markdown-link-check
63+
args: [ -q ]
64+
65+
- repo: https://github.com/hukkin/mdformat
66+
rev: 0.7.22
67+
hooks:
68+
- id: mdformat
69+
additional_dependencies:
70+
- mdformat-gfm
71+
- mdformat-gfm-alerts
72+
73+
5974
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
6075
ci:
6176
autoupdate_schedule: weekly

CHANGES.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
# CHANGES.md
22

33
[Unreleased](https://github.com/RolnickLab/geospatial-tools/tree/main) (latest)
4-
-------------------------------------------------------------------------------------
54

6-
* Refactor the stac.py module to extract logic that belongs more in raster.py
7-
* Update the makefile
8-
* Update the project dependencies
9-
* Add new QA tools : `autoflake`, `autopep8` and `ruff`
5+
______________________________________________________________________
6+
7+
- Refactor the stac.py module to extract logic that belongs more in raster.py
8+
- Update the makefile
9+
- Update the project dependencies
10+
- Add new QA tools : `autoflake`, `autopep8` and `ruff`
1011

1112
[0.1.3](https://github.com/RolnickLab/geospatial-tools/tree/0.1.3) (2024-09-23)
12-
-------------------------------------------------------------------------------------
13+
14+
______________________________________________________________________
1315

1416
- Convert project to use `nox` instead of `tox` for cluster storage optimization.
1517

1618
[0.1.2](https://github.com/RolnickLab/geospatial-tools/tree/0.1.2) (2024-09-23)
17-
-------------------------------------------------------------------------------------
1819

19-
- Fix `docformatter` with missing extra dependency for use with `pyproject.toml`
20+
______________________________________________________________________
2021

22+
- Fix `docformatter` with missing extra dependency for use with `pyproject.toml`
2123

2224
[0.1.1](https://github.com/RolnickLab/geospatial-tools/tree/0.1.1) (2024-09-20)
23-
-------------------------------------------------------------------------------------
25+
26+
______________________________________________________________________
2427

2528
- Fix `black` dependency that was not correctly setup in dev dependency group
2629

2730
[0.1.0](https://github.com/RolnickLab/geospatial-tools/tree/0.1.0) (2024-09-20)
28-
-------------------------------------------------------------------------------------
29-
31+
32+
______________________________________________________________________
33+
3034
- Add `resample_tiff_raster.py` script
3135
- Implement functions for clipping and reprojecting raster images
3236
- Implement vector functions for grid creation
@@ -35,4 +39,4 @@
3539
- Implement functions and scripts to search for and process Sentinel 2 products from
3640
Microsoft's Planetary Computer
3741
- Add examples of the above in Jupyter notebook formats
38-
- Add tests and notebook tests
42+
- Add tests and notebook tests

CONTRIBUTING.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,45 @@ To add a new dependency with a specific version:
1717
poetry add "<dependency_name>==<x.x.x>"
1818
```
1919

20-
To add a new dependency to a specific group of dependencies
20+
To add a new dependency to a specific group of dependencies
2121
(for example, the development dependencies):
2222

2323
```
2424
poetry add --group dev <dependency_name>
2525
```
2626

2727
## Design patterns
28+
2829
Two main considerations should be made when contributing to this package.
2930

3031
First, a polymorphic approach, using abstract classes and their concrete implementation,
3132
should be prioritized in order to increase maintainability and extensibility.
3233

3334
Therefore, new additions should try to follow this design pattern and either implement
34-
new concrete classes or create new abstract classes and their implementations for
35+
new concrete classes or create new abstract classes and their implementations for
3536
completely new behavior or needs.
3637

37-
Avoid multiple levels of inheritance; the approach should be _AbstractClass ->
38-
[ConcreteClass1, ConcreteClass2, ...]_ and not
38+
Avoid multiple levels of inheritance; the approach should be _AbstractClass ->
39+
[ConcreteClass1, ConcreteClass2, ...]_ and not
3940
_AbstractClass -> ChildClass -> GrandChildClass -> ..._
4041

41-
Next, a dependency-injection approach is to be preferred, as well as a composition
42+
Next, a dependency-injection approach is to be preferred, as well as a composition
4243
approach when creating new modules or extending existing ones.
4344

4445
Functional approaches are also acceptable when appropriate, but classes should still
45-
be used for data management/representation. This can be done with either regular
46+
be used for data management/representation. This can be done with either regular
4647
classes, `dataclasses`, or `pydantic` models.
4748

4849
## Tests
4950

50-
New contributions should include appropriate tests. Pytest is the preferred library to
51+
New contributions should include appropriate tests. Pytest is the preferred library to
5152
use for testing in this project.
5253

5354
To get started and to learn more about testing in Python:
5455

55-
* [Getting started with testing](https://realpython.com/python-testing/)
56-
* [Testing in the contest of Machine Learning](https://fullstackdeeplearning.com/course/2022/lecture-3-troubleshooting-and-testing/)
57-
* [Pytest Documentation](https://docs.pytest.org/en/stable/how-to/index.html)
56+
- [Getting started with testing](https://realpython.com/python-testing/)
57+
- [Testing in the contest of Machine Learning](https://fullstackdeeplearning.com/course/2022/lecture-3-troubleshooting-and-testing/)
58+
- [Pytest Documentation](https://docs.pytest.org/en/stable/how-to/index.html)
5859

5960
## Docstring and type hinting
6061

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ machine there's a good chance this will work.
1414

1515
The following Makefile files should not be modified, but can be consulted:
1616

17-
* [Makefile](Makefile) : Orchestration of the different files
18-
* [base.make](.make/base.make) : Shared utilities, project agnostic.
17+
- [Makefile](Makefile) : Orchestration of the different files
18+
- [base.make](.make/base.make) : Shared utilities, project agnostic.
1919

2020
The following Makefile files are project or user specific:
2121

22-
* [Makefile.variables](Makefile.variables) : Shared project variables.
23-
* [Makefile.targets](Makefile.targets) : Shared project targets.
24-
* [Makefile.private](Makefile.private.example) : User specific variables and targets.
25-
* This file is ignored by git and should never be committed, as it can also contain
26-
secrets.
27-
* You can create your own version locally by copying from
28-
[Makefile.private.example](Makefile.private.example)
22+
- [Makefile.variables](Makefile.variables) : Shared project variables.
23+
- [Makefile.targets](Makefile.targets) : Shared project targets.
24+
- [Makefile.private](Makefile.private.example) : User specific variables and targets.
25+
- This file is ignored by git and should never be committed, as it can also contain
26+
secrets.
27+
- You can create your own version locally by copying from
28+
[Makefile.private.example](Makefile.private.example)
2929

3030
## Basic Information
3131

@@ -49,8 +49,8 @@ streamlining script use as well as fix path issues related to imports.
4949

5050
If on a compute cluster, first load the appropriate python module:
5151

52-
* [How to create a virtual environment for the Mila cluster](docs/environment_creation_mila.md)
53-
* [How to create an environment for the DRAC cluster](docs/environment_creation_drac.md)
52+
- [How to create a virtual environment for the Mila cluster](docs/environment_creation_mila.md)
53+
- [How to create an environment for the DRAC cluster](docs/environment_creation_drac.md)
5454

5555
Installing `pipx` and `poetry`:
5656

@@ -97,9 +97,9 @@ on [how to use your poetry virtual environment](https://python-poetry.org/docs/b
9797

9898
You can:
9999

100-
* Use the `poetry run` command to access your executables
101-
* ex. `poetry run python your_script.py`, or `poetry run pylint src/`
102-
* Use the `poetry shell` command to activate and step in your project environment
100+
- Use the `poetry run` command to access your executables
101+
- ex. `poetry run python your_script.py`, or `poetry run pylint src/`
102+
- Use the `poetry shell` command to activate and step in your project environment
103103

104104
#### Conda
105105

@@ -114,7 +114,7 @@ If working on the Mila cluster, first load the appropriate module :
114114
make conda-create-env
115115
```
116116

117-
2. Activate `conda` environment (substitute with your <CONDA_TOOL> if something else
117+
2. Activate `conda` environment (substitute with your \<CONDA_TOOL> if something else
118118
than `conda`:
119119

120120
```
@@ -154,8 +154,8 @@ This also installs and configures the `pre-commit` hook. See ...
154154
This project assumes environment management will be done with `conda`, a classic
155155
python virtual environment, or directly through `poetry`.
156156

157-
* [Poetry](https://python-poetry.org/docs/basic-usage/)
158-
* [Conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html)
157+
- [Poetry](https://python-poetry.org/docs/basic-usage/)
158+
- [Conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html)
159159

160160
While it is possible to manage the environment with, for example, pyenv or virtualenv,
161161
those specific use cases are not supported by the Makefile and require users to set up
@@ -176,10 +176,10 @@ information.
176176

177177
Your project will need a virtual environment for your dependencies.
178178

179-
* [How to create a virtual environment for the Mila cluster](docs/environment_creation_mila.md)
180-
* [How to create an environment for the DRAC cluster](docs/environment_creation_drac.md)
181-
* [How to create a Conda environment](docs/conda_environment_creation.md)
182-
* [Migrating to DRAC from another environment](docs/migrating_to_drac.md)
179+
- [How to create a virtual environment for the Mila cluster](docs/environment_creation_mila.md)
180+
- [How to create an environment for the DRAC cluster](docs/environment_creation_drac.md)
181+
- [How to create a Conda environment](docs/conda_environment_creation.md)
182+
- [Migrating to DRAC from another environment](docs/migrating_to_drac.md)
183183

184184
There are different ways of managing your python version in these environments. On the
185185
clusters, you have access to different python modules, and through `conda` you have access

data/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
### International
66

7-
* [NASA's EarthData](https://www.earthdata.nasa.gov/)
8-
* [USGS Earth Explorer](https://earthexplorer.usgs.gov/)
9-
* [Copernicus Open Access Hub](https://scihub.copernicus.eu/)
10-
* [Climate Data Store](https://cds.climate.copernicus.eu/cdsapp#!/home)
7+
- [NASA's EarthData](https://www.earthdata.nasa.gov/)
8+
- [USGS Earth Explorer](https://earthexplorer.usgs.gov/)
9+
- [Copernicus Open Access Hub](https://scihub.copernicus.eu/)
10+
- [Climate Data Store](https://cds.climate.copernicus.eu/cdsapp#!/home)
1111

1212
## Satellite data
1313

@@ -25,9 +25,9 @@ The tiling grid can be found here in KML format : [](https://sentiwiki.copernicu
2525

2626
### Canada
2727

28-
* [GEO.ca](https://geo.ca/) : Canada's geographic information portal
29-
* [Données Québec](https://www.donneesquebec.ca/) : Quebec's open data portal
28+
- [GEO.ca](https://geo.ca/) : Canada's geographic information portal
29+
- [Données Québec](https://www.donneesquebec.ca/) : Quebec's open data portal
3030

3131
### USA
3232

33-
* [Cartographic Boundaries, Census Office](https://www.census.gov/geographies/mapping-files/time-series/geo/carto-boundary-file.html)
33+
- [Cartographic Boundaries, Census Office](https://www.census.gov/geographies/mapping-files/time-series/geo/carto-boundary-file.html)

notebooks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Notebooks
22

3-
Place to store all the project's notebooks
3+
Place to store all the project's notebooks

0 commit comments

Comments
 (0)