# Python bindings for [Reticula][reticula]
[reticula]: https://github.com/reticula-network/reticula
## Installation
The library offers pre-compiled Wheels for x64 Windows, MacOS and Linux. The library
currently supports Python version 3.8 or newer.
```console
$ pip install reticula
```
### Installing from source
Alternatively you can install the library from source:
Clone the library:
```console
$ git clone https://github.com/arashbm/reticula-python.git
```
Build the Wheel:
```console
$ 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:
```pycon
>>> 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/`](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.
```pycon
>>> 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:
```pycon
>>> 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)
```
Raw data
{
"_id": null,
"home_page": "",
"name": "reticula",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "Complex Networks,Networks,network,Graphs,Graph Theory,graph,Temporal Networks,temporal network,Hypergraphs,hypergraph,hyper-graph",
"author": "",
"author_email": "Arash Badie-Modiri <arashbm@gmail.com>",
"download_url": "",
"platform": null,
"description": "# Python bindings for [Reticula][reticula]\n\n[reticula]: https://github.com/reticula-network/reticula\n\n## Installation\n\nThe library offers pre-compiled Wheels for x64 Windows, MacOS and Linux. The library\ncurrently supports Python version 3.8 or newer.\n\n```console\n$ pip install reticula\n```\n\n### Installing from source\nAlternatively you can install the library from source:\n\nClone the library:\n```console\n$ git clone https://github.com/arashbm/reticula-python.git\n```\n\nBuild the Wheel:\n```console\n$ cd reticula-python\n$ pip install .\n```\n\nNote that compiling from source requires an unbelievable amount (> 40GB) of RAM.\n\n## Basic examples\n\nGenerate a random static network and investigate:\n```pycon\n>>> import reticula as ret\n>>> state = ret.mersenne_twister(42) # create a pseudorandom number generator\n>>> g = ret.random_gnp_graph[ret.int64](n=100, p=0.02, random_state=state)\n>>> g\n<undirected_network[int64] with 100 verts and 110 edges>\n>>> g.vertices()\n[0, 1, 2, 3, .... 99]\n>>> g.edges()\n[undirected_edge[int64](0, 16), undirected_edge[int64](0, 20),\n undirected_edge[int64](0, 31), undirected_edge[int64](0, 51), ...]\n>>> ret.connected_components(g)\n[<component[int64] of 1 nodes: {9}>, <component[int64] of 1 node {33}>, ...]\n>>> lcc = max(ret.connected_components(g), key=len)\n>>> lcc\n<component[int64] of 93 nodes: {99, 96, 95, 94, ...}>\n>>> g2 = ret.vertex_induced_subgraph(g, lcc)\n>>> g2\n<undirected_network[int64] with 93 verts and 109 edges>\n```\nA more complete example of static network percolation analysis, running on\nmultiple threads, can be found in\n[`examples/static_network_percolation/`](examples/static_network_percolation/)\n\nCreate a random fully-mixed temporal network and calculate simple\n(unconstrained) reachability from node 0 at time 0 to all nodes and times.\n```pycon\n>>> import reticula as ret\n>>> state = ret.mersenne_twister(42)\n>>> g = ret.random_fully_mixed_temporal_network[ret.int64](\\\n... size=100, rate=0.01, max_t=1024, random_state=state)\n>>> adj = ret.temporal_adjacency.simple[\\\n... ret.undirected_temporal_edge[ret.int64, ret.double]]()\n>>> cluster = ret.out_cluster(\\\n... temporal_network=g, temporal_adjacency=adj, vertex=0, time=0.0)\n>>> cluster\n<temporal_cluster[undirected_temporal_edge[int64, double],\n simple[undirected_temporal_edge[int64, double]]] with volume 100\n and lifetime (0 1.7976931348623157e+308]>\n>>> cluster.covers(vertex=12, time=100.0)\nTrue\n\n>>> # Let's see all intervals where vert 15 is reachable from vert 0 at t=0.0:\n>>> list(cluster.interval_sets()[15])\n[(3.099055278145548, 1.7976931348623157e+308)]\n```\n\nLet's now try limited waiting-time (with dt = 5.0) reachability:\n```pycon\n>>> import reticula as ret\n>>> state = ret.mersenne_twister(42)\n>>> g = ret.random_fully_mixed_temporal_network[int64](\\\n... size=100, rate=0.01, max_t=1024, random_state=state)\n>>> adj = ret.temporal_adjacency.limited_waiting_time[\\\n... ret.undirected_temporal_edge[ret.int64, ret.double]](dt=5.0)\n>>> cluster = ret.out_cluster(\\\n... temporal_network=g, temporal_adjacency=adj, vertex=0, time=0.0)\n>>> cluster\n<temporal_cluster[undirected_temporal_edge[int64, double],\n limited_waiting_time[undirected_temporal_edge[int64, double]]] with\n volume 100 and lifetime (0 1028.9972186553928]>\n>>> cluster.covers(vertex=15, time=16.0)\nTrue\n>>> list(cluster.interval_sets()[15])\n[(3.099055278145548, 200.17866501023616),\n (200.39858803326402, 337.96139372380003),\n ...\n (1017.5258263596586, 1028.9149586273347)]\n\n>>> # Total \"human-hours\" of reachability cluster\n>>> cluster.mass()\n101747.97444555275\n\n>>> # Survival time of the reachability cluster\n>>> cluster.lifetime()\n(0.0, 1028.9972186553928)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Analyse temporal network and hypergraphs efficiently.",
"version": "0.9.2",
"project_urls": {
"bug-tracker": "https://github.com/reticula-network/reticula-python/issues",
"documentation": "https://docs.reticula.network/",
"homepage": "https://reticula.network/",
"repository": "https://github.com/reticula-network/reticula-python"
},
"split_keywords": [
"complex networks",
"networks",
"network",
"graphs",
"graph theory",
"graph",
"temporal networks",
"temporal network",
"hypergraphs",
"hypergraph",
"hyper-graph"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1021ae2399324479246587d19fdc9393c3dfa2b026f540a0ce91b91b25b33e27",
"md5": "6d42d6869adf537ea22d190f5cffc388",
"sha256": "cfbc3f0f87075cf607bfe428d2c7c5f5e2a2c1f82a67386a2891b97cfff9e9bc"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp310-cp310-macosx_10_15_universal2.whl",
"has_sig": false,
"md5_digest": "6d42d6869adf537ea22d190f5cffc388",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 36080484,
"upload_time": "2023-05-31T17:26:08",
"upload_time_iso_8601": "2023-05-31T17:26:08.040622Z",
"url": "https://files.pythonhosted.org/packages/10/21/ae2399324479246587d19fdc9393c3dfa2b026f540a0ce91b91b25b33e27/reticula-0.9.2-cp310-cp310-macosx_10_15_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b0849dddada3ed377483f098d0a9dedddf0632f1522fea731e9a50b2d45341a1",
"md5": "bd8e011cd0a6600f3d9b53c7474a7d65",
"sha256": "02f93b52be3fb80e131a7bc787e1236afe13187772da433659feed04e17e335c"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "bd8e011cd0a6600f3d9b53c7474a7d65",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 11928514,
"upload_time": "2023-05-31T17:26:17",
"upload_time_iso_8601": "2023-05-31T17:26:17.398271Z",
"url": "https://files.pythonhosted.org/packages/b0/84/9dddada3ed377483f098d0a9dedddf0632f1522fea731e9a50b2d45341a1/reticula-0.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ec53015e593ebb96e32ba68233d89f71285601e05753032b1eead4ccf3b04733",
"md5": "5e32518fb144a13a44d7a47c400b6c71",
"sha256": "f14a421dfdc221976aa71d6d0b042c67a902704055408af74284c54970dd851f"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "5e32518fb144a13a44d7a47c400b6c71",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 12417000,
"upload_time": "2023-05-31T17:26:21",
"upload_time_iso_8601": "2023-05-31T17:26:21.665248Z",
"url": "https://files.pythonhosted.org/packages/ec/53/015e593ebb96e32ba68233d89f71285601e05753032b1eead4ccf3b04733/reticula-0.9.2-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "08c794d9f0206a0be2148492f43bdb346e9e25f870241c8e9c08a24fea9eb3df",
"md5": "67be3ab7e0d0ccfde9001e062d12109b",
"sha256": "7645884e8aafd1bd5f6620b708f4585f9fe375f142325167644a18d3bda9747f"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp311-cp311-macosx_10_15_universal2.whl",
"has_sig": false,
"md5_digest": "67be3ab7e0d0ccfde9001e062d12109b",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 36108183,
"upload_time": "2023-05-31T17:26:30",
"upload_time_iso_8601": "2023-05-31T17:26:30.038054Z",
"url": "https://files.pythonhosted.org/packages/08/c7/94d9f0206a0be2148492f43bdb346e9e25f870241c8e9c08a24fea9eb3df/reticula-0.9.2-cp311-cp311-macosx_10_15_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b1810ce6bd37521e3072c4ec3797fe0c8b612fe1a525500a2c00f58cda113ed5",
"md5": "daf9e6c46cbc6ac8f5f8a944cc9d1fa0",
"sha256": "e68f77e7f8e704fd1ecb4d357fb424decd19922ce633deac50bf7b0b497cf88d"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "daf9e6c46cbc6ac8f5f8a944cc9d1fa0",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 11929795,
"upload_time": "2023-05-31T17:26:39",
"upload_time_iso_8601": "2023-05-31T17:26:39.646360Z",
"url": "https://files.pythonhosted.org/packages/b1/81/0ce6bd37521e3072c4ec3797fe0c8b612fe1a525500a2c00f58cda113ed5/reticula-0.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bd765d54d88ae3c4905f12f528ae02906b61a77b475512ed3937598721eab45e",
"md5": "18d38277eed860fe53d915b1d36f70c4",
"sha256": "9bc2281ebf93f6efa648fc02494dd3b90707d46c79504195977fedc7b86b040b"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "18d38277eed860fe53d915b1d36f70c4",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 12417507,
"upload_time": "2023-05-31T17:26:44",
"upload_time_iso_8601": "2023-05-31T17:26:44.350135Z",
"url": "https://files.pythonhosted.org/packages/bd/76/5d54d88ae3c4905f12f528ae02906b61a77b475512ed3937598721eab45e/reticula-0.9.2-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "09ddc01aed189187de3d045a7eb9c960997d28c66f7b0e11d43e9e517edb752a",
"md5": "d4e3c4d8c1d1d4446be80438e9ef2595",
"sha256": "72c6ca79a90c39262d6c618bb0ec719c2e276f7a69bee321d9157be3649e6c37"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp38-cp38-macosx_10_15_universal2.whl",
"has_sig": false,
"md5_digest": "d4e3c4d8c1d1d4446be80438e9ef2595",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 36081210,
"upload_time": "2023-05-31T17:26:51",
"upload_time_iso_8601": "2023-05-31T17:26:51.607602Z",
"url": "https://files.pythonhosted.org/packages/09/dd/c01aed189187de3d045a7eb9c960997d28c66f7b0e11d43e9e517edb752a/reticula-0.9.2-cp38-cp38-macosx_10_15_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6de19ae144e6888642fae599334d69373f693fd4fbf81b4dc70dd0690f61e1e8",
"md5": "aa0578e43e3270b96012cedd7966766d",
"sha256": "8cea9a8de51c17c32c6bfbcea6bb10d1c7fa95eac214a46fcafd406d5575a711"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "aa0578e43e3270b96012cedd7966766d",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 11930190,
"upload_time": "2023-05-31T17:26:56",
"upload_time_iso_8601": "2023-05-31T17:26:56.448920Z",
"url": "https://files.pythonhosted.org/packages/6d/e1/9ae144e6888642fae599334d69373f693fd4fbf81b4dc70dd0690f61e1e8/reticula-0.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c2de383f45a6202d500badc853d9a6330a990f5c81512bd133bd750f6bcee98",
"md5": "14af139316814a127ebbaa61015f3a0a",
"sha256": "c0bdeb1f0174056da44f71b994486b1094617a0a05c274a7191d79e42e79e3a6"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp38-cp38-win_amd64.whl",
"has_sig": false,
"md5_digest": "14af139316814a127ebbaa61015f3a0a",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 12430640,
"upload_time": "2023-05-31T17:27:01",
"upload_time_iso_8601": "2023-05-31T17:27:01.738143Z",
"url": "https://files.pythonhosted.org/packages/2c/2d/e383f45a6202d500badc853d9a6330a990f5c81512bd133bd750f6bcee98/reticula-0.9.2-cp38-cp38-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d979dee22fa29cda4c63346611c24b39f1ce9918561e5d25ab06ade907b01aa1",
"md5": "6403c7b5b5431a66b50596f855fa23fd",
"sha256": "85428cbe6b2989e0075d264df6969e39e5704d2eb117d6ee5706c688ea6f8b92"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp39-cp39-macosx_10_15_universal2.whl",
"has_sig": false,
"md5_digest": "6403c7b5b5431a66b50596f855fa23fd",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 36081190,
"upload_time": "2023-05-31T17:27:09",
"upload_time_iso_8601": "2023-05-31T17:27:09.392226Z",
"url": "https://files.pythonhosted.org/packages/d9/79/dee22fa29cda4c63346611c24b39f1ce9918561e5d25ab06ade907b01aa1/reticula-0.9.2-cp39-cp39-macosx_10_15_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e55e24bfa9842ea820a9c0e637354f9b467882b1a9189fefa2b375fe140d8098",
"md5": "5b92110707ad7d9c5bed9ae8ffe90ccb",
"sha256": "602bf2d76bf1224454688c57b97326be1a1a498367faee1d3572bdb0b2e52a35"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "5b92110707ad7d9c5bed9ae8ffe90ccb",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 11929901,
"upload_time": "2023-05-31T17:27:14",
"upload_time_iso_8601": "2023-05-31T17:27:14.134871Z",
"url": "https://files.pythonhosted.org/packages/e5/5e/24bfa9842ea820a9c0e637354f9b467882b1a9189fefa2b375fe140d8098/reticula-0.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ba8fe3d79e3ca04305af1f0c4e2e3865e1278d3c3cdf054e5dcdef137f39924f",
"md5": "1c8a321e3767ed39959044666b4beedc",
"sha256": "f07c1b646442425f83efe42d2bc28e6fc7bd7ca8820e7db3a5f1684559e79136"
},
"downloads": -1,
"filename": "reticula-0.9.2-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "1c8a321e3767ed39959044666b4beedc",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 12417805,
"upload_time": "2023-05-31T17:27:18",
"upload_time_iso_8601": "2023-05-31T17:27:18.048155Z",
"url": "https://files.pythonhosted.org/packages/ba/8f/e3d79e3ca04305af1f0c4e2e3865e1278d3c3cdf054e5dcdef137f39924f/reticula-0.9.2-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-31 17:26:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "reticula-network",
"github_project": "reticula-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "reticula"
}