protee 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.
Files changed (44) hide show
  1. protee-0.1.0/LICENSE +28 -0
  2. protee-0.1.0/PKG-INFO +131 -0
  3. protee-0.1.0/README.md +96 -0
  4. protee-0.1.0/pyproject.toml +167 -0
  5. protee-0.1.0/pyproject.toml.orig +155 -0
  6. protee-0.1.0/src/protee/__init__.py +66 -0
  7. protee-0.1.0/src/protee/_assets/NOTICE.md +20 -0
  8. protee-0.1.0/src/protee/_assets/cytoscape-expand-collapse.LICENSE.md +21 -0
  9. protee-0.1.0/src/protee/_assets/cytoscape-expand-collapse.js +1 -0
  10. protee-0.1.0/src/protee/_assets/cytoscape.LICENSE.txt +19 -0
  11. protee-0.1.0/src/protee/_assets/cytoscape.min.js +32 -0
  12. protee-0.1.0/src/protee/constraints/__init__.py +142 -0
  13. protee-0.1.0/src/protee/constraints/_compose.py +331 -0
  14. protee-0.1.0/src/protee/constraints/_data.py +279 -0
  15. protee-0.1.0/src/protee/constraints/_effects.py +390 -0
  16. protee-0.1.0/src/protee/constraints/_failure.py +801 -0
  17. protee-0.1.0/src/protee/constraints/_inputs.py +247 -0
  18. protee-0.1.0/src/protee/constraints/_model.py +585 -0
  19. protee-0.1.0/src/protee/constraints/_patterns.py +194 -0
  20. protee-0.1.0/src/protee/constraints/_provenance.py +194 -0
  21. protee-0.1.0/src/protee/constraints/_table.py +183 -0
  22. protee-0.1.0/src/protee/constraints/_toml.py +215 -0
  23. protee-0.1.0/src/protee/constraints/_verify.py +692 -0
  24. protee-0.1.0/src/protee/constraints/data/fr-oversize-transport-2006.toml +119 -0
  25. protee-0.1.0/src/protee/flow/__init__.py +53 -0
  26. protee-0.1.0/src/protee/flow/_augmenting.py +152 -0
  27. protee-0.1.0/src/protee/flow/_disjoint.py +165 -0
  28. protee-0.1.0/src/protee/flow/_feasibility.py +112 -0
  29. protee-0.1.0/src/protee/flow/_maxflow.py +243 -0
  30. protee-0.1.0/src/protee/flow/_methods.py +295 -0
  31. protee-0.1.0/src/protee/flow/_normal.py +126 -0
  32. protee-0.1.0/src/protee/flow/_problem.py +178 -0
  33. protee-0.1.0/src/protee/flow/_result.py +102 -0
  34. protee-0.1.0/src/protee/flow/_simplex.py +229 -0
  35. protee-0.1.0/src/protee/flow/diagnostics.py +362 -0
  36. protee-0.1.0/src/protee/graph.py +191 -0
  37. protee-0.1.0/src/protee/io.py +817 -0
  38. protee-0.1.0/src/protee/paths.py +383 -0
  39. protee-0.1.0/src/protee/py.typed +0 -0
  40. protee-0.1.0/src/protee/routes.py +474 -0
  41. protee-0.1.0/src/protee/schemas/protee-node-link-0.schema.json +125 -0
  42. protee-0.1.0/src/protee/structure.py +481 -0
  43. protee-0.1.0/src/protee/transforms.py +436 -0
  44. protee-0.1.0/src/protee/viz.py +1537 -0
