lsapy 0.1.0.dev1__tar.gz → 0.1.0.dev2__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 (45) hide show
  1. lsapy-0.1.0.dev2/CHANGELOG.rst +47 -0
  2. lsapy-0.1.0.dev2/CODE_OF_CONDUCT.md +132 -0
  3. lsapy-0.1.0.dev2/CONTRIBUTING.rst +157 -0
  4. lsapy-0.1.0.dev2/PKG-INFO +154 -0
  5. lsapy-0.1.0.dev2/README.rst +107 -0
  6. lsapy-0.1.0.dev2/docs/Makefile +20 -0
  7. lsapy-0.1.0.dev2/docs/api/index.rst +39 -0
  8. lsapy-0.1.0.dev2/docs/changelog.rst +1 -0
  9. lsapy-0.1.0.dev2/docs/community/code_of_conduct.rst +1 -0
  10. lsapy-0.1.0.dev2/docs/community/contributing.rst +1 -0
  11. lsapy-0.1.0.dev2/docs/community/index.rst +19 -0
  12. lsapy-0.1.0.dev2/docs/conf.py +130 -0
  13. lsapy-0.1.0.dev2/docs/getting_started/index.rst +29 -0
  14. lsapy-0.1.0.dev2/docs/index.rst +33 -0
  15. lsapy-0.1.0.dev2/docs/logos/FT2050-full_colour.png +0 -0
  16. lsapy-0.1.0.dev2/docs/logos/UCBlack.png +0 -0
  17. lsapy-0.1.0.dev2/docs/logos/UCWhite.png +0 -0
  18. lsapy-0.1.0.dev2/docs/make.bat +35 -0
  19. lsapy-0.1.0.dev2/docs/notebooks/criteria.ipynb +142 -0
  20. lsapy-0.1.0.dev2/docs/notebooks/functions.ipynb +322 -0
  21. lsapy-0.1.0.dev2/docs/notebooks/index.rst +16 -0
  22. {lsapy-0.1.0.dev1 → lsapy-0.1.0.dev2}/docs/notebooks/introduction.ipynb +5 -5
  23. lsapy-0.1.0.dev2/docs/notebooks/lsa.ipynb +1956 -0
  24. lsapy-0.1.0.dev2/docs/readme.rst +1 -0
  25. lsapy-0.1.0.dev2/docs/references.bib +35 -0
  26. lsapy-0.1.0.dev2/docs/references.rst +5 -0
  27. lsapy-0.1.0.dev2/environment.yml +30 -0
  28. {lsapy-0.1.0.dev1 → lsapy-0.1.0.dev2}/pyproject.toml +36 -3
  29. {lsapy-0.1.0.dev1 → lsapy-0.1.0.dev2}/src/lsapy/__init__.py +1 -1
  30. lsapy-0.1.0.dev2/src/lsapy/criteria.py +147 -0
  31. lsapy-0.1.0.dev2/src/lsapy/functions.py +635 -0
  32. {lsapy-0.1.0.dev1 → lsapy-0.1.0.dev2}/src/lsapy/lsa.py +262 -13
  33. lsapy-0.1.0.dev2/src/lsapy/statistics.py +211 -0
  34. lsapy-0.1.0.dev2/src/lsapy/utils.py +56 -0
  35. lsapy-0.1.0.dev1/CHANGELOG.rst +0 -27
  36. lsapy-0.1.0.dev1/PKG-INFO +0 -27
  37. lsapy-0.1.0.dev1/README.md +0 -7
  38. lsapy-0.1.0.dev1/environment.yml +0 -236
  39. lsapy-0.1.0.dev1/src/lsapy/criteria.py +0 -75
  40. lsapy-0.1.0.dev1/src/lsapy/functions.py +0 -267
  41. lsapy-0.1.0.dev1/src/lsapy/statistics.py +0 -117
  42. lsapy-0.1.0.dev1/src/lsapy/utils.py +0 -24
  43. {lsapy-0.1.0.dev1 → lsapy-0.1.0.dev2}/LICENSE +0 -0
  44. {lsapy-0.1.0.dev1 → lsapy-0.1.0.dev2}/src/lsapy/data/climate_sample.nc +0 -0
  45. {lsapy-0.1.0.dev1 → lsapy-0.1.0.dev2}/src/lsapy/data/soil_sample.nc +0 -0
