lokigi 0.1.0__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.
- lokigi-0.1.0/.gitignore +32 -0
- lokigi-0.1.0/LICENSE.md +21 -0
- lokigi-0.1.0/PKG-INFO +105 -0
- lokigi-0.1.0/README.md +75 -0
- lokigi-0.1.0/lokigi/__init__.py +7 -0
- lokigi-0.1.0/lokigi/mixins/__init__.py +0 -0
- lokigi-0.1.0/lokigi/mixins/site_solution_plots.py +2219 -0
- lokigi-0.1.0/lokigi/mixins/site_solvers.py +430 -0
- lokigi-0.1.0/lokigi/mixins/solution_comparator_methods.py +228 -0
- lokigi-0.1.0/lokigi/mixins/solution_comparator_plots.py +86 -0
- lokigi-0.1.0/lokigi/plot_utils.py +254 -0
- lokigi-0.1.0/lokigi/site.py +1708 -0
- lokigi-0.1.0/lokigi/site_solutions.py +353 -0
- lokigi-0.1.0/lokigi/utils.py +666 -0
- lokigi-0.1.0/pyproject.toml +69 -0
lokigi-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
*.pyc*
|
|
2
|
+
|
|
3
|
+
token.txt
|
|
4
|
+
|
|
5
|
+
/.quarto/
|
|
6
|
+
tests/*test*.csv
|
|
7
|
+
tests/outputs/*test*
|
|
8
|
+
tests/outputs/simple_funcs_run/*test*
|
|
9
|
+
|
|
10
|
+
.tox
|
|
11
|
+
htmlcov/
|
|
12
|
+
*.coverage
|
|
13
|
+
.cache/
|
|
14
|
+
|
|
15
|
+
.vscode
|
|
16
|
+
|
|
17
|
+
**/*.quarto_ipynb
|
|
18
|
+
|
|
19
|
+
_freeze/
|
|
20
|
+
dist/
|
|
21
|
+
docs/
|
|
22
|
+
reference/
|
|
23
|
+
|
|
24
|
+
node_modules/
|
|
25
|
+
package.json
|
|
26
|
+
package-lock.json
|
|
27
|
+
|
|
28
|
+
_environment
|
|
29
|
+
|
|
30
|
+
.venv
|
|
31
|
+
|
|
32
|
+
sample_data/LSOA_2011_Boundaries_Super_Generalised_Clipped_BSC_EW_V4.geojson
|
lokigi-0.1.0/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sammi Rosser
|
|
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.
|
lokigi-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lokigi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A package for generating, ranking, analysing and visualising the best candidate solutions for discrete facility location problems
|
|
5
|
+
Project-URL: Homepage, https://github.com/hsma-tools/lokigi
|
|
6
|
+
Project-URL: Documentation, http://hsma-tools.github.io/lokigi/lokigi_docs/
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/hsma-tools/lokigi/issues
|
|
8
|
+
Author-email: Sammi Rosser <s.j.rosser@exeter.ac.uk>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE.md
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Requires-Dist: adjusttext>=1.3.0
|
|
18
|
+
Requires-Dist: contextily<2.0.0,>=1.5.0
|
|
19
|
+
Requires-Dist: folium>=0.14.0
|
|
20
|
+
Requires-Dist: geopandas<2.0.0,>=1.0.0
|
|
21
|
+
Requires-Dist: mapclassify<3.0.0,>=2.0.0
|
|
22
|
+
Requires-Dist: numpy<3.0.0,>=1.26.2
|
|
23
|
+
Requires-Dist: pandas<4.0.0,>=2.0.1
|
|
24
|
+
Requires-Dist: pydantic<3.0.0,>=2.0.0
|
|
25
|
+
Requires-Dist: seaborn>=0.13.2
|
|
26
|
+
Requires-Dist: sweetpareto>=1.1.0
|
|
27
|
+
Requires-Dist: tqdm>=4.67.3
|
|
28
|
+
Requires-Dist: webcolors>=24.11.1
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
## lokigi - Generate, rank, analyse and visualise the best candidate solutions for facility location problems
|
|
32
|
+
|
|
33
|
+
lokigi means 'to locate' or 'to place' in the Esperanto language.
|
|
34
|
+
|
|
35
|
+
(or it's the backronym '**L**ocation **O**ptimisation: **K**-best solution **I**nspection, **G**eneration & **I**nsights' - whichever floats your boat)
|
|
36
|
+
|
|
37
|
+
lokigi exists to make the process of providing decision support for healthcare problems with a geographical component easier.
|
|
38
|
+
|
|
39
|
+
A range of fantastic libraries exist for geographic optimization (e.g. [spopt](https://pysal.org/spopt/)), but many use linear programming to optimize the solution, meaning you emerge with a single optimal solution. For healthcare contexts, this often isn't ideal - decision makers need a range of near-optimal solutions to balance against real-world constraints.
|
|
40
|
+
|
|
41
|
+
Building on [work from Dr Tom Monks](https://github.com/health-data-science-OR/healthcare-logistics/tree/master/optimisation) and [previous rounds of the Health Service Modelling Associates programme](https://hsma.co.uk/hsma_content/modules/current_module_details/3_geographic_modelling_visualisation.html), lokigi is designed to make it easier to beginner programmers to tackle location optimization problems for the benefit of their organisations.
|
|
42
|
+
|
|
43
|
+
Lokigi is planned to expand to boundary optimisation problems in the future.
|
|
44
|
+
|
|
45
|
+
# Getting started
|
|
46
|
+
|
|
47
|
+
Head to the [documentation](https://hsma-tools.github.io/lokigi/lokigi_docs/) to find out how to use the package.
|
|
48
|
+
|
|
49
|
+
For now, you would need to clone this repository to make use of it.
|
|
50
|
+
|
|
51
|
+
PyPi and Conda support coming very soon.
|
|
52
|
+
|
|
53
|
+
## Contributors
|
|
54
|
+
|
|
55
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
56
|
+
<!-- prettier-ignore-start -->
|
|
57
|
+
<!-- markdownlint-disable -->
|
|
58
|
+
<table>
|
|
59
|
+
<tbody>
|
|
60
|
+
<tr>
|
|
61
|
+
<td align="center" valign="top" width="14.28%"><a href="http://hsma.co.uk"><img src="https://avatars.githubusercontent.com/u/29951987?v=4?s=100" width="100px;" alt="Sammi Rosser"/><br /><sub><b>Sammi Rosser</b></sub></a><br /><a href="https://github.com/hsma-tools/lokigi/commits?author=Bergam0t" title="Code">💻</a> <a href="https://github.com/hsma-tools/lokigi/commits?author=Bergam0t" title="Documentation">📖</a> <a href="https://github.com/hsma-tools/lokigi/commits?author=Bergam0t" title="Tests">⚠️</a> <a href="https://github.com/hsma-tools/lokigi/issues?q=author%3ABergam0t" title="Bug reports">🐛</a> <a href="#content-Bergam0t" title="Content">🖋</a> <a href="#design-Bergam0t" title="Design">🎨</a> <a href="#example-Bergam0t" title="Examples">💡</a> <a href="#ideas-Bergam0t" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-Bergam0t" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-Bergam0t" title="Maintenance">🚧</a> <a href="#projectManagement-Bergam0t" title="Project Management">📆</a> <a href="#research-Bergam0t" title="Research">🔬</a> <a href="#tutorial-Bergam0t" title="Tutorials">✅</a></td>
|
|
62
|
+
<td align="center" valign="top" width="14.28%"><a href="https://experts.exeter.ac.uk/19244-thomas-monks"><img src="https://avatars.githubusercontent.com/u/881493?v=4?s=100" width="100px;" alt="Tom Monks"/><br /><sub><b>Tom Monks</b></sub></a><br /><a href="https://github.com/hsma-tools/lokigi/commits?author=TomMonks" title="Code">💻</a> <a href="#ideas-TomMonks" title="Ideas, Planning, & Feedback">🤔</a> <a href="#mentoring-TomMonks" title="Mentoring">🧑🏫</a></td>
|
|
63
|
+
<td align="center" valign="top" width="14.28%"><a href="https://sites.google.com/nihr.ac.uk/hsma"><img src="https://avatars.githubusercontent.com/u/43324262?v=4?s=100" width="100px;" alt="Dr Daniel Chalk"/><br /><sub><b>Dr Daniel Chalk</b></sub></a><br /><a href="#mentoring-hsma-chief-elf" title="Mentoring">🧑🏫</a></td>
|
|
64
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/amyheather"><img src="https://avatars.githubusercontent.com/u/92166537?v=4?s=100" width="100px;" alt="Amy Heather"/><br /><sub><b>Amy Heather</b></sub></a><br /><a href="#infra-amyheather" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
65
|
+
</tr>
|
|
66
|
+
</tbody>
|
|
67
|
+
</table>
|
|
68
|
+
|
|
69
|
+
<!-- markdownlint-restore -->
|
|
70
|
+
<!-- prettier-ignore-end -->
|
|
71
|
+
|
|
72
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## Note
|
|
76
|
+
|
|
77
|
+
This package builds on work from the metapy project from Dr Tom Monks.
|
|
78
|
+
|
|
79
|
+
Metapy can be found [here](https://github.com/health-data-science-OR/healthcare-logistics/tree/master/optimisation/metapy).
|
|
80
|
+
|
|
81
|
+
Metapy is release under the MIT licence. The licence is reproduced below in line with the terms of the licence.
|
|
82
|
+
|
|
83
|
+
> MIT License
|
|
84
|
+
|
|
85
|
+
> Copyright (c) 2020 health-data-science-OR
|
|
86
|
+
|
|
87
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
88
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
89
|
+
> in the Software without restriction, including without limitation the rights
|
|
90
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
91
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
92
|
+
> furnished to do so, subject to the following conditions:
|
|
93
|
+
|
|
94
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
95
|
+
> copies or substantial portions of the Software.
|
|
96
|
+
|
|
97
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
98
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
99
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
100
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
101
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
102
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
103
|
+
> SOFTWARE.
|
|
104
|
+
|
|
105
|
+
Modified metapy code is noted within the source code.
|
lokigi-0.1.0/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
## lokigi - Generate, rank, analyse and visualise the best candidate solutions for facility location problems
|
|
2
|
+
|
|
3
|
+
lokigi means 'to locate' or 'to place' in the Esperanto language.
|
|
4
|
+
|
|
5
|
+
(or it's the backronym '**L**ocation **O**ptimisation: **K**-best solution **I**nspection, **G**eneration & **I**nsights' - whichever floats your boat)
|
|
6
|
+
|
|
7
|
+
lokigi exists to make the process of providing decision support for healthcare problems with a geographical component easier.
|
|
8
|
+
|
|
9
|
+
A range of fantastic libraries exist for geographic optimization (e.g. [spopt](https://pysal.org/spopt/)), but many use linear programming to optimize the solution, meaning you emerge with a single optimal solution. For healthcare contexts, this often isn't ideal - decision makers need a range of near-optimal solutions to balance against real-world constraints.
|
|
10
|
+
|
|
11
|
+
Building on [work from Dr Tom Monks](https://github.com/health-data-science-OR/healthcare-logistics/tree/master/optimisation) and [previous rounds of the Health Service Modelling Associates programme](https://hsma.co.uk/hsma_content/modules/current_module_details/3_geographic_modelling_visualisation.html), lokigi is designed to make it easier to beginner programmers to tackle location optimization problems for the benefit of their organisations.
|
|
12
|
+
|
|
13
|
+
Lokigi is planned to expand to boundary optimisation problems in the future.
|
|
14
|
+
|
|
15
|
+
# Getting started
|
|
16
|
+
|
|
17
|
+
Head to the [documentation](https://hsma-tools.github.io/lokigi/lokigi_docs/) to find out how to use the package.
|
|
18
|
+
|
|
19
|
+
For now, you would need to clone this repository to make use of it.
|
|
20
|
+
|
|
21
|
+
PyPi and Conda support coming very soon.
|
|
22
|
+
|
|
23
|
+
## Contributors
|
|
24
|
+
|
|
25
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
26
|
+
<!-- prettier-ignore-start -->
|
|
27
|
+
<!-- markdownlint-disable -->
|
|
28
|
+
<table>
|
|
29
|
+
<tbody>
|
|
30
|
+
<tr>
|
|
31
|
+
<td align="center" valign="top" width="14.28%"><a href="http://hsma.co.uk"><img src="https://avatars.githubusercontent.com/u/29951987?v=4?s=100" width="100px;" alt="Sammi Rosser"/><br /><sub><b>Sammi Rosser</b></sub></a><br /><a href="https://github.com/hsma-tools/lokigi/commits?author=Bergam0t" title="Code">💻</a> <a href="https://github.com/hsma-tools/lokigi/commits?author=Bergam0t" title="Documentation">📖</a> <a href="https://github.com/hsma-tools/lokigi/commits?author=Bergam0t" title="Tests">⚠️</a> <a href="https://github.com/hsma-tools/lokigi/issues?q=author%3ABergam0t" title="Bug reports">🐛</a> <a href="#content-Bergam0t" title="Content">🖋</a> <a href="#design-Bergam0t" title="Design">🎨</a> <a href="#example-Bergam0t" title="Examples">💡</a> <a href="#ideas-Bergam0t" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-Bergam0t" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-Bergam0t" title="Maintenance">🚧</a> <a href="#projectManagement-Bergam0t" title="Project Management">📆</a> <a href="#research-Bergam0t" title="Research">🔬</a> <a href="#tutorial-Bergam0t" title="Tutorials">✅</a></td>
|
|
32
|
+
<td align="center" valign="top" width="14.28%"><a href="https://experts.exeter.ac.uk/19244-thomas-monks"><img src="https://avatars.githubusercontent.com/u/881493?v=4?s=100" width="100px;" alt="Tom Monks"/><br /><sub><b>Tom Monks</b></sub></a><br /><a href="https://github.com/hsma-tools/lokigi/commits?author=TomMonks" title="Code">💻</a> <a href="#ideas-TomMonks" title="Ideas, Planning, & Feedback">🤔</a> <a href="#mentoring-TomMonks" title="Mentoring">🧑🏫</a></td>
|
|
33
|
+
<td align="center" valign="top" width="14.28%"><a href="https://sites.google.com/nihr.ac.uk/hsma"><img src="https://avatars.githubusercontent.com/u/43324262?v=4?s=100" width="100px;" alt="Dr Daniel Chalk"/><br /><sub><b>Dr Daniel Chalk</b></sub></a><br /><a href="#mentoring-hsma-chief-elf" title="Mentoring">🧑🏫</a></td>
|
|
34
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/amyheather"><img src="https://avatars.githubusercontent.com/u/92166537?v=4?s=100" width="100px;" alt="Amy Heather"/><br /><sub><b>Amy Heather</b></sub></a><br /><a href="#infra-amyheather" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
35
|
+
</tr>
|
|
36
|
+
</tbody>
|
|
37
|
+
</table>
|
|
38
|
+
|
|
39
|
+
<!-- markdownlint-restore -->
|
|
40
|
+
<!-- prettier-ignore-end -->
|
|
41
|
+
|
|
42
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Note
|
|
46
|
+
|
|
47
|
+
This package builds on work from the metapy project from Dr Tom Monks.
|
|
48
|
+
|
|
49
|
+
Metapy can be found [here](https://github.com/health-data-science-OR/healthcare-logistics/tree/master/optimisation/metapy).
|
|
50
|
+
|
|
51
|
+
Metapy is release under the MIT licence. The licence is reproduced below in line with the terms of the licence.
|
|
52
|
+
|
|
53
|
+
> MIT License
|
|
54
|
+
|
|
55
|
+
> Copyright (c) 2020 health-data-science-OR
|
|
56
|
+
|
|
57
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
58
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
59
|
+
> in the Software without restriction, including without limitation the rights
|
|
60
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
61
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
62
|
+
> furnished to do so, subject to the following conditions:
|
|
63
|
+
|
|
64
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
65
|
+
> copies or substantial portions of the Software.
|
|
66
|
+
|
|
67
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
68
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
69
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
70
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
71
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
72
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
73
|
+
> SOFTWARE.
|
|
74
|
+
|
|
75
|
+
Modified metapy code is noted within the source code.
|
|
File without changes
|