deepSSF 0.2.1__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. {deepssf-0.2.1 → deepssf-0.2.3}/PKG-INFO +34 -23
  2. {deepssf-0.2.1 → deepssf-0.2.3}/README.md +33 -22
  3. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/__init__.py +1 -1
  4. {deepssf-0.2.1 → deepssf-0.2.3}/tests/test_deepssf.py +16 -11
  5. {deepssf-0.2.1 → deepssf-0.2.3}/.github/workflows/ci.yml +0 -0
  6. {deepssf-0.2.1 → deepssf-0.2.3}/.github/workflows/publish.yml +0 -0
  7. {deepssf-0.2.1 → deepssf-0.2.3}/.gitignore +0 -0
  8. {deepssf-0.2.1 → deepssf-0.2.3}/.pre-commit-config.yaml +0 -0
  9. {deepssf-0.2.1 → deepssf-0.2.3}/CHANGELOG.md +0 -0
  10. {deepssf-0.2.1 → deepssf-0.2.3}/CITATION.cff +0 -0
  11. {deepssf-0.2.1 → deepssf-0.2.3}/LICENSE +0 -0
  12. {deepssf-0.2.1 → deepssf-0.2.3}/Package_generation_process.md +0 -0
  13. {deepssf-0.2.1 → deepssf-0.2.3}/environment.yml +0 -0
  14. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example.html +0 -0
  15. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example.ipynb +0 -0
  16. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-15-output-1.png +0 -0
  17. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-17-output-1.png +0 -0
  18. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-19-output-1.png +0 -0
  19. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-21-output-1.png +0 -0
  20. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-23-output-1.png +0 -0
  21. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-24-output-1.png +0 -0
  22. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-25-output-1.png +0 -0
  23. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-27-output-1.png +0 -0
  24. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-28-output-1.png +0 -0
  25. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-29-output-1.png +0 -0
  26. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-30-output-1.png +0 -0
  27. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-32-output-1.png +0 -0
  28. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/figure-html/cell-7-output-1.png +0 -0
  29. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/bootstrap/bootstrap-138a6193a3bd40baf1e627da441a4734.min.css +0 -0
  30. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/bootstrap/bootstrap-icons.css +0 -0
  31. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/bootstrap/bootstrap-icons.woff +0 -0
  32. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/bootstrap/bootstrap.min.js +0 -0
  33. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/clipboard/clipboard.min.js +0 -0
  34. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/quarto-html/anchor.min.js +0 -0
  35. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/quarto-html/popper.min.js +0 -0
  36. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/quarto-html/quarto-syntax-highlighting-7f8f88aac4f3542376d5c11b86a4c14d.css +0 -0
  37. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/quarto-html/quarto.js +0 -0
  38. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/quarto-html/tabsets/tabsets.js +0 -0
  39. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/quarto-html/tippy.css +0 -0
  40. {deepssf-0.2.1 → deepssf-0.2.3}/examples/deepssf_train_validate_example_files/libs/quarto-html/tippy.umd.min.js +0 -0
  41. {deepssf-0.2.1 → deepssf-0.2.3}/examples/references.bib +0 -0
  42. {deepssf-0.2.1 → deepssf-0.2.3}/icons/both_icons.png +0 -0
  43. {deepssf-0.2.1 → deepssf-0.2.3}/icons/deepSSF_hex_textured_Python.png +0 -0
  44. {deepssf-0.2.1 → deepssf-0.2.3}/icons/deepSSF_hex_textured_R.png +0 -0
  45. {deepssf-0.2.1 → deepssf-0.2.3}/pyproject.toml +0 -0
  46. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/data.py +0 -0
  47. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/datasets/data/buffalo_djelk_id2005.csv +0 -0
  48. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/datasets/data/ndvi_2005.tif +0 -0
  49. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/datasets/data/slope_2005.tif +0 -0
  50. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/model.py +0 -0
  51. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/simulate.py +0 -0
  52. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/train.py +0 -0
  53. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/utils.py +0 -0
  54. {deepssf-0.2.1 → deepssf-0.2.3}/src/deepssf/validate.py +0 -0
  55. {deepssf-0.2.1 → deepssf-0.2.3}/styles.css +0 -0
  56. {deepssf-0.2.1 → deepssf-0.2.3}/tests/__init__.py +0 -0
  57. {deepssf-0.2.1 → deepssf-0.2.3}/tests/test_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepSSF
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Deep learning step selection functions for predicting animal movement.
5
5
  Project-URL: Homepage, https://swforrest.github.io/deepSSF/
6
6
  Project-URL: Repository, https://github.com/swforrest/deepssf
