Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

reticula-0.11.0-cp312-abi3-win_amd64.whl (13.0 MB view details)

Uploaded CPython 3.12+Windows x86-64

reticula-0.11.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

reticula-0.11.0-cp312-abi3-macosx_10_15_universal2.whl (37.3 MB view details)

Uploaded CPython 3.12+macOS 10.15+ universal2 (ARM64, x86-64)

reticula-0.11.0-cp311-cp311-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.11Windows x86-64

reticula-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

reticula-0.11.0-cp311-cp311-macosx_10_15_universal2.whl (37.1 MB view details)

Uploaded CPython 3.11macOS 10.15+ universal2 (ARM64, x86-64)

reticula-0.11.0-cp310-cp310-win_amd64.whl (12.9 MB view details)

Uploaded CPython 3.10Windows x86-64

reticula-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

reticula-0.11.0-cp310-cp310-macosx_10_15_universal2.whl (37.1 MB view details)

Uploaded CPython 3.10macOS 10.15+ universal2 (ARM64, x86-64)

File details

Details for the file reticula-0.11.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: reticula-0.11.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 13.0 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for reticula-0.11.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4707e71c8debe9fa5aa96d67cfdb0d098e1eeedf3d159da82a75956a91d62112
MD5 970ec8cde09b0f9edabb57d0f46c7717
BLAKE2b-256 6973a39a71bd046c5e693476bdc5503991a4c0e216e6c14d68695d6f0c318888

See more details on using hashes here.

File details

Details for the file reticula-0.11.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reticula-0.11.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 551085b63cd9dcfa46a80ff790b726160834b42a006e174340863f100aceae97
MD5 e62ef7a2e04ebcd81bd87ba844947066
BLAKE2b-256 1f8fb813ff3388ba3f3e5c19c81ddc6f976a674f1067174b0ea0ee690a1baf6c

See more details on using hashes here.

File details

Details for the file reticula-0.11.0-cp312-abi3-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for reticula-0.11.0-cp312-abi3-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 d28262f080395a5c0e4dd90cc3e471d954ad8f7b6c5a41a98b8cf35894c1ed56
MD5 3554787bd1808d68f67dd70ca53d334b
BLAKE2b-256 bd883a9c1d8d91c0179ae4dabe1c75520d7670e2ad68b8b70de0caf7328f5b02

See more details on using hashes here.

File details

Details for the file reticula-0.11.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: reticula-0.11.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 12.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for reticula-0.11.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aef04ac4566065504ec9ab7c1a8054418cca8aeb9d1d6911a991800f0bbcb93b
MD5 f5972bf68310faf9a421733ad1a28265
BLAKE2b-256 f0bbbf9302f02a6162be3b1c590e930c0b663ff90f92b164e9ae98b7807ab5ff

See more details on using hashes here.

File details

Details for the file reticula-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reticula-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc91c3284378d4064524cf039a39b3c52c3a0dbbc9a5123e2eac163fcc378171
MD5 4423a27351b1c18dc2a64facc3090c83
BLAKE2b-256 f94e5cf462fd1960bf00f24c03c979568a91dfef21a477c1e3554240a9241966

See more details on using hashes here.

File details

Details for the file reticula-0.11.0-cp311-cp311-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for reticula-0.11.0-cp311-cp311-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 60f8f30846cbed324d74b643bec29c945cdf15f938b62ac9f240b26c47a0831e
MD5 f701ae924733d26e0beda158c85ec690
BLAKE2b-256 808cf5b2b9535abf52a03bab44222d4f4dec67a5557265ee122e1755ae4935ef

See more details on using hashes here.

File details

Details for the file reticula-0.11.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: reticula-0.11.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 12.9 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for reticula-0.11.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d6e7547badf005a65bc2948cee6c82b7bf23462e4e31b01ad02472b6dfe31fb0
MD5 bbea45f11bf041218300985627c73c87
BLAKE2b-256 ae5e24dcebc7b9d960b6111a95113b199769da6f0465253f360b472f1605c35e

See more details on using hashes here.

File details

Details for the file reticula-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for reticula-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 118b1a9f6bcf5041e60f40f552d60f76bd2db05c3c5dd6d6ec2d498509af8c4f
MD5 71a3cac2fb37ad99c1a98057034a4e79
BLAKE2b-256 cab5792e8939afd4dc920bb102abd1d956889f80649e7f8d97d6345a9a827d44

See more details on using hashes here.

File details

Details for the file reticula-0.11.0-cp310-cp310-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for reticula-0.11.0-cp310-cp310-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 338cde2404c719166d586eb6a6360e66b3b00e234fd6b3148ef1d3ddc58975b6
MD5 ff83c41eac25d2df8e433bcba1d2515b
BLAKE2b-256 efb8e541d6366b31c0c51b9170baf793b2a61cd07b707ebd24083d2bde74bebf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page