dagua 0.0.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.
dagua-0.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 John Mark Taylor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
dagua-0.0.0/PKG-INFO ADDED
@@ -0,0 +1,58 @@
1
+ Metadata-Version: 2.4
2
+ Name: dagua
3
+ Version: 0.0.0
4
+ Summary: GPU-accelerated differentiable graph layout engine built on PyTorch
5
+ Author: John Mark Taylor
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/johnmarktaylor91/dagua
8
+ Project-URL: Repository, https://github.com/johnmarktaylor91/dagua
9
+ Project-URL: Issues, https://github.com/johnmarktaylor91/dagua/issues
10
+ Keywords: graph,layout,visualization,pytorch,dag,graphviz,hierarchical
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Visualization
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: torch>=1.9
25
+ Provides-Extra: render
26
+ Requires-Dist: matplotlib>=3.5; extra == "render"
27
+ Provides-Extra: graphviz
28
+ Requires-Dist: graphviz>=0.20; extra == "graphviz"
29
+ Provides-Extra: dev
30
+ Requires-Dist: matplotlib>=3.5; extra == "dev"
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: pytest-cov; extra == "dev"
33
+ Requires-Dist: ruff>=0.4; extra == "dev"
34
+ Requires-Dist: mypy; extra == "dev"
35
+ Requires-Dist: pip-audit; extra == "dev"
36
+ Requires-Dist: pre-commit; extra == "dev"
37
+ Provides-Extra: test
38
+ Requires-Dist: pytest>=7.0; extra == "test"
39
+ Requires-Dist: matplotlib>=3.5; extra == "test"
40
+ Dynamic: license-file
41
+
42
+ # dagua
43
+
44
+ GPU-accelerated differentiable graph layout engine built on PyTorch.
45
+
46
+ **DAG + agua.** Directed acyclic graphs + water. Named after the Dagua River in Colombia — a river flows downhill (like a DAG), never cycles back (acyclic), and finds its own path through the landscape (like gradient descent finding optimal node positions).
47
+
48
+ ## Why?
49
+
50
+ Graphviz has dominated graph visualization for 30 years but has hard scaling limits. No existing Python package provides pip-installable, hierarchical (Sugiyama-style) graph layout. Dagua fills this gap: `pip install dagua`, pure Python + PyTorch, GPU-accelerated, hierarchical layout with composable constraints.
51
+
52
+ ## Status
53
+
54
+ Pre-alpha. Under active development.
55
+
56
+ ## License
57
+
58
+ MIT
dagua-0.0.0/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # dagua
2
+
3
+ GPU-accelerated differentiable graph layout engine built on PyTorch.
4
+
5
+ **DAG + agua.** Directed acyclic graphs + water. Named after the Dagua River in Colombia — a river flows downhill (like a DAG), never cycles back (acyclic), and finds its own path through the landscape (like gradient descent finding optimal node positions).
6
+
7
+ ## Why?
8
+
9
+ Graphviz has dominated graph visualization for 30 years but has hard scaling limits. No existing Python package provides pip-installable, hierarchical (Sugiyama-style) graph layout. Dagua fills this gap: `pip install dagua`, pure Python + PyTorch, GPU-accelerated, hierarchical layout with composable constraints.
10
+
11
+ ## Status
12
+
13
+ Pre-alpha. Under active development.
14
+
15
+ ## License
16
+
17
+ MIT
@@ -0,0 +1,9 @@
1
+ """Dagua: GPU-accelerated differentiable graph layout engine built on PyTorch."""
2
+
3
+ __version__ = "0.0.0"
4
+
5
+ # Public API will be re-exported here once modules are implemented:
6
+ # from dagua.elements import Node, Edge, Cluster
7
+ # from dagua.graph import Graph
8
+ # from dagua.style import NodeStyle, EdgeStyle, ClusterStyle
9
+ # from dagua.defaults import set_default_device, set_default_theme
@@ -0,0 +1,9 @@
1
+ """Module-level defaults — device, theme.
2
+
3
+ Minimal global state. Prefer passing these explicitly to Graph; these exist
4
+ only as convenience to avoid repeating device='cuda' on every call.
5
+
6
+ Usage:
7
+ dagua.set_default_device('cuda')
8
+ dagua.set_default_theme('dark')
9
+ """
@@ -0,0 +1,5 @@
1
+ """Node, Edge, Cluster dataclasses — pure structural data.
2
+
3
+ These hold topology and identity, not visual styling (that's style.py).
4
+ Elements are the atoms that Graph holds collections of.
5
+ """
@@ -0,0 +1,6 @@
1
+ """Graph class — the central orchestrator.
2
+
3
+ Holds nodes, edges, and clusters. Maintains ID→index mapping.
4
+ Provides layout() and render() orchestration methods.
5
+ from_* classmethods delegate to io.py for construction from various formats.
6
+ """
@@ -0,0 +1,8 @@
1
+ """Graph construction and export utilities.
2
+
3
+ from_edges, from_edge_index, from_networkx, from_dict — thin converters
4
+ that build Graph instances from various input formats.
5
+ to_dot — export to Graphviz DOT format.
6
+
7
+ Graph.from_* classmethods are thin wrappers over functions here.
8
+ """
@@ -0,0 +1,4 @@
1
+ """Layout subpackage — differentiable graph layout via PyTorch optimization.
2
+
3
+ Re-exports the public API: layout(), individual constraint classes.
4
+ """
@@ -0,0 +1,14 @@
1
+ """Composable constraint loss functions.
2
+
3
+ Each constraint is a callable: (pos, graph_data) -> scalar loss.
4
+
5
+ Built-in constraints:
6
+ - DAG: enforce top-to-bottom ordering for directed edges
7
+ - Repel: prevent node overlap via pairwise repulsion
8
+ - Attract: pull connected nodes together (edge attraction)
9
+ - Overlap: hard overlap penalty (complements projection.py)
10
+ - Cluster: group related nodes spatially
11
+ - Align: rank/axis alignment for specific node groups
12
+
13
+ Users can write custom constraints in ~3 lines by following this protocol.
14
+ """
@@ -0,0 +1,8 @@
1
+ """Core optimization loop — the heart of dagua (~200 lines of PyTorch).
2
+
3
+ Takes edge_index, node_sizes, groups as tensors (NOT a Graph object).
4
+ Initializes positions as learnable parameters, runs optimization with
5
+ composite loss from constraints, returns detached position tensor.
6
+
7
+ Headless design: independently testable without the Graph abstraction.
8
+ """
@@ -0,0 +1,5 @@
1
+ """Hard overlap resolution via projected gradient descent.
2
+
3
+ After each optimizer step, projects positions to satisfy hard constraints
4
+ (e.g., no node overlap). This is the "projection" in projected gradient descent.
5
+ """
@@ -0,0 +1,6 @@
1
+ """Annealing schedules for constraint weights.
2
+
3
+ Controls how constraint weights evolve during optimization — e.g., start with
4
+ strong DAG ordering, then gradually increase repulsion. Enables curriculum-style
5
+ layout optimization.
6
+ """
@@ -0,0 +1,6 @@
1
+ """Render subpackage — multiple output backends.
2
+
3
+ Re-exports: render(), to_svg().
4
+ Renderers accept structured data (positions, elements, styles), not Graph objects.
5
+ Graph.render() is a thin wrapper that extracts data and calls the appropriate renderer.
6
+ """
@@ -0,0 +1,5 @@
1
+ """Optional Graphviz passthrough — neato -n2 with fixed positions.
2
+
3
+ Writes a .dot file with pre-computed positions, renders via Graphviz's neato
4
+ engine with -n2 flag (use given positions). Requires graphviz Python package.
5
+ """
@@ -0,0 +1,5 @@
1
+ """Matplotlib renderer — batched rendering via PatchCollection + LineCollection.
2
+
3
+ Default renderer. Requires matplotlib (optional dependency).
4
+ Renders nodes as patches, edges as line collections, labels as text.
5
+ """
@@ -0,0 +1,5 @@
1
+ """Direct SVG string output — zero external dependencies.
2
+
3
+ Generates SVG markup directly. Jupyter-friendly (displays inline).
4
+ Useful when matplotlib is not available or not desired.
5
+ """
@@ -0,0 +1,5 @@
1
+ """Bezier edge routing — computes control points after layout.
2
+
3
+ Tier 1: heuristic routing (orthogonal + bezier curves).
4
+ Tier 2 (future): differentiable routing integrated into the optimization loop.
5
+ """
@@ -0,0 +1,5 @@
1
+ """NodeStyle, EdgeStyle, ClusterStyle — visual presentation data.
2
+
3
+ Themes, palettes, auto-coloring. Separate from elements.py because styling
4
+ concerns grow independently of structural concerns.
5
+ """
@@ -0,0 +1,4 @@
1
+ """Shared utilities — text measurement, graph topology helpers.
2
+
3
+ Small pure functions used across modules. No heavy dependencies.
4
+ """
@@ -0,0 +1,58 @@
1
+ Metadata-Version: 2.4
2
+ Name: dagua
3
+ Version: 0.0.0
4
+ Summary: GPU-accelerated differentiable graph layout engine built on PyTorch
5
+ Author: John Mark Taylor
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/johnmarktaylor91/dagua
8
+ Project-URL: Repository, https://github.com/johnmarktaylor91/dagua
9
+ Project-URL: Issues, https://github.com/johnmarktaylor91/dagua/issues
10
+ Keywords: graph,layout,visualization,pytorch,dag,graphviz,hierarchical
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Visualization
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: torch>=1.9
25
+ Provides-Extra: render
26
+ Requires-Dist: matplotlib>=3.5; extra == "render"
27
+ Provides-Extra: graphviz
28
+ Requires-Dist: graphviz>=0.20; extra == "graphviz"
29
+ Provides-Extra: dev
30
+ Requires-Dist: matplotlib>=3.5; extra == "dev"
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: pytest-cov; extra == "dev"
33
+ Requires-Dist: ruff>=0.4; extra == "dev"
34
+ Requires-Dist: mypy; extra == "dev"
35
+ Requires-Dist: pip-audit; extra == "dev"
36
+ Requires-Dist: pre-commit; extra == "dev"
37
+ Provides-Extra: test
38
+ Requires-Dist: pytest>=7.0; extra == "test"
39
+ Requires-Dist: matplotlib>=3.5; extra == "test"
40
+ Dynamic: license-file
41
+
42
+ # dagua
43
+
44
+ GPU-accelerated differentiable graph layout engine built on PyTorch.
45
+
46
+ **DAG + agua.** Directed acyclic graphs + water. Named after the Dagua River in Colombia — a river flows downhill (like a DAG), never cycles back (acyclic), and finds its own path through the landscape (like gradient descent finding optimal node positions).
47
+
48
+ ## Why?
49
+
50
+ Graphviz has dominated graph visualization for 30 years but has hard scaling limits. No existing Python package provides pip-installable, hierarchical (Sugiyama-style) graph layout. Dagua fills this gap: `pip install dagua`, pure Python + PyTorch, GPU-accelerated, hierarchical layout with composable constraints.
51
+
52
+ ## Status
53
+
54
+ Pre-alpha. Under active development.
55
+
56
+ ## License
57
+
58
+ MIT
@@ -0,0 +1,30 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ dagua/__init__.py
5
+ dagua/defaults.py
6
+ dagua/elements.py
7
+ dagua/graph.py
8
+ dagua/io.py
9
+ dagua/routing.py
10
+ dagua/style.py
11
+ dagua/utils.py
12
+ dagua.egg-info/PKG-INFO
13
+ dagua.egg-info/SOURCES.txt
14
+ dagua.egg-info/dependency_links.txt
15
+ dagua.egg-info/requires.txt
16
+ dagua.egg-info/top_level.txt
17
+ dagua/layout/__init__.py
18
+ dagua/layout/constraints.py
19
+ dagua/layout/engine.py
20
+ dagua/layout/projection.py
21
+ dagua/layout/schedule.py
22
+ dagua/render/__init__.py
23
+ dagua/render/graphviz.py
24
+ dagua/render/mpl.py
25
+ dagua/render/svg.py
26
+ tests/test_elements.py
27
+ tests/test_graph.py
28
+ tests/test_io.py
29
+ tests/test_routing.py
30
+ tests/test_style.py
@@ -0,0 +1,20 @@
1
+ torch>=1.9
2
+
3
+ [dev]
4
+ matplotlib>=3.5
5
+ pytest>=7.0
6
+ pytest-cov
7
+ ruff>=0.4
8
+ mypy
9
+ pip-audit
10
+ pre-commit
11
+
12
+ [graphviz]
13
+ graphviz>=0.20
14
+
15
+ [render]
16
+ matplotlib>=3.5
17
+
18
+ [test]
19
+ pytest>=7.0
20
+ matplotlib>=3.5
@@ -0,0 +1 @@
1
+ dagua
@@ -0,0 +1,107 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "dagua"
7
+ version = "0.0.0"
8
+ description = "GPU-accelerated differentiable graph layout engine built on PyTorch"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.9"
12
+ authors = [
13
+ {name = "John Mark Taylor"},
14
+ ]
15
+ keywords = ["graph", "layout", "visualization", "pytorch", "dag", "graphviz", "hierarchical"]
16
+ classifiers = [
17
+ "Development Status :: 2 - Pre-Alpha",
18
+ "Intended Audience :: Developers",
19
+ "Intended Audience :: Science/Research",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Topic :: Scientific/Engineering :: Visualization",
26
+ "Topic :: Software Development :: Libraries :: Python Modules",
27
+ ]
28
+ dependencies = [
29
+ "torch>=1.9",
30
+ ]
31
+
32
+ [project.optional-dependencies]
33
+ render = ["matplotlib>=3.5"]
34
+ graphviz = ["graphviz>=0.20"]
35
+ dev = [
36
+ "matplotlib>=3.5",
37
+ "pytest>=7.0",
38
+ "pytest-cov",
39
+ "ruff>=0.4",
40
+ "mypy",
41
+ "pip-audit",
42
+ "pre-commit",
43
+ ]
44
+ test = [
45
+ "pytest>=7.0",
46
+ "matplotlib>=3.5",
47
+ ]
48
+
49
+ [project.urls]
50
+ Homepage = "https://github.com/johnmarktaylor91/dagua"
51
+ Repository = "https://github.com/johnmarktaylor91/dagua"
52
+ Issues = "https://github.com/johnmarktaylor91/dagua/issues"
53
+
54
+ [tool.setuptools.packages.find]
55
+ include = ["dagua*"]
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = ["tests"]
59
+ markers = [
60
+ "smoke: quick sanity checks",
61
+ "slow: tests that take >10s",
62
+ "gpu: tests requiring CUDA",
63
+ ]
64
+
65
+ [tool.coverage.run]
66
+ source = ["dagua"]
67
+ branch = true
68
+
69
+ [tool.coverage.report]
70
+ show_missing = true
71
+ skip_empty = true
72
+
73
+ [tool.coverage.html]
74
+ directory = "tests/test_outputs/reports/coverage_html"
75
+
76
+ [tool.coverage.lcov]
77
+ output = "tests/test_outputs/coverage.lcov"
78
+
79
+ [tool.mypy]
80
+ python_version = "3.11"
81
+ warn_return_any = false
82
+ warn_unused_configs = true
83
+ ignore_missing_imports = true
84
+ check_untyped_defs = false
85
+ disallow_untyped_defs = false
86
+
87
+ [tool.ruff]
88
+ line-length = 100
89
+ target-version = "py39"
90
+
91
+ [tool.ruff.lint]
92
+ select = ["E", "F", "W", "I"]
93
+
94
+ [tool.semantic_release]
95
+ version_toml = ["pyproject.toml:project.version"]
96
+ version_variables = ["dagua/__init__.py:__version__"]
97
+ branch = "main"
98
+ major_on_zero = true
99
+ build_command = "pip install build && python -m build"
100
+ commit_message = "chore(release): {version}"
101
+
102
+ [tool.semantic_release.remote]
103
+ type = "github"
104
+ token = { env = "GH_TOKEN" }
105
+
106
+ [tool.semantic_release.publish]
107
+ upload_to_vcs_release = true
dagua-0.0.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ """Tests for Node, Edge, Cluster dataclasses."""
@@ -0,0 +1 @@
1
+ """Tests for Graph class — construction, ID mapping, orchestration."""
@@ -0,0 +1 @@
1
+ """Tests for io.py — from_edges, from_edge_index, from_networkx, to_dot."""
@@ -0,0 +1 @@
1
+ """Tests for bezier edge routing."""
@@ -0,0 +1 @@
1
+ """Tests for NodeStyle, EdgeStyle, ClusterStyle, themes."""