scrollstats 0.1.1__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 (63) hide show
  1. scrollstats-0.1.1/.git_archival.txt +3 -0
  2. scrollstats-0.1.1/.gitattributes +1 -0
  3. scrollstats-0.1.1/.github/CONTRIBUTING.md +89 -0
  4. scrollstats-0.1.1/.github/dependabot.yml +11 -0
  5. scrollstats-0.1.1/.github/release.yml +5 -0
  6. scrollstats-0.1.1/.github/workflows/cd.yml +56 -0
  7. scrollstats-0.1.1/.github/workflows/ci.yml +67 -0
  8. scrollstats-0.1.1/.github/workflows/draft-pdf.yml +28 -0
  9. scrollstats-0.1.1/.gitignore +171 -0
  10. scrollstats-0.1.1/.pre-commit-config.yaml +90 -0
  11. scrollstats-0.1.1/.readthedocs.yaml +17 -0
  12. scrollstats-0.1.1/LICENSE +21 -0
  13. scrollstats-0.1.1/PKG-INFO +165 -0
  14. scrollstats-0.1.1/README.md +116 -0
  15. scrollstats-0.1.1/docs/CalculateRidgeMetrics.md +159 -0
  16. scrollstats-0.1.1/docs/CompleteScrollStatsWorkflow.md +134 -0
  17. scrollstats-0.1.1/docs/CreateVectorDatasets.md +329 -0
  18. scrollstats-0.1.1/docs/DelineateRidgeAreas.md +317 -0
  19. scrollstats-0.1.1/docs/conf.py +82 -0
  20. scrollstats-0.1.1/docs/index.md +95 -0
  21. scrollstats-0.1.1/example_data/input/LBR_025_bend.geojson +360 -0
  22. scrollstats-0.1.1/example_data/input/LBR_025_cl.geojson +3166 -0
  23. scrollstats-0.1.1/example_data/input/LBR_025_dem.tif +0 -0
  24. scrollstats-0.1.1/example_data/input/LBR_025_packets.geojson +568 -0
  25. scrollstats-0.1.1/example_data/input/LBR_025_ridges_manual.geojson +2095 -0
  26. scrollstats-0.1.1/img/README.md +3 -0
  27. scrollstats-0.1.1/img/agreement_raster.png +0 -0
  28. scrollstats-0.1.1/img/agreement_v_denoised.png +0 -0
  29. scrollstats-0.1.1/img/bend_geometry.png +0 -0
  30. scrollstats-0.1.1/img/binary_classification.png +0 -0
  31. scrollstats-0.1.1/img/dem_v_agreement.png +0 -0
  32. scrollstats-0.1.1/img/migration_pathway.png +0 -0
  33. scrollstats-0.1.1/img/migration_pathways.png +0 -0
  34. scrollstats-0.1.1/img/pc_v_dem_v_rt.png +0 -0
  35. scrollstats-0.1.1/img/ridge_amplitude.png +0 -0
  36. scrollstats-0.1.1/img/ridges_and_centerline.png +0 -0
  37. scrollstats-0.1.1/img/smoothed_ridges.png +0 -0
  38. scrollstats-0.1.1/noxfile.py +107 -0
  39. scrollstats-0.1.1/paper/figs/digitized_dem.png +0 -0
  40. scrollstats-0.1.1/paper/figs/example_metric.png +0 -0
  41. scrollstats-0.1.1/paper/figs/example_output.png +0 -0
  42. scrollstats-0.1.1/paper/figs/example_transect.png +0 -0
  43. scrollstats-0.1.1/paper/paper.bib +45 -0
  44. scrollstats-0.1.1/paper/paper.md +103 -0
  45. scrollstats-0.1.1/pyproject.toml +194 -0
  46. scrollstats-0.1.1/src/scrollstats/__init__.py +39 -0
  47. scrollstats-0.1.1/src/scrollstats/_version.py +34 -0
  48. scrollstats-0.1.1/src/scrollstats/_version.pyi +4 -0
  49. scrollstats-0.1.1/src/scrollstats/delineation/__init__.py +13 -0
  50. scrollstats-0.1.1/src/scrollstats/delineation/array_types.py +31 -0
  51. scrollstats-0.1.1/src/scrollstats/delineation/line_smoother.py +122 -0
  52. scrollstats-0.1.1/src/scrollstats/delineation/raster_classifiers.py +537 -0
  53. scrollstats-0.1.1/src/scrollstats/delineation/raster_denoisers.py +68 -0
  54. scrollstats-0.1.1/src/scrollstats/delineation/ridge_area_raster.py +214 -0
  55. scrollstats-0.1.1/src/scrollstats/py.typed +0 -0
  56. scrollstats-0.1.1/src/scrollstats/ridge_metrics/__init__.py +18 -0
  57. scrollstats-0.1.1/src/scrollstats/ridge_metrics/calc_ridge_metrics.py +63 -0
  58. scrollstats-0.1.1/src/scrollstats/ridge_metrics/data_extractors.py +853 -0
  59. scrollstats-0.1.1/src/scrollstats/ridge_metrics/ridge_amplitude.py +226 -0
  60. scrollstats-0.1.1/src/scrollstats/transecting/__init__.py +8 -0
  61. scrollstats-0.1.1/src/scrollstats/transecting/transect.py +1331 -0
  62. scrollstats-0.1.1/tests/test_core.py +418 -0
  63. scrollstats-0.1.1/tests/test_package.py +9 -0
