topolib 0.4.1__tar.gz → 0.4.2__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 topolib might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: topolib
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: A compact Python library for modeling, analyzing, and visualizing optical network topologies.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -31,7 +31,7 @@ Project-URL: Repository, https://gitlab.com/DaniloBorquez/topolib
31
31
  Description-Content-Type: text/markdown
32
32
 
33
33
  # Topolib 🚀
34
-
34
+ # Topolib 🚀
35
35
 
36
36
  [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
37
37
  [![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](LICENSE)
@@ -40,99 +40,80 @@ Description-Content-Type: text/markdown
40
40
  [![Release coverage](https://gitlab.com/DaniloBorquez/topolib/badges/release/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=release)
41
41
  [![Documentation Status](https://readthedocs.org/projects/topolib/badge/?version=latest)](https://topolib.readthedocs.io/en/latest/?badge=latest)
42
42
 
43
- A compact Python library for working with optical network topologies: nodes, links, metrics and visualization tools. 🌐
43
+ > **Topolib** is a compact, modular Python library for modeling, analyzing, and visualizing optical network topologies.
44
+ > **Goal:** Provide researchers and engineers with a simple, extensible toolkit for working with nodes, links, metrics, and map-based visualizations.
45
+ >
46
+ > 🌐 **Model** | 📊 **Analyze** | 🗺️ **Visualize** | 🧩 **Extend**
47
+
48
+ ---
44
49
 
45
- ## Overview
50
+ ## 📂 Examples
46
51
 
47
- Topolib models network topologies with three main modules:
52
+ Explore ready-to-run usage examples in the [`examples/`](examples/) folder!
53
+ - [Show topology on a map](examples/show_topology_in_map.py) 🗺️
54
+ - More coming soon!
48
55
 
49
- - `topolib.elements` — Definitions of elementary building blocks
50
- - `Node` — represents a network node with id, name and geographic coordinates
51
- - `Link` — connects two `Node` objects and stores link length and id
56
+ ---
52
57
 
53
- - `topolib.topology` — High-level topology model
54
- - `Topology` — holds nodes and links, provides methods to add/remove nodes and links, compute metrics, export JSON, and compute shortest/disjoint paths
55
- - `Path` — represents a path through the topology
58
+ ## 🧭 Overview
56
59
 
57
- - `topolib.analysis` Metrics and analysis helpers
58
- - `Metrics` — functions to compute node degree, link length statistics, connection matrices, etc.
60
+ Topolib is organized into four main modules:
59
61
 
60
- - `topolib.visualization` — Visualization helpers
61
- - `MapView` — functions to display topology with OSM or paper-style maps
62
+ - 🧱 **Elements:** `Node`, `Link`basic building blocks
63
+ - 🕸️ **Topology:** `Topology`, `Path`manage nodes, links, paths, and adjacency
64
+ - 📈 **Analysis:** `Metrics` — compute node degree, link stats, connection matrices
65
+ - 🖼️ **Visualization:** `MapView` — plot topologies on real maps
62
66
 
63
- (These components are derived from the project's class diagram in `diagrams/class_diagram.puml`.)
67
+ ---
64
68
 
65
- ## Features
66
- - Modular design: elements, topology, analysis, and visualization
69
+ ## Features
70
+
71
+ - Modular, extensible design
67
72
  - Easy-to-use classes for nodes, links, and paths
68
73
  - Built-in metrics and analysis helpers
69
74
  - JSON import/export and interoperability
70
75
  - Ready for Sphinx, Read the Docs, and PyPI
71
76
 
72
- ## Quickstart ⚡
77
+ ---
73
78
 
74
- Create and activate a virtual environment, install dev dependencies and run tests:
79
+ ## Quickstart
75
80
 
76
81
  ```bash
77
82
  python -m venv .venv
78
83
  source .venv/bin/activate
79
- python -m pip install -U pip
80
- python -m pip install -r dev-requirements.txt
81
- python -m pytest -q
82
- ```
83
-
84
- ## Installation
85
-
86
- ```bash
84
+ pip install -U pip
87
85
  pip install topolib
88
86
  ```
89
87
 
90
- Or for development:
88
+ ---
91
89
 
92
- ```bash
93
- git clone https://gitlab.com/DaniloBorquez/topolib.git
94
- cd topolib
95
- python -m venv .venv
96
- source .venv/bin/activate
97
- pip install -e .
98
- pip install -r dev-requirements.txt
99
- ```
100
-
101
- ## Documentation
90
+ ## 📚 Documentation
102
91
 
103
92
  Full documentation: [https://topolib.readthedocs.io/](https://topolib.readthedocs.io/)
104
93
 
105
- ## Basic usage example
94
+ ---
106
95
 
107
- ```py
96
+ ## 📝 Basic usage
97
+
98
+ ```python
108
99
  from topolib.elements.node import Node
109
100
  from topolib.topology.topology import Topology
110
101
 
111
- # Create nodes
112
102
  n1 = Node(1, 'A', 10.0, 20.0)
113
103
  n2 = Node(2, 'B', 11.0, 21.0)
114
-
115
- # Build topology
116
- topo = Topology()
117
- topo.add_node(n1)
118
- topo.add_node(n2)
119
- # add links, compute metrics, visualize
104
+ topo = Topology(nodes=[n1, n2])
105
+ # Add links, compute metrics, visualize, etc.
120
106
  ```
121
107
 
108
+ ---
122
109
 
123
- ## Development 🛠️
124
-
125
- See `CONTRIBUTING.md` for development guidelines, commit message rules and pre-commit setup.
126
-
127
-
128
-
129
- ## Class diagram
110
+ ## 🛠️ Development
130
111
 
131
- ![](diagrams/class_diagram.puml)
112
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development guidelines, commit message rules, and pre-commit setup.
132
113
 
133
- (If you prefer a rendered image of the UML, render the PlantUML file locally or in your CI pipeline.)
114
+ ---
134
115
 
135
- ## License
116
+ ## 📄 License
136
117
 
137
- See `LICENSE` in the project root.
118
+ MIT — see [`LICENSE`](LICENSE) for details.
138
119
 
@@ -0,0 +1,86 @@
1
+ # Topolib 🚀
2
+ # Topolib 🚀
3
+
4
+ [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
5
+ [![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](LICENSE)
6
+ [![Issues](https://img.shields.io/badge/issues-on%20GitLab-blue.svg)](https://gitlab.com/DaniloBorquez/topolib/-/issues)
7
+ [![Develop coverage](https://gitlab.com/DaniloBorquez/topolib/badges/develop/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=develop)
8
+ [![Release coverage](https://gitlab.com/DaniloBorquez/topolib/badges/release/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=release)
9
+ [![Documentation Status](https://readthedocs.org/projects/topolib/badge/?version=latest)](https://topolib.readthedocs.io/en/latest/?badge=latest)
10
+
11
+ > **Topolib** is a compact, modular Python library for modeling, analyzing, and visualizing optical network topologies.
12
+ > **Goal:** Provide researchers and engineers with a simple, extensible toolkit for working with nodes, links, metrics, and map-based visualizations.
13
+ >
14
+ > 🌐 **Model** | 📊 **Analyze** | 🗺️ **Visualize** | 🧩 **Extend**
15
+
16
+ ---
17
+
18
+ ## 📂 Examples
19
+
20
+ Explore ready-to-run usage examples in the [`examples/`](examples/) folder!
21
+ - [Show topology on a map](examples/show_topology_in_map.py) 🗺️
22
+ - More coming soon!
23
+
24
+ ---
25
+
26
+ ## 🧭 Overview
27
+
28
+ Topolib is organized into four main modules:
29
+
30
+ - 🧱 **Elements:** `Node`, `Link` — basic building blocks
31
+ - 🕸️ **Topology:** `Topology`, `Path` — manage nodes, links, paths, and adjacency
32
+ - 📈 **Analysis:** `Metrics` — compute node degree, link stats, connection matrices
33
+ - 🖼️ **Visualization:** `MapView` — plot topologies on real maps
34
+
35
+ ---
36
+
37
+ ## ✨ Features
38
+
39
+ - Modular, extensible design
40
+ - Easy-to-use classes for nodes, links, and paths
41
+ - Built-in metrics and analysis helpers
42
+ - JSON import/export and interoperability
43
+ - Ready for Sphinx, Read the Docs, and PyPI
44
+
45
+ ---
46
+
47
+ ## ⚡ Quickstart
48
+
49
+ ```bash
50
+ python -m venv .venv
51
+ source .venv/bin/activate
52
+ pip install -U pip
53
+ pip install topolib
54
+ ```
55
+
56
+ ---
57
+
58
+ ## 📚 Documentation
59
+
60
+ Full documentation: [https://topolib.readthedocs.io/](https://topolib.readthedocs.io/)
61
+
62
+ ---
63
+
64
+ ## 📝 Basic usage
65
+
66
+ ```python
67
+ from topolib.elements.node import Node
68
+ from topolib.topology.topology import Topology
69
+
70
+ n1 = Node(1, 'A', 10.0, 20.0)
71
+ n2 = Node(2, 'B', 11.0, 21.0)
72
+ topo = Topology(nodes=[n1, n2])
73
+ # Add links, compute metrics, visualize, etc.
74
+ ```
75
+
76
+ ---
77
+
78
+ ## 🛠️ Development
79
+
80
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md) for development guidelines, commit message rules, and pre-commit setup.
81
+
82
+ ---
83
+
84
+ ## 📄 License
85
+
86
+ MIT — see [`LICENSE`](LICENSE) for details.
@@ -2,7 +2,7 @@
2
2
  [tool.poetry]
3
3
  name = "topolib"
4
4
  # Poetry requires a version field, but poetry-dynamic-versioning will override it
5
- version = "0.4.1"
5
+ version = "0.4.2"
6
6
  description = "A compact Python library for modeling, analyzing, and visualizing optical network topologies."
7
7
  authors = ["Danilo Bórquez-Paredes <danilo.borquez.p@uai.cl>"]
8
8
  license = "MIT"
@@ -2,7 +2,7 @@
2
2
  Metrics module for network topology analysis.
3
3
  """
4
4
 
5
- from typing import List, Any, Dict, Optional
5
+ from typing import List, Dict, Optional
6
6
 
7
7
 
8
8
  from topolib.topology import Topology
@@ -12,16 +12,16 @@ class Metrics:
12
12
  """
13
13
  Provides static methods for computing metrics on network topologies.
14
14
 
15
- Todos los métodos reciben una instancia de Topology.
15
+ All methods receive a Topology instance.
16
16
 
17
- Métodos
17
+ Methods
18
18
  -------
19
19
  node_degree(topology)
20
- Calcula el grado de cada nodo.
20
+ Calculates the degree of each node.
21
21
  link_length_stats(topology)
22
- Calcula estadísticas (min, max, avg) de las longitudes de los enlaces.
22
+ Calculates statistics (min, max, avg) of link lengths.
23
23
  connection_matrix(topology)
24
- Construye la matriz de adyacencia.
24
+ Builds the adjacency matrix.
25
25
  """
26
26
 
27
27
  @staticmethod
topolib-0.4.1/README.md DELETED
@@ -1,105 +0,0 @@
1
- # Topolib 🚀
2
-
3
-
4
- [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/)
5
- [![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](LICENSE)
6
- [![Issues](https://img.shields.io/badge/issues-on%20GitLab-blue.svg)](https://gitlab.com/DaniloBorquez/topolib/-/issues)
7
- [![Develop coverage](https://gitlab.com/DaniloBorquez/topolib/badges/develop/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=develop)
8
- [![Release coverage](https://gitlab.com/DaniloBorquez/topolib/badges/release/coverage.svg)](https://gitlab.com/DaniloBorquez/topolib/-/pipelines?ref=release)
9
- [![Documentation Status](https://readthedocs.org/projects/topolib/badge/?version=latest)](https://topolib.readthedocs.io/en/latest/?badge=latest)
10
-
11
- A compact Python library for working with optical network topologies: nodes, links, metrics and visualization tools. 🌐
12
-
13
- ## Overview
14
-
15
- Topolib models network topologies with three main modules:
16
-
17
- - `topolib.elements` — Definitions of elementary building blocks
18
- - `Node` — represents a network node with id, name and geographic coordinates
19
- - `Link` — connects two `Node` objects and stores link length and id
20
-
21
- - `topolib.topology` — High-level topology model
22
- - `Topology` — holds nodes and links, provides methods to add/remove nodes and links, compute metrics, export JSON, and compute shortest/disjoint paths
23
- - `Path` — represents a path through the topology
24
-
25
- - `topolib.analysis` — Metrics and analysis helpers
26
- - `Metrics` — functions to compute node degree, link length statistics, connection matrices, etc.
27
-
28
- - `topolib.visualization` — Visualization helpers
29
- - `MapView` — functions to display topology with OSM or paper-style maps
30
-
31
- (These components are derived from the project's class diagram in `diagrams/class_diagram.puml`.)
32
-
33
- ## Features
34
- - Modular design: elements, topology, analysis, and visualization
35
- - Easy-to-use classes for nodes, links, and paths
36
- - Built-in metrics and analysis helpers
37
- - JSON import/export and interoperability
38
- - Ready for Sphinx, Read the Docs, and PyPI
39
-
40
- ## Quickstart ⚡
41
-
42
- Create and activate a virtual environment, install dev dependencies and run tests:
43
-
44
- ```bash
45
- python -m venv .venv
46
- source .venv/bin/activate
47
- python -m pip install -U pip
48
- python -m pip install -r dev-requirements.txt
49
- python -m pytest -q
50
- ```
51
-
52
- ## Installation
53
-
54
- ```bash
55
- pip install topolib
56
- ```
57
-
58
- Or for development:
59
-
60
- ```bash
61
- git clone https://gitlab.com/DaniloBorquez/topolib.git
62
- cd topolib
63
- python -m venv .venv
64
- source .venv/bin/activate
65
- pip install -e .
66
- pip install -r dev-requirements.txt
67
- ```
68
-
69
- ## Documentation
70
-
71
- Full documentation: [https://topolib.readthedocs.io/](https://topolib.readthedocs.io/)
72
-
73
- ## Basic usage example
74
-
75
- ```py
76
- from topolib.elements.node import Node
77
- from topolib.topology.topology import Topology
78
-
79
- # Create nodes
80
- n1 = Node(1, 'A', 10.0, 20.0)
81
- n2 = Node(2, 'B', 11.0, 21.0)
82
-
83
- # Build topology
84
- topo = Topology()
85
- topo.add_node(n1)
86
- topo.add_node(n2)
87
- # add links, compute metrics, visualize
88
- ```
89
-
90
-
91
- ## Development 🛠️
92
-
93
- See `CONTRIBUTING.md` for development guidelines, commit message rules and pre-commit setup.
94
-
95
-
96
-
97
- ## Class diagram
98
-
99
- ![](diagrams/class_diagram.puml)
100
-
101
- (If you prefer a rendered image of the UML, render the PlantUML file locally or in your CI pipeline.)
102
-
103
- ## License
104
-
105
- See `LICENSE` in the project root.
File without changes
File without changes