protee-0.1.0/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Miki
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
protee-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: protee
3
+ Version: 0.1.0
4
+ Summary: Proteus: graph and operations research algorithms whose methods are chosen explicitly, compared, and backed by certificates and diagnostics
5
+ Keywords: operations research,optimization,graphs,life cycle,life-cycle profile,network flows,shortest paths
6
+ Author: miki4ia
7
+ Author-email: miki4ia <miki4ia@gmail.com>
8
+ License-Expression: BSD-3-Clause AND MIT
9
+ License-File: LICENSE
10
+ License-File: src/protee/_assets/cytoscape-expand-collapse.LICENSE.md
11
+ License-File: src/protee/_assets/cytoscape.LICENSE.txt
12
+ Classifier: Development Status :: 2 - Pre-Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
22
+ Classifier: Typing :: Typed
23
+ Requires-Dist: numpy>=2.3.2 ; python_full_version < '3.15'
24
+ Requires-Dist: numpy>=2.5.2 ; python_full_version >= '3.15'
25
+ Requires-Dist: scipy>=1.16.1 ; python_full_version < '3.15'
26
+ Requires-Dist: scipy>=1.18.1 ; python_full_version >= '3.15'
27
+ Requires-Dist: pygraphviz>=2.0 ; extra == 'viz'
28
+ Requires-Python: >=3.12
29
+ Project-URL: Homepage, https://github.com/miki4iaml/protee
30
+ Project-URL: Repository, https://github.com/miki4iaml/protee
31
+ Project-URL: Issues, https://github.com/miki4iaml/protee/issues
32
+ Project-URL: Changelog, https://github.com/miki4iaml/protee/blob/main/CHANGELOG.md
33
+ Provides-Extra: viz
34
+ Description-Content-Type: text/markdown
35
+
36
+ # protee
37
+
38
+ **English** | [Français](https://github.com/miki4iaml/protee/blob/v0.1.0/README.fr.md)
39
+
40
+ [![CI](https://github.com/miki4iaml/protee/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/miki4iaml/protee/actions/workflows/ci.yml)
41
+ [![CodeQL](https://github.com/miki4iaml/protee/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/miki4iaml/protee/actions/workflows/github-code-scanning/codeql)
42
+ [![Python](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fmiki4iaml%2Fprotee%2Fdevelop%2Fpyproject.toml)](https://github.com/miki4iaml/protee/blob/v0.1.0/pyproject.toml)
43
+ [![License](https://img.shields.io/github/license/miki4iaml/protee)](https://github.com/miki4iaml/protee/blob/v0.1.0/LICENSE)
44
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
45
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
46
+ [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
47
+ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-fe5196)](https://www.conventionalcommits.org/en/v1.0.0/)
48
+
49
+ **Proteus: graph and operations research algorithms whose methods are
50
+ chosen explicitly, compared, and backed by certificates and
51
+ diagnostics.**
52
+
53
+ Pure Python package, depending only on NumPy and SciPy (wheels for
54
+ every supported platform); it works on an offline workstation (no
55
+ online solver, service or engine).
56
+
57
+ > Pre-alpha: a first set of graph and flow algorithms is available
58
+ > (`protee.graph`, `protee.paths`, `protee.routes`, `protee.flow`,
59
+ > `protee.structure`, `protee.transforms`, `protee.io`), with
60
+ > requirements turned into traceable constraints on graphs
61
+ > (`protee.constraints`); their API is provisional until version 1.0,
62
+ > and the model of life-cycle profiles is being designed.
63
+
64
+ Typed graphs are exchanged with other projects in the node-link format
65
+ [`protee-node-link/0`](https://github.com/miki4iaml/protee/blob/v0.1.0/docs/node-link-format.md) (`protee.io`), and
66
+ drawn by `protee.viz`: selection, groups and loops without dependency,
67
+ SVG and a page to explore offline with the optional extra `viz` (see the
68
+ [gallery](https://github.com/miki4iaml/protee/blob/v0.1.0/docs/gallery/README.md)).
69
+
70
+ ## Why protee
71
+
72
+ Many graph problems start from requirements written by people: a
73
+ client's specification, a regulation, a doctrine, a standard. "The
74
+ mass of the vehicle stays within the load limit of each bridge", or
75
+ "this situation occurs at most twice in the life of the equipment",
76
+ becomes a constraint on a graph, and a method returns a route or a
77
+ flow. To trust that result, each requirement must be traceable from its
78
+ source to its proof.
79
+
80
+ protee implements this chain of six links:
81
+
82
+ 1. **source**: the document, its edition and paragraph, or the
83
+ client's statement;
84
+ 2. **normalized requirement**: an identified statement, in English and
85
+ in other languages if needed;
86
+ 3. **constraint pattern**: a generic, named form (arc admissibility,
87
+ speed cap, occurrence bounds…), without values;
88
+ 4. **values**: from value sets, each value with its source, edition and
89
+ precedence; missing data stay unknown, never presumed compatible;
90
+ 5. **named method**: chosen explicitly by the caller;
91
+ 6. **proof**: each requirement verified on the result, independently of
92
+ the method (`applied`, `partial`, `not_applied`, `no_data`,
93
+ `not_applicable`), with its impact (the result with and without it)
94
+ and the provenance of the result.
95
+
96
+ Each link has precedents; we did not find the complete chain in the
97
+ sources we reviewed. Two reference applications guide and validate it:
98
+ life-cycle profiles (the graph of the situations an equipment goes
99
+ through, from manufacture to use) and route planning on large road
100
+ networks. protee provides a value set taken from a public text, for
101
+ testing and illustration.
102
+
103
+ ## Installation
104
+
105
+ From PyPI, with Python 3.12 or later:
106
+
107
+ ```
108
+ pip install protee
109
+ ```
110
+
111
+ The drawing in SVG and in a page to explore (`protee.viz.render_svg`,
112
+ `protee.viz.render_html`) needs the optional extra `viz`:
113
+
114
+ ```
115
+ pip install "protee[viz]"
116
+ ```
117
+
118
+ To work on protee itself, see the
119
+ [contributing guide](https://github.com/miki4iaml/protee/blob/v0.1.0/.github/CONTRIBUTING.md).
120
+
121
+ ## Contributing
122
+
123
+ Contributions are welcome: see the [contributing guide](https://github.com/miki4iaml/protee/blob/v0.1.0/.github/CONTRIBUTING.md)
124
+ and the rules shared by contributors and coding agents in
125
+ [AGENTS.md](https://github.com/miki4iaml/protee/blob/v0.1.0/AGENTS.md).
126
+
127
+ ## License
128
+
129
+ [BSD-3-Clause](https://github.com/miki4iaml/protee/blob/v0.1.0/LICENSE). The page written by `protee.viz.render_html`
130
+ embeds cytoscape.js and cytoscape-expand-collapse, under the MIT licence
131
+ ([notice](https://github.com/miki4iaml/protee/blob/v0.1.0/src/protee/_assets/NOTICE.md)).
protee-0.1.0/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # protee
2
+
3
+ **English** | [Français](https://github.com/miki4iaml/protee/blob/v0.1.0/README.fr.md)
4
+
5
+ [![CI](https://github.com/miki4iaml/protee/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/miki4iaml/protee/actions/workflows/ci.yml)
6
+ [![CodeQL](https://github.com/miki4iaml/protee/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/miki4iaml/protee/actions/workflows/github-code-scanning/codeql)
7
+ [![Python](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fmiki4iaml%2Fprotee%2Fdevelop%2Fpyproject.toml)](https://github.com/miki4iaml/protee/blob/v0.1.0/pyproject.toml)
8
+ [![License](https://img.shields.io/github/license/miki4iaml/protee)](https://github.com/miki4iaml/protee/blob/v0.1.0/LICENSE)
9
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
10
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
11
+ [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
12
+ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-fe5196)](https://www.conventionalcommits.org/en/v1.0.0/)
13
+
14
+ **Proteus: graph and operations research algorithms whose methods are
15
+ chosen explicitly, compared, and backed by certificates and
16
+ diagnostics.**
17
+
18
+ Pure Python package, depending only on NumPy and SciPy (wheels for
19
+ every supported platform); it works on an offline workstation (no
20
+ online solver, service or engine).
21
+
22
+ > Pre-alpha: a first set of graph and flow algorithms is available
23
+ > (`protee.graph`, `protee.paths`, `protee.routes`, `protee.flow`,
24
+ > `protee.structure`, `protee.transforms`, `protee.io`), with
25
+ > requirements turned into traceable constraints on graphs
26
+ > (`protee.constraints`); their API is provisional until version 1.0,
27
+ > and the model of life-cycle profiles is being designed.
28
+
29
+ Typed graphs are exchanged with other projects in the node-link format
30
+ [`protee-node-link/0`](https://github.com/miki4iaml/protee/blob/v0.1.0/docs/node-link-format.md) (`protee.io`), and
31
+ drawn by `protee.viz`: selection, groups and loops without dependency,
32
+ SVG and a page to explore offline with the optional extra `viz` (see the
33
+ [gallery](https://github.com/miki4iaml/protee/blob/v0.1.0/docs/gallery/README.md)).
34
+
35
+ ## Why protee
36
+
37
+ Many graph problems start from requirements written by people: a
38
+ client's specification, a regulation, a doctrine, a standard. "The
39
+ mass of the vehicle stays within the load limit of each bridge", or
40
+ "this situation occurs at most twice in the life of the equipment",
41
+ becomes a constraint on a graph, and a method returns a route or a
42
+ flow. To trust that result, each requirement must be traceable from its
43
+ source to its proof.
44
+
45
+ protee implements this chain of six links:
46
+
47
+ 1. **source**: the document, its edition and paragraph, or the
48
+ client's statement;
49
+ 2. **normalized requirement**: an identified statement, in English and
50
+ in other languages if needed;
51
+ 3. **constraint pattern**: a generic, named form (arc admissibility,
52
+ speed cap, occurrence bounds…), without values;
53
+ 4. **values**: from value sets, each value with its source, edition and
54
+ precedence; missing data stay unknown, never presumed compatible;
55
+ 5. **named method**: chosen explicitly by the caller;
56
+ 6. **proof**: each requirement verified on the result, independently of
57
+ the method (`applied`, `partial`, `not_applied`, `no_data`,
58
+ `not_applicable`), with its impact (the result with and without it)
59
+ and the provenance of the result.
60
+
61
+ Each link has precedents; we did not find the complete chain in the
62
+ sources we reviewed. Two reference applications guide and validate it:
63
+ life-cycle profiles (the graph of the situations an equipment goes
64
+ through, from manufacture to use) and route planning on large road
65
+ networks. protee provides a value set taken from a public text, for
66
+ testing and illustration.
67
+
68
+ ## Installation
69
+
70
+ From PyPI, with Python 3.12 or later:
71
+
72
+ ```
73
+ pip install protee
74
+ ```
75
+
76
+ The drawing in SVG and in a page to explore (`protee.viz.render_svg`,
77
+ `protee.viz.render_html`) needs the optional extra `viz`:
78
+
79
+ ```
80
+ pip install "protee[viz]"
81
+ ```
82
+
83
+ To work on protee itself, see the
84
+ [contributing guide](https://github.com/miki4iaml/protee/blob/v0.1.0/.github/CONTRIBUTING.md).
85
+
86
+ ## Contributing
87
+
88
+ Contributions are welcome: see the [contributing guide](https://github.com/miki4iaml/protee/blob/v0.1.0/.github/CONTRIBUTING.md)
89
+ and the rules shared by contributors and coding agents in
90
+ [AGENTS.md](https://github.com/miki4iaml/protee/blob/v0.1.0/AGENTS.md).
91
+
92
+ ## License
93
+
94
+ [BSD-3-Clause](https://github.com/miki4iaml/protee/blob/v0.1.0/LICENSE). The page written by `protee.viz.render_html`
95
+ embeds cytoscape.js and cytoscape-expand-collapse, under the MIT licence
96
+ ([notice](https://github.com/miki4iaml/protee/blob/v0.1.0/src/protee/_assets/NOTICE.md)).
@@ -0,0 +1,167 @@
1
+ [project]
2
+ name = "protee"
3
+ version = "0.1.0"
4
+ description = "Proteus: graph and operations research algorithms whose methods are chosen explicitly, compared, and backed by certificates and diagnostics"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ license = "BSD-3-Clause AND MIT"
8
+ license-files = [
9
+ "LICENSE",
10
+ "src/protee/_assets/*.LICENSE.*",
11
+ ]
12
+ keywords = [
13
+ "operations research",
14
+ "optimization",
15
+ "graphs",
16
+ "life cycle",
17
+ "life-cycle profile",
18
+ "network flows",
19
+ "shortest paths",
20
+ ]
21
+ classifiers = [
22
+ "Development Status :: 2 - Pre-Alpha",
23
+ "Intended Audience :: Science/Research",
24
+ "Operating System :: OS Independent",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3 :: Only",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
30
+ "Topic :: Scientific/Engineering",
31
+ "Topic :: Scientific/Engineering :: Mathematics",
32
+ "Typing :: Typed",
33
+ ]
34
+ dependencies = [
35
+ "numpy>=2.3.2 ; python_full_version < '3.15'",
36
+ "numpy>=2.5.2 ; python_full_version >= '3.15'",
37
+ "scipy>=1.16.1 ; python_full_version < '3.15'",
38
+ "scipy>=1.18.1 ; python_full_version >= '3.15'",
39
+ ]
40
+
41
+ [[project.authors]]
42
+ name = "miki4ia"
43
+ email = "miki4ia@gmail.com"
44
+
45
+ [project.urls]
46
+ Homepage = "https://github.com/miki4iaml/protee"
47
+ Repository = "https://github.com/miki4iaml/protee"
48
+ Issues = "https://github.com/miki4iaml/protee/issues"
49
+ Changelog = "https://github.com/miki4iaml/protee/blob/main/CHANGELOG.md"
50
+
51
+ [project.optional-dependencies]
52
+ viz = ["pygraphviz>=2.0"]
53
+
54
+ [build-system]
55
+ requires = ["uv_build>=0.12.18,<0.14.0"]
56
+ build-backend = "uv_build"
57
+
58
+ [dependency-groups]
59
+ dev = [
60
+ "codespell>=2.4.3",
61
+ "coverage>=7.16.2",
62
+ "highspy>=1.16.0",
63
+ "hypothesis>=6.170.14",
64
+ "jsonschema>=4.26.0",
65
+ "mypy>=2.4.0",
66
+ "networkx>=3.7",
67
+ "pre-commit>=4.6.2",
68
+ "pygraphviz>=2.0",
69
+ "pytest>=9.1.1",
70
+ "ruff>=0.16.9",
71
+ "zizmor>=1.30.1",
72
+ ]
73
+
74
+ [tool.mypy]
75
+ python_version = "3.12"
76
+ strict = true
77
+ files = [
78
+ "src",
79
+ "tests",
80
+ "scripts",
81
+ "docs",
82
+ ]
83
+ warn_unreachable = true
84
+ enable_error_code = [
85
+ "ignore-without-code",
86
+ "redundant-expr",
87
+ "truthy-bool",
88
+ ]
89
+
90
+ [[tool.mypy.overrides]]
91
+ module = [
92
+ "jsonschema",
93
+ "jsonschema.*",
94
+ "networkx",
95
+ "networkx.*",
96
+ "pygraphviz",
97
+ "pygraphviz.*",
98
+ ]
99
+ ignore_missing_imports = true
100
+
101
+ [tool.pytest]
102
+ minversion = "9.0"
103
+ testpaths = ["tests"]
104
+ strict = true
105
+ filterwarnings = ["error"]
106
+ addopts = [
107
+ "-ra",
108
+ "--showlocals",
109
+ ]
110
+ log_level = "INFO"
111
+
112
+ [tool.coverage.run]
113
+ branch = true
114
+ source = [
115
+ "src/protee",
116
+ "scripts",
117
+ ]
118
+ relative_files = true
119
+
120
+ [tool.coverage.report]
121
+ fail_under = 80
122
+ show_missing = true
123
+ exclude_also = ['if __name__ == "__main__":']
124
+
125
+ [tool.ruff.format]
126
+ exclude = ["*.md"]
127
+
128
+ [tool.ruff.lint]
129
+ extend-select = [
130
+ "ARG",
131
+ "B",
132
+ "C4",
133
+ "I002",
134
+ "PIE",
135
+ "PT",
136
+ "PTH",
137
+ "RET",
138
+ "T20",
139
+ ]
140
+
141
+ [tool.ruff.lint.isort]
142
+ required-imports = ["from __future__ import annotations"]
143
+
144
+ [tool.ruff.lint.per-file-ignores]
145
+ "tests/**" = ["ARG001"]
146
+ "scripts/**" = [
147
+ "T20",
148
+ "I002",
149
+ ]
150
+
151
+ [tool.codespell]
152
+ skip = "*.fr.md,uv.lock,src/protee/_assets/*.js"
153
+ ignore-words-list = "flate,alph"
154
+
155
+ [tool.repo-review.ignore]
156
+ PC110 = "ruff format runs as a local hook through uv run --frozen (single version source: uv.lock)"
157
+ PC140 = "mypy runs as a local hook through uv run --frozen (single version source: uv.lock)"
158
+ PC160 = "codespell runs as a local hook through uv run --frozen (single version source: uv.lock)"
159
+ PC190 = "ruff check runs as a local hook through uv run --frozen (single version source: uv.lock)"
160
+ SEC001 = "zizmor runs as a local hook through uv run --frozen (single version source: uv.lock)"
161
+ PC901 = "pre-commit.ci is not used; CI replays the hooks itself"
162
+ PC902 = "pre-commit.ci is not used; CI replays the hooks itself"
163
+ PC903 = "pre-commit.ci is not used; CI replays the hooks itself"
164
+ PC180 = "no markdown formatter, by choice (dependency control, hand-written texts)"
165
+ PY007 = "uv run is the task runner, identical on every OS"
166
+ PY004 = "temporary: documentation not started yet"
167
+ PC170 = "temporary: no reStructuredText until the documentation exists"
@@ -0,0 +1,155 @@
1
+ [project]
2
+ name = "protee"
3
+ version = "0.1.0"
4
+ description = "Proteus: graph and operations research algorithms whose methods are chosen explicitly, compared, and backed by certificates and diagnostics"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "miki4ia", email = "miki4ia@gmail.com" }
8
+ ]
9
+ requires-python = ">=3.12"
10
+ # The drawing page embeds third-party JavaScript under the MIT licence.
11
+ license = "BSD-3-Clause AND MIT"
12
+ license-files = ["LICENSE", "src/protee/_assets/*.LICENSE.*"]
13
+ keywords = [
14
+ "operations research",
15
+ "optimization",
16
+ "graphs",
17
+ "life cycle",
18
+ "life-cycle profile",
19
+ "network flows",
20
+ "shortest paths",
21
+ ]
22
+ classifiers = [
23
+ "Development Status :: 2 - Pre-Alpha",
24
+ "Intended Audience :: Science/Research",
25
+ "Operating System :: OS Independent",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3 :: Only",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Programming Language :: Python :: 3.14",
31
+ "Topic :: Scientific/Engineering",
32
+ "Topic :: Scientific/Engineering :: Mathematics",
33
+ "Typing :: Typed",
34
+ ]
35
+ dependencies = [
36
+ # Lower bounds: the first releases with wheels for Python 3.14 (kept for
37
+ # 3.12 and 3.13, whose first releases with wheels are past the support
38
+ # window of SPEC 0), and for Python 3.15.
39
+ "numpy>=2.3.2 ; python_full_version < '3.15'",
40
+ "numpy>=2.5.2 ; python_full_version >= '3.15'",
41
+ "scipy>=1.16.1 ; python_full_version < '3.15'",
42
+ "scipy>=1.18.1 ; python_full_version >= '3.15'",
43
+ ]
44
+
45
+ [project.urls]
46
+ Homepage = "https://github.com/miki4iaml/protee"
47
+ Repository = "https://github.com/miki4iaml/protee"
48
+ Issues = "https://github.com/miki4iaml/protee/issues"
49
+ Changelog = "https://github.com/miki4iaml/protee/blob/main/CHANGELOG.md"
50
+
51
+ [project.optional-dependencies]
52
+ viz = [
53
+ "pygraphviz>=2.0",
54
+ ]
55
+
56
+ [build-system]
57
+ requires = ["uv_build>=0.12.18,<0.14.0"]
58
+ build-backend = "uv_build"
59
+
60
+ [dependency-groups]
61
+ dev = [
62
+ "codespell>=2.4.3",
63
+ "coverage>=7.16.2",
64
+ # Test oracles (independent solvers) and property-based tests; highspy
65
+ # 1.16.0 is the first release with CPython 3.15 wheels.
66
+ "highspy>=1.16.0",
67
+ "hypothesis>=6.170.14",
68
+ "jsonschema>=4.26.0",
69
+ "mypy>=2.4.0",
70
+ "networkx>=3.7",
71
+ "pre-commit>=4.6.2",
72
+ "pygraphviz>=2.0",
73
+ "pytest>=9.1.1",
74
+ "ruff>=0.16.9",
75
+ "zizmor>=1.30.1",
76
+ ]
77
+
78
+ [tool.mypy]
79
+ python_version = "3.12"
80
+ strict = true
81
+ files = ["src", "tests", "scripts", "docs"]
82
+ warn_unreachable = true
83
+ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
84
+
85
+ [[tool.mypy.overrides]]
86
+ # networkx, pygraphviz and jsonschema ship no type hints; in the tests,
87
+ # they are oracles (pygraphviz is also the optional extra viz).
88
+ module = [
89
+ "jsonschema",
90
+ "jsonschema.*",
91
+ "networkx",
92
+ "networkx.*",
93
+ "pygraphviz",
94
+ "pygraphviz.*",
95
+ ]
96
+ ignore_missing_imports = true
97
+
98
+ [tool.pytest]
99
+ minversion = "9.0"
100
+ testpaths = ["tests"]
101
+ strict = true
102
+ filterwarnings = ["error"]
103
+ addopts = ["-ra", "--showlocals"]
104
+ log_level = "INFO"
105
+
106
+ [tool.coverage.run]
107
+ branch = true
108
+ # Explicit: the hook scripts are loaded from their path by importlib.
109
+ source = ["src/protee", "scripts"]
110
+ # Same paths on Windows and Linux, so that reports can be merged.
111
+ relative_files = true
112
+
113
+ [tool.coverage.report]
114
+ # Floor, not target: the actual rate is visible in the reports.
115
+ fail_under = 80
116
+ show_missing = true
117
+ exclude_also = ['if __name__ == "__main__":']
118
+
119
+ [tool.ruff.format]
120
+ # The documents keep their own layout (aligned comments).
121
+ exclude = ["*.md"]
122
+
123
+ [tool.ruff.lint]
124
+ # On top of ruff's default selection, which Dependabot bumps surface in CI.
125
+ extend-select = ["ARG", "B", "C4", "I002", "PIE", "PT", "PTH", "RET", "T20"]
126
+
127
+ [tool.ruff.lint.isort]
128
+ # Annotations are evaluated lazily on every supported Python version.
129
+ required-imports = ["from __future__ import annotations"]
130
+
131
+ [tool.ruff.lint.per-file-ignores]
132
+ # Fixtures requested for their side effects look like unused arguments.
133
+ "tests/**" = ["ARG001"]
134
+ # The hooks are command-line tools: printing is their output. They are
135
+ # shared with other repositories and keep their own imports.
136
+ "scripts/**" = ["T20", "I002"]
137
+
138
+ [tool.codespell]
139
+ skip = "*.fr.md,uv.lock,src/protee/_assets/*.js"
140
+ # Format terms: the Flate filter of PDF, the ALPH chunk of WebP.
141
+ ignore-words-list = "flate,alph"
142
+
143
+ [tool.repo-review.ignore]
144
+ PC110 = "ruff format runs as a local hook through uv run --frozen (single version source: uv.lock)"
145
+ PC140 = "mypy runs as a local hook through uv run --frozen (single version source: uv.lock)"
146
+ PC160 = "codespell runs as a local hook through uv run --frozen (single version source: uv.lock)"
147
+ PC190 = "ruff check runs as a local hook through uv run --frozen (single version source: uv.lock)"
148
+ SEC001 = "zizmor runs as a local hook through uv run --frozen (single version source: uv.lock)"
149
+ PC901 = "pre-commit.ci is not used; CI replays the hooks itself"
150
+ PC902 = "pre-commit.ci is not used; CI replays the hooks itself"
151
+ PC903 = "pre-commit.ci is not used; CI replays the hooks itself"
152
+ PC180 = "no markdown formatter, by choice (dependency control, hand-written texts)"
153
+ PY007 = "uv run is the task runner, identical on every OS"
154
+ PY004 = "temporary: documentation not started yet"
155
+ PC170 = "temporary: no reStructuredText until the documentation exists"
@@ -0,0 +1,66 @@
1
+ # SPDX-FileCopyrightText: 2026 Miki
2
+ # SPDX-License-Identifier: BSD-3-Clause
3
+
4
+ """protee: graph and operations research algorithms.
5
+
6
+ Their methods are chosen explicitly, compared, and backed by certificates
7
+ and diagnostics.
8
+
9
+ The subpackages are imported on demand, so that ``import protee`` stays
10
+ light:
11
+
12
+ - :mod:`protee.graph`: the immutable directed multigraph;
13
+ - :mod:`protee.io`: node-link JSON, CSV and DIMACS formats;
14
+ - :mod:`protee.structure`: components, degree-2 paths, spanning trees and
15
+ cycle bases;
16
+ - :mod:`protee.paths`: shortest paths;
17
+ - :mod:`protee.routes`: routes through waypoints, k shortest paths,
18
+ replacement paths, overlap and most reliable path;
19
+ - :mod:`protee.flow`: maximum flows, feasibility, minimum or maximum cost
20
+ flows with named methods, disjoint paths and diagnostics;
21
+ - :mod:`protee.transforms`: reversible graph transformations;
22
+ - :mod:`protee.constraints`: requirements (exigences) turned into
23
+ traceable constraints on graphs, composed, verified on results and
24
+ reported in a table;
25
+ - :mod:`protee.viz`: drawing of node-link documents (selection, groups,
26
+ loops, transitive reduction, Graphviz DOT text; SVG and a page to
27
+ explore offline with the optional extra ``viz``).
28
+
29
+ The whole API is provisional until version 1.0: the formalization of the
30
+ problems is refined with the feedback of the 0.x versions.
31
+ """
32
+
33
+ from __future__ import annotations
34
+
35
+ import importlib
36
+ from importlib.metadata import version
37
+ from types import ModuleType
38
+
39
+ __all__ = [
40
+ "__version__",
41
+ "constraints",
42
+ "flow",
43
+ "graph",
44
+ "io",
45
+ "paths",
46
+ "routes",
47
+ "structure",
48
+ "transforms",
49
+ "viz",
50
+ ]
51
+
52
+ #: Version of the installed distribution, declared only in pyproject.toml.
53
+ __version__ = version("protee")
54
+
55
+ _SUBMODULES = frozenset(__all__) - {"__version__"}
56
+
57
+
58
+ def __getattr__(name: str) -> ModuleType:
59
+ """Import a subpackage on first access (PEP 562)."""
60
+ if name in _SUBMODULES:
61
+ return importlib.import_module(f"{__name__}.{name}")
62
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
63
+
64
+
65
+ def __dir__() -> list[str]:
66
+ return sorted(set(globals()) | _SUBMODULES)
@@ -0,0 +1,20 @@
1
+ # Third-party files
2
+
3
+ Embedded in the pages written by `protee.viz.render_html`, which open
4
+ offline. Each file comes from its npm package, checked against the
5
+ integrity published by the npm registry. Two changes only, which keep
6
+ the meaning of the code: a final newline where it lacks, and, in
7
+ `cytoscape.min.js`, the one zero-width space of a string literal
8
+ written as its escape `\u200B` (the same JavaScript value), so that
9
+ the repository's check for hidden characters passes.
10
+
11
+ | File | Package | Version | Path in the package | SHA-256 upstream | SHA-256 here |
12
+ |---|---|---|---|---|---|
13
+ | `cytoscape.min.js` | cytoscape | 3.35.0 | `package/dist/cytoscape.min.js` | `71fa9ebec21a7ca2c40cff6aacc30d1f6464e363662ad4b2c197e1adc770cd94` | `48de7dc1403b3455cf8ee85c440637f1525ca5c0f518d62daadefe4b3efef853` |
14
+ | `cytoscape.LICENSE.txt` | cytoscape | 3.35.0 | `package/LICENSE` | `eb319c6e6f233607f71e8e2f450391751883cfc0eeb3ca7ef574c13d1d9c2203` | `f7ebdc2a36c48b5413fe0b60f7a16b6163ff171d5bb35f27dfda432962dd4f49` |
15
+ | `cytoscape-expand-collapse.js` | cytoscape-expand-collapse | 4.1.1 | `package/cytoscape-expand-collapse.js` | `0f2ad3c36a62c61071076044f70f7db844a816d199de3619373efd9d1ab864e6` | `75182544e61fd5317a60e2840db31bcf3d1426a3326a9563c6d007aed043fbe8` |
16
+ | `cytoscape-expand-collapse.LICENSE.md` | cytoscape-expand-collapse | 4.1.1 | `package/LICENSE.md` | `7653ed3cdf53bc1b49f15666b964de4b24eae3bbffcb1fba6fe4817bc9be9926` | `7653ed3cdf53bc1b49f15666b964de4b24eae3bbffcb1fba6fe4817bc9be9926` |
17
+
18
+ Licences: both packages are under the MIT licence; their texts are
19
+ `cytoscape.LICENSE.txt` (The Cytoscape Consortium) and
20
+ `cytoscape-expand-collapse.LICENSE.md` (iVis@Bilkent).