Analyse temporal network and hypergraphs efficiently.
Project description
Python bindings for Reticula
Installation
The library offers pre-compiled Wheels for x64 Windows, MacOS and Linux. The library currently supports Python version 3.8 or newer.
$ pip install reticula
Installing from source
Alternatively you can install the library from source:
Clone the library:
$ git clone https://github.com/arashbm/reticula-python.git
Build the Wheel:
$ cd reticula-python
$ pip install .
Note that compiling from source requires an unbelievable amount (> 40GB) of RAM.
Basic examples
Generate a random static network and investigate:
>>> import reticula as ret
>>> state = ret.mersenne_twister(42) # create a pseudorandom number generator
>>> g = ret.random_gnp_graph[ret.int64](n=100, p=0.02, random_state=state)
>>> g
<undirected_network[int64] with 100 verts and 110 edges>
>>> g.vertices()
[0, 1, 2, 3, .... 99]
>>> g.edges()
[undirected_edge[int64](0, 16), undirected_edge[int64](0, 20),
undirected_edge[int64](0, 31), undirected_edge[int64](0, 51), ...]
>>> ret.connected_components(g)
[<component[int64] of 1 nodes: {9}>, <component[int64] of 1 node {33}>, ...]
>>> lcc = max(ret.connected_components(g), key=len)
>>> lcc
<component[int64] of 93 nodes: {99, 96, 95, 94, ...}>
>>> g2 = ret.vertex_induced_subgraph(g, lcc)
>>> g2
<undirected_network[int64] with 93 verts and 109 edges>
A more complete example of static network percolation analysis, running on
multiple threads, can be found in
examples/static_network_percolation/
Create a random fully-mixed temporal network and calculate simple (unconstrained) reachability from node 0 at time 0 to all nodes and times.
>>> import reticula as ret
>>> state = ret.mersenne_twister(42)
>>> g = ret.random_fully_mixed_temporal_network[ret.int64](\
... size=100, rate=0.01, max_t=1024, random_state=state)
>>> adj = ret.temporal_adjacency.simple[\
... ret.undirected_temporal_edge[ret.int64, ret.double]]()
>>> cluster = ret.out_cluster(\
... temporal_network=g, temporal_adjacency=adj, vertex=0, time=0.0)
>>> cluster
<temporal_cluster[undirected_temporal_edge[int64, double],
simple[undirected_temporal_edge[int64, double]]] with volume 100
and lifetime (0 1.7976931348623157e+308]>
>>> cluster.covers(vertex=12, time=100.0)
True
>>> # Let's see all intervals where vert 15 is reachable from vert 0 at t=0.0:
>>> list(cluster.interval_sets()[15])
[(3.099055278145548, 1.7976931348623157e+308)]
Let's now try limited waiting-time (with dt = 5.0) reachability:
>>> import reticula as ret
>>> state = ret.mersenne_twister(42)
>>> g = ret.random_fully_mixed_temporal_network[int64](\
... size=100, rate=0.01, max_t=1024, random_state=state)
>>> adj = ret.temporal_adjacency.limited_waiting_time[\
... ret.undirected_temporal_edge[ret.int64, ret.double]](dt=5.0)
>>> cluster = ret.out_cluster(\
... temporal_network=g, temporal_adjacency=adj, vertex=0, time=0.0)
>>> cluster
<temporal_cluster[undirected_temporal_edge[int64, double],
limited_waiting_time[undirected_temporal_edge[int64, double]]] with
volume 100 and lifetime (0 1028.9972186553928]>
>>> cluster.covers(vertex=15, time=16.0)
True
>>> list(cluster.interval_sets()[15])
[(3.099055278145548, 200.17866501023616),
(200.39858803326402, 337.96139372380003),
...
(1017.5258263596586, 1028.9149586273347)]
>>> # Total "human-hours" of reachability cluster
>>> cluster.mass()
101747.97444555275
>>> # Survival time of the reachability cluster
>>> cluster.lifetime()
(0.0, 1028.9972186553928)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for reticula-0.10.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144e6722033ceb02ca204a6c8751ae6de4db0fcef014d6b9faba25088b45fda7 |
|
MD5 | 5e0a26d95264bdb0a9f6997e8d5a6fc2 |
|
BLAKE2b-256 | e0b49a96f2a8dc0557e2ab9181e4a97edc07d835c12ba04dc9bc79118f28fcee |
Hashes for reticula-0.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4c081090182aae34e2dba7148737557357e0e052d581d7dba91990cd86c4185 |
|
MD5 | c00f32fa881cbc520c3abcca96ec26d3 |
|
BLAKE2b-256 | b99e9968db386fee0d5582ab20647d7a2a86ed86c664942e0b75b00966fc45a2 |
Hashes for reticula-0.10.1-cp312-cp312-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c987f2368f7942a4fe703b23f55179eaee86dc3bc823d804c11bdc3ae62072f2 |
|
MD5 | 0f0e2cdc9f805e215de24541ff4be4a9 |
|
BLAKE2b-256 | 74f6f25ffbcac1cd8227ffaeb19115390f66af2c8dfc431507e488f3b662f061 |
Hashes for reticula-0.10.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db9106e790f72be072f75d521810d31e9f3dcfe58ba0d72c871de70b9d53737a |
|
MD5 | 889b7cec6758b0b5b6f4baac6fa7b3a3 |
|
BLAKE2b-256 | e26fec4a7ba96a24679141edee98ccdbe219396cc34457a3fbdda71a9b18af5c |
Hashes for reticula-0.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fc4ce455f91d27926517bad354097982b636b52caba481042be66197e1304a5 |
|
MD5 | bab76ff84e27a00596b5225c1c212aa5 |
|
BLAKE2b-256 | 4a97f9a5b0353d17aedfdc191b13261a317f0c60e6b74efc1684c506567d7d09 |
Hashes for reticula-0.10.1-cp311-cp311-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a00bd33edd81a32e6ff3c1f9231fa1108ea8201527a341f30e4ed1baa5e12007 |
|
MD5 | bbb88dac709811f14800c56bffb1ecee |
|
BLAKE2b-256 | f196b7b1132c1e12ff1ae4c8c29f00e514e55d8cb87d78444ae3e3d6fef405a5 |
Hashes for reticula-0.10.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bacc731b5796a631e9ae1e76306d6d3d99ea6e1339f3be90961a78ff73d81826 |
|
MD5 | 4392f888aa8f07de797ecde965cd36bf |
|
BLAKE2b-256 | 7ccc23dad423f0429c7b8e54b0be266e8a40a1ce20d1d4aded39bc65eee18a9d |
Hashes for reticula-0.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d73eeeb8c22b02827aee10e6c80542da103532727472f78eafad1cd54d20e612 |
|
MD5 | 84056e14774230ababc64c17fb0ab866 |
|
BLAKE2b-256 | 525dbdf14984b2e0deb6ef63345c8142cec1177244e8334a4ed5d44e31ac230d |
Hashes for reticula-0.10.1-cp310-cp310-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf336194b130bd25bced924677129f9aab9283d9493f337f10d12a2d3b9b3177 |
|
MD5 | 11fe2a660dd0f15ab11fb587c0f6ded6 |
|
BLAKE2b-256 | ae1049453eedaf4ae9712ba603152b13963223d1620f0b9782a6174c7b0f12c7 |
Hashes for reticula-0.10.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1540f5e83d41eb80f57dd6e795bb7faebeb129205e62477c840baaee0f3f6b81 |
|
MD5 | d932dda46ecb44a4df2cc39aa5e52a93 |
|
BLAKE2b-256 | a1c16ed67f107805d8d0d1902e79b365ba4d67aa5401b7d055760b774e25dd4d |
Hashes for reticula-0.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3f9dda246b15a83ad65ef632a139bb7b7c01aaf04ad20c62381fcffd1ae447c |
|
MD5 | 28e74d18bccba4bd343011c44da3289f |
|
BLAKE2b-256 | 5a9ab8e9f423aa93ed47ca1e967493971d81479f5dd74df5fcb93ff40a4db50d |
Hashes for reticula-0.10.1-cp39-cp39-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fce4612289ea9af284188e93987573d7ddf2eed7932fa26414391b1273b864ec |
|
MD5 | 9e4062dde138feeb0fc0ab3fca5d34b6 |
|
BLAKE2b-256 | 62cf0fced387ef5cc0691115e65dfb1bb626b6742b7f84758ed3baa9ce408223 |
Hashes for reticula-0.10.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e332318cb3a3280caebf907effe903098e2b642cfc121508f4d6d137046bd3 |
|
MD5 | 2e8de8a0f18eabdf1d1266466e9f3ce2 |
|
BLAKE2b-256 | b163aeb5943a9749beb46f6c7d4e70ee667aafa68b2c3a944d5e6629675dc1ac |
Hashes for reticula-0.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7852a030f8041ba7bc4814063ebf23eeb90d966a4abb28fa304c105dd3ec2ff |
|
MD5 | e094623cb1541cd3051d4a898fd6ea55 |
|
BLAKE2b-256 | 10384a46500b265263cd1b8de3be96c7d28af9264545e19c82d958c5e4a4fa85 |
Hashes for reticula-0.10.1-cp38-cp38-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ad07acfffca5c1ffaedfc14c059750ac5c88bff5bdaf2621907486b7143fdb6 |
|
MD5 | fb34afdb2a321e8ebe967f248d4b544a |
|
BLAKE2b-256 | 30ab1f1c45175273d569859ff440255f55a10c2713c6f3ba95868ecdc829ba23 |