@@ -0,0 +1,3 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,89 @@
1
+ See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed
2
+ description of best practices for developing scientific packages.
3
+
4
+ [spc-dev-intro]: https://learn.scientific-python.org/development/
5
+
6
+ # Quick development
7
+
8
+ The fastest way to start with development is to use nox. If you don't have nox,
9
+ you can use `pipx run nox` to run it without installing, or `pipx install nox`.
10
+ If you don't have pipx (pip for applications), then you can install with
11
+ `pip install pipx` (the only case were installing an application with regular
12
+ pip is reasonable). If you use macOS, then pipx and nox are both in brew, use
13
+ `brew install pipx nox`.
14
+
15
+ To use, run `nox`. This will lint and test using every installed version of
16
+ Python on your system, skipping ones that are not installed. You can also run
17
+ specific jobs:
18
+
19
+ ```console
20
+ $ nox -s lint # Lint only
21
+ $ nox -s tests # Python tests
22
+ $ nox -s docs # Build and serve the docs
23
+ $ nox -s build # Make an SDist and wheel
24
+ ```
25
+
26
+ Nox handles everything for you, including setting up an temporary virtual
27
+ environment for each run.
28
+
29
+ # Setting up a development environment manually
30
+
31
+ You can set up a development environment by running:
32
+
33
+ ```bash
34
+ python3 -m venv .venv
35
+ source ./.venv/bin/activate
36
+ pip install -v -e .[dev]
37
+ ```
38
+
39
+ If you have the
40
+ [Python Launcher for Unix](https://github.com/brettcannon/python-launcher), you
41
+ can instead do:
42
+
43
+ ```bash
44
+ py -m venv .venv
45
+ py -m install -v -e .[dev]
46
+ ```
47
+
48
+ # Pre-commit
49
+
50
+ You should prepare pre-commit, which will help you by checking that commits pass
51
+ required checks:
52
+
53
+ ```bash
54
+ pip install pre-commit # or brew install pre-commit on macOS
55
+ pre-commit install # Will install a pre-commit hook into the git repo
56
+ ```
57
+
58
+ You can also/alternatively run `pre-commit run` (changes only) or
59
+ `pre-commit run --all-files` to check even without installing the hook.
60
+
61
+ # Testing
62
+
63
+ Use pytest to run the unit checks:
64
+
65
+ ```bash
66
+ pytest
67
+ ```
68
+
69
+ # Coverage
70
+
71
+ Use pytest-cov to generate coverage reports:
72
+
73
+ ```bash
74
+ pytest --cov=scrollstats
75
+ ```
76
+
77
+ # Building docs
78
+
79
+ You can build and serve the docs using:
80
+
81
+ ```bash
82
+ nox -s docs
83
+ ```
84
+
85
+ You can build the docs only with:
86
+
87
+ ```bash
88
+ nox -s docs --non-interactive
89
+ ```
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ groups:
9
+ actions:
10
+ patterns:
11
+ - "*"
@@ -0,0 +1,5 @@
1
+ changelog:
2
+ exclude:
3
+ authors:
4
+ - dependabot
5
+ - pre-commit-ci
@@ -0,0 +1,56 @@
1
+ name: CD
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+ release:
10
+ types:
11
+ - published
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ env:
18
+ # Many color libraries just need this to be set to any value, but at least
19
+ # one distinguishes color depth, where "3" -> "256-bit color".
20
+ FORCE_COLOR: 3
21
+
22
+ jobs:
23
+ dist:
24
+ name: Distribution build
25
+ runs-on: ubuntu-latest
26
+
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 0
31
+
32
+ - uses: hynek/build-and-inspect-python-package@v2
33
+
34
+ publish:
35
+ needs: [dist]
36
+ name: Publish to PyPI
37
+ environment: pypi
38
+ permissions:
39
+ id-token: write
40
+ attestations: write
41
+ contents: read
42
+ runs-on: ubuntu-latest
43
+ if: github.event_name == 'release' && github.event.action == 'published'
44
+
45
+ steps:
46
+ - uses: actions/download-artifact@v6
47
+ with:
48
+ name: Packages
49
+ path: dist
50
+
51
+ - name: Generate artifact attestation for sdist and wheel
52
+ uses: actions/attest-build-provenance@v2.2.3
53
+ with:
54
+ subject-path: "dist/*"
55
+
56
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,67 @@
1
+ name: CI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ env:
15
+ # Many color libraries just need this to be set to any value, but at least
16
+ # one distinguishes color depth, where "3" -> "256-bit color".
17
+ FORCE_COLOR: 3
18
+
19
+ jobs:
20
+ pre-commit:
21
+ name: Format
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ fetch-depth: 0
27
+ - uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.x"
30
+ - uses: pre-commit/action@v3.0.1
31
+ with:
32
+ extra_args: --hook-stage manual --all-files
33
+ - name: Run Pylint
34
+ run: pipx run nox -s pylint -- --output-format=github
35
+
36
+ checks:
37
+ name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
38
+ runs-on: ${{ matrix.runs-on }}
39
+ needs: [pre-commit]
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ python-version: ["3.10", "3.11", "3.12"]
44
+ runs-on: [ubuntu-latest, macos-14]
45
+
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ with:
49
+ fetch-depth: 0
50
+
51
+ - uses: actions/setup-python@v5
52
+ with:
53
+ python-version: ${{ matrix.python-version }}
54
+ allow-prereleases: true
55
+
56
+ - name: Install package
57
+ run: python -m pip install .[test]
58
+
59
+ - name: Test package
60
+ run: >-
61
+ python -m pytest -ra --cov --cov-report=xml --cov-report=term
62
+ --durations=20
63
+
64
+ - name: Upload coverage report
65
+ uses: codecov/codecov-action@v5
66
+ with:
67
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,28 @@
1
+ name: Draft PDF
2
+ on:
3
+ push:
4
+ paths:
5
+ - paper/**
6
+ - .github/workflows/draft-pdf.yml
7
+
8
+ jobs:
9
+ paper:
10
+ runs-on: ubuntu-latest
11
+ name: Paper Draft
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+ - name: Build draft PDF
16
+ uses: openjournals/openjournals-draft-action@master
17
+ with:
18
+ journal: joss
19
+ # This should be the path to the paper within your repo.
20
+ paper-path: paper/paper.md
21
+ - name: Upload
22
+ uses: actions/upload-artifact@v4
23
+ with:
24
+ name: paper
25
+ # This is the output path where Pandoc will write the compiled
26
+ # PDF. Note, this should be the same directory as the input
27
+ # paper.md
28
+ path: paper/paper.pdf
@@ -0,0 +1,171 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+ docs/api/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
99
+ __pypackages__/
100
+
101
+ # Celery stuff
102
+ celerybeat-schedule
103
+ celerybeat.pid
104
+
105
+ # SageMath parsed files
106
+ *.sage.py
107
+
108
+ # Environments
109
+ .env
110
+ .venv
111
+ env/
112
+ venv/
113
+ ENV/
114
+ env.bak/
115
+ venv.bak/
116
+
117
+ # Spyder project settings
118
+ .spyderproject
119
+ .spyproject
120
+
121
+ # Rope project settings
122
+ .ropeproject
123
+
124
+ # mkdocs documentation
125
+ /site
126
+
127
+ # mypy
128
+ .mypy_cache/
129
+ .dmypy.json
130
+ dmypy.json
131
+
132
+ # Pyre type checker
133
+ .pyre/
134
+
135
+ # pytype static type analyzer
136
+ .pytype/
137
+
138
+ # Cython debug symbols
139
+ cython_debug/
140
+
141
+ # setuptools_scm
142
+ src/*/_version.py
143
+
144
+
145
+ # ruff
146
+ .ruff_cache/
147
+
148
+ # OS specific stuff
149
+ .DS_Store
150
+ .DS_Store?
151
+ ._*
152
+ .Spotlight-V100
153
+ .Trashes
154
+ ehthumbs.db
155
+ Thumbs.db
156
+
157
+ # Common editor files
158
+ *~
159
+ *.swp
160
+
161
+
162
+ # Additional
163
+ config.py
164
+ scrollstats/config.py
165
+ .DS_Store
166
+ */.DS_Store/*
167
+ data/
168
+ figures/
169
+ FIGURE_*
170
+ DEV_*
171
+ example_data/output/
@@ -0,0 +1,90 @@
1
+ ci:
2
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
3
+ autofix_commit_msg: "style: pre-commit fixes"
4
+
5
+ exclude: ^.cruft.json|.copier-answers.yml$
6
+
7
+ repos:
8
+ - repo: https://github.com/adamchainz/blacken-docs
9
+ rev: "1.19.1"
10
+ hooks:
11
+ - id: blacken-docs
12
+ additional_dependencies: [black==24.*]
13
+
14
+ - repo: https://github.com/pre-commit/pre-commit-hooks
15
+ rev: "v5.0.0"
16
+ hooks:
17
+ - id: check-added-large-files
18
+ - id: check-case-conflict
19
+ - id: check-merge-conflict
20
+ - id: check-symlinks
21
+ - id: check-yaml
22
+ - id: debug-statements
23
+ - id: end-of-file-fixer
24
+ - id: mixed-line-ending
25
+ - id: name-tests-test
26
+ args: ["--pytest-test-first"]
27
+ - id: requirements-txt-fixer
28
+ - id: trailing-whitespace
29
+
30
+ - repo: https://github.com/pre-commit/pygrep-hooks
31
+ rev: "v1.10.0"
32
+ hooks:
33
+ - id: rst-backticks
34
+ - id: rst-directive-colons
35
+ - id: rst-inline-touching-normal
36
+
37
+ - repo: https://github.com/rbubley/mirrors-prettier
38
+ rev: "v3.5.3"
39
+ hooks:
40
+ - id: prettier
41
+ types_or: [yaml, markdown, html, css, scss, javascript, json]
42
+ args: [--prose-wrap=always]
43
+
44
+ - repo: https://github.com/astral-sh/ruff-pre-commit
45
+ rev: "v0.11.5"
46
+ hooks:
47
+ - id: ruff
48
+ args: ["--fix", "--show-fixes"]
49
+ - id: ruff-format
50
+
51
+ - repo: https://github.com/pre-commit/mirrors-mypy
52
+ rev: "v1.15.0"
53
+ hooks:
54
+ - id: mypy
55
+ files: src|tests
56
+ args: []
57
+ additional_dependencies:
58
+ - pytest
59
+
60
+ - repo: https://github.com/codespell-project/codespell
61
+ rev: "v2.4.1"
62
+ hooks:
63
+ - id: codespell
64
+ additional_dependencies:
65
+ - tomli
66
+
67
+ - repo: https://github.com/shellcheck-py/shellcheck-py
68
+ rev: "v0.10.0.1"
69
+ hooks:
70
+ - id: shellcheck
71
+
72
+ - repo: local
73
+ hooks:
74
+ - id: disallow-caps
75
+ name: Disallow improper capitalization
76
+ language: pygrep
77
+ entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
78
+ exclude: .pre-commit-config.yaml
79
+
80
+ - repo: https://github.com/henryiii/validate-pyproject-schema-store
81
+ rev: "2025.08.29"
82
+ hooks:
83
+ - id: validate-pyproject
84
+
85
+ - repo: https://github.com/python-jsonschema/check-jsonschema
86
+ rev: "0.33.0"
87
+ hooks:
88
+ - id: check-dependabot
89
+ - id: check-github-workflows
90
+ - id: check-readthedocs
@@ -0,0 +1,17 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ version: 2
5
+
6
+ build:
7
+ os: ubuntu-22.04
8
+ tools:
9
+ python: "3.12"
10
+ commands:
11
+ - asdf plugin add uv
12
+ - asdf install uv latest
13
+ - asdf global uv latest
14
+ - uv venv
15
+ - uv pip install .[docs]
16
+ - .venv/bin/python -m sphinx -T -b html -d docs/_build/doctrees -D
17
+ language=en docs $READTHEDOCS_OUTPUT/html
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 a-vanderheiden
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.