isobenefit 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.

Potentially problematic release.


This version of isobenefit might be problematic. Click here for more details.

@@ -0,0 +1,7 @@
1
+ /target
2
+ *.so
3
+ *.pyd
4
+ *.dylib
5
+ __pycache__/
6
+ *.egg-info/
7
+ .pytest_cache/
@@ -0,0 +1,400 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 3
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.5.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
10
+
11
+ [[package]]
12
+ name = "cfg-if"
13
+ version = "1.0.4"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
16
+
17
+ [[package]]
18
+ name = "crossbeam-deque"
19
+ version = "0.8.6"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
22
+ dependencies = [
23
+ "crossbeam-epoch",
24
+ "crossbeam-utils",
25
+ ]
26
+
27
+ [[package]]
28
+ name = "crossbeam-epoch"
29
+ version = "0.9.18"
30
+ source = "registry+https://github.com/rust-lang/crates.io-index"
31
+ checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
32
+ dependencies = [
33
+ "crossbeam-utils",
34
+ ]
35
+
36
+ [[package]]
37
+ name = "crossbeam-utils"
38
+ version = "0.8.21"
39
+ source = "registry+https://github.com/rust-lang/crates.io-index"
40
+ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
41
+
42
+ [[package]]
43
+ name = "either"
44
+ version = "1.16.0"
45
+ source = "registry+https://github.com/rust-lang/crates.io-index"
46
+ checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
47
+
48
+ [[package]]
49
+ name = "getrandom"
50
+ version = "0.2.17"
51
+ source = "registry+https://github.com/rust-lang/crates.io-index"
52
+ checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
53
+ dependencies = [
54
+ "cfg-if",
55
+ "libc",
56
+ "wasi",
57
+ ]
58
+
59
+ [[package]]
60
+ name = "heck"
61
+ version = "0.5.0"
62
+ source = "registry+https://github.com/rust-lang/crates.io-index"
63
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
64
+
65
+ [[package]]
66
+ name = "indoc"
67
+ version = "2.0.7"
68
+ source = "registry+https://github.com/rust-lang/crates.io-index"
69
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
70
+ dependencies = [
71
+ "rustversion",
72
+ ]
73
+
74
+ [[package]]
75
+ name = "isobenefit"
76
+ version = "0.1.0"
77
+ dependencies = [
78
+ "ndarray",
79
+ "numpy",
80
+ "pyo3",
81
+ "rand",
82
+ "rand_chacha",
83
+ "rayon",
84
+ ]
85
+
86
+ [[package]]
87
+ name = "libc"
88
+ version = "0.2.186"
89
+ source = "registry+https://github.com/rust-lang/crates.io-index"
90
+ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
91
+
92
+ [[package]]
93
+ name = "matrixmultiply"
94
+ version = "0.3.10"
95
+ source = "registry+https://github.com/rust-lang/crates.io-index"
96
+ checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08"
97
+ dependencies = [
98
+ "autocfg",
99
+ "rawpointer",
100
+ ]
101
+
102
+ [[package]]
103
+ name = "memoffset"
104
+ version = "0.9.1"
105
+ source = "registry+https://github.com/rust-lang/crates.io-index"
106
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
107
+ dependencies = [
108
+ "autocfg",
109
+ ]
110
+
111
+ [[package]]
112
+ name = "ndarray"
113
+ version = "0.16.1"
114
+ source = "registry+https://github.com/rust-lang/crates.io-index"
115
+ checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841"
116
+ dependencies = [
117
+ "matrixmultiply",
118
+ "num-complex",
119
+ "num-integer",
120
+ "num-traits",
121
+ "portable-atomic",
122
+ "portable-atomic-util",
123
+ "rawpointer",
124
+ ]
125
+
126
+ [[package]]
127
+ name = "num-complex"
128
+ version = "0.4.6"
129
+ source = "registry+https://github.com/rust-lang/crates.io-index"
130
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
131
+ dependencies = [
132
+ "num-traits",
133
+ ]
134
+
135
+ [[package]]
136
+ name = "num-integer"
137
+ version = "0.1.46"
138
+ source = "registry+https://github.com/rust-lang/crates.io-index"
139
+ checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
140
+ dependencies = [
141
+ "num-traits",
142
+ ]
143
+
144
+ [[package]]
145
+ name = "num-traits"
146
+ version = "0.2.19"
147
+ source = "registry+https://github.com/rust-lang/crates.io-index"
148
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
149
+ dependencies = [
150
+ "autocfg",
151
+ ]
152
+
153
+ [[package]]
154
+ name = "numpy"
155
+ version = "0.22.1"
156
+ source = "registry+https://github.com/rust-lang/crates.io-index"
157
+ checksum = "edb929bc0da91a4d85ed6c0a84deaa53d411abfb387fc271124f91bf6b89f14e"
158
+ dependencies = [
159
+ "libc",
160
+ "ndarray",
161
+ "num-complex",
162
+ "num-integer",
163
+ "num-traits",
164
+ "pyo3",
165
+ "rustc-hash",
166
+ ]
167
+
168
+ [[package]]
169
+ name = "once_cell"
170
+ version = "1.21.4"
171
+ source = "registry+https://github.com/rust-lang/crates.io-index"
172
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
173
+
174
+ [[package]]
175
+ name = "portable-atomic"
176
+ version = "1.13.1"
177
+ source = "registry+https://github.com/rust-lang/crates.io-index"
178
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
179
+
180
+ [[package]]
181
+ name = "portable-atomic-util"
182
+ version = "0.2.7"
183
+ source = "registry+https://github.com/rust-lang/crates.io-index"
184
+ checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618"
185
+ dependencies = [
186
+ "portable-atomic",
187
+ ]
188
+
189
+ [[package]]
190
+ name = "ppv-lite86"
191
+ version = "0.2.21"
192
+ source = "registry+https://github.com/rust-lang/crates.io-index"
193
+ checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
194
+ dependencies = [
195
+ "zerocopy",
196
+ ]
197
+
198
+ [[package]]
199
+ name = "proc-macro2"
200
+ version = "1.0.106"
201
+ source = "registry+https://github.com/rust-lang/crates.io-index"
202
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
203
+ dependencies = [
204
+ "unicode-ident",
205
+ ]
206
+
207
+ [[package]]
208
+ name = "pyo3"
209
+ version = "0.22.6"
210
+ source = "registry+https://github.com/rust-lang/crates.io-index"
211
+ checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884"
212
+ dependencies = [
213
+ "cfg-if",
214
+ "indoc",
215
+ "libc",
216
+ "memoffset",
217
+ "once_cell",
218
+ "portable-atomic",
219
+ "pyo3-build-config",
220
+ "pyo3-ffi",
221
+ "pyo3-macros",
222
+ "unindent",
223
+ ]
224
+
225
+ [[package]]
226
+ name = "pyo3-build-config"
227
+ version = "0.22.6"
228
+ source = "registry+https://github.com/rust-lang/crates.io-index"
229
+ checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38"
230
+ dependencies = [
231
+ "once_cell",
232
+ "target-lexicon",
233
+ ]
234
+
235
+ [[package]]
236
+ name = "pyo3-ffi"
237
+ version = "0.22.6"
238
+ source = "registry+https://github.com/rust-lang/crates.io-index"
239
+ checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636"
240
+ dependencies = [
241
+ "libc",
242
+ "pyo3-build-config",
243
+ ]
244
+
245
+ [[package]]
246
+ name = "pyo3-macros"
247
+ version = "0.22.6"
248
+ source = "registry+https://github.com/rust-lang/crates.io-index"
249
+ checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453"
250
+ dependencies = [
251
+ "proc-macro2",
252
+ "pyo3-macros-backend",
253
+ "quote",
254
+ "syn",
255
+ ]
256
+
257
+ [[package]]
258
+ name = "pyo3-macros-backend"
259
+ version = "0.22.6"
260
+ source = "registry+https://github.com/rust-lang/crates.io-index"
261
+ checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
262
+ dependencies = [
263
+ "heck",
264
+ "proc-macro2",
265
+ "pyo3-build-config",
266
+ "quote",
267
+ "syn",
268
+ ]
269
+
270
+ [[package]]
271
+ name = "quote"
272
+ version = "1.0.45"
273
+ source = "registry+https://github.com/rust-lang/crates.io-index"
274
+ checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
275
+ dependencies = [
276
+ "proc-macro2",
277
+ ]
278
+
279
+ [[package]]
280
+ name = "rand"
281
+ version = "0.8.6"
282
+ source = "registry+https://github.com/rust-lang/crates.io-index"
283
+ checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a"
284
+ dependencies = [
285
+ "libc",
286
+ "rand_chacha",
287
+ "rand_core",
288
+ ]
289
+
290
+ [[package]]
291
+ name = "rand_chacha"
292
+ version = "0.3.1"
293
+ source = "registry+https://github.com/rust-lang/crates.io-index"
294
+ checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
295
+ dependencies = [
296
+ "ppv-lite86",
297
+ "rand_core",
298
+ ]
299
+
300
+ [[package]]
301
+ name = "rand_core"
302
+ version = "0.6.4"
303
+ source = "registry+https://github.com/rust-lang/crates.io-index"
304
+ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
305
+ dependencies = [
306
+ "getrandom",
307
+ ]
308
+
309
+ [[package]]
310
+ name = "rawpointer"
311
+ version = "0.2.1"
312
+ source = "registry+https://github.com/rust-lang/crates.io-index"
313
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
314
+
315
+ [[package]]
316
+ name = "rayon"
317
+ version = "1.12.0"
318
+ source = "registry+https://github.com/rust-lang/crates.io-index"
319
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
320
+ dependencies = [
321
+ "either",
322
+ "rayon-core",
323
+ ]
324
+
325
+ [[package]]
326
+ name = "rayon-core"
327
+ version = "1.13.0"
328
+ source = "registry+https://github.com/rust-lang/crates.io-index"
329
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
330
+ dependencies = [
331
+ "crossbeam-deque",
332
+ "crossbeam-utils",
333
+ ]
334
+
335
+ [[package]]
336
+ name = "rustc-hash"
337
+ version = "1.1.0"
338
+ source = "registry+https://github.com/rust-lang/crates.io-index"
339
+ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
340
+
341
+ [[package]]
342
+ name = "rustversion"
343
+ version = "1.0.22"
344
+ source = "registry+https://github.com/rust-lang/crates.io-index"
345
+ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
346
+
347
+ [[package]]
348
+ name = "syn"
349
+ version = "2.0.117"
350
+ source = "registry+https://github.com/rust-lang/crates.io-index"
351
+ checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
352
+ dependencies = [
353
+ "proc-macro2",
354
+ "quote",
355
+ "unicode-ident",
356
+ ]
357
+
358
+ [[package]]
359
+ name = "target-lexicon"
360
+ version = "0.12.16"
361
+ source = "registry+https://github.com/rust-lang/crates.io-index"
362
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
363
+
364
+ [[package]]
365
+ name = "unicode-ident"
366
+ version = "1.0.24"
367
+ source = "registry+https://github.com/rust-lang/crates.io-index"
368
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
369
+
370
+ [[package]]
371
+ name = "unindent"
372
+ version = "0.2.4"
373
+ source = "registry+https://github.com/rust-lang/crates.io-index"
374
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
375
+
376
+ [[package]]
377
+ name = "wasi"
378
+ version = "0.11.1+wasi-snapshot-preview1"
379
+ source = "registry+https://github.com/rust-lang/crates.io-index"
380
+ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
381
+
382
+ [[package]]
383
+ name = "zerocopy"
384
+ version = "0.8.52"
385
+ source = "registry+https://github.com/rust-lang/crates.io-index"
386
+ checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f"
387
+ dependencies = [
388
+ "zerocopy-derive",
389
+ ]
390
+
391
+ [[package]]
392
+ name = "zerocopy-derive"
393
+ version = "0.8.52"
394
+ source = "registry+https://github.com/rust-lang/crates.io-index"
395
+ checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930"
396
+ dependencies = [
397
+ "proc-macro2",
398
+ "quote",
399
+ "syn",
400
+ ]
@@ -0,0 +1,31 @@
1
+ [package]
2
+ name = "isobenefit"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ license = "AGPL-3.0-or-later"
6
+ description = "Rust simulation core for the Isobenefit Urbanism QGIS plugin"
7
+ repository = "https://github.com/UCL/BSP-isobenefit-qgis-plugin"
8
+ rust-version = "1.74"
9
+ readme = "README.md"
10
+
11
+ [lib]
12
+ name = "isobenefit"
13
+ crate-type = ["cdylib", "rlib"]
14
+
15
+ [dependencies]
16
+ ndarray = "0.16"
17
+ rayon = "1.10"
18
+ rand = "0.8"
19
+ rand_chacha = "0.3"
20
+ pyo3 = { version = "0.22", features = ["abi3-py39"], optional = true }
21
+ numpy = { version = "0.22", optional = true }
22
+
23
+ [features]
24
+ default = []
25
+ # Enabled by maturin when building the Python extension; left off for `cargo test`
26
+ # so the pure-Rust algorithm modules compile and test without linking libpython.
27
+ python = ["dep:pyo3", "dep:numpy", "pyo3/extension-module"]
28
+
29
+ [profile.release]
30
+ lto = true
31
+ codegen-units = 1
@@ -0,0 +1,45 @@
1
+ Metadata-Version: 2.4
2
+ Name: isobenefit
3
+ Version: 0.1.0
4
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
5
+ Classifier: Programming Language :: Rust
6
+ Classifier: Programming Language :: Python :: 3
7
+ Requires-Dist: numpy>=1.21
8
+ Summary: Rust simulation core for Isobenefit Urbanism (arrays-in / arrays-out).
9
+ Author-email: Gareth Simons <gareth.simons@ucl.ac.uk>
10
+ License: AGPL-3.0-or-later
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
13
+ Project-URL: repository, https://github.com/UCL/BSP-isobenefit-qgis-plugin
14
+
15
+ # isobenefit
16
+
17
+ The Rust simulation core for the [Isobenefit Urbanism QGIS plugin](https://github.com/UCL/BSP-isobenefit-qgis-plugin).
18
+
19
+ It is a pure compute engine: **arrays in, arrays out**. It never imports QGIS or
20
+ performs any GIS IO — the plugin handles reading layers, reprojection,
21
+ rasterization and writing rasters, then hands plain numpy arrays to this core.
22
+
23
+ ## Layout
24
+
25
+ - `src/neighbours.rs` — neighbour iteration, contiguity counting, green-span checks
26
+ - `src/access.rs` — heap-based bounded Dijkstra accessibility (parallel map-reduce)
27
+ - `src/density.rs` — deterministic per-work-item RNG + density draws
28
+ - `src/sim.rs` — the `Simulation` state machine and `run_ensemble`
29
+ - `src/lib.rs` / `src/py_bindings.rs` — PyO3 bindings (built only with `--features python`)
30
+
31
+ ## Development
32
+
33
+ ```bash
34
+ cargo test # pure-Rust algorithm tests (no Python needed)
35
+ maturin develop --release # build + install the extension into the active venv
36
+ pytest tests_py # Python-level golden + property tests
37
+ ```
38
+
39
+ Parallelism (rayon) and determinism are first-class: results are independent of
40
+ thread count. Reproducibility comes from per-work-item seeding
41
+ (`ChaCha8Rng` derived from `(seed, work_id)`) and order-independent integer-sum
42
+ reductions in the accessibility kernels.
43
+
44
+ Licensed under AGPL-3.0-or-later.
45
+
@@ -0,0 +1,30 @@
1
+ # isobenefit
2
+
3
+ The Rust simulation core for the [Isobenefit Urbanism QGIS plugin](https://github.com/UCL/BSP-isobenefit-qgis-plugin).
4
+
5
+ It is a pure compute engine: **arrays in, arrays out**. It never imports QGIS or
6
+ performs any GIS IO — the plugin handles reading layers, reprojection,
7
+ rasterization and writing rasters, then hands plain numpy arrays to this core.
8
+
9
+ ## Layout
10
+
11
+ - `src/neighbours.rs` — neighbour iteration, contiguity counting, green-span checks
12
+ - `src/access.rs` — heap-based bounded Dijkstra accessibility (parallel map-reduce)
13
+ - `src/density.rs` — deterministic per-work-item RNG + density draws
14
+ - `src/sim.rs` — the `Simulation` state machine and `run_ensemble`
15
+ - `src/lib.rs` / `src/py_bindings.rs` — PyO3 bindings (built only with `--features python`)
16
+
17
+ ## Development
18
+
19
+ ```bash
20
+ cargo test # pure-Rust algorithm tests (no Python needed)
21
+ maturin develop --release # build + install the extension into the active venv
22
+ pytest tests_py # Python-level golden + property tests
23
+ ```
24
+
25
+ Parallelism (rayon) and determinism are first-class: results are independent of
26
+ thread count. Reproducibility comes from per-work-item seeding
27
+ (`ChaCha8Rng` derived from `(seed, work_id)`) and order-independent integer-sum
28
+ reductions in the accessibility kernels.
29
+
30
+ Licensed under AGPL-3.0-or-later.
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["maturin>=1.5,<2.0"]
3
+ build-backend = "maturin"
4
+
5
+ [project]
6
+ name = "isobenefit"
7
+ description = "Rust simulation core for Isobenefit Urbanism (arrays-in / arrays-out)."
8
+ readme = "README.md"
9
+ license = { text = "AGPL-3.0-or-later" }
10
+ requires-python = ">=3.9"
11
+ authors = [{ name = "Gareth Simons", email = "gareth.simons@ucl.ac.uk" }]
12
+ dependencies = ["numpy>=1.21"]
13
+ classifiers = [
14
+ "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
15
+ "Programming Language :: Rust",
16
+ "Programming Language :: Python :: 3",
17
+ ]
18
+ dynamic = ["version"]
19
+
20
+ [project.urls]
21
+ repository = "https://github.com/UCL/BSP-isobenefit-qgis-plugin"
22
+
23
+ [tool.maturin]
24
+ python-source = "python"
25
+ module-name = "isobenefit._core"
26
+ features = ["python"]
27
+ # abi3 wheel: one wheel per platform across Python >=3.9
@@ -0,0 +1,11 @@
1
+ """Isobenefit Urbanism simulation core.
2
+
3
+ A pure compute engine (Rust extension) with no GIS dependencies: it takes numpy
4
+ arrays plus scalar parameters and returns numpy arrays / snapshots. All GIS IO
5
+ (reading layers, reprojection, rasterization, writing rasters) lives in the QGIS
6
+ plugin, not here.
7
+ """
8
+
9
+ from ._core import Simulation, run_ensemble, __version__
10
+
11
+ __all__ = ["Simulation", "run_ensemble", "__version__"]
File without changes