@@ -0,0 +1,47 @@
1
+ =========
2
+ Changelog
3
+ =========
4
+
5
+ v0.1.0-dev2 (2025-05-25)
6
+ ------------------------
7
+ Contributor to this version: Baptiste Hamon (@baptistehamon).
8
+
9
+ Internal changes
10
+ ^^^^^^^^^^^^^^^^
11
+ * Major changes for documentation (issue `#2 <https://github.com/baptistehamon/lsapy/issues/2>`_, PR `#9 <https://github.com/baptistehamon/lsapy/pull/9>`_):
12
+ * All public objects are now documented using the `NumPy-style <https://numpydoc.readthedocs.io/en/latest/format.html>`_.
13
+ * *introduction.ipynb* has been slip into three different ones: *criteria.ipynb*, *function.ipynb*, and *lsa.ipynb*.
14
+ * The top-level documentation has been updated/created:
15
+ * The format of README and CHANGELOG files is now reStructuredText (RST).
16
+ * A proper README has been created.
17
+ * A CODE_OF_CONDUCT file adopting the `Contributor Covenant <https://www.contributor-covenant.org/>`_ code of conduct has been added.
18
+ * A CONTRIBUTING.md providing guidelines on how to contribute to the project has been added.
19
+ * FT20250 and UC logos used in the documentation have been added to the repository.
20
+ * The documentation building using `Sphinx <https://www.sphinx-doc.org/en/master/>`_ has been setup:
21
+ * The documentation uses the `PyData theme <https://pydata-sphinx-theme.readthedocs.io/en/stable/>`_.
22
+ * A User-facing documentation is now available and has been published on `Read the Docs <https://readthedocs.org/>`_.
23
+ * The project dependencies have been updated and made consistent accross *pyproject.toml* and *environments.yml* files.
24
+
25
+ v0.1.0-dev1 (2025-05-16)
26
+ ------------------------
27
+ Contributor to this version: Baptiste Hamon (@baptistehamon).
28
+
29
+ New features
30
+ ^^^^^^^^^^^^
31
+ * Add ruff configuration to the project.
32
+
33
+ Bug fixes
34
+ ^^^^^^^^^
35
+ * 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>`_)
36
+
37
+ v0.1.0-dev0 (2025-03-12)
38
+ ------------------------
39
+ Contributor to this version: Baptiste Hamon (@baptistehamon).
40
+
41
+ * First release on PyPI.
42
+
43
+ New features
44
+ ^^^^^^^^^^^^
45
+ * ``SuitabilityFunction`` to define the function used for suitability computation.
46
+ * ``SuitabilityCriteria`` to define criteria to consider in the LSA
47
+ * ``LandSuitability`` to conduct LSA.
@@ -0,0 +1,132 @@
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
132
+
@@ -0,0 +1,157 @@
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 you to format your code using `ruff`:
45
+
46
+ .. code-block:: shell
47
+
48
+ ruff check --fix src/lsapy/
49
+ ruff format src/lsapy/
50
+
51
+ This will automatically format your code and fix any linting issues.
52
+
53
+ #. The last step before committing is to run the tests:
54
+
55
+ .. code-block:: shell
56
+
57
+ pytest --doctest-modules src/lsapy/ # to run doctests
58
+
59
+ #. Commit your changes and push your branch.
60
+
61
+ .. code-block:: shell
62
+
63
+ git add *
64
+ git commit -m "Short description of your changes"
65
+ git push origin name-of-your-bugfix-or-feature
66
+
67
+ #. Create a pull request on GitHub.
68
+
69
+ Before creating a pull request, we first ask you to open an issue in the `GitHub repository`_. Describe the bug you would
70
+ like to fix or the feature you would like to add. Link the issue to your pull request.
71
+
72
+ .. note::
73
+
74
+ **Longer Term Commitment ?**
75
+
76
+ While the project is still in its early stages, a bigger maintainers team may be required in the future if the project
77
+ grows. If you like the project and are interested in joining the maintainers team, please reach out to us. We will be happy to
78
+ discuss it with you.
79
+
80
+ Reminder for maintainers
81
+ ------------------------
82
+
83
+ This section provides some useful information for maintainers.
84
+
85
+ Versioning
86
+ ^^^^^^^^^^
87
+
88
+ The project follows `Semantic Versioning`_ scheme:
89
+
90
+ .. code-block:: shell
91
+
92
+ major.minor.patch-releaseX
93
+ | | | | |
94
+ | | | | +--- Build number (e.g., 1, 2, 3...)
95
+ | | | +------- Degree of production (e.g., dev, alpha, beta)
96
+ | | +-------------- Patch release (e.g., bug fixes)
97
+ | +-------------------- Minor release (e.g., new features)
98
+ +-------------------------- Major release (e.g., breaking changes)
99
+
100
+
101
+ Packaging and Deployment
102
+ ^^^^^^^^^^^^^^^^^^^^^^^^
103
+
104
+ .. note::
105
+
106
+ This section comes largely from the `xclim Contributing guidelines`_. Small edits have been made to match the
107
+ development stage of `LSAPy`.
108
+
109
+ 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.
110
+
111
+ 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.
112
+
113
+ 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:
114
+
115
+ .. code-block:: shell
116
+
117
+ bump-my-version bump <option> # possible options: major / minor / patch / release / build
118
+
119
+ These commands will increment the version and create a commit with an autogenerated message.
120
+
121
+ 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:
122
+
123
+ .. code-block:: shell
124
+
125
+ git push origin prepare-v123
126
+
127
+ 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:
128
+
129
+ Tagging and releasing on GitHub still have to made `via` the GitHub interface. The tag name should be the same as the version number (e.g., ``v1.2.3``).
130
+
131
+ The Manual Approach
132
+ ~~~~~~~~~~~~~~~~~~~
133
+
134
+ The manual approach to library packaging for general support (pip wheels) requires that the `flit`_ library is installed.
135
+
136
+ From the command line on your Linux distribution, simply run the following from the clone's main dev branch:
137
+
138
+ .. code-block:: shell
139
+
140
+ # To build the packages (sources and wheel)
141
+ flit build
142
+
143
+ # To upload to PyPI
144
+ flit publish
145
+
146
+ The new version based off of the version checked out will now be available via ``pip`` (``$ pip install lsapy``).
147
+
148
+ Credits
149
+ -------
150
+
151
+ This document is inspired by the `xclim Contributing guidelines`_.
152
+
153
+ .. _`GitHub Repository`: https://github.com/baptistehamon/lsapy
154
+ .. _`issue tracker`: https://github.com/baptistehamon/lsapy/issues
155
+ .. _`xclim Contributing guidelines`: https://github.com/Ouranosinc/xclim/blob/main/CONTRIBUTING.rst
156
+ .. _`Semantic Versioning`: https://semver.org/
157
+ .. _`flit`: https://flit.pypa.io/en/stable/index.html
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.4
2
+ Name: lsapy
3
+ Version: 0.1.0.dev2
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: flit >=3.11 ; extra == "dev"
29
+ Requires-Dist: ipykernel ; extra == "dev"
30
+ Requires-Dist: ipython >=9.0.0 ; extra == "dev"
31
+ Requires-Dist: matplotlib >=3.9.0 ; extra == "dev"
32
+ Requires-Dist: pytest >=8.3.0 ; extra == "dev"
33
+ Requires-Dist: ruff >=0.10.0 ; extra == "dev"
34
+ Requires-Dist: nbsphinx >=0.9.5 ; extra == "docs"
35
+ Requires-Dist: pybtex >=0.24.0 ; extra == "docs"
36
+ Requires-Dist: pydata-sphinx-theme >=0.16.0 ; extra == "docs"
37
+ Requires-Dist: sphinx >=8.2.0 ; extra == "docs"
38
+ Requires-Dist: sphinx-autodoc-typehints >=3.2.0 ; extra == "docs"
39
+ Requires-Dist: sphinx-copybutton ; extra == "docs"
40
+ Requires-Dist: sphinx-mdinclude ; extra == "docs"
41
+ Requires-Dist: sphinxcontrib-bibtex >=2.6.0 ; extra == "docs"
42
+ Project-URL: Homepage, https://github.com/baptistehamon/lsapy
43
+ Project-URL: Issues, https://github.com/baptistehamon/lsapy/issues
44
+ Provides-Extra: all
45
+ Provides-Extra: dev
46
+ Provides-Extra: docs
47
+
48
+ LSAPy: Land Suitability Analysis in Python
49
+ ===========================================
50
+
51
+ |pypi| |zenodo| |ruff|
52
+
53
+ `LSAPy` stand for Land Suitability Analysis (LSA) in Python. Its objective is to make conducting
54
+ LSA in Python easier and more accessible to users. It provides a set of objects built around
55
+ `xarray`_ and operating together, making LSA's workflow straight forward and easy to understand.
56
+
57
+ .. _`xarray`: https://xarray.pydata.org/en/stable/
58
+
59
+ Quick Start
60
+ -------------
61
+ To install `LSAPy`, you can use `pip`:
62
+
63
+ .. code-block:: shell
64
+
65
+ pip install lsapy
66
+
67
+
68
+ You can now perform your LSA:
69
+
70
+ .. code-block:: python
71
+
72
+ # import modules
73
+ from lsapy import SuitabilityFunction, SuitabilityCriteria, LandSuitability
74
+
75
+ # define your criteria
76
+ criteria = {
77
+ 'crit1': SuitabilityCriteria(
78
+ name='criteria1',
79
+ indicator= indicator1, # xarray object
80
+ suitability_function= SuitabilityFunction("relevant-function")
81
+ ),
82
+ 'crit2': SuitabilityCriteria(
83
+ name='criteria2',
84
+ indicator= indicator2, # xarray object
85
+ suitability_function= SuitabilityFunction("relevant-function")
86
+ )
87
+ # add all necessary criteria
88
+ }
89
+
90
+ # define your land suitability
91
+ ls = LandSuitability(
92
+ name= 'name_of_your_lsa',
93
+ criteria= criteria,
94
+ )
95
+
96
+ # run your analysis
97
+ ls.compute_suitability(params)
98
+
99
+ More detailed tutorials and examples can be found in the `User Guide`_.
100
+
101
+ .. _`User Guide`: https://lsapy.readthedocs.io/en/latest/notebooks/index.html
102
+
103
+
104
+ Contributing
105
+ ------------
106
+
107
+ `LSAPy` is an open-source project and we welcome contributions from the community. If you are interested in contributing, please
108
+ refer to the `Contribution`_ section for guidelines on how to get started helping us improve the library.
109
+
110
+ .. _`Contribution`: https://lsapy.readthedocs.io/en/latest/community/contributing.html
111
+
112
+ Credits
113
+ -------
114
+
115
+ The development of `LSAPy` started as part of a PhD, funded by the the `Food Transition 2050`_ Joint Postgraduate School and hosted
116
+ by the `University of Canterbury`_ in New Zealand.
117
+
118
+ |FT2050| |UC-white| |UC-black|
119
+
120
+ The Python package has been created following the `pyOpenSci Guidebook`_.
121
+
122
+ .. _`Food Transition 2050`: https://www.foodtransitions2050.ac.nz/
123
+ .. _`University of Canterbury`: https://www.canterbury.ac.nz/
124
+ .. _`pyOpenSci Guidebook`: https://www.pyopensci.org/python-package-guide/
125
+
126
+ .. |FT2050| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/FT2050-full_colour.png
127
+ :class: dark-light
128
+ :target: https://www.foodtransitions2050.ac.nz/
129
+ :width: 200px
130
+ :alt: Food Transition 2050 Logo
131
+
132
+ .. |UC-white| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/UCWhite.png
133
+ :class: only-dark
134
+ :target: https://www.canterbury.ac.nz/
135
+ :width: 100px
136
+ :alt: University of Canterbury Logo
137
+
138
+ .. |UC-black| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/UCBlack.png
139
+ :class: only-light
140
+ :target: https://www.canterbury.ac.nz/
141
+ :width: 100px
142
+ :alt: University of Canterbury Logo
143
+
144
+ .. |pypi| image:: https://img.shields.io/pypi/v/lsapy.svg
145
+ :target: https://pypi.python.org/pypi/lsapy
146
+ :alt: Python Package Index Build
147
+
148
+ .. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.15015111.svg
149
+ :target: https://doi.org/10.5281/zenodo.15015111
150
+ :alt: Zenodo DOI
151
+
152
+ .. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
153
+ :target: https://github.com/astral-sh/ruff
154
+ :alt: Ruff
@@ -0,0 +1,107 @@
1
+ LSAPy: Land Suitability Analysis in Python
2
+ ===========================================
3
+
4
+ |pypi| |zenodo| |ruff|
5
+
6
+ `LSAPy` stand for Land Suitability Analysis (LSA) in Python. Its objective is to make conducting
7
+ LSA in Python easier and more accessible to users. It provides a set of objects built around
8
+ `xarray`_ and operating together, making LSA's workflow straight forward and easy to understand.
9
+
10
+ .. _`xarray`: https://xarray.pydata.org/en/stable/
11
+
12
+ Quick Start
13
+ -------------
14
+ To install `LSAPy`, you can use `pip`:
15
+
16
+ .. code-block:: shell
17
+
18
+ pip install lsapy
19
+
20
+
21
+ You can now perform your LSA:
22
+
23
+ .. code-block:: python
24
+
25
+ # import modules
26
+ from lsapy import SuitabilityFunction, SuitabilityCriteria, LandSuitability
27
+
28
+ # define your criteria
29
+ criteria = {
30
+ 'crit1': SuitabilityCriteria(
31
+ name='criteria1',
32
+ indicator= indicator1, # xarray object
33
+ suitability_function= SuitabilityFunction("relevant-function")
34
+ ),
35
+ 'crit2': SuitabilityCriteria(
36
+ name='criteria2',
37
+ indicator= indicator2, # xarray object
38
+ suitability_function= SuitabilityFunction("relevant-function")
39
+ )
40
+ # add all necessary criteria
41
+ }
42
+
43
+ # define your land suitability
44
+ ls = LandSuitability(
45
+ name= 'name_of_your_lsa',
46
+ criteria= criteria,
47
+ )
48
+
49
+ # run your analysis
50
+ ls.compute_suitability(params)
51
+
52
+ More detailed tutorials and examples can be found in the `User Guide`_.
53
+
54
+ .. _`User Guide`: https://lsapy.readthedocs.io/en/latest/notebooks/index.html
55
+
56
+
57
+ Contributing
58
+ ------------
59
+
60
+ `LSAPy` is an open-source project and we welcome contributions from the community. If you are interested in contributing, please
61
+ refer to the `Contribution`_ section for guidelines on how to get started helping us improve the library.
62
+
63
+ .. _`Contribution`: https://lsapy.readthedocs.io/en/latest/community/contributing.html
64
+
65
+ Credits
66
+ -------
67
+
68
+ The development of `LSAPy` started as part of a PhD, funded by the the `Food Transition 2050`_ Joint Postgraduate School and hosted
69
+ by the `University of Canterbury`_ in New Zealand.
70
+
71
+ |FT2050| |UC-white| |UC-black|
72
+
73
+ The Python package has been created following the `pyOpenSci Guidebook`_.
74
+
75
+ .. _`Food Transition 2050`: https://www.foodtransitions2050.ac.nz/
76
+ .. _`University of Canterbury`: https://www.canterbury.ac.nz/
77
+ .. _`pyOpenSci Guidebook`: https://www.pyopensci.org/python-package-guide/
78
+
79
+ .. |FT2050| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/FT2050-full_colour.png
80
+ :class: dark-light
81
+ :target: https://www.foodtransitions2050.ac.nz/
82
+ :width: 200px
83
+ :alt: Food Transition 2050 Logo
84
+
85
+ .. |UC-white| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/UCWhite.png
86
+ :class: only-dark
87
+ :target: https://www.canterbury.ac.nz/
88
+ :width: 100px
89
+ :alt: University of Canterbury Logo
90
+
91
+ .. |UC-black| image:: https://raw.githubusercontent.com/baptistehamon/lsapy/main/docs/logos/UCBlack.png
92
+ :class: only-light
93
+ :target: https://www.canterbury.ac.nz/
94
+ :width: 100px
95
+ :alt: University of Canterbury Logo
96
+
97
+ .. |pypi| image:: https://img.shields.io/pypi/v/lsapy.svg
98
+ :target: https://pypi.python.org/pypi/lsapy
99
+ :alt: Python Package Index Build
100
+
101
+ .. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.15015111.svg
102
+ :target: https://doi.org/10.5281/zenodo.15015111
103
+ :alt: Zenodo DOI
104
+
105
+ .. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
106
+ :target: https://github.com/astral-sh/ruff
107
+ :alt: Ruff
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,39 @@
1
+ =========
2
+ LSAPy API
3
+ =========
4
+
5
+ This page provides an overview of all implemented public objects, functions and methods of the `LSAPy` package.
6
+
7
+ .. warning::
8
+
9
+ The package is still in development and only pre-release versions have been published,
10
+ meaning the package should not be considered stable yet. Breaking changes are likely to
11
+ occur before the first official release.
12
+
13
+ .. currentmodule:: lsapy
14
+
15
+ Constructors
16
+ ------------
17
+
18
+ .. autosummary::
19
+ :toctree: generated
20
+ :nosignatures:
21
+
22
+ SuitabilityFunction
23
+ SuitabilityCriteria
24
+ LandSuitability
25
+
26
+ Membership Functions
27
+ --------------------
28
+
29
+ .. autosummary::
30
+ :toctree: generated
31
+ :nosignatures:
32
+
33
+ functions.logistic
34
+ functions.sigmoid
35
+ functions.vetharaniam2022_eq3
36
+ functions.vetharaniam2022_eq5
37
+ functions.vetharaniam2024_eq8
38
+ functions.vetharaniam2024_eq10
39
+
@@ -0,0 +1 @@
1
+ .. include:: ../CHANGELOG.rst
@@ -0,0 +1 @@
1
+ .. mdinclude:: ../../CODE_OF_CONDUCT.md
@@ -0,0 +1 @@
1
+ .. include:: ../../CONTRIBUTING.rst
@@ -0,0 +1,19 @@
1
+ :html_theme.sidebar_secondary.remove:
2
+
3
+ =========
4
+ Community
5
+ =========
6
+
7
+ The project is only at the beginning of its journey but help is always welcome! We are working hard to make it better,
8
+ and in that sense, we appreciate any feedback and contributions. As a project's contributor, you should adhere to the
9
+ :doc:`Code of Conduct </community/code_of_conduct>`.
10
+
11
+ If you are interested in contributing to the project, please read the :doc:`Contributing Guidelines </community/contributing>`.
12
+
13
+ .. toctree::
14
+ :maxdepth: 1
15
+ :caption: Community
16
+ :hidden:
17
+
18
+ Contributing <contributing>
19
+ Code of Conduct <code_of_conduct>