lsapy 0.1.0.dev1__tar.gz → 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. lsapy-0.1.1/CHANGELOG.rst +93 -0
  2. lsapy-0.1.1/CODE_OF_CONDUCT.md +131 -0
  3. lsapy-0.1.1/CONTRIBUTING.rst +181 -0
  4. {lsapy-0.1.0.dev1 → lsapy-0.1.1}/LICENSE +19 -19
  5. lsapy-0.1.1/PKG-INFO +187 -0
  6. lsapy-0.1.1/README.rst +135 -0
  7. lsapy-0.1.1/ci/requirements_ci.in +3 -0
  8. lsapy-0.1.1/ci/requirements_ci.txt +357 -0
  9. lsapy-0.1.1/docs/Makefile +20 -0
  10. lsapy-0.1.1/docs/_static/style.css +7 -0
  11. lsapy-0.1.1/docs/api/index.rst +34 -0
  12. lsapy-0.1.1/docs/changelog.rst +1 -0
  13. lsapy-0.1.1/docs/community/code_of_conduct.rst +1 -0
  14. lsapy-0.1.1/docs/community/contributing.rst +1 -0
  15. lsapy-0.1.1/docs/community/index.rst +19 -0
  16. lsapy-0.1.1/docs/conf.py +136 -0
  17. lsapy-0.1.1/docs/getting_started/index.rst +23 -0
  18. lsapy-0.1.1/docs/index.rst +33 -0
  19. lsapy-0.1.1/docs/logos/FT2050-full_colour.png +0 -0
  20. lsapy-0.1.1/docs/logos/UCBlack.png +0 -0
  21. lsapy-0.1.1/docs/logos/UCWhite.png +0 -0
  22. lsapy-0.1.1/docs/logos/lsapy/LSAPy_Icon.png +0 -0
  23. lsapy-0.1.1/docs/logos/lsapy/LSAPy_Icon.svg +244 -0
  24. lsapy-0.1.1/docs/logos/lsapy/LSAPy_Logo_Dark.png +0 -0
  25. lsapy-0.1.1/docs/logos/lsapy/LSAPy_Logo_FullColour.png +0 -0
  26. lsapy-0.1.1/docs/logos/lsapy/LSAPy_Logo_FullColour.svg +248 -0
  27. lsapy-0.1.1/docs/logos/lsapy/LSAPy_Logo_FullDark.png +0 -0
  28. lsapy-0.1.1/docs/logos/lsapy/LSAPy_Logo_FullLight.png +0 -0
  29. lsapy-0.1.1/docs/logos/lsapy/LSAPy_Logo_Light.png +0 -0
  30. lsapy-0.1.1/docs/logos/lsapy/branding.md +19 -0
  31. lsapy-0.1.1/docs/make.bat +35 -0
  32. lsapy-0.1.1/docs/notebooks/criteria.ipynb +154 -0
  33. lsapy-0.1.1/docs/notebooks/functions.ipynb +298 -0
  34. lsapy-0.1.1/docs/notebooks/index.rst +16 -0
  35. lsapy-0.1.1/docs/notebooks/lsa.ipynb +1969 -0
  36. lsapy-0.1.1/docs/readme.rst +1 -0
  37. lsapy-0.1.1/docs/references.bib +35 -0
  38. lsapy-0.1.1/docs/references.rst +5 -0
  39. lsapy-0.1.1/environment.yml +33 -0
  40. {lsapy-0.1.0.dev1 → lsapy-0.1.1}/pyproject.toml +173 -118
  41. {lsapy-0.1.0.dev1 → lsapy-0.1.1}/src/lsapy/__init__.py +9 -9
  42. lsapy-0.1.1/src/lsapy/core/__init__.py +1 -0
  43. lsapy-0.1.1/src/lsapy/core/functions.py +52 -0
  44. lsapy-0.1.1/src/lsapy/criteria.py +181 -0
  45. lsapy-0.1.1/src/lsapy/functions/__init__.py +7 -0
  46. lsapy-0.1.1/src/lsapy/functions/_discrete.py +30 -0
  47. lsapy-0.1.1/src/lsapy/functions/_suitability.py +158 -0
  48. lsapy-0.1.1/src/lsapy/functions/membership.py +372 -0
  49. lsapy-0.1.1/src/lsapy/lsa.py +624 -0
  50. lsapy-0.1.1/src/lsapy/statistics.py +211 -0
  51. lsapy-0.1.1/src/lsapy/utils.py +56 -0
  52. lsapy-0.1.0.dev1/CHANGELOG.rst +0 -27
  53. lsapy-0.1.0.dev1/PKG-INFO +0 -27
  54. lsapy-0.1.0.dev1/README.md +0 -7
  55. lsapy-0.1.0.dev1/docs/notebooks/introduction.ipynb +0 -2421
  56. lsapy-0.1.0.dev1/environment.yml +0 -236
  57. lsapy-0.1.0.dev1/src/lsapy/criteria.py +0 -75
  58. lsapy-0.1.0.dev1/src/lsapy/functions.py +0 -267
  59. lsapy-0.1.0.dev1/src/lsapy/lsa.py +0 -389
  60. lsapy-0.1.0.dev1/src/lsapy/statistics.py +0 -117
  61. lsapy-0.1.0.dev1/src/lsapy/utils.py +0 -24
  62. {lsapy-0.1.0.dev1 → lsapy-0.1.1}/src/lsapy/data/climate_sample.nc +0 -0
  63. {lsapy-0.1.0.dev1 → lsapy-0.1.1}/src/lsapy/data/soil_sample.nc +0 -0