@@ -57,7 +57,7 @@ Forrest, S. W., Pagendam, D., Hassan, C., Potts, J. R., Drovandi, C., Bode, M.,
57
57
 
58
58
  ## Installation (pip only)
59
59
 
60
- If you manage your own Python environment, install deepSSF with:
60
+ If you already have a Python environment that you want to install the package into, install deepSSF with:
61
61
 
62
62
  ```bash
63
63
  pip install deepssf
@@ -80,28 +80,39 @@ print(deepssf.__version__)
80
80
 
81
81
  ## Setting up (for users new to Python)
82
82
 
83
- If you are coming from R, think of a conda environment the way you think of
84
- an `renv` project library — it is a self-contained Python installation that
85
- keeps this project's packages separate from everything else on your computer.
86
- The steps below create one for deepssf and should take about five minutes.
87
-
88
83
  ### 1. Install Miniconda (once, system-wide)
89
84
 
90
85
  Download and run the installer from the
91
86
  [official Miniconda page](https://docs.anaconda.com/miniconda/).
92
87
 
93
- - **Windows**: use the **Anaconda Prompt** for all subsequent commands, and
94
- choose an install path that contains **no spaces** (e.g. `C:\miniconda3`).
95
- - **macOS / Linux**: a normal terminal works fine.
88
+ If you click 'Download' towards the top right, the links to download
89
+ Miniconda are towards the bottom of the page - the links at the top are
90
+ for the Anaconda Distribution, which has thousands of pacakges and is
91
+ not necessary to get things up and running initially.
92
+
93
+ ### 1b. (Optional) Install an IDE (such as VSCode)
94
+
95
+ Once you have Python and Miniconda installed, you will likely want an interface
96
+ (‘Integrated Development Environment’, an IDE) to code in (such as RStudio for R users).
97
+ I use Visual Studio Code, or ‘VS Code’ as I find the functionality similar to RStudio
98
+ (and as I have become familiar with VS Code I prefer it to RStudio in some ways).
96
99
 
97
- > **Miniforge alternative**: if you prefer to avoid Anaconda's default channel
98
- > entirely, [Miniforge](https://github.com/conda-forge/miniforge) is a
99
- > drop-in replacement that ships with `conda-forge` as the only channel.
100
+ You can download VSCode from here: [https://code.visualstudio.com/](https://code.visualstudio.com/).
101
+
102
+ For the commands below, you can use the Terminal directly in VScode (Terminal > New Terminal),
103
+ or the Terminal/Command Line in Windows or macOS.
100
104
 
101
105
  ### 2. Create the environment
102
106
 
107
+ Think of a conda environment the way you think of an `renv` project library —
108
+ it is a self-contained Python installation that
109
+ keeps this project's packages separate from everything else on your computer.
110
+ The steps below create one for deepSSF.
111
+
112
+ Using the Terminal (which can be in VScode), you can clone the package repository with:
113
+
103
114
  ```bash
104
- git clone https://github.com/swforrest/deepssf
115
+ git clone https://github.com/swforrest/deepssf_package
105
116
  cd deepssf
106
117
  conda env create -f environment.yml
107
118
  ```
@@ -115,6 +126,8 @@ correct backend at runtime.
115
126
 
116
127
  ### 3. Activate the environment
117
128
 
129
+ Also in the Terminal:
130
+
118
131
  ```bash
119
132
  conda activate deepssf
120
133
  ```
@@ -130,23 +143,21 @@ register the environment so it appears as a kernel option:
130
143
  python -m ipykernel install --user --name deepssf --display-name "Python (deepssf)"
131
144
  ```
132
145
 
133
- ### 5. Launch Jupyter Lab
134
-
135
- ```bash
136
- jupyter lab
137
- ```
138
-
139
- Then open `examples/deepssf_train_validate_example.ipynb` to get started.
146
+ Then you can open `examples/deepssf_train_validate_example.ipynb` in VSCode to get started.
147
+ You can also view the knitted `deepssf_train_validate_example.html` script, which you
148
+ should be able to open in a browser such as Chrome.
140
149
 
141
150
  ---
142
151
 
143
152
  ## Documentation
144
153
 
145
- Tutorials and walkthroughs: https://swforrest.github.io/deepSSF/
154
+ There are additional tutorials and walkthroughs to help understand
155
+ deep learning concepts and the deepSSF approach, model and functions at:
156
+ https://swforrest.github.io/deepSSF/
146
157
 
147
158
  ## Citation
148
159
 
