edsger 0.0.14__tar.gz → 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.
- edsger-0.1.0/.github/workflows/docs.yml +43 -0
- {edsger-0.0.14 → edsger-0.1.0}/.github/workflows/tests.yml +3 -3
- {edsger-0.0.14 → edsger-0.1.0}/.gitignore +13 -0
- edsger-0.1.0/.readthedocs.yaml +27 -0
- {edsger-0.0.14/src/edsger.egg-info → edsger-0.1.0}/PKG-INFO +8 -6
- {edsger-0.0.14 → edsger-0.1.0}/README.md +4 -4
- {edsger-0.0.14 → edsger-0.1.0}/docs/Makefile +1 -1
- edsger-0.1.0/docs/requirements.txt +19 -0
- edsger-0.1.0/docs/source/api.md +136 -0
- {edsger-0.0.14 → edsger-0.1.0}/docs/source/conf.py +28 -2
- edsger-0.1.0/docs/source/contributing.md +69 -0
- edsger-0.1.0/docs/source/index.md +54 -0
- edsger-0.1.0/docs/source/installation.md +148 -0
- edsger-0.1.0/docs/source/quickstart.md +207 -0
- {edsger-0.0.14 → edsger-0.1.0}/pyproject.toml +1 -0
- edsger-0.1.0/src/edsger/_version.py +1 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/commons.c +2641 -2119
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/dijkstra.c +9754 -9548
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/path_tracking.c +7668 -7464
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/pq_4ary_dec_0b.c +8357 -8270
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/spiess_florian.c +9175 -8827
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/star.c +8669 -8936
- {edsger-0.0.14 → edsger-0.1.0/src/edsger.egg-info}/PKG-INFO +8 -6
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger.egg-info/SOURCES.txt +8 -4
- edsger-0.0.14/docs/source/edsger.rst +0 -12
- edsger-0.0.14/docs/source/index.rst +0 -22
- edsger-0.0.14/docs/source/installation.rst +0 -90
- edsger-0.0.14/docs/source/introduction.rst +0 -7
- edsger-0.0.14/src/edsger/_version.py +0 -1
- {edsger-0.0.14 → edsger-0.1.0}/.github/workflows/publish.yml +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/AUTHORS.rst +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/CHANGELOG.rst +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/CONTRIBUTING.rst +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/LICENSE +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/MANIFEST.in +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/requirements-dev.txt +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/requirements.txt +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/scripts/dijkstra_dimacs.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/setup.cfg +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/setup.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/__init__.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/commons.pxd +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/commons.pyx +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/dijkstra.pyx +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/networks.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/path.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/path_tracking.pyx +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/pq_4ary_dec_0b.pxd +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/pq_4ary_dec_0b.pyx +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/spiess_florian.pyx +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/star.pyx +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger/utils.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger.egg-info/dependency_links.txt +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger.egg-info/not-zip-safe +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger.egg-info/requires.txt +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/src/edsger.egg-info/top_level.txt +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/tests/test_dijkstra.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/tests/test_path.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/tests/test_path_tracking.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/tests/test_pq_4ary_dec_0b.py +0 -0
- {edsger-0.0.14 → edsger-0.1.0}/tests/test_spiess_florian.py +0 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
name: Documentation
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ release ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ release ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build-docs:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v4
|
15
|
+
|
16
|
+
- name: Set up Python
|
17
|
+
uses: actions/setup-python@v5
|
18
|
+
with:
|
19
|
+
python-version: '3.11'
|
20
|
+
|
21
|
+
- name: Install documentation dependencies
|
22
|
+
run: |
|
23
|
+
python -m pip install --upgrade pip
|
24
|
+
pip install -r docs/requirements.txt
|
25
|
+
|
26
|
+
- name: Build documentation
|
27
|
+
run: |
|
28
|
+
cd docs
|
29
|
+
make html
|
30
|
+
|
31
|
+
- name: Upload documentation artifacts
|
32
|
+
uses: actions/upload-artifact@v4
|
33
|
+
with:
|
34
|
+
name: documentation-html
|
35
|
+
path: docs/build/html/
|
36
|
+
|
37
|
+
- name: Deploy to GitHub Pages (on release branch)
|
38
|
+
if: github.ref == 'refs/heads/release' && github.event_name == 'push'
|
39
|
+
uses: peaceiris/actions-gh-pages@v4
|
40
|
+
with:
|
41
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
42
|
+
publish_dir: docs/build/html
|
43
|
+
publish_branch: gh-pages
|
@@ -9,13 +9,13 @@ jobs:
|
|
9
9
|
test:
|
10
10
|
strategy:
|
11
11
|
matrix:
|
12
|
-
os: [ubuntu-
|
12
|
+
os: [ubuntu-22.04, windows-2022, macos-14]
|
13
13
|
python-version: ["3.11"]
|
14
14
|
runs-on: ${{ matrix.os }}
|
15
15
|
steps:
|
16
|
-
- uses: actions/checkout@
|
16
|
+
- uses: actions/checkout@v4
|
17
17
|
- name: Set up Python ${{ matrix.python-version }}
|
18
|
-
uses: actions/setup-python@
|
18
|
+
uses: actions/setup-python@v5
|
19
19
|
with:
|
20
20
|
python-version: ${{ matrix.python-version }}
|
21
21
|
- name: Install dependencies
|
@@ -45,9 +45,22 @@ sdist/*
|
|
45
45
|
docs/api/*
|
46
46
|
docs/_rst/*
|
47
47
|
docs/_build/*
|
48
|
+
docs/build/*
|
48
49
|
cover/*
|
49
50
|
MANIFEST
|
50
51
|
|
52
|
+
# Documentation backup and temporary folders
|
53
|
+
docs_BCKP/
|
54
|
+
docs_old/
|
55
|
+
site/
|
56
|
+
tmp/
|
57
|
+
|
58
|
+
# Credentials and config
|
59
|
+
.pypirc
|
60
|
+
|
61
|
+
# MkDocs (unused)
|
62
|
+
mkdocs.yml
|
63
|
+
|
51
64
|
# Per-project virtualenvs
|
52
65
|
.venv*/
|
53
66
|
.conda*/
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Read the Docs configuration file for Sphinx projects
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
3
|
+
|
4
|
+
version: 2
|
5
|
+
|
6
|
+
# Set the OS, Python version and other tools you might need
|
7
|
+
build:
|
8
|
+
os: ubuntu-22.04
|
9
|
+
tools:
|
10
|
+
python: "3.12"
|
11
|
+
|
12
|
+
# Build documentation in the "docs/" directory with Sphinx
|
13
|
+
sphinx:
|
14
|
+
configuration: docs/source/conf.py
|
15
|
+
|
16
|
+
# Explicitly set the version of Python and its requirements
|
17
|
+
python:
|
18
|
+
install:
|
19
|
+
- requirements: docs/requirements.txt
|
20
|
+
- requirements: requirements.txt
|
21
|
+
- method: pip
|
22
|
+
path: .
|
23
|
+
|
24
|
+
# Optional but recommended, pin the Python requirements used to build docs
|
25
|
+
formats:
|
26
|
+
- pdf
|
27
|
+
- htmlzip
|
@@ -1,11 +1,12 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: edsger
|
3
|
-
Version: 0.0
|
3
|
+
Version: 0.1.0
|
4
4
|
Summary: Graph algorithms in Cython.
|
5
5
|
Author-email: François Pacull <francois.pacull@architecture-performance.fr>
|
6
6
|
Maintainer-email: François Pacull <francois.pacull@architecture-performance.fr>
|
7
7
|
License: MIT License
|
8
8
|
Project-URL: Repository, https://github.com/aetperf/Edsger
|
9
|
+
Project-URL: Documentation, https://edsger.readthedocs.io
|
9
10
|
Keywords: python,graph,shortest path,Dijkstra
|
10
11
|
Platform: any
|
11
12
|
Classifier: Development Status :: 4 - Beta
|
@@ -31,6 +32,7 @@ Provides-Extra: doc
|
|
31
32
|
Requires-Dist: sphinx; extra == "doc"
|
32
33
|
Requires-Dist: sphinx_design; extra == "doc"
|
33
34
|
Requires-Dist: sphinx_rtd_theme; extra == "doc"
|
35
|
+
Dynamic: license-file
|
34
36
|
|
35
37
|
|
36
38
|

|
@@ -205,11 +207,11 @@ shortest_paths[-5:]
|
|
205
207
|
|
206
208
|
#### Run method options
|
207
209
|
|
208
|
-
The `run` method can take the following arguments besides the source vertex index:
|
210
|
+
The `run` method can take the following arguments besides the source/target vertex index:
|
209
211
|
|
210
212
|
- `path_tracking` : bool, optional (default=False)
|
211
213
|
|
212
|
-
Whether to track the shortest path(s) from the source vertex to all other vertices in the graph.
|
214
|
+
Whether to track the shortest path(s) from/to the source/target vertex to all other vertices in the graph.
|
213
215
|
|
214
216
|
```python
|
215
217
|
dijkstra = Dijkstra(edges)
|
@@ -229,7 +231,7 @@ The path is returned as an array of vertex indices. This is an ordered list of v
|
|
229
231
|
|
230
232
|
- `return_inf` : bool, optional (default=True)
|
231
233
|
|
232
|
-
Whether to return path
|
234
|
+
Whether to return path lengths as infinity (np.inf) when no path exists.
|
233
235
|
|
234
236
|
```python
|
235
237
|
dijkstra = Dijkstra(edges, orientation='in')
|
@@ -262,7 +264,7 @@ shortest_paths
|
|
262
264
|
|
263
265
|
- `heap_length_ratio` : float, optional (default=1.0)
|
264
266
|
|
265
|
-
This is an experimental parameter that controls the size of the heap used in the algorithm. The heap is a static array that is used to store the vertices that
|
267
|
+
This is an experimental parameter that controls the size of the heap used in the algorithm. The heap is a static array that is used to store the vertices that may be visited next. A value of 1.0 means that the heap is the same size as the number of vertices, so there is no risk of overflow. Be aware that there is no guarantee that the algorithm will work with a heap length ratio smaller that 1. The lowest ratio that works for a given graph depends on the graph structure and the source vertex. For a rather sparse graph, a small ratio may work, but for a dense graph, a ratio of 1.0 is required.
|
266
268
|
|
267
269
|
## Contributing
|
268
270
|
|
@@ -171,11 +171,11 @@ shortest_paths[-5:]
|
|
171
171
|
|
172
172
|
#### Run method options
|
173
173
|
|
174
|
-
The `run` method can take the following arguments besides the source vertex index:
|
174
|
+
The `run` method can take the following arguments besides the source/target vertex index:
|
175
175
|
|
176
176
|
- `path_tracking` : bool, optional (default=False)
|
177
177
|
|
178
|
-
Whether to track the shortest path(s) from the source vertex to all other vertices in the graph.
|
178
|
+
Whether to track the shortest path(s) from/to the source/target vertex to all other vertices in the graph.
|
179
179
|
|
180
180
|
```python
|
181
181
|
dijkstra = Dijkstra(edges)
|
@@ -195,7 +195,7 @@ The path is returned as an array of vertex indices. This is an ordered list of v
|
|
195
195
|
|
196
196
|
- `return_inf` : bool, optional (default=True)
|
197
197
|
|
198
|
-
Whether to return path
|
198
|
+
Whether to return path lengths as infinity (np.inf) when no path exists.
|
199
199
|
|
200
200
|
```python
|
201
201
|
dijkstra = Dijkstra(edges, orientation='in')
|
@@ -228,7 +228,7 @@ shortest_paths
|
|
228
228
|
|
229
229
|
- `heap_length_ratio` : float, optional (default=1.0)
|
230
230
|
|
231
|
-
This is an experimental parameter that controls the size of the heap used in the algorithm. The heap is a static array that is used to store the vertices that
|
231
|
+
This is an experimental parameter that controls the size of the heap used in the algorithm. The heap is a static array that is used to store the vertices that may be visited next. A value of 1.0 means that the heap is the same size as the number of vertices, so there is no risk of overflow. Be aware that there is no guarantee that the algorithm will work with a heap length ratio smaller that 1. The lowest ratio that works for a given graph depends on the graph structure and the source vertex. For a rather sparse graph, a small ratio may work, but for a dense graph, a ratio of 1.0 is required.
|
232
232
|
|
233
233
|
## Contributing
|
234
234
|
|
@@ -17,4 +17,4 @@ help:
|
|
17
17
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
18
18
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
19
19
|
%: Makefile
|
20
|
-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Documentation build requirements
|
2
|
+
sphinx>=7.0.0
|
3
|
+
myst-parser>=2.0.0
|
4
|
+
sphinx-autodoc-typehints>=1.22.0
|
5
|
+
sphinx-copybutton>=0.5.0
|
6
|
+
furo>=2023.5.20
|
7
|
+
|
8
|
+
# Required for building Cython extensions during doc build
|
9
|
+
numpy>=1.26
|
10
|
+
pandas>=2.0
|
11
|
+
Cython>=3.0
|
12
|
+
setuptools>=61.0
|
13
|
+
|
14
|
+
# Optional but recommended
|
15
|
+
sphinx-design>=0.5.0
|
16
|
+
sphinx-tabs>=3.4.0
|
17
|
+
|
18
|
+
# ReadTheDocs specific
|
19
|
+
readthedocs-sphinx-search>=0.3.0
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# API Reference
|
2
|
+
|
3
|
+
This section provides detailed documentation for all public classes and functions in Edsger.
|
4
|
+
|
5
|
+
## edsger.path Module
|
6
|
+
|
7
|
+
### Dijkstra Class
|
8
|
+
|
9
|
+
The main class for performing Dijkstra's shortest path algorithm.
|
10
|
+
|
11
|
+
#### Constructor Parameters
|
12
|
+
|
13
|
+
- `edges`: pandas.DataFrame containing the graph edges
|
14
|
+
- `tail`: Column name for edge source nodes (default: 'tail')
|
15
|
+
- `head`: Column name for edge destination nodes (default: 'head')
|
16
|
+
- `weight`: Column name for edge weights (default: 'weight')
|
17
|
+
- `orientation`: Either 'out' (single-source) or 'in' (single-target) (default: 'out')
|
18
|
+
- `check_edges`: Whether to validate edge data (default: False)
|
19
|
+
- `permute`: Whether to optimize node indexing (default: False)
|
20
|
+
|
21
|
+
#### Methods
|
22
|
+
|
23
|
+
##### run
|
24
|
+
|
25
|
+
```python
|
26
|
+
def run(self, vertex_idx, path_tracking=False, return_inf=True,
|
27
|
+
return_series=False, heap_length_ratio=1.0)
|
28
|
+
```
|
29
|
+
|
30
|
+
Runs the shortest path algorithm from/to the specified vertex.
|
31
|
+
|
32
|
+
**Parameters:**
|
33
|
+
- `vertex_idx`: Source/target vertex index
|
34
|
+
- `path_tracking`: Whether to track paths for reconstruction (default: False)
|
35
|
+
- `return_inf`: Return infinity for unreachable vertices (default: True)
|
36
|
+
- `return_series`: Return results as pandas Series (default: False)
|
37
|
+
- `heap_length_ratio`: Heap size as fraction of vertices (default: 1.0)
|
38
|
+
|
39
|
+
**Returns:**
|
40
|
+
- Array or Series of shortest path lengths
|
41
|
+
|
42
|
+
##### get_path
|
43
|
+
|
44
|
+
```python
|
45
|
+
def get_path(self, vertex_idx)
|
46
|
+
```
|
47
|
+
|
48
|
+
Reconstructs the shortest path to/from a vertex (requires `path_tracking=True`).
|
49
|
+
|
50
|
+
**Parameters:**
|
51
|
+
- `vertex_idx`: Destination/source vertex index
|
52
|
+
|
53
|
+
**Returns:**
|
54
|
+
- Array of vertex indices forming the path
|
55
|
+
|
56
|
+
##### get_vertices
|
57
|
+
|
58
|
+
```python
|
59
|
+
def get_vertices(self)
|
60
|
+
```
|
61
|
+
|
62
|
+
Returns all vertices in the graph.
|
63
|
+
|
64
|
+
**Returns:**
|
65
|
+
- Array of vertex indices
|
66
|
+
|
67
|
+
### Examples
|
68
|
+
|
69
|
+
#### Basic Usage
|
70
|
+
|
71
|
+
```python
|
72
|
+
from edsger.path import Dijkstra
|
73
|
+
import pandas as pd
|
74
|
+
|
75
|
+
# Create a graph
|
76
|
+
edges = pd.DataFrame({
|
77
|
+
'tail': [0, 0, 1],
|
78
|
+
'head': [1, 2, 2],
|
79
|
+
'weight': [1, 4, 2]
|
80
|
+
})
|
81
|
+
|
82
|
+
# Initialize Dijkstra
|
83
|
+
dijkstra = Dijkstra(edges)
|
84
|
+
|
85
|
+
# Find shortest paths from vertex 0
|
86
|
+
paths = dijkstra.run(vertex_idx=0)
|
87
|
+
```
|
88
|
+
|
89
|
+
#### With Path Tracking
|
90
|
+
|
91
|
+
```python
|
92
|
+
# Enable path tracking
|
93
|
+
paths = dijkstra.run(vertex_idx=0, path_tracking=True)
|
94
|
+
|
95
|
+
# Get the actual path to vertex 2
|
96
|
+
path = dijkstra.get_path(vertex_idx=2)
|
97
|
+
```
|
98
|
+
|
99
|
+
#### Custom Parameters
|
100
|
+
|
101
|
+
```python
|
102
|
+
# Create with custom settings
|
103
|
+
dijkstra = Dijkstra(
|
104
|
+
edges,
|
105
|
+
orientation='in',
|
106
|
+
check_edges=True,
|
107
|
+
permute=True
|
108
|
+
)
|
109
|
+
|
110
|
+
# Run with custom parameters
|
111
|
+
paths = dijkstra.run(
|
112
|
+
vertex_idx=2,
|
113
|
+
return_series=True,
|
114
|
+
heap_length_ratio=0.5
|
115
|
+
)
|
116
|
+
```
|
117
|
+
|
118
|
+
### Graph Data Format
|
119
|
+
|
120
|
+
Edsger expects graph data as a pandas DataFrame with the following structure:
|
121
|
+
|
122
|
+
| Column | Type | Description |
|
123
|
+
|--------|---------|--------------------------------------|
|
124
|
+
| tail | int | Source vertex ID |
|
125
|
+
| head | int | Destination vertex ID |
|
126
|
+
| weight | float | Edge weight (must be non-negative) |
|
127
|
+
|
128
|
+
Example:
|
129
|
+
```python
|
130
|
+
edges = pd.DataFrame({
|
131
|
+
'tail': [0, 0, 1, 2],
|
132
|
+
'head': [1, 2, 2, 3],
|
133
|
+
'weight': [1.0, 4.0, 2.0, 1.0]
|
134
|
+
})
|
135
|
+
```
|
136
|
+
|
@@ -3,7 +3,6 @@
|
|
3
3
|
# For the full list of built-in configuration values, see the documentation:
|
4
4
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
5
5
|
|
6
|
-
|
7
6
|
# -- Path setup --------------------------------------------------------------
|
8
7
|
|
9
8
|
# If extensions (or modules to document with autodoc) are in another directory,
|
@@ -13,7 +12,7 @@
|
|
13
12
|
import os
|
14
13
|
import sys
|
15
14
|
|
16
|
-
sys.path.insert(0, os.path.abspath("../../src/
|
15
|
+
sys.path.insert(0, os.path.abspath("../../src/"))
|
17
16
|
|
18
17
|
# -- Project information -----------------------------------------------------
|
19
18
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
@@ -22,6 +21,16 @@ project = "Edsger"
|
|
22
21
|
copyright = "2024, Architecture & Performance"
|
23
22
|
author = "Francois Pacull"
|
24
23
|
|
24
|
+
# Get version from the package
|
25
|
+
try:
|
26
|
+
from edsger._version import __version__
|
27
|
+
release = __version__
|
28
|
+
version = __version__
|
29
|
+
except ImportError:
|
30
|
+
# Fallback if import fails
|
31
|
+
release = "0.0.15"
|
32
|
+
version = "0.0.15"
|
33
|
+
|
25
34
|
# -- General configuration ---------------------------------------------------
|
26
35
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
27
36
|
|
@@ -44,5 +53,22 @@ extensions = [
|
|
44
53
|
"sphinx.ext.autosummary",
|
45
54
|
"sphinx.ext.napoleon",
|
46
55
|
"sphinx.ext.intersphinx",
|
56
|
+
"sphinx.ext.viewcode",
|
47
57
|
"sphinx_design",
|
58
|
+
"myst_parser", # Enable MyST parser for Markdown
|
59
|
+
"sphinx_copybutton",
|
48
60
|
]
|
61
|
+
|
62
|
+
# MyST parser configuration
|
63
|
+
myst_enable_extensions = [
|
64
|
+
"deflist",
|
65
|
+
"tasklist",
|
66
|
+
"html_admonition",
|
67
|
+
"html_image",
|
68
|
+
]
|
69
|
+
|
70
|
+
# Source suffix
|
71
|
+
source_suffix = {
|
72
|
+
'.rst': 'restructuredtext',
|
73
|
+
'.md': 'markdown',
|
74
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Contributing to Edsger
|
2
|
+
|
3
|
+
We welcome contributions to the Edsger library! This document provides guidelines for contributing to the project.
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
### Development Environment
|
8
|
+
|
9
|
+
1. Clone the repository:
|
10
|
+
```bash
|
11
|
+
git clone https://github.com/aetperf/Edsger.git
|
12
|
+
cd Edsger
|
13
|
+
```
|
14
|
+
|
15
|
+
2. Create a virtual environment:
|
16
|
+
```bash
|
17
|
+
python -m venv venv
|
18
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
19
|
+
```
|
20
|
+
|
21
|
+
3. Install development dependencies:
|
22
|
+
```bash
|
23
|
+
pip install -r requirements-dev.txt
|
24
|
+
pip install -e .
|
25
|
+
```
|
26
|
+
|
27
|
+
## Development Guidelines
|
28
|
+
|
29
|
+
### Code Style
|
30
|
+
|
31
|
+
- Follow PEP 8 for Python code
|
32
|
+
- Use meaningful variable and function names
|
33
|
+
- Add docstrings to all public functions and classes
|
34
|
+
- Keep functions focused and concise
|
35
|
+
|
36
|
+
### Testing
|
37
|
+
|
38
|
+
- Write tests for all new features
|
39
|
+
- Ensure all tests pass before submitting a pull request
|
40
|
+
- Aim for high test coverage
|
41
|
+
|
42
|
+
### Documentation
|
43
|
+
|
44
|
+
- Update documentation for any new features or changes
|
45
|
+
- Use clear and concise language
|
46
|
+
- Include examples where appropriate
|
47
|
+
|
48
|
+
## Submitting Changes
|
49
|
+
|
50
|
+
1. Fork the repository on GitHub
|
51
|
+
2. Create a new branch for your feature or bugfix
|
52
|
+
3. Make your changes and commit them with clear commit messages
|
53
|
+
4. Push your branch to your fork
|
54
|
+
5. Submit a pull request with a clear description of your changes
|
55
|
+
|
56
|
+
## Reporting Issues
|
57
|
+
|
58
|
+
When reporting issues, please include:
|
59
|
+
|
60
|
+
- A clear description of the problem
|
61
|
+
- Steps to reproduce the issue
|
62
|
+
- Expected vs actual behavior
|
63
|
+
- System information (OS, Python version, etc.)
|
64
|
+
|
65
|
+
## Questions?
|
66
|
+
|
67
|
+
If you have questions about contributing, please open an issue on GitHub or contact the maintainers.
|
68
|
+
|
69
|
+
Thank you for contributing to Edsger!
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
github_url: https://github.com/aetperf/Edsger
|
3
|
+
---
|
4
|
+
|
5
|
+
# Edsger
|
6
|
+
|
7
|
+
*Graph algorithms in Cython*
|
8
|
+
|
9
|
+
Welcome to the Edsger documentation! Edsger is a Python library for efficient graph algorithms implemented in Cython. The library currently focuses on shortest path algorithms, with Dijkstra's algorithm fully implemented and additional algorithms planned for future releases.
|
10
|
+
|
11
|
+
## Key Features
|
12
|
+
|
13
|
+
- Fast implementation of Dijkstra's algorithm
|
14
|
+
- Support for both single-source and single-target shortest paths
|
15
|
+
- Easy integration with pandas DataFrames
|
16
|
+
- Memory-efficient 4-ary heap implementation
|
17
|
+
- Path tracking and reconstruction capabilities
|
18
|
+
|
19
|
+
## Quick Links
|
20
|
+
|
21
|
+
- [Installation](installation.md) - How to install Edsger
|
22
|
+
- [Quick Start](quickstart.md) - Get started quickly with basic examples
|
23
|
+
- [API Reference](api.md) - Complete API reference
|
24
|
+
|
25
|
+
## Table of Contents
|
26
|
+
|
27
|
+
```{toctree}
|
28
|
+
:maxdepth: 2
|
29
|
+
:caption: User Guide
|
30
|
+
|
31
|
+
installation
|
32
|
+
quickstart
|
33
|
+
```
|
34
|
+
|
35
|
+
```{toctree}
|
36
|
+
:maxdepth: 2
|
37
|
+
:caption: API Reference
|
38
|
+
|
39
|
+
api
|
40
|
+
```
|
41
|
+
|
42
|
+
```{toctree}
|
43
|
+
:maxdepth: 1
|
44
|
+
:caption: Development
|
45
|
+
|
46
|
+
contributing
|
47
|
+
```
|
48
|
+
|
49
|
+
## Indices
|
50
|
+
|
51
|
+
- {ref}`genindex`
|
52
|
+
- {ref}`modindex`
|
53
|
+
- {ref}`search`
|
54
|
+
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# Installation Guide
|
2
|
+
|
3
|
+
This guide will help you install the `edsger` package on your system.
|
4
|
+
|
5
|
+
## Requirements
|
6
|
+
|
7
|
+
Before you begin, ensure you have the following prerequisites:
|
8
|
+
|
9
|
+
- Python 3.11 or higher
|
10
|
+
- pip (Python package installer) or uv (recommended)
|
11
|
+
- (Optional) git for installing from source
|
12
|
+
|
13
|
+
## Method 1: Using Python venv + pip
|
14
|
+
|
15
|
+
Create a virtual environment and install with pip:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
# Create a virtual environment
|
19
|
+
python -m venv edsger-env
|
20
|
+
|
21
|
+
# Activate the virtual environment
|
22
|
+
source edsger-env/bin/activate # On Windows: edsger-env\Scripts\activate
|
23
|
+
|
24
|
+
# Install edsger
|
25
|
+
pip install edsger
|
26
|
+
```
|
27
|
+
|
28
|
+
## Method 2: Using uv (Recommended)
|
29
|
+
|
30
|
+
[uv](https://github.com/astral-sh/uv) provides faster installation and better dependency resolution:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
# Install uv if you haven't already
|
34
|
+
pip install uv
|
35
|
+
|
36
|
+
# Create a virtual environment with uv
|
37
|
+
uv venv edsger-env
|
38
|
+
|
39
|
+
# Activate the virtual environment
|
40
|
+
source edsger-env/bin/activate # On Windows: edsger-env\Scripts\activate
|
41
|
+
|
42
|
+
# Install edsger
|
43
|
+
uv pip install edsger
|
44
|
+
```
|
45
|
+
|
46
|
+
## Installing from Source
|
47
|
+
|
48
|
+
If you prefer to install from source or contribute to development:
|
49
|
+
|
50
|
+
### 1. Clone the Repository
|
51
|
+
|
52
|
+
```bash
|
53
|
+
git clone https://github.com/aetperf/Edsger.git
|
54
|
+
cd Edsger
|
55
|
+
```
|
56
|
+
|
57
|
+
### 2. Using Python venv + pip
|
58
|
+
|
59
|
+
```bash
|
60
|
+
# Create and activate virtual environment
|
61
|
+
python -m venv edsger-env
|
62
|
+
source edsger-env/bin/activate # On Windows: edsger-env\Scripts\activate
|
63
|
+
|
64
|
+
# Install in editable mode
|
65
|
+
pip install -e .
|
66
|
+
```
|
67
|
+
|
68
|
+
### 3. Using uv (Recommended)
|
69
|
+
|
70
|
+
```bash
|
71
|
+
# Create and activate virtual environment
|
72
|
+
uv venv edsger-env
|
73
|
+
source edsger-env/bin/activate # On Windows: edsger-env\Scripts\activate
|
74
|
+
|
75
|
+
# Install in editable mode
|
76
|
+
uv pip install -e .
|
77
|
+
```
|
78
|
+
|
79
|
+
### 4. Verify the Installation
|
80
|
+
|
81
|
+
Check that the installation was successful by importing the package in a Python shell:
|
82
|
+
|
83
|
+
```python
|
84
|
+
python
|
85
|
+
>>> import edsger
|
86
|
+
>>> edsger.__version__
|
87
|
+
```
|
88
|
+
|
89
|
+
You should see the version number of the `edsger` package.
|
90
|
+
|
91
|
+
## Development Installation
|
92
|
+
|
93
|
+
For contributors who need development dependencies:
|
94
|
+
|
95
|
+
### Using Python venv + pip
|
96
|
+
|
97
|
+
```bash
|
98
|
+
# Create and activate virtual environment
|
99
|
+
python -m venv edsger-env
|
100
|
+
source edsger-env/bin/activate # On Windows: edsger-env\Scripts\activate
|
101
|
+
|
102
|
+
# Install development dependencies
|
103
|
+
pip install -r requirements-dev.txt
|
104
|
+
pip install -e .
|
105
|
+
```
|
106
|
+
|
107
|
+
### Using uv (Recommended)
|
108
|
+
|
109
|
+
```bash
|
110
|
+
# Create and activate virtual environment
|
111
|
+
uv venv edsger-env
|
112
|
+
source edsger-env/bin/activate # On Windows: edsger-env\Scripts\activate
|
113
|
+
|
114
|
+
# Install development dependencies
|
115
|
+
uv pip install -r requirements-dev.txt
|
116
|
+
uv pip install -e .
|
117
|
+
```
|
118
|
+
|
119
|
+
## Troubleshooting
|
120
|
+
|
121
|
+
### Module Not Found Error
|
122
|
+
|
123
|
+
If you encounter a `ModuleNotFoundError`, make sure that:
|
124
|
+
1. The `edsger` package is installed correctly
|
125
|
+
2. You're using the correct Python environment
|
126
|
+
3. The `PYTHONPATH` is set appropriately (if needed)
|
127
|
+
|
128
|
+
### Compilation Issues
|
129
|
+
|
130
|
+
If you experience compilation issues, ensure you have:
|
131
|
+
- A working C compiler
|
132
|
+
- NumPy installed
|
133
|
+
- Cython >= 3.0 installed
|
134
|
+
|
135
|
+
## Uninstallation
|
136
|
+
|
137
|
+
To uninstall the `edsger` package:
|
138
|
+
|
139
|
+
```bash
|
140
|
+
pip uninstall edsger
|
141
|
+
```
|
142
|
+
|
143
|
+
## Getting Help
|
144
|
+
|
145
|
+
For further assistance:
|
146
|
+
- Check the [documentation](index.md)
|
147
|
+
- Open an issue on [GitHub](https://github.com/aetperf/Edsger)
|
148
|
+
- Contact the maintainer at [francois.pacull@architecture-performance.fr](mailto:francois.pacull@architecture-performance.fr)
|