@@ -0,0 +1,93 @@
1
+ =========
2
+ Changelog
3
+ =========
4
+
5
+ v0.1.1 (2025-07-26)
6
+ -------------------
7
+ Contributor to this version: Baptiste Hamon (@baptistehamon).
8
+
9
+ Internal changes
10
+ ^^^^^^^^^^^^^^^^
11
+ * The documentation has been updated to reflect the changes in ``LandSuitabilityAnalysis`` workflow (issue `#41 <https://github.com/baptistehamon/lsapy/issues/41>`_, PR `#42 <https://github.com/baptistehamon/lsapy/pull/42>`_).
12
+
13
+ v0.1.0 (2025-07-25)
14
+ -------------------
15
+ Contributor to this version: Baptiste Hamon (@baptistehamon).
16
+
17
+ New features
18
+ ^^^^^^^^^^^^
19
+ * New function ``membership.fit_membership`` implemented as replacement of the deprecated ``MembershipSuitFunction.fit`` method (issue `#29 <https://github.com/baptistehamon/lsapy/issues/29>`_, PR `#30 <https://github.com/baptistehamon/lsapy/pull/30>`_).
20
+
21
+ Breaking changes
22
+ ^^^^^^^^^^^^^^^^
23
+ * ``MembershipSuitFunction`` and ``DiscreteSuitFunction`` have been removed (issue `#29 <https://github.com/baptistehamon/lsapy/issues/29>`_, PR `#30 <https://github.com/baptistehamon/lsapy/pull/30>`_).
24
+ * Changes in ``SuitabilityFunction`` (issue `#15 <https://github.com/baptistehamon/lsapy/issues/15>`_, PR `#23 <https://github.com/baptistehamon/lsapy/pull/23>`_ & PR `#30 <https://github.com/baptistehamon/lsapy/pull/30>`_):
25
+ * ``func_method`` and ``func_params`` have been renamed to ``name`` and ``params`` respectively.
26
+ * ``map`` has been deprecated because of its redundancy with the ``__call__`` method. Changes will be permanent in LSAPy v0.1.0. Call the function directly instead.
27
+ * ``LandSuitability`` has been renamed to ``LandSuitabilityAnalysis``. (issue `#15 <https://github.com/baptistehamon/lsapy/issues/15>`_, PR `#26 <https://github.com/baptistehamon/lsapy/pull/26>`_)
28
+ * ``name`` has been renamed to ``land_use``.
29
+ * ``compute_criteria_suitability``, ``compute_category_suitability``, and ``compute_suitability`` methods have been removed and the method ``run`` has been implemented as replacement (issue `#15 <https://github.com/baptistehamon/lsapy/issues/15>`_, PR `#38 <https://github.com/baptistehamon/lsapy/pull/38>`_)
30
+ * ``mask``, ``statistics`` and ``spatial_statistics`` methods have been removed.
31
+
32
+ Internal changes
33
+ ^^^^^^^^^^^^^^^^
34
+ * Templates for requesting new features, asking question and submitting PR have been added (issue `#11 <https://github.com/baptistehamon/lsapy/issues/11>`_, PR `#12 <https://github.com/baptistehamon/lsapy/pull/12>`_).
35
+ * The README has been updated to make links permanent and to add a docs badge (PR `#13 <https://github.com/baptistehamon/lsapy/pull/13>`_, PR `#15 <https://github.com/baptistehamon/lsapy/pull/15>`).
36
+ * A configuration file for Zenodo integration has been added to the repository (PR `#14 <https://github.com/baptistehamon/lsapy/pull/14>`_).
37
+ * `Pre-commit` has been setup and `ruff`, `codespell` and `numpydoc` hooks have been added (issue `#8 <https://github.com/baptistehamon/lsapy/issues/8>`_, PR `#18 <https://github.com/baptistehamon/lsapy/pull/18>`_/PR `#19 <https://github.com/baptistehamon/lsapy/pull/19>`_).
38
+ * The autoupdate schedule of `pre-commit` has been set to weekly (PR `#21 <https://github.com/baptistehamon/lsapy/pull/21>`_)
39
+ * The unused ``introduction.ipynb`` notebook has been removed (issue `#15 <https://github.com/baptistehamon/lsapy/issues/15>`_, PR `#20 <https://github.com/baptistehamon/lsapy/pull/20>`_).
40
+ * The structure around ``SuitabilityFunction`` (PR `#30 <https://github.com/baptistehamon/lsapy/pull/30>`_):
41
+ * The ``SuitabilityFunction`` has been moved to LSAPy ``function._suitability`` module.
42
+ * The membership functions have been moved to the ``function.membership`` module.
43
+ * The discrete function has been moved to the ``function._discrete`` module.
44
+ * The ``equation`` decorator has been rename to ``declare_equation`` and moved to the ``core.function`` module.
45
+ * The ``get_function_from_name`` function has been moved to the ``core.function`` module.
46
+ * Changes on ``SuitabilityCriteria`` (issue `#15 <https://github.com/baptistehamon/lsapy/issues/15>`_, PR `#31 <https://github.com/baptistehamon/lsapy/pull/31>`_):
47
+ * It now has a ``comment`` and ``is_computed`` attributes.
48
+ * ``func`` parameter is now optional, useful when the criteria is already computed.
49
+ * LSAPy logo has been added: README and documentation have been updated to use it (PR `#27 <https://github.com/baptistehamon/lsapy/pull/27>`_)
50
+
51
+ v0.1.0-dev2 (2025-05-25)
52
+ ------------------------
53
+ Contributor to this version: Baptiste Hamon (@baptistehamon).
54
+
55
+ Internal changes
56
+ ^^^^^^^^^^^^^^^^
57
+ * Major changes for documentation (issue `#2 <https://github.com/baptistehamon/lsapy/issues/2>`_, PR `#9 <https://github.com/baptistehamon/lsapy/pull/9>`_):
58
+ * All public objects are now documented using the `NumPy-style <https://numpydoc.readthedocs.io/en/latest/format.html>`_.
59
+ * *introduction.ipynb* has been slip into three different ones: *criteria.ipynb*, *function.ipynb*, and *lsa.ipynb*.
60
+ * The top-level documentation has been updated/created:
61
+ * The format of README and CHANGELOG files is now reStructuredText (RST).
62
+ * A proper README has been created.
63
+ * A CODE_OF_CONDUCT file adopting the `Contributor Covenant <https://www.contributor-covenant.org/>`_ code of conduct has been added.
64
+ * A CONTRIBUTING.md providing guidelines on how to contribute to the project has been added.
65
+ * FT20250 and UC logos used in the documentation have been added to the repository.
66
+ * The documentation building using `Sphinx <https://www.sphinx-doc.org/en/master/>`_ has been setup:
67
+ * The documentation uses the `PyData theme <https://pydata-sphinx-theme.readthedocs.io/en/stable/>`_.
68
+ * A User-facing documentation is now available and has been published on `Read the Docs <https://readthedocs.org/>`_.
69
+ * The project dependencies have been updated and made consistent across *pyproject.toml* and *environments.yml* files.
70
+
71
+ v0.1.0-dev1 (2025-05-16)
72
+ ------------------------
73
+ Contributor to this version: Baptiste Hamon (@baptistehamon).
74
+
75
+ New features
76
+ ^^^^^^^^^^^^
77
+ * Add ruff configuration to the project.
78
+
79
+ Bug fixes
80
+ ^^^^^^^^^
81
+ * Fix the fit of ``MembershipSuitFunction`` returning the wrong best fit (issue `#1 <https://github.com/baptistehamon/lsapy/issues/1>`_, PR `#5 <https://github.com/baptistehamon/lsapy/pull/5>`_)
82
+
83
+ v0.1.0-dev0 (2025-03-12)
84
+ ------------------------
85
+ Contributor to this version: Baptiste Hamon (@baptistehamon).
86
+
87
+ * First release on PyPI.
88
+
89
+ New features
90
+ ^^^^^^^^^^^^
91
+ * ``SuitabilityFunction`` to define the function used for suitability computation.
92
+ * ``SuitabilityCriteria`` to define criteria to consider in the LSA
93
+ * ``LandSuitability`` to conduct LSA.
@@ -0,0 +1,131 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders.
63
+ All complaints will be reviewed and investigated promptly and fairly.
64
+
65
+ All community leaders are obligated to respect the privacy and security of the
66
+ reporter of any incident.
67
+
68
+ ## Enforcement Guidelines
69
+
70
+ Community leaders will follow these Community Impact Guidelines in determining
71
+ the consequences for any action they deem in violation of this Code of Conduct:
72
+
73
+ ### 1. Correction
74
+
75
+ **Community Impact**: Use of inappropriate language or other behavior deemed
76
+ unprofessional or unwelcome in the community.
77
+
78
+ **Consequence**: A private, written warning from community leaders, providing
79
+ clarity around the nature of the violation and an explanation of why the
80
+ behavior was inappropriate. A public apology may be requested.
81
+
82
+ ### 2. Warning
83
+
84
+ **Community Impact**: A violation through a single incident or series of
85
+ actions.
86
+
87
+ **Consequence**: A warning with consequences for continued behavior. No
88
+ interaction with the people involved, including unsolicited interaction with
89
+ those enforcing the Code of Conduct, for a specified period of time. This
90
+ includes avoiding interactions in community spaces as well as external channels
91
+ like social media. Violating these terms may lead to a temporary or permanent
92
+ ban.
93
+
94
+ ### 3. Temporary Ban
95
+
96
+ **Community Impact**: A serious violation of community standards, including
97
+ sustained inappropriate behavior.
98
+
99
+ **Consequence**: A temporary ban from any sort of interaction or public
100
+ communication with the community for a specified period of time. No public or
101
+ private interaction with the people involved, including unsolicited interaction
102
+ with those enforcing the Code of Conduct, is allowed during this period.
103
+ Violating these terms may lead to a permanent ban.
104
+
105
+ ### 4. Permanent Ban
106
+
107
+ **Community Impact**: Demonstrating a pattern of violation of community
108
+ standards, including sustained inappropriate behavior, harassment of an
109
+ individual, or aggression toward or disparagement of classes of individuals.
110
+
111
+ **Consequence**: A permanent ban from any sort of public interaction within the
112
+ community.
113
+
114
+ ## Attribution
115
+
116
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117
+ version 2.1, available at
118
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
119
+
120
+ Community Impact Guidelines were inspired by
121
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
122
+
123
+ For answers to common questions about this code of conduct, see the FAQ at
124
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
125
+ [https://www.contributor-covenant.org/translations][translations].
126
+
127
+ [homepage]: https://www.contributor-covenant.org
128
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
129
+ [Mozilla CoC]: https://github.com/mozilla/diversity
130
+ [FAQ]: https://www.contributor-covenant.org/faq
131
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,181 @@
1
+ =====================
2
+ Contributing to LSAPy
3
+ =====================
4
+
5
+ No matter the scope of your contribution, help is always welcome!
6
+
7
+ The `issue tracker`_ is the best place to start if you want to contribute to `LSAPy`. You can get involved in different ways:
8
+
9
+ * **Submitting feedbacks**: We welcome any feedback on the library, whether it's about the API, the documentation, or anything else.
10
+ * **Suggesting new features**: If you have an idea for a new feature or improvement. Explain your idea in details and provide any thoughts you have on how it could be implemented.
11
+ * **Reporting bugs**: If you find a bug, please report it making sure to include as much information as possible to help us reproduce the bug (e.g., operating system, local setup details, steps to reproduce it...).
12
+
13
+ The `issue tracker`_ is also the place to ask questions about the library. The maintainers and the community will be happy to help you.
14
+
15
+ Contribution Workflow
16
+ ---------------------
17
+ Below is the steps to follow for contributing to the project.
18
+
19
+ #. Fork the `LSAPy` repository on GitHub to your own account.
20
+
21
+ #. Clone your forked repository to your local machine.
22
+
23
+ .. code-block:: shell
24
+
25
+ git clone git@github.com:<your_username>/lsapy.git
26
+ cd lsapy/
27
+
28
+ #. Create a virtual environment (``conda`` is recommended) and install the dependencies.
29
+
30
+ .. code-block:: shell
31
+
32
+ conda env create -f environment.yml
33
+ conda activate lsapy
34
+ python -m pip install -e .
35
+
36
+ #. Create a new branch for your changes.
37
+
38
+ .. code-block:: shell
39
+
40
+ git checkout -b name-of-your-bugfix-or-feature
41
+
42
+ You can now make changes.
43
+
44
+ #. Before committing your changes, we ask that you install ``pre-commit`` in your development environment and run git hooks to ensure that your code adheres to the project's coding standards:
45
+
46
+ .. code-block:: shell
47
+
48
+ # To install the necessary pre-commit hooks:
49
+ pre-commit install
50
+ # To run pre-commit hooks manually:
51
+ pre-commit run --all-files
52
+
53
+ Instead of ``pre-commit``, you can check individual hooks manually with `ruff`:
54
+
55
+ .. code-block:: shell
56
+
57
+ ruff check --fix --show-fixes src/lsapy/
58
+ ruff format src/lsapy/
59
+
60
+ This will automatically format your code and fix any linting issues.
61
+
62
+ #. The last step before committing is to run the tests:
63
+
64
+ .. code-block:: shell
65
+
66
+ pytest --doctest-modules src/lsapy/ # to run doctests
67
+
68
+ #. Commit your changes and push your branch.
69
+
70
+ .. code-block:: shell
71
+
72
+ git add *
73
+ git commit -m "Short description of your changes"
74
+ git push origin name-of-your-bugfix-or-feature
75
+
76
+ #. Create a pull request on GitHub.
77
+
78
+ Before creating a pull request, we first ask you to open an issue in the `GitHub repository`_. Describe the bug you would
79
+ like to fix or the feature you would like to add. Link the issue to your pull request.
80
+
81
+ .. note::
82
+
83
+ **Longer Term Commitment ?**
84
+
85
+ While the project is still in its early stages, a bigger maintainers team may be required in the future if the project
86
+ grows. If you like the project and are interested in joining the maintainers team, please reach out to us. We will be happy to
87
+ discuss it with you.
88
+
89
+ Reminder for maintainers
90
+ ------------------------
91
+
92
+ This section provides some useful information for maintainers.
93
+
94
+ Versioning
95
+ ^^^^^^^^^^
96
+
97
+ The project follows `Semantic Versioning`_ scheme:
98
+
99
+ .. code-block:: shell
100
+
101
+ major.minor.patch-releaseX
102
+ | | | | |
103
+ | | | | +--- Build number (e.g., 1, 2, 3...)
104
+ | | | +------- Degree of production (e.g., dev, alpha, beta)
105
+ | | +-------------- Patch release (e.g., bug fixes)
106
+ | +-------------------- Minor release (e.g., new features)
107
+ +-------------------------- Major release (e.g., breaking changes)
108
+
109
+
110
+ Packaging and Deployment
111
+ ^^^^^^^^^^^^^^^^^^^^^^^^
112
+
113
+ .. note::
114
+
115
+ This section comes largely from the `xclim Contributing guidelines`_. Small edits have been made to match `LSAPy` project.
116
+
117
+ This section serves as a reminder for the maintainers on how to prepare the library for a tagged version and how to deploy packages to TestPyPI and PyPI.
118
+
119
+ When a new version has been minted (features have been successfully integrated test coverage and stability is adequate), maintainers should update the pip-installable package (wheel and source release) on PyPI.
120
+
121
+ From a new branch (e.g. ``prepare-v123``), open a Pull Request and make sure all your changes to support a new version are committed (**update the entry for newest version in CHANGELOG.rst**), then run:
122
+
123
+ .. code-block:: shell
124
+
125
+ bump-my-version bump <option> # possible options: major / minor / patch / release / build
126
+
127
+ These commands will increment the version and create a commit with an autogenerated message.
128
+
129
+ For PyPI releases/stable versions, ensure that the last version bumping command run is ``$ bump-my-version bump release`` to remove the ``-dev``. These changes can now be merged to the ``prepare-v123`` branch:
130
+
131
+ .. code-block:: shell
132
+
133
+ git push origin prepare-v123
134
+
135
+ With this performed, we can tag a version that will act as the GitHub-provided stable source archive. **Be sure to only tag from the `main` branch when all changes from PRs have been merged!** The commands needed are:
136
+
137
+ .. code-block:: shell
138
+
139
+ git tag v1.2.3
140
+ git push --tags
141
+
142
+ .. note::
143
+
144
+ All tags pushed to GitHub will trigger a build and publish a package to TestPyPI by default.
145
+
146
+ The Automated Approach
147
+ ~~~~~~~~~~~~~~~~~~~~~~
148
+
149
+ The simplest way to package `LSAPy` is to "publish" a version on GitHub. GitHub CI Actions are presently configured to build the library and publish the packages on PyPI automatically.
150
+
151
+ .. warning::
152
+
153
+ A published version on PyPI can never be overwritten. Be sure to verify that the package published at https://test.pypi.org/project/lsapy/ matches expectations before publishing a version on GitHub.
154
+
155
+ The Manual Approach
156
+ ~~~~~~~~~~~~~~~~~~~
157
+
158
+ The manual approach to library packaging for general support (pip wheels) requires that the `flit`_ library is installed.
159
+
160
+ From the command line on your Linux distribution, simply run the following from the clone's main dev branch:
161
+
162
+ .. code-block:: shell
163
+
164
+ # To build the packages (sources and wheel)
165
+ flit build
166
+
167
+ # To upload to PyPI
168
+ flit publish
169
+
170
+ The new version based off of the version checked out will now be available via ``pip`` (``$ pip install lsapy``).
171
+
172
+ Credits
173
+ -------
174
+
175
+ This document is inspired by the `xclim Contributing guidelines`_.
176
+
177
+ .. _`GitHub Repository`: https://github.com/baptistehamon/lsapy
178
+ .. _`issue tracker`: https://github.com/baptistehamon/lsapy/issues
179
+ .. _`xclim Contributing guidelines`: https://github.com/Ouranosinc/xclim/blob/main/CONTRIBUTING.rst
180
+ .. _`Semantic Versioning`: https://semver.org/
181
+ .. _`flit`: https://flit.pypa.io/en/stable/index.html
@@ -1,19 +1,19 @@
1
- Copyright (c) 2018 The Python Packaging Authority
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.
1
+ Copyright (c) 2018 The Python Packaging Authority
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
lsapy-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.4
2
+ Name: lsapy
3
+ Version: 0.1.1
4
+ Summary: A Python package for Land Suitability Analysis.
5
+ Keywords: LSAPy,Land Suitability Analysis,Spatial Analysis,GIS,Geography
6
+ Author-email: Baptiste Hamon <baptiste.hamon@pg.canterbury.ac.nz>
7
+ Maintainer-email: Baptiste Hamon <baptiste.hamon@pg.canterbury.ac.nz>
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/x-rst
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Natural Language :: English
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Topic :: Scientific/Engineering :: GIS
17
+ License-File: LICENSE
18
+ Requires-Dist: geopandas >=0.14.0
19
+ Requires-Dist: numpy >=1.26.0
20
+ Requires-Dist: pandas >=2.2.0
21
+ Requires-Dist: regionmask >=0.13.0
22
+ Requires-Dist: scipy >=1.15.0
23
+ Requires-Dist: Shapely >=2.0.0
24
+ Requires-Dist: xarray >=2024.10.0
25
+ Requires-Dist: lsapy[dev] ; extra == "all"
26
+ Requires-Dist: lsapy[docs] ; extra == "all"
27
+ Requires-Dist: bump-my-version >=1.1.4 ; extra == "dev"
28
+ Requires-Dist: codespell >=2.4.1 ; extra == "dev"
29
+ Requires-Dist: flit >=3.11 ; extra == "dev"
30
+ Requires-Dist: ipykernel ; extra == "dev"
31
+ Requires-Dist: ipython >=9.0.0 ; extra == "dev"
32
+ Requires-Dist: matplotlib >=3.9.0 ; extra == "dev"
33
+ Requires-Dist: numpydoc >=1.8.0 ; extra == "dev"
34
+ Requires-Dist: pre-commit >=4.0.0 ; extra == "dev"
35
+ Requires-Dist: pytest >=8.3.0 ; extra == "dev"
36
+ Requires-Dist: ruff >=0.10.0 ; extra == "dev"
37
+ Requires-Dist: xclim >=0.54.0 ; extra == "dev"
38
+ Requires-Dist: nbsphinx >=0.9.5 ; extra == "docs"
39
+ Requires-Dist: pybtex >=0.24.0 ; extra == "docs"
40
+ Requires-Dist: pydata-sphinx-theme >=0.16.0 ; extra == "docs"
41
+ Requires-Dist: sphinx >=8.2.0 ; extra == "docs"
42
+ Requires-Dist: sphinx-autodoc-typehints >=3.2.0 ; extra == "docs"
43
+ Requires-Dist: sphinx-copybutton ; extra == "docs"
44
+ Requires-Dist: sphinx-mdinclude ; extra == "docs"
45
+ Requires-Dist: sphinxcontrib-bibtex >=2.6.0 ; extra == "docs"
46
+ Project-URL: Homepage, https://github.com/baptistehamon/lsapy
47
+ Project-URL: Issues, https://github.com/baptistehamon/lsapy/issues
48
+ Provides-Extra: all
49
+ Provides-Extra: dev
50
+ Provides-Extra: docs
51
+
52
+ .. image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/lsapy/LSAPy_Logo_FullColour.png
53
+ :class: dark-light
54
+ :align: center
55
+ :target: https://github.com/baptistehamon/lsapy
56
+ :width: 400px
57
+ :alt: LSAPy Logo
58
+
59
+ LSAPy: Land Suitability Analysis in Python
60
+ ===========================================
61
+ |pypi| |status| |ruff| |pre-commit| |docs| |question| |zenodo|
62
+
63
+ `LSAPy` stands for Land Suitability Analysis (LSA) in Python. Its objective is to make conducting
64
+ LSA in Python easier and more accessible to users. It provides a set of objects built around
65
+ `xarray`_ and operating together, making LSA's workflow straight forward and easy to understand.
66
+
67
+ .. _`xarray`: https://xarray.pydata.org/en/stable/
68
+
69
+ Quick Start
70
+ -------------
71
+ To install `LSAPy`, you can use `pip`:
72
+
73
+ .. code-block:: shell
74
+
75
+ pip install lsapy
76
+
77
+
78
+ You can now perform your LSA:
79
+
80
+ .. code-block:: python
81
+
82
+ # import modules
83
+ from lsapy import LandSuitabilityAnalysis, SuitabilityCriteria, SuitabilityFunction
84
+
85
+ # define your criteria
86
+ criteria = {
87
+ 'crit1': SuitabilityCriteria(
88
+ name='criteria1',
89
+ indicator= indicator1, # xarray object
90
+ func=SuitabilityFunction(name="function_name", params={'param1': value1, 'param2': value2})
91
+ ),
92
+ 'crit2': SuitabilityCriteria(
93
+ name='criteria2',
94
+ indicator= indicator2, # xarray object
95
+ func= SuitabilityFunction(name="another_function_name", params={'param1': value1, 'param2': value2})
96
+ )
97
+ # add all necessary criteria
98
+ }
99
+
100
+ # define your land suitability
101
+ lsa = LandSuitabilityAnalysis(
102
+ land_use= 'land_use_name',
103
+ criteria= criteria,
104
+ )
105
+
106
+ # run your analysis
107
+ lsa.run(params)
108
+
109
+ More detailed tutorials and examples can be found in the `User Guide`_.
110
+
111
+ .. _`User Guide`: https://lsapy.readthedocs.io/en/latest/notebooks/index.html
112
+
113
+
114
+ Contributing
115
+ ------------
116
+
117
+ `LSAPy` is an open-source project and we welcome contributions from the community. If you are interested in contributing, please
118
+ refer to the `Contribution`_ section for guidelines on how to get started helping us improve the library.
119
+
120
+ .. _`Contribution`: https://lsapy.readthedocs.io/en/latest/community/contributing.html
121
+
122
+ Credits
123
+ -------
124
+
125
+ The development of `LSAPy` started as part of a PhD, funded by the `Food Transition 2050`_ Joint Postgraduate School and hosted
126
+ by the `University of Canterbury`_ in New Zealand.
127
+
128
+ |FT2050| |UC-white| |UC-black|
129
+
130
+ The Python package has been created following the `pyOpenSci Guidebook`_.
131
+
132
+ .. _`Food Transition 2050`: https://www.foodtransitions2050.ac.nz/
133
+ .. _`University of Canterbury`: https://www.canterbury.ac.nz/
134
+ .. _`pyOpenSci Guidebook`: https://www.pyopensci.org/python-package-guide/
135
+
136
+ .. |logo| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/lsapy/LSAPy_Logo_FullColour.png
137
+ :class: dark-light
138
+ :target: https://github.com/baptistehamon/lsapy
139
+ :width: 400px
140
+ :alt: LSAPy Logo
141
+
142
+ .. |FT2050| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/FT2050-full_colour.png
143
+ :class: dark-light
144
+ :target: https://www.foodtransitions2050.ac.nz/
145
+ :width: 200px
146
+ :alt: Food Transition 2050 Logo
147
+
148
+ .. |UC-white| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/UCWhite.png
149
+ :class: only-dark
150
+ :target: https://www.canterbury.ac.nz/
151
+ :width: 100px
152
+ :alt: University of Canterbury Logo
153
+
154
+ .. |UC-black| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/UCBlack.png
155
+ :class: only-light
156
+ :target: https://www.canterbury.ac.nz/
157
+ :width: 100px
158
+ :alt: University of Canterbury Logo
159
+
160
+ .. |pypi| image:: https://img.shields.io/pypi/v/lsapy.svg
161
+ :target: https://pypi.python.org/pypi/lsapy
162
+ :alt: Python Package Index Build
163
+
164
+ .. |status| image:: https://www.repostatus.org/badges/latest/wip.svg
165
+ :target: https://www.repostatus.org/#wip
166
+ :alt: Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.
167
+
168
+ .. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.15015111.svg
169
+ :target: https://doi.org/10.5281/zenodo.15015111
170
+ :alt: Zenodo DOI
171
+
172
+ .. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
173
+ :target: https://github.com/astral-sh/ruff
174
+ :alt: Ruff
175
+
176
+ .. |docs| image:: https://readthedocs.org/projects/lsapy/badge/
177
+ :target: https://lsapy.readthedocs.io/en/latest/
178
+ :alt: Documentation Status
179
+
180
+ .. |question| image:: https://img.shields.io/badge/Question_%3F-blue?style=social&logo=github
181
+ :target: https://github.com/baptistehamon/lsapy/labels/question
182
+ :alt: Link to question issues
183
+
184
+ .. |pre-commit| image:: https://results.pre-commit.ci/badge/github/baptistehamon/lsapy/main.svg
185
+ :target: https://results.pre-commit.ci/latest/github/baptistehamon/lsapy/main
186
+ :alt: pre-commit.ci status
187
+