Skip to content

Commit 3ec43de

Browse files
authored
Update dev packages, lint files (#139)
* Update dev packages, lint files * Remove some pre-commit checks
1 parent c144031 commit 3ec43de

10 files changed

+105
-102
lines changed

.pre-commit-config.yaml

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
exclude: ^.*\.lock$
44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.6.0
6+
rev: v5.0.0
77
hooks:
8+
- id: check-added-large-files
9+
- id: check-ast
10+
- id: check-merge-conflict
11+
- id: debug-statements
12+
- id: mixed-line-ending
813
- id: trailing-whitespace
914
- id: end-of-file-fixer
10-
- repo: https://github.com/python-poetry/poetry
11-
rev: 1.8.0
12-
hooks:
13-
- id: poetry-check
14-
- id: poetry-lock
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.5.1
16+
rev: v0.9.4
1717
hooks:
1818
- id: ruff
19-
args: [ '--fix', '--select', 'I']
19+
types_or: [ python, pyi ]
20+
args: [ --fix ]
2021
- id: ruff-format
22+
types_or: [ python, pyi ]

conda/recipe.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,3 @@ about:
6161
extra:
6262
recipe-maintainers:
6363
- tayden
64-

docs/beginner_guide/execution.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ It is typical of many CLI tools to also have a `--help` option that can be used
2323
To get help documentation for the `kom` tool, you can type `kom --help` into your terminal.
2424

2525
??? tip "Shorthand flags"
26-
You can also use the shorthand flags `-h` to get help, e.g. `kom -h`. This is common for many CLI tools.
26+
You can also use the shorthand flags `-h` to get help, e.g. `kom -h`. This is common for many CLI tools.
2727
Options will be shown in the help documentation with both the long form (`--help`) and the shorthand form (`-h`).
2828

2929
```console
@@ -35,12 +35,12 @@ This will show you a list of the subcommands available to you, as well as a brie
3535
### Processing an Image
3636

3737
??? note "A note on mussel detection"
38-
The Kelp-O-Matic tool is designed to detect both kelp and mussels. The following information was written for kelp
39-
detection, but the same information applies for mussels. All you have to do to find mussels instead of kelp is use
38+
The Kelp-O-Matic tool is designed to detect both kelp and mussels. The following information was written for kelp
39+
detection, but the same information applies for mussels. All you have to do to find mussels instead of kelp is use
4040
the `kom find-mussels` subcommand instead of `kom find-kelp` in the following steps.
4141

4242
#### Subcommands and Options
43-
To process an image, you will need to use the `kom find-kelp` subcommand. This subcommand is used to detect kelp in an
43+
To process an image, you will need to use the `kom find-kelp` subcommand. This subcommand is used to detect kelp in an
4444
image. Like we did for `kom`, we can also get help for subcommands:
4545

4646
```console
@@ -82,31 +82,31 @@ The various options available to you are detailed in the `--help` documentation.
8282
The options are flags that can be used to enable or disable certain features of the tool, or they can take arguments to customize the behavior of the tool.
8383

8484
!!! example "An Example Command"
85-
85+
8686
=== "Windows"
8787

8888
```console
8989
kom find-kelp --species --crop-size 2048 .\some\image_with_kelp.tif .\some\output.tif
9090
```
9191

92-
In this example, we are running the `find-kelp` subcommand with the `--species` option and a
93-
`--crop-size` of 2048. The input image is located at `.\some\image_with_kelp.tif`.
92+
In this example, we are running the `find-kelp` subcommand with the `--species` option and a
93+
`--crop-size` of 2048. The input image is located at `.\some\image_with_kelp.tif`.
9494
The output will be saved to `.\some\output.tif`.
95-
95+
9696
=== "MacOS/Linux"
9797

9898
```console
9999
kom find-kelp --species --crop-size 2048 ./some/image_with_kelp.tif ./some/output.tif
100100
```
101101

102-
In this example, we are running the `find-kelp` subcommand with the `--species` option and a
103-
`--crop-size` of 2048. The input image is located at `./some/image_with_kelp.tif`.
102+
In this example, we are running the `find-kelp` subcommand with the `--species` option and a
103+
`--crop-size` of 2048. The input image is located at `./some/image_with_kelp.tif`.
104104
The output will be saved to `./some/output.tif`.
105105

106106
##### Executing the Command
107-
Once you have constructed your command, execute it by pressing ++enter++.
107+
Once you have constructed your command, execute it by pressing ++enter++.
108108

109-
Wait for the progress bar to reach 100%, then open the results in an image processing or spatial analysis software such as QGIS or ArcGIS.
109+
Wait for the progress bar to reach 100%, then open the results in an image processing or spatial analysis software such as QGIS or ArcGIS.
110110
Review the results for errors and edit as needed.
111111

112112
**Part 3 Kelp Segmentation is now complete!**

docs/beginner_guide/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Beginner Guide
22

3-
This document outlines step-by-step how to execute the Kelp-O-Matic tool for those with little to no experience with
3+
This document outlines step-by-step how to execute the Kelp-O-Matic tool for those with little to no experience with
44
executing commands from the Terminal or Command Line.
55

66
1. [Terminal Crash Course](./terminal_crash_course.md)

docs/beginner_guide/install_env_setup.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ guide.
66

77
??? question "Why UV"
88

9-
`uv` is a Python environment manager that is easy to use and works on Windows, MacOS, and Linux.
10-
It is a good choice for beginners and experienced users alike. It's extremely fast and lightweight, and provides a
9+
`uv` is a Python environment manager that is easy to use and works on Windows, MacOS, and Linux.
10+
It is a good choice for beginners and experienced users alike. It's extremely fast and lightweight, and provides a
1111
simple way to manage Python environments and install packages.
1212

1313
## UV Virtual Environment Setup
@@ -26,8 +26,8 @@ guide.
2626

2727
??? question "What's a Virtual Environment"
2828

29-
A virtual environment is a self-contained directory that contains a Python installation for a particular version
30-
of Python, plus a number of additional packages. It allows you to work on a specific project without affecting
29+
A virtual environment is a self-contained directory that contains a Python installation for a particular version
30+
of Python, plus a number of additional packages. It allows you to work on a specific project without affecting
3131
other projects or the system Python installation.
3232

3333
It's a good practice to create a new virtual environment for each project you work on. This way, you can install the
@@ -58,7 +58,7 @@ active.
5858
5959
## Install Kelp-O-Matic
6060
61-
Now that you have your virtual environment set up, you can install Kelp-O-Matic and its dependencies very easily with
61+
Now that you have your virtual environment set up, you can install Kelp-O-Matic and its dependencies very easily with
6262
`uv`.
6363
6464
1. Install Kelp-O-Matic using the following command:
@@ -68,15 +68,15 @@ Now that you have your virtual environment set up, you can install Kelp-O-Matic
6868
6969
!!! important
7070
71-
The `kom` command will be available only when the virtual environment is activated. If you close your terminal,
71+
The `kom` command will be available only when the virtual environment is activated. If you close your terminal,
7272
be sure to navigate to the location where you created the virtual environment and activate it again before running
7373
`kom`.
7474
7575
??? question "What's `uv pip`?"
76-
`uv` has a built-in package manager called `pip` that you can use to install Python packages. When not using `uv`,
76+
`uv` has a built-in package manager called `pip` that you can use to install Python packages. When not using `uv`,
7777
Python comes with a package manager called `pip`. `uv pip` is just a faster version of that default package manager.
7878
7979
## Next Steps
8080
81-
You're now ready to process some imagery, hooray! Head over to the next section,
82-
[Running the Segmentation tool](./execution.md), to learn how to run the segmentation tool
81+
You're now ready to process some imagery, hooray! Head over to the next section,
82+
[Running the Segmentation tool](./execution.md), to learn how to run the segmentation tool

docs/beginner_guide/terminal_crash_course.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ depending on your operating system, so choose the tab below based on which is re
1717
application that appears.
1818

1919
=== "MacOS/Linux"
20-
On MacOS and Linux, the default terminal is called Terminal. To open Terminal, search for "Terminal" in the search bar
20+
On MacOS and Linux, the default terminal is called Terminal. To open Terminal, search for "Terminal" in the search bar
2121
and click on the application that appears.
2222

2323
### Nagivating around
@@ -43,7 +43,7 @@ depending on your operating system, so choose the tab below based on which is re
4343
| ------- | ----------- |
4444
| `cd [some path]` | Change directory |
4545
| `ls [some path]` | List files and folders in the current directory |
46-
46+
4747

4848
#### Specifying Paths
4949

@@ -52,7 +52,7 @@ depending on your operating system, so choose the tab below based on which is re
5252
- Using `..` is interpreted as "the parent directory" of my current location.
5353
- Using `.` is interpreted as "the current directory".
5454
- Using `~` is interpreted as the user's home directory. (e.g. `C:\Users\McLovin`, if that is your username)
55-
- You can use relative paths to navigate to folders in relation to your current location, like ` cd .\Documents`
55+
- You can use relative paths to navigate to folders in relation to your current location, like ` cd .\Documents`
5656
- You can also use absolute paths to navigate, like `cd C:\Users\McLovin\Documents`.
5757
- Use ++tab++ to autocomplete file and folder names. It is **very strongly** recommended to use this to avoid typos and save time typing long paths.
5858
- e.g. `cd C:\Users\McLovin\Docu` then press ++tab++ to autocomplete to `cd C:\Users\McLovin\Documents`. Pressing ++tab++ again will cycle through all possible completions.
@@ -62,7 +62,7 @@ depending on your operating system, so choose the tab below based on which is re
6262
- Using `..` is interpreted as "the parent directory" of my current location.
6363
- Using `.` is interpreted as "the current directory".
6464
- Using `~` is interpreted as the user's home directory. (e.g. `/home/mclovin`, if that is your username)
65-
- You can use relative paths to navigate to folders in relation to your current location, like ` cd ./documents`
65+
- You can use relative paths to navigate to folders in relation to your current location, like ` cd ./documents`
6666
- You can also use absolute paths to navigate, like `cd /home/mclovin/documents`. Absolute paths start from the root directory `/`.
6767
- Use ++tab++ to autocomplete file and folder names. It is **very strongly** recommended to use this to avoid typos and save time typing long paths.
6868
- e.g. `cd /home/mclovin/docu` then press ++tab++ to autocomplete to `cd /home/mclovin/documents`. Pressing ++tab++ again will cycle through all possible completions.
@@ -101,15 +101,15 @@ depending on your operating system, so choose the tab below based on which is re
101101
| `cd /home/mclovin/documents` | Move to a folder called `documents` inside the `mclovin` home directory |
102102

103103
!!! warning "Spaces in Paths"
104-
If a folder or file name has a space in it, you need to enclose the path in quotes.
105-
For example, if you have a folder called `My Documents`, you would need to use `cd "My Documents"`.
106-
It's a good idea to avoid spaces in folder and file names to make your life easier. Many people use
104+
If a folder or file name has a space in it, you need to enclose the path in quotes.
105+
For example, if you have a folder called `My Documents`, you would need to use `cd "My Documents"`.
106+
It's a good idea to avoid spaces in folder and file names to make your life easier. Many people use
107107
underscores `_` or hyphens `-` instead of spaces.
108108

109109

110-
You did it! You now know enough to navigate around the terminal. There are many commands you can use
111-
in the terminal, but these are the most important ones to get you started. You're now going to copy and paste some
112-
commands to set up the Kelp-O-Matic tool, detailed in the next section. This is going to add a new command to your
110+
You did it! You now know enough to navigate around the terminal. There are many commands you can use
111+
in the terminal, but these are the most important ones to get you started. You're now going to copy and paste some
112+
commands to set up the Kelp-O-Matic tool, detailed in the next section. This is going to add a new command to your
113113
terminal that you can use to run the Kelp-O-Matic tool.
114114

115115
### Next Steps

docs/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
## Getting Started
2727

28-
Please see the [beginner guide](beginner_guide/index.md) if you are new to using command line tools. Otherwise, see the
28+
Please see the [beginner guide](beginner_guide/index.md) if you are new to using command line tools. Otherwise, see the
2929
[installation](installation.md) and the [CLI](cli.md) or [Python API](python_lib.md) documentation.
3030

3131
## Features
@@ -38,15 +38,15 @@ Please see the [beginner guide](beginner_guide/index.md) if you are new to using
3838

3939
## Contribute
4040

41-
Please file a bug report using our
42-
[GitHub Issue Tracker :material-github:](https://github.com/HakaiInstitute/kelp-o-matic/issues) if you encounter any
41+
Please file a bug report using our
42+
[GitHub Issue Tracker :material-github:](https://github.com/HakaiInstitute/kelp-o-matic/issues) if you encounter any
4343
problems.
4444

4545
Comments and questions are also appreciated!
4646

4747
## License
4848

49-
Kelp-O-Matic is released under the
49+
Kelp-O-Matic is released under the
5050
[MIT license](https://raw.githubusercontent.com/tayden/kelp-o-matic/main/LICENSE.txt).
5151

5252
## Contact

kelp_o_matic/cli.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
find_mussels as find_mussels_,
1111
)
1212

13-
cli = typer.Typer(context_settings={"help_option_names": ["-h", "--help"]}, add_completion=False)
13+
cli = typer.Typer(
14+
context_settings={"help_option_names": ["-h", "--help"]}, add_completion=False
15+
)
1416

1517

1618
@cli.command()

pyproject.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ kom = "kelp_o_matic.cli:cli"
2424

2525
[dependency-groups]
2626
dev = [
27-
"pre-commit>=3.3.3",
28-
"ruff>=0.0.272",
29-
"pytest>=7.3.2",
27+
"pre-commit>=4.1.0",
28+
"ruff>=0.9.5",
29+
"pytest>=8.3.4",
3030
]
3131
docs = [
32-
"mkdocs>=1.5.3,<2",
33-
"mkdocs-material>=9.5.2,<10",
34-
"mkdocstrings-python>=1.7.5,<2",
32+
"mkdocs>=1.6.1,<2",
33+
"mkdocs-material>=9.6.3,<10",
34+
"mkdocstrings-python>=1.14.6,<2",
3535
]
3636

3737
[tool.uv]

0 commit comments

Comments
 (0)