You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-5Lines changed: 25 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,18 @@
1
1
# preCICE Config Graph
2
2
3
-
A Python library that builds a graph from a preCICE configuration file for validation and visualization purposes.
3
+
A Python library that builds a graph from a preCICE configuration file for validation and visualization purposes
4
+
and enables to recreate a precice-config.xml from it.
4
5
5
-
**How does this differ from [the preCICE Config-Visualizer](https://github.com/precice/config-visualizer)?** The graph built by this library is not (directly) meant to be displayed. The focus is on building a graph that represents the structure of a preCICE configuration in a way that is useful in checking for logical errors.
6
+
**How does this differ from [the preCICE Config-Visualizer](https://github.com/precice/config-visualizer)?** The graph
7
+
built by this library is not (directly) meant to be displayed. The focus is on building a graph that represents the
8
+
structure of a preCICE configuration in a way that is useful in checking for logical errors.
9
+
This logic can also be used to generate a precice-config.xml from a given set of nodes.
6
10
7
11
> [!NOTE]
8
12
> This library assumes the config file to follow some basic rules. For example, references by name are assumed to exist.
9
-
> If the config file passes the preCICE-built-in checks (`precice-tools check`) without errors, then it is also read correctly by this library. If `precice-tools check` does not succeed, the behavior of this library is undefined (it will probably crash).
13
+
> If the config file passes the preCICE-built-in checks (`precice-cli config check`) without errors, then it is also
14
+
> read correctly by this library. If `precice-cli config check` does not succeed, the behavior of this library is
15
+
> undefined (it will probably crash).
10
16
11
17
## Requirements
12
18
@@ -18,16 +24,21 @@ A Python library that builds a graph from a preCICE configuration file for valid
18
24
## Installation
19
25
20
26
1. Clone this repository:
27
+
21
28
```bash
22
29
git clone https://github.com/precice/config-graph
23
30
cd config-graph
24
31
```
32
+
25
33
2. Create a new Python Virtual Environment (optional, but recommended):
34
+
26
35
```bash
27
36
python -m venv venv
28
37
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
29
38
```
39
+
30
40
3. Install required dependencies:
41
+
31
42
```bash
32
43
pip install .
33
44
```
@@ -48,6 +59,7 @@ config-graph
48
59
│ ├── edges.py # Definition of edge types
49
60
│ ├── graph.py # Main logic for building the graph from parsed XML
50
61
│ ├── nodes.py # Definition of node types
62
+
│ ├── enums.py # Definition enums used for node-creation
51
63
│ └── xml_processing.py # preCICE-specific utilities for reading XML files correctly
52
64
│
53
65
├── test # All files for automated testing
@@ -64,7 +76,14 @@ config-graph
64
76
65
77
## Using in your project
66
78
67
-
This library is not yet published to any package registry. Nonetheless, it can still be imported into your `pyproject.toml` like so:
79
+
This library is published to PyPi as `precice-config-graph`.
80
+
It can be installed via
81
+
82
+
```bash
83
+
pip install precice-config-graph
84
+
```
85
+
86
+
Otherwise, it can also be imported into your `pyproject.toml` like so:
68
87
69
88
```toml
70
89
# …
@@ -91,7 +110,8 @@ graph.print_graph(G)
91
110
92
111
## Debugging graph generation
93
112
94
-
This module includes a small utility that helps with debugging the output graph. You can pass a custom `precice-config.xml` and it displays the graph it built in a pop-up window.
113
+
This module includes a small utility that helps with debugging the output graph. You can pass a custom
114
+
`precice-config.xml` and it displays the graph it built in a pop-up window.
0 commit comments