149
- If you use deepssf in your research, please cite the paper. See `CITATION.cff` or use the citation and link to paper below.
160
+ If you use deepSSF in your research, please cite the paper. See `CITATION.cff` or use the citation and link to paper below.
150
161
 
151
162
  Forrest, S. W., Pagendam, D., Hassan, C., Potts, J. R., Drovandi, C., Bode, M., & Hoskins, A. J. (2026). **Predicting animal movement with deepSSF : A deep learning step selection framework**. Methods in Ecology and Evolution, 17(2), 371–391. https://doi.org/10.1111/2041-210x.70136
152
163
 
@@ -18,7 +18,7 @@ Forrest, S. W., Pagendam, D., Hassan, C., Potts, J. R., Drovandi, C., Bode, M.,
18
18
 
19
19
  ## Installation (pip only)
20
20
 
21
- If you manage your own Python environment, install deepSSF with:
21
+ If you already have a Python environment that you want to install the package into, install deepSSF with:
22
22
 
23
23
  ```bash
24
24
  pip install deepssf
@@ -41,28 +41,39 @@ print(deepssf.__version__)
41
41
 
42
42
  ## Setting up (for users new to Python)
43
43
 
44
- If you are coming from R, think of a conda environment the way you think of
45
- an `renv` project library — it is a self-contained Python installation that
46
- keeps this project's packages separate from everything else on your computer.
47
- The steps below create one for deepssf and should take about five minutes.
48
-
49
44
  ### 1. Install Miniconda (once, system-wide)
50
45
 
51
46
  Download and run the installer from the
52
47
  [official Miniconda page](https://docs.anaconda.com/miniconda/).
53
48
 
54
- - **Windows**: use the **Anaconda Prompt** for all subsequent commands, and
55
- choose an install path that contains **no spaces** (e.g. `C:\miniconda3`).
56
- - **macOS / Linux**: a normal terminal works fine.
49
+ If you click 'Download' towards the top right, the links to download
50
+ Miniconda are towards the bottom of the page - the links at the top are
51
+ for the Anaconda Distribution, which has thousands of pacakges and is
52
+ not necessary to get things up and running initially.
53
+
54
+ ### 1b. (Optional) Install an IDE (such as VSCode)
55
+
56
+ Once you have Python and Miniconda installed, you will likely want an interface
57
+ (‘Integrated Development Environment’, an IDE) to code in (such as RStudio for R users).
58
+ I use Visual Studio Code, or ‘VS Code’ as I find the functionality similar to RStudio
59
+ (and as I have become familiar with VS Code I prefer it to RStudio in some ways).
57
60
 
58
- > **Miniforge alternative**: if you prefer to avoid Anaconda's default channel
59
- > entirely, [Miniforge](https://github.com/conda-forge/miniforge) is a
60
- > drop-in replacement that ships with `conda-forge` as the only channel.
61
+ You can download VSCode from here: [https://code.visualstudio.com/](https://code.visualstudio.com/).
62
+
63
+ For the commands below, you can use the Terminal directly in VScode (Terminal > New Terminal),
64
+ or the Terminal/Command Line in Windows or macOS.
61
65
 
62
66
  ### 2. Create the environment
63
67
 
68
+ Think of a conda environment the way you think of an `renv` project library —
69
+ it is a self-contained Python installation that
70
+ keeps this project's packages separate from everything else on your computer.
71
+ The steps below create one for deepSSF.
72
+
73
+ Using the Terminal (which can be in VScode), you can clone the package repository with:
74
+
64
75
  ```bash
65
- git clone https://github.com/swforrest/deepssf
76
+ git clone https://github.com/swforrest/deepssf_package
66
77
  cd deepssf
67
78
  conda env create -f environment.yml
68
79
  ```
@@ -76,6 +87,8 @@ correct backend at runtime.
76
87
 
77
88
  ### 3. Activate the environment
78
89
 
90
+ Also in the Terminal:
91
+
79
92
  ```bash
80
93
  conda activate deepssf
81
94
  ```
@@ -91,23 +104,21 @@ register the environment so it appears as a kernel option:
91
104
  python -m ipykernel install --user --name deepssf --display-name "Python (deepssf)"
92
105
  ```
93
106
 
94
- ### 5. Launch Jupyter Lab
95
-
96
- ```bash
97
- jupyter lab
98
- ```
99
-
100
- Then open `examples/deepssf_train_validate_example.ipynb` to get started.
107
+ Then you can open `examples/deepssf_train_validate_example.ipynb` in VSCode to get started.
108
+ You can also view the knitted `deepssf_train_validate_example.html` script, which you
109
+ should be able to open in a browser such as Chrome.
101
110
 
102
111
  ---
