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: .github/copilot-instructions.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,14 +34,16 @@ You work as an experienced senior software engineer on the **NetGraph** project,
34
34
35
35
---
36
36
37
-
# Contribution Guidelines for NetGraph
37
+
##Contribution Guidelines for NetGraph
38
38
39
39
### 1 – Style & Linting
40
+
40
41
- Follow **PEP 8** with an 88-character line length.
41
42
- All linting/formatting is handled by **ruff**; import order is automatic.
42
43
- Do not run `black`, `isort`, or other formatters manually—use `make format` instead.
43
44
44
45
### 2 – Docstrings
46
+
45
47
- Use **Google-style** docstrings for every public module, class, function, and method.
46
48
- Single-line docstrings are acceptable for simple private helpers.
47
49
- Keep the prose concise and factual—no marketing fluff or AI verbosity.
@@ -138,11 +140,14 @@ Prioritize **why** over **what**, but include **what** when code is non-obvious.
138
140
* Update `docs/` when adding features.
139
141
* Run `make docs` to generate `docs/reference/api-full.md`from source code.
140
142
* Always check all doc files for accuracy, absence of marketing language, andAI verbosity.
143
+
***Markdown formatting**: Lists, code blocks, and block quotes require a blank line before them to render correctly.
141
144
142
145
## Output rules for the assistant
143
146
144
147
1. Run Ruff formatin your head before responding.
145
148
2. Include Google-style docstrings andtype hints.
146
149
3. Write or update unit tests for new functionality; fix code (not tests) when existing tests fail. Exception: tests may be changed after thorough analysis if they are genuinely flawed, requirements have changed, or breaking changes are approved.
147
150
4. Respect existing public API signatures unless the user approves breaking changes.
148
-
5. If you need more information, ask concise clarification questions.
151
+
5. Document all new features and changes in the codebase. Run `make docs` to generate the full API reference.
152
+
6. Run `make check` before finishing to ensure all code passes linting, type checking, and tests.
153
+
7. If you need more information, ask concise clarification questions.
You can filter the output to include only specific workflow steps using the `--keys` option:
77
90
78
91
```bash
79
-
# Only include results from the capacity_probe step
80
-
python -m ngraph run scenario.yaml --keys capacity_probe
92
+
# Only include results from the capacity_probe step (stdout only)
93
+
python -m ngraph run scenario.yaml --keys capacity_probe --stdout
81
94
82
-
# Include multiple specific steps
83
-
python -m ngraph run scenario.yaml --keys build_graph capacity_probe
95
+
# Include multiple specific steps and export to file
96
+
python -m ngraph run scenario.yaml --keys build_graph capacity_probe --results filtered.json
84
97
85
-
# Filter and print to stdout
86
-
python -m ngraph run scenario.yaml --keys capacity_probe --stdout
98
+
# Filter and print to stdout while also saving to default file
99
+
python -m ngraph run scenario.yaml --keys capacity_probe --results --stdout
87
100
```
88
101
89
102
The `--keys` option filters by the `name` field of workflow steps defined in your scenario YAML file. For example, if your scenario has:
@@ -156,6 +169,44 @@ The exact keys and values depend on:
156
169
- The parameters and results of each step
157
170
- The network topology and analysis performed
158
171
172
+
## Output Behavior
173
+
174
+
**NetGraph CLI output behavior changed in recent versions** to provide more flexibility:
175
+
176
+
### Default Behavior (No Output Flags)
177
+
```bash
178
+
python -m ngraph run scenario.yaml
179
+
```
180
+
- Executes the scenario
181
+
- Logs execution progress to the terminal
182
+
-**Does not create any output files**
183
+
-**Does not print results to stdout**
184
+
185
+
### Export to File
186
+
```bash
187
+
# Export to default file (results.json)
188
+
python -m ngraph run scenario.yaml --results
189
+
190
+
# Export to custom file
191
+
python -m ngraph run scenario.yaml --results my_analysis.json
192
+
```
193
+
194
+
### Print to Terminal
195
+
```bash
196
+
python -m ngraph run scenario.yaml --stdout
197
+
```
198
+
- Prints JSON results to stdout
199
+
-**Does not create any files**
200
+
201
+
### Combined Output
202
+
```bash
203
+
python -m ngraph run scenario.yaml --results analysis.json --stdout
204
+
```
205
+
- Creates a JSON file AND prints to stdout
206
+
- Useful for viewing results immediately while also saving them
207
+
208
+
**Migration Note:** If you were relying on automatic `results.json` creation, add the `--results` flag to your commands.
209
+
159
210
## Integration with Workflows
160
211
161
212
The CLI executes the complete workflow defined in your scenario file, running all steps in sequence and accumulating results. This automates complex network analysis tasks without manual intervention.
0 commit comments