protee 0.1.0__tar.gz → 0.2.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.
- {protee-0.1.0 → protee-0.2.0}/PKG-INFO +21 -14
- {protee-0.1.0 → protee-0.2.0}/README.md +19 -12
- {protee-0.1.0 → protee-0.2.0}/pyproject.toml +2 -2
- {protee-0.1.0 → protee-0.2.0}/pyproject.toml.orig +5 -3
- {protee-0.1.0 → protee-0.2.0}/src/protee/io.py +38 -9
- {protee-0.1.0 → protee-0.2.0}/src/protee/schemas/protee-node-link-0.schema.json +24 -1
- protee-0.2.0/src/protee/viz.py +2829 -0
- protee-0.1.0/src/protee/viz.py +0 -1537
- {protee-0.1.0 → protee-0.2.0}/LICENSE +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/__init__.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/_assets/NOTICE.md +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/_assets/cytoscape-expand-collapse.LICENSE.md +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/_assets/cytoscape-expand-collapse.js +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/_assets/cytoscape.LICENSE.txt +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/_assets/cytoscape.min.js +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/__init__.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_compose.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_data.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_effects.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_failure.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_inputs.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_model.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_patterns.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_provenance.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_table.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_toml.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/_verify.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/constraints/data/fr-oversize-transport-2006.toml +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/__init__.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_augmenting.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_disjoint.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_feasibility.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_maxflow.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_methods.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_normal.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_problem.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_result.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/_simplex.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/flow/diagnostics.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/graph.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/paths.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/py.typed +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/routes.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/structure.py +0 -0
- {protee-0.1.0 → protee-0.2.0}/src/protee/transforms.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: protee
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Proteus: graph and operations research algorithms whose methods are chosen explicitly, compared, and backed by certificates and diagnostics
|
|
5
5
|
Keywords: operations research,optimization,graphs,life cycle,life-cycle profile,network flows,shortest paths
|
|
6
6
|
Author: miki4ia
|
|
7
7
|
Author-email: miki4ia <miki4ia@gmail.com>
|
|
8
|
-
License-Expression: BSD-3-Clause AND MIT
|
|
8
|
+
License-Expression: BSD-3-Clause AND MIT AND etalab-2.0
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
License-File: src/protee/_assets/cytoscape-expand-collapse.LICENSE.md
|
|
11
11
|
License-File: src/protee/_assets/cytoscape.LICENSE.txt
|
|
@@ -35,12 +35,12 @@ Description-Content-Type: text/markdown
|
|
|
35
35
|
|
|
36
36
|
# protee
|
|
37
37
|
|
|
38
|
-
**English** | [Français](https://github.com/miki4iaml/protee/blob/v0.
|
|
38
|
+
**English** | [Français](https://github.com/miki4iaml/protee/blob/v0.2.0/README.fr.md)
|
|
39
39
|
|
|
40
40
|
[](https://github.com/miki4iaml/protee/actions/workflows/ci.yml)
|
|
41
41
|
[](https://github.com/miki4iaml/protee/actions/workflows/github-code-scanning/codeql)
|
|
42
|
-
[](https://github.com/miki4iaml/protee/blob/v0.
|
|
43
|
-
[](https://github.com/miki4iaml/protee/blob/v0.
|
|
42
|
+
[](https://github.com/miki4iaml/protee/blob/v0.2.0/pyproject.toml)
|
|
43
|
+
[](https://github.com/miki4iaml/protee/blob/v0.2.0/LICENSE)
|
|
44
44
|
[](https://github.com/astral-sh/uv)
|
|
45
45
|
[](https://github.com/astral-sh/ruff)
|
|
46
46
|
[](https://mypy-lang.org/)
|
|
@@ -62,10 +62,12 @@ online solver, service or engine).
|
|
|
62
62
|
> and the model of life-cycle profiles is being designed.
|
|
63
63
|
|
|
64
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.
|
|
66
|
-
drawn by `protee.viz`: selection, groups
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
[`protee-node-link/0`](https://github.com/miki4iaml/protee/blob/v0.2.0/docs/node-link-format.md) (`protee.io`), and
|
|
66
|
+
drawn by `protee.viz`: selection, groups, loops, contraction, colour by
|
|
67
|
+
vocabulary and a matrix view (N² chart) without dependency; SVG figures,
|
|
68
|
+
light or dark, with their legend and a footer, and a page to explore
|
|
69
|
+
offline (tooltips, formulas, the matrix under the graph), with the
|
|
70
|
+
optional extra `viz` (see the [gallery](https://github.com/miki4iaml/protee/blob/v0.2.0/docs/gallery/README.md)).
|
|
69
71
|
|
|
70
72
|
## Why protee
|
|
71
73
|
|
|
@@ -116,16 +118,21 @@ pip install "protee[viz]"
|
|
|
116
118
|
```
|
|
117
119
|
|
|
118
120
|
To work on protee itself, see the
|
|
119
|
-
[contributing guide](https://github.com/miki4iaml/protee/blob/v0.
|
|
121
|
+
[contributing guide](https://github.com/miki4iaml/protee/blob/v0.2.0/.github/CONTRIBUTING.md).
|
|
120
122
|
|
|
121
123
|
## Contributing
|
|
122
124
|
|
|
123
|
-
Contributions are welcome: see the [contributing guide](https://github.com/miki4iaml/protee/blob/v0.
|
|
125
|
+
Contributions are welcome: see the [contributing guide](https://github.com/miki4iaml/protee/blob/v0.2.0/.github/CONTRIBUTING.md)
|
|
124
126
|
and the rules shared by contributors and coding agents in
|
|
125
|
-
[AGENTS.md](https://github.com/miki4iaml/protee/blob/v0.
|
|
127
|
+
[AGENTS.md](https://github.com/miki4iaml/protee/blob/v0.2.0/AGENTS.md).
|
|
126
128
|
|
|
127
129
|
## License
|
|
128
130
|
|
|
129
|
-
[BSD-3-Clause](https://github.com/miki4iaml/protee/blob/v0.
|
|
131
|
+
[BSD-3-Clause](https://github.com/miki4iaml/protee/blob/v0.2.0/LICENSE). The page written by `protee.viz.render_html`
|
|
130
132
|
embeds cytoscape.js and cytoscape-expand-collapse, under the MIT licence
|
|
131
|
-
([notice](https://github.com/miki4iaml/protee/blob/v0.
|
|
133
|
+
([notice](https://github.com/miki4iaml/protee/blob/v0.2.0/src/protee/_assets/NOTICE.md)); the embedded value set reuses a
|
|
134
|
+
public text under the [Licence Ouverte 2.0](https://spdx.org/licenses/etalab-2.0.html),
|
|
135
|
+
credited in its notice.
|
|
136
|
+
|
|
137
|
+
How protee runs, is developed and published, and what it ships:
|
|
138
|
+
[security, supply chain and compliance](https://github.com/miki4iaml/protee/blob/v0.2.0/docs/security-and-compliance.md).
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# protee
|
|
2
2
|
|
|
3
|
-
**English** | [Français](https://github.com/miki4iaml/protee/blob/v0.
|
|
3
|
+
**English** | [Français](https://github.com/miki4iaml/protee/blob/v0.2.0/README.fr.md)
|
|
4
4
|
|
|
5
5
|
[](https://github.com/miki4iaml/protee/actions/workflows/ci.yml)
|
|
6
6
|
[](https://github.com/miki4iaml/protee/actions/workflows/github-code-scanning/codeql)
|
|
7
|
-
[](https://github.com/miki4iaml/protee/blob/v0.
|
|
8
|
-
[](https://github.com/miki4iaml/protee/blob/v0.
|
|
7
|
+
[](https://github.com/miki4iaml/protee/blob/v0.2.0/pyproject.toml)
|
|
8
|
+
[](https://github.com/miki4iaml/protee/blob/v0.2.0/LICENSE)
|
|
9
9
|
[](https://github.com/astral-sh/uv)
|
|
10
10
|
[](https://github.com/astral-sh/ruff)
|
|
11
11
|
[](https://mypy-lang.org/)
|
|
@@ -27,10 +27,12 @@ online solver, service or engine).
|
|
|
27
27
|
> and the model of life-cycle profiles is being designed.
|
|
28
28
|
|
|
29
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.
|
|
31
|
-
drawn by `protee.viz`: selection, groups
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
[`protee-node-link/0`](https://github.com/miki4iaml/protee/blob/v0.2.0/docs/node-link-format.md) (`protee.io`), and
|
|
31
|
+
drawn by `protee.viz`: selection, groups, loops, contraction, colour by
|
|
32
|
+
vocabulary and a matrix view (N² chart) without dependency; SVG figures,
|
|
33
|
+
light or dark, with their legend and a footer, and a page to explore
|
|
34
|
+
offline (tooltips, formulas, the matrix under the graph), with the
|
|
35
|
+
optional extra `viz` (see the [gallery](https://github.com/miki4iaml/protee/blob/v0.2.0/docs/gallery/README.md)).
|
|
34
36
|
|
|
35
37
|
## Why protee
|
|
36
38
|
|
|
@@ -81,16 +83,21 @@ pip install "protee[viz]"
|
|
|
81
83
|
```
|
|
82
84
|
|
|
83
85
|
To work on protee itself, see the
|
|
84
|
-
[contributing guide](https://github.com/miki4iaml/protee/blob/v0.
|
|
86
|
+
[contributing guide](https://github.com/miki4iaml/protee/blob/v0.2.0/.github/CONTRIBUTING.md).
|
|
85
87
|
|
|
86
88
|
## Contributing
|
|
87
89
|
|
|
88
|
-
Contributions are welcome: see the [contributing guide](https://github.com/miki4iaml/protee/blob/v0.
|
|
90
|
+
Contributions are welcome: see the [contributing guide](https://github.com/miki4iaml/protee/blob/v0.2.0/.github/CONTRIBUTING.md)
|
|
89
91
|
and the rules shared by contributors and coding agents in
|
|
90
|
-
[AGENTS.md](https://github.com/miki4iaml/protee/blob/v0.
|
|
92
|
+
[AGENTS.md](https://github.com/miki4iaml/protee/blob/v0.2.0/AGENTS.md).
|
|
91
93
|
|
|
92
94
|
## License
|
|
93
95
|
|
|
94
|
-
[BSD-3-Clause](https://github.com/miki4iaml/protee/blob/v0.
|
|
96
|
+
[BSD-3-Clause](https://github.com/miki4iaml/protee/blob/v0.2.0/LICENSE). The page written by `protee.viz.render_html`
|
|
95
97
|
embeds cytoscape.js and cytoscape-expand-collapse, under the MIT licence
|
|
96
|
-
([notice](https://github.com/miki4iaml/protee/blob/v0.
|
|
98
|
+
([notice](https://github.com/miki4iaml/protee/blob/v0.2.0/src/protee/_assets/NOTICE.md)); the embedded value set reuses a
|
|
99
|
+
public text under the [Licence Ouverte 2.0](https://spdx.org/licenses/etalab-2.0.html),
|
|
100
|
+
credited in its notice.
|
|
101
|
+
|
|
102
|
+
How protee runs, is developed and published, and what it ships:
|
|
103
|
+
[security, supply chain and compliance](https://github.com/miki4iaml/protee/blob/v0.2.0/docs/security-and-compliance.md).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "protee"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "Proteus: graph and operations research algorithms whose methods are chosen explicitly, compared, and backed by certificates and diagnostics"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
7
|
-
license = "BSD-3-Clause AND MIT"
|
|
7
|
+
license = "BSD-3-Clause AND MIT AND etalab-2.0"
|
|
8
8
|
license-files = [
|
|
9
9
|
"LICENSE",
|
|
10
10
|
"src/protee/_assets/*.LICENSE.*",
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "protee"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "Proteus: graph and operations research algorithms whose methods are chosen explicitly, compared, and backed by certificates and diagnostics"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
7
7
|
{ name = "miki4ia", email = "miki4ia@gmail.com" }
|
|
8
8
|
]
|
|
9
9
|
requires-python = ">=3.12"
|
|
10
|
-
# The drawing page embeds third-party JavaScript under the MIT licence
|
|
11
|
-
|
|
10
|
+
# The drawing page embeds third-party JavaScript under the MIT licence; the
|
|
11
|
+
# embedded value set reuses a public text under the Licence Ouverte 2.0,
|
|
12
|
+
# credited in its notice.
|
|
13
|
+
license = "BSD-3-Clause AND MIT AND etalab-2.0"
|
|
12
14
|
license-files = ["LICENSE", "src/protee/_assets/*.LICENSE.*"]
|
|
13
15
|
keywords = [
|
|
14
16
|
"operations research",
|
|
@@ -405,6 +405,8 @@ _LANGUAGE = re.compile(
|
|
|
405
405
|
)
|
|
406
406
|
#: The start of an absolute IRI: its scheme, then a colon (as the schema).
|
|
407
407
|
_SCHEME = re.compile(r"[A-Za-z][A-Za-z0-9+.-]*:")
|
|
408
|
+
#: A term of a vocabulary: ``prefix:name`` (as the schema).
|
|
409
|
+
_TERM = re.compile(r"[^:\s]+:\S+")
|
|
408
410
|
|
|
409
411
|
|
|
410
412
|
def _absolute(iri: object) -> bool:
|
|
@@ -529,6 +531,8 @@ class _Checker:
|
|
|
529
531
|
on != "edge" or not isinstance(entry["symmetric"], bool)
|
|
530
532
|
):
|
|
531
533
|
self.bad(where, "'symmetric' is a boolean, for edges only")
|
|
534
|
+
if entry.get("mappings") is not None:
|
|
535
|
+
self.mappings(f"{where}.mappings", entry["mappings"])
|
|
532
536
|
ident = entry.get("id")
|
|
533
537
|
if self.identifier(f"{where}.id", ident):
|
|
534
538
|
assert isinstance(ident, str)
|
|
@@ -536,11 +540,34 @@ class _Checker:
|
|
|
536
540
|
self.bad(where, f"{ident!r} is declared twice for {on}s")
|
|
537
541
|
sets[on].add(ident)
|
|
538
542
|
|
|
543
|
+
def term(self, where: str, value: object) -> None:
|
|
544
|
+
"""A term ``prefix:name``, with a declared prefix."""
|
|
545
|
+
if not (isinstance(value, str) and _TERM.fullmatch(value)):
|
|
546
|
+
self.bad(where, "must be a term prefix:name")
|
|
547
|
+
elif (prefix := value.split(":", 1)[0]) not in self.prefixes:
|
|
548
|
+
self.bad(where, f"prefix {prefix!r} is not declared in graph.prefixes")
|
|
549
|
+
|
|
550
|
+
def mappings(self, where: str, mappings: object) -> None:
|
|
551
|
+
if not isinstance(mappings, list):
|
|
552
|
+
self.bad(where, "must be a list")
|
|
553
|
+
return
|
|
554
|
+
for j, mapping in enumerate(mappings):
|
|
555
|
+
here = f"{where}[{j}]"
|
|
556
|
+
if not isinstance(mapping, Mapping):
|
|
557
|
+
self.bad(here, "must be an object")
|
|
558
|
+
continue
|
|
559
|
+
self.term(f"{here}.predicate", mapping.get("predicate"))
|
|
560
|
+
self.term(f"{here}.object", mapping.get("object"))
|
|
561
|
+
if mapping.get("justification") is not None:
|
|
562
|
+
self.term(f"{here}.justification", mapping["justification"])
|
|
563
|
+
|
|
539
564
|
def common(self, where: str, item: Mapping[str, Any], on: str) -> None:
|
|
540
|
-
# The format defines description, family and url for nodes only
|
|
541
|
-
#
|
|
565
|
+
# The format defines description, family and url for nodes only, and
|
|
566
|
+
# locator for edges only: elsewhere, they are free keys.
|
|
542
567
|
texts = (
|
|
543
|
-
("label", "description", "family", "url")
|
|
568
|
+
("label", "description", "family", "url")
|
|
569
|
+
if on == "node"
|
|
570
|
+
else ("label", "locator")
|
|
544
571
|
)
|
|
545
572
|
for key in texts:
|
|
546
573
|
if item.get(key) is not None and not isinstance(item[key], str):
|
|
@@ -633,12 +660,14 @@ def check_node_link(data: object) -> tuple[str, ...]:
|
|
|
633
660
|
prefixes; for every attribute declared in ``graph.vocabulary``
|
|
634
661
|
(``type``, ``status``, ``role``…), each value used by a node or an edge
|
|
635
662
|
declared there, for nodes or for edges, a declared value being
|
|
636
|
-
``prefix:name`` with a declared prefix or a plain name;
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
663
|
+
``prefix:name`` with a declared prefix or a plain name; the ``mappings``
|
|
664
|
+
of a declaration, whose ``predicate``, ``object`` and optional
|
|
665
|
+
``justification`` are terms ``prefix:name`` with declared prefixes;
|
|
666
|
+
unique node identifiers, opaque texts (an IRI is allowed) or integers,
|
|
667
|
+
never expanded; edges between existing nodes, with integer keys unique
|
|
668
|
+
between the same two nodes, and a text ``locator``; metrics that are
|
|
669
|
+
finite numbers, ``"inf"``, ``"-inf"`` or ``null``. Other keys are
|
|
670
|
+
allowed. ``links`` is read in place of ``edges``.
|
|
642
671
|
|
|
643
672
|
Parameters
|
|
644
673
|
----------
|
|
@@ -77,6 +77,21 @@
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
+
"term": {
|
|
81
|
+
"description": "prefix:name, without spaces, with a prefix declared in graph.prefixes.",
|
|
82
|
+
"type": "string",
|
|
83
|
+
"pattern": "^(?!.*\\s)[^:]+:.+$"
|
|
84
|
+
},
|
|
85
|
+
"mapping": {
|
|
86
|
+
"description": "A correspondence of a declared value to a term of another vocabulary, as in SSSOM: a relation (a SKOS mapping relation, such as skos:exactMatch), the term, and an optional justification (a SEMAPV term).",
|
|
87
|
+
"type": "object",
|
|
88
|
+
"required": ["predicate", "object"],
|
|
89
|
+
"properties": {
|
|
90
|
+
"predicate": {"$ref": "#/$defs/term"},
|
|
91
|
+
"object": {"$ref": "#/$defs/term"},
|
|
92
|
+
"justification": {"anyOf": [{"$ref": "#/$defs/term"}, {"type": "null"}]}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
80
95
|
"declaration": {
|
|
81
96
|
"type": "object",
|
|
82
97
|
"required": ["id", "on", "label"],
|
|
@@ -89,7 +104,11 @@
|
|
|
89
104
|
"on": {"enum": ["node", "edge"]},
|
|
90
105
|
"label": {"type": "string"},
|
|
91
106
|
"description": {"$ref": "#/$defs/text"},
|
|
92
|
-
"symmetric": {"type": ["boolean", "null"]}
|
|
107
|
+
"symmetric": {"type": ["boolean", "null"]},
|
|
108
|
+
"mappings": {
|
|
109
|
+
"type": ["array", "null"],
|
|
110
|
+
"items": {"$ref": "#/$defs/mapping"}
|
|
111
|
+
}
|
|
93
112
|
},
|
|
94
113
|
"if": {"properties": {"on": {"const": "node"}}},
|
|
95
114
|
"then": {
|
|
@@ -118,6 +137,10 @@
|
|
|
118
137
|
"target": {"$ref": "#/$defs/nodeId"},
|
|
119
138
|
"key": {"type": ["integer", "null"]},
|
|
120
139
|
"label": {"$ref": "#/$defs/text"},
|
|
140
|
+
"locator": {
|
|
141
|
+
"description": "The place in the target that the edge points to: an equation number, an article, a clause.",
|
|
142
|
+
"$ref": "#/$defs/text"
|
|
143
|
+
},
|
|
121
144
|
"metrics": {"$ref": "#/$defs/metrics"}
|
|
122
145
|
}
|
|
123
146
|
}
|