103
112
 
104
113
  ## Documentation
105
114
 
106
- Tutorials and walkthroughs: https://swforrest.github.io/deepSSF/
115
+ There are additional tutorials and walkthroughs to help understand
116
+ deep learning concepts and the deepSSF approach, model and functions at:
117
+ https://swforrest.github.io/deepSSF/
107
118
 
108
119
  ## Citation
109
120
 
110
- If you use deepssf in your research, please cite the paper. See `CITATION.cff` or use the citation and link to paper below.
121
+ If you use deepSSF in your research, please cite the paper. See `CITATION.cff` or use the citation and link to paper below.
111
122
 
112
123
  Forrest, S. W., Pagendam, D., Hassan, C., Potts, J. R., Drovandi, C., Bode, M., & Hoskins, A. J. (2026). **Predicting animal movement with deepSSF : A deep learning step selection framework**. Methods in Ecology and Evolution, 17(2), 371–391. https://doi.org/10.1111/2041-210x.70136
113
124
 
@@ -7,7 +7,7 @@ expose the things you want people to rely on. Internal helpers stay private.
7
7
 
8
8
  # Single source of truth for the version. hatchling reads this string at build
9
9
  # time (see pyproject.toml [tool.hatch.version]). Bump it when you release.
10
- __version__ = "0.2.1"
10
+ __version__ = "0.2.3"
11
11
 
12
12
  from deepssf.data import (
13
13
  MovementDataset,
@@ -371,7 +371,7 @@ def test_make_simulation_inputs_hour_wraps():
371
371
 
372
372
 
373
373
  def test_simulate_next_step_returns_coords_and_tensors(small_params):
374
- """simulate_next_step returns new coordinates and three log-prob tensors."""
374
+ """simulate_next_step returns new coordinates."""
375
375
  import math
376
376
 
377
377
  import rasterio.transform
@@ -396,15 +396,12 @@ def test_simulate_next_step_returns_coords_and_tensors(small_params):
396
396
  scalars = torch.zeros(1, 4)
397
397
  bearing = torch.zeros(1, 1)
398
398
 
399
- new_x, new_y, hab, move, step, px, py = simulate_next_step(
399
+ new_x, new_y, px, py = simulate_next_step(
400
400
  model, rasters, scalars, bearing, window_size=W,
401
401
  x_loc=W * 25 / 2, y_loc=W * 25 / 2, transform=transform,
402
402
  )
403
403
  assert isinstance(new_x, float)
404
404
  assert isinstance(new_y, float)
405
- assert hab.shape == (W, W)
406
- assert move.shape == (W, W)
407
- assert step.shape == (W, W)
408
405
  assert 0 <= px < W
409
406
  assert 0 <= py < W
410
407
 
@@ -676,11 +673,19 @@ def test_prepare_movement_df_has_dx_dy():
676
673
 
677
674
  assert "dx" in df.columns
678
675
  assert "dy" in df.columns
679
- assert np.isfinite(df["dx"].values).all()
680
- assert np.isfinite(df["dy"].values).all()
681
- # dx = x2_ - x1_, dy = y2_ - y1_
682
- np.testing.assert_allclose(df["dx"].values, df["x2_"].values - df["x1_"].values)
683
- np.testing.assert_allclose(df["dy"].values, df["y2_"].values - df["y1_"].values)
676
+
677
+ dx = df["dx"].to_numpy(dtype=float)
678
+ dy = df["dy"].to_numpy(dtype=float)
679
+ x1 = df["x1_"].to_numpy(dtype=float)
680
+ x2 = df["x2_"].to_numpy(dtype=float)
681
+ y1 = df["y1_"].to_numpy(dtype=float)
682
+ y2 = df["y2_"].to_numpy(dtype=float)
683
+
684
+ assert np.isfinite(dx).all()
685
+ assert np.isfinite(dy).all()
686
+
687
+ np.testing.assert_allclose(dx, x2 - x1)
688
+ np.testing.assert_allclose(dy, y2 - y1)
684
689
 
685
690
 
686
691
  def test_filter_steps_by_window_removes_large_steps():
@@ -775,7 +780,7 @@ def test_fit_returns_loss_history(small_params):
775
780
  optimisers, schedulers = make_optimisers(model)
776
781
  history = fit(
777
782
  model,
778
- n_conv_layers=3, # number of conv layers (used only for snapshots)
783
+ image_trim_pixels=3, # number of conv layers (used only for snapshots)
779
784
  window_size=H, # spatial crop size (used only for snapshots)
780
785
  dl_train=_DL(),
781
786
  dl_val=_DL(),
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes