db-process 0.2.0__tar.gz → 0.3.1__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 (28) hide show
  1. {db_process-0.2.0 → db_process-0.3.1}/PKG-INFO +34 -45
  2. {db_process-0.2.0 → db_process-0.3.1}/README.md +33 -44
  3. {db_process-0.2.0 → db_process-0.3.1}/db_process/__init__.py +89 -102
  4. {db_process-0.2.0 → db_process-0.3.1}/db_process/__main__.py +6 -6
  5. {db_process-0.2.0 → db_process-0.3.1}/db_process/cli.py +92 -152
  6. {db_process-0.2.0 → db_process-0.3.1}/db_process/commands.py +449 -449
  7. {db_process-0.2.0 → db_process-0.3.1}/db_process/executable.py +76 -76
  8. {db_process-0.2.0 → db_process-0.3.1}/db_process/runner.py +330 -330
  9. {db_process-0.2.0 → db_process-0.3.1}/db_process.egg-info/PKG-INFO +34 -45
  10. {db_process-0.2.0 → db_process-0.3.1}/db_process.egg-info/SOURCES.txt +5 -2
  11. {db_process-0.2.0 → db_process-0.3.1}/pyproject.toml +41 -36
  12. {db_process-0.2.0 → db_process-0.3.1}/tests/test_cli.py +108 -108
  13. db_process-0.3.1/tests/test_cli_output.py +174 -0
  14. {db_process-0.2.0 → db_process-0.3.1}/tests/test_commands.py +316 -316
  15. db_process-0.3.1/tests/test_commands_extra.py +169 -0
  16. {db_process-0.2.0 → db_process-0.3.1}/tests/test_executable.py +47 -47
  17. db_process-0.3.1/tests/test_executable_defaults.py +92 -0
  18. db_process-0.3.1/tests/test_runner.py +441 -0
  19. db_process-0.3.1/tests/test_runner_subprocess.py +84 -0
  20. {db_process-0.2.0 → db_process-0.3.1}/tests/test_status.py +59 -59
  21. db_process-0.2.0/db_process/diagnostics.py +0 -308
  22. db_process-0.2.0/tests/test_diagnostics.py +0 -192
  23. {db_process-0.2.0 → db_process-0.3.1}/LICENSE +0 -0
  24. {db_process-0.2.0 → db_process-0.3.1}/db_process.egg-info/dependency_links.txt +0 -0
  25. {db_process-0.2.0 → db_process-0.3.1}/db_process.egg-info/entry_points.txt +0 -0
  26. {db_process-0.2.0 → db_process-0.3.1}/db_process.egg-info/requires.txt +0 -0
  27. {db_process-0.2.0 → db_process-0.3.1}/db_process.egg-info/top_level.txt +0 -0
  28. {db_process-0.2.0 → db_process-0.3.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: db-process
3
- Version: 0.2.0
3
+ Version: 0.3.1
4
4
  Summary: Python interface to DesignBuilder command line processing.
5
5
  Author: DesignBuilder Software
6
6
  Project-URL: Homepage, https://github.com/DesignBuilderSoftware/db-process
@@ -16,15 +16,11 @@ Dynamic: license-file
16
16
 
17
17
  # db-process
18
18
 
19
- Python interface to DesignBuilder's command-line driver — typed `/process=` commands,
20
- subprocess execution, process discovery, and diagnostics-log parsing.
19
+ Python interface to DesignBuilder's command-line driver — typed `/process=` commands, subprocess execution, and process discovery.
21
20
 
22
- DesignBuilder is a Windows GUI app, but it exposes a `/process=` argument
23
- that runs a sequence of commands non-interactively and exits. `db-process`
24
- wraps that surface in real Python: dataclass commands instead of stringly-typed
25
- flags, a `ProcessChain` builder, blocking and non-blocking runners, helpers
26
- to find/kill the process, and a parser for the rolling diagnostics logs
27
- DesignBuilder writes under `%LOCALAPPDATA%`.
21
+ DesignBuilder is a Windows GUI app, but it exposes a `/process=` argument that runs a sequence of commands non-interactively and exits. `db-process` wraps that surface in real Python: dataclass commands instead of stringly-typed flags, a `ProcessChain` builder, blocking and non-blocking runners, and helpers to find/kill the process.
22
+
23
+ > For diagnostic-log parsing see [db-diag](https://github.com/DesignBuilderSoftware/db-diag).
28
24
 
29
25
  ## Install
30
26
 
@@ -92,15 +88,9 @@ db-process open # launch DesignBuilder
92
88
  db-process open path/to.dsb # launch with a model
93
89
  db-process close # kill any running DesignBuilder
94
90
  db-process restart [model] # close + open (with a 1.5 s settle)
95
-
96
- db-process diag list # list recent diagnostic logs (newest first)
97
- db-process diag latest # print a one-paragraph summary of the newest log
98
- db-process diag latest --errors # also list every error line found
99
- db-process diag summary <path> # summarise a specific log
100
91
  ```
101
92
 
102
- `db-process` is the entry point installed by the package; you can also run it
103
- as `python -m db_process`.
93
+ `db-process` is the entry point installed by the package; you can also run it as `python -m db_process`.
104
94
 
105
95
  ## Public API
106
96
 
@@ -127,10 +117,6 @@ from db_process import (
127
117
  # Convenience factories
128
118
  eplus_simulation, sbem_calculation, export_xml,
129
119
  heating_and_cooling_design, daylighting, cfd_simulation,
130
-
131
- # Diagnostics logs
132
- DiagnosticsLog, find_logs, latest_log,
133
- parse_filename_timestamp, DEFAULT_DIAGNOSTICS_DIR,
134
120
  )
135
121
  ```
136
122
 
@@ -177,35 +163,12 @@ documented in DesignBuilder Help. Example output of `chain.to_string()`:
177
163
  Every command is also exposed as a plain dataclass, so you can construct
178
164
  chains without the builder when that's clearer.
179
165
 
180
- ### Diagnostics logs
181
-
182
- DesignBuilder writes a per-session diagnostics log to
183
- `%LOCALAPPDATA%\DesignBuilder\Diagnostics\` named like
184
- `DesignBuilder_diagnostic_2026-04-23_15-12-08.txt`. `DiagnosticsLog`
185
- parses one of those files into a structured object:
186
-
187
- ```python
188
- from db_process import latest_log, DiagnosticsLog
189
-
190
- log = DiagnosticsLog.from_file(latest_log())
191
- print(log.summary())
192
- print(log.is_complete, log.duration, log.error_count)
193
- for line_no, text in log.errors:
194
- print(f"L{line_no}: {text}")
195
- ```
196
-
197
- Error detection uses word-boundary matching (`error`, `failed`, `exception`,
198
- `fatal`, `crash`) plus a small negative list to suppress known benign markers
199
- (e.g. the `GL_KHR_no_error` OpenGL extension).
200
-
201
166
  ## Compatibility
202
167
 
203
168
  - **DesignBuilder**: any version that supports the `/process=` argument.
204
169
  Tested against the v25.1 / v26.1 lines.
205
170
  - **Python**: 3.10+.
206
- - **OS**: Windows for live runs. The command model and diagnostics parser
207
- are pure Python and import on any platform — useful for unit tests on
208
- Linux CI.
171
+ - **OS**: Windows for live runs. The command model is pure Python and imports on any platform — useful for unit tests on Linux CI.
209
172
 
210
173
  ## Development
211
174
 
@@ -222,5 +185,31 @@ Tests are split by area:
222
185
  | `test_commands.py` | `ProcessChain` building + every command's `to_string()` |
223
186
  | `test_executable.py` | `find_designbuilder` resolution order |
224
187
  | `test_status.py` | `status` / `ProcessStatus` |
225
- | `test_diagnostics.py` | log parsing, error detection, filename timestamps |
226
188
  | `test_cli.py` | CLI argparse wiring (mocked subprocess) |
189
+
190
+ ## Releasing
191
+
192
+ Every version is a tag. `pyproject.toml`'s `version` and the git tag must never
193
+ drift apart — consumers pin to `@vX.Y.Z`, and an untagged bump leaves them with
194
+ nothing to pin to but a commit SHA.
195
+
196
+ To cut a release, bump `version` in `pyproject.toml` on `main`:
197
+
198
+ ```toml
199
+ [project]
200
+ version = "0.3.0"
201
+ ```
202
+
203
+ The `Release` workflow then tags that commit `v0.3.0` and opens a matching
204
+ GitHub Release with generated notes. It only fires on changes to
205
+ `pyproject.toml`, and skips silently if the tag already exists, so re-runs are
206
+ safe.
207
+
208
+ To tag manually instead — or to backfill a version that predates the workflow:
209
+
210
+ ```bash
211
+ git tag -a v0.3.0 -m "v0.3.0" && git push origin v0.3.0
212
+ ```
213
+
214
+ Bump the version in the same pull request as the change it describes, not as a
215
+ separate follow-up — that's how the two fell out of step before.
@@ -1,14 +1,10 @@
1
1
  # db-process
2
2
 
3
- Python interface to DesignBuilder's command-line driver — typed `/process=` commands,
4
- subprocess execution, process discovery, and diagnostics-log parsing.
3
+ Python interface to DesignBuilder's command-line driver — typed `/process=` commands, subprocess execution, and process discovery.
5
4
 
6
- DesignBuilder is a Windows GUI app, but it exposes a `/process=` argument
7
- that runs a sequence of commands non-interactively and exits. `db-process`
8
- wraps that surface in real Python: dataclass commands instead of stringly-typed
9
- flags, a `ProcessChain` builder, blocking and non-blocking runners, helpers
10
- to find/kill the process, and a parser for the rolling diagnostics logs
11
- DesignBuilder writes under `%LOCALAPPDATA%`.
5
+ DesignBuilder is a Windows GUI app, but it exposes a `/process=` argument that runs a sequence of commands non-interactively and exits. `db-process` wraps that surface in real Python: dataclass commands instead of stringly-typed flags, a `ProcessChain` builder, blocking and non-blocking runners, and helpers to find/kill the process.
6
+
7
+ > For diagnostic-log parsing see [db-diag](https://github.com/DesignBuilderSoftware/db-diag).
12
8
 
13
9
  ## Install
14
10
 
@@ -76,15 +72,9 @@ db-process open # launch DesignBuilder
76
72
  db-process open path/to.dsb # launch with a model
77
73
  db-process close # kill any running DesignBuilder
78
74
  db-process restart [model] # close + open (with a 1.5 s settle)
79
-
80
- db-process diag list # list recent diagnostic logs (newest first)
81
- db-process diag latest # print a one-paragraph summary of the newest log
82
- db-process diag latest --errors # also list every error line found
83
- db-process diag summary <path> # summarise a specific log
84
75
  ```
85
76
 
86
- `db-process` is the entry point installed by the package; you can also run it
87
- as `python -m db_process`.
77
+ `db-process` is the entry point installed by the package; you can also run it as `python -m db_process`.
88
78
 
89
79
  ## Public API
90
80
 
@@ -111,10 +101,6 @@ from db_process import (
111
101
  # Convenience factories
112
102
  eplus_simulation, sbem_calculation, export_xml,
113
103
  heating_and_cooling_design, daylighting, cfd_simulation,
114
-
115
- # Diagnostics logs
116
- DiagnosticsLog, find_logs, latest_log,
117
- parse_filename_timestamp, DEFAULT_DIAGNOSTICS_DIR,
118
104
  )
119
105
  ```
120
106
 
@@ -161,35 +147,12 @@ documented in DesignBuilder Help. Example output of `chain.to_string()`:
161
147
  Every command is also exposed as a plain dataclass, so you can construct
162
148
  chains without the builder when that's clearer.
163
149
 
164
- ### Diagnostics logs
165
-
166
- DesignBuilder writes a per-session diagnostics log to
167
- `%LOCALAPPDATA%\DesignBuilder\Diagnostics\` named like
168
- `DesignBuilder_diagnostic_2026-04-23_15-12-08.txt`. `DiagnosticsLog`
169
- parses one of those files into a structured object:
170
-
171
- ```python
172
- from db_process import latest_log, DiagnosticsLog
173
-
174
- log = DiagnosticsLog.from_file(latest_log())
175
- print(log.summary())
176
- print(log.is_complete, log.duration, log.error_count)
177
- for line_no, text in log.errors:
178
- print(f"L{line_no}: {text}")
179
- ```
180
-
181
- Error detection uses word-boundary matching (`error`, `failed`, `exception`,
182
- `fatal`, `crash`) plus a small negative list to suppress known benign markers
183
- (e.g. the `GL_KHR_no_error` OpenGL extension).
184
-
185
150
  ## Compatibility
186
151
 
187
152
  - **DesignBuilder**: any version that supports the `/process=` argument.
188
153
  Tested against the v25.1 / v26.1 lines.
189
154
  - **Python**: 3.10+.
190
- - **OS**: Windows for live runs. The command model and diagnostics parser
191
- are pure Python and import on any platform — useful for unit tests on
192
- Linux CI.
155
+ - **OS**: Windows for live runs. The command model is pure Python and imports on any platform — useful for unit tests on Linux CI.
193
156
 
194
157
  ## Development
195
158
 
@@ -206,5 +169,31 @@ Tests are split by area:
206
169
  | `test_commands.py` | `ProcessChain` building + every command's `to_string()` |
207
170
  | `test_executable.py` | `find_designbuilder` resolution order |
208
171
  | `test_status.py` | `status` / `ProcessStatus` |
209
- | `test_diagnostics.py` | log parsing, error detection, filename timestamps |
210
172
  | `test_cli.py` | CLI argparse wiring (mocked subprocess) |
173
+
174
+ ## Releasing
175
+
176
+ Every version is a tag. `pyproject.toml`'s `version` and the git tag must never
177
+ drift apart — consumers pin to `@vX.Y.Z`, and an untagged bump leaves them with
178
+ nothing to pin to but a commit SHA.
179
+
180
+ To cut a release, bump `version` in `pyproject.toml` on `main`:
181
+
182
+ ```toml
183
+ [project]
184
+ version = "0.3.0"
185
+ ```
186
+
187
+ The `Release` workflow then tags that commit `v0.3.0` and opens a matching
188
+ GitHub Release with generated notes. It only fires on changes to
189
+ `pyproject.toml`, and skips silently if the tag already exists, so re-runs are
190
+ safe.
191
+
192
+ To tag manually instead — or to backfill a version that predates the workflow:
193
+
194
+ ```bash
195
+ git tag -a v0.3.0 -m "v0.3.0" && git push origin v0.3.0
196
+ ```
197
+
198
+ Bump the version in the same pull request as the change it describes, not as a
199
+ separate follow-up — that's how the two fell out of step before.
@@ -1,102 +1,89 @@
1
- """
2
- db-process
3
- ====================================
4
- Python interface to DesignBuilder command line processing.
5
-
6
- This package provides:
7
-
8
- - **Executable discovery** — find DesignBuilder.exe across env vars,
9
- default install paths, and the system PATH.
10
- - **Typed command model** — dataclasses for every ``/process=`` command
11
- documented in DesignBuilder Help, with a fluent builder API.
12
- - **Subprocess execution** — blocking and non-blocking modes, timeout
13
- handling, and idle-detection termination.
14
- """
15
-
16
- from db_process.commands import (
17
- ChangeAttributeValue,
18
- ExportAsXML,
19
- ExternalCommand,
20
- ImportLibraryData,
21
- ImportModelData,
22
- NoClose,
23
- ProcessChain,
24
- RunCalculation,
25
- Screen,
26
- SimEndDate,
27
- SimStartDate,
28
- SwitchScreen,
29
- TabChange,
30
- UseSimManager,
31
- # Convenience factories
32
- cfd_simulation,
33
- daylighting,
34
- eplus_simulation,
35
- export_xml,
36
- heating_and_cooling_design,
37
- sbem_calculation,
38
- )
39
- from db_process.diagnostics import (
40
- DEFAULT_DIAGNOSTICS_DIR,
41
- DiagnosticsLog,
42
- find_logs,
43
- latest_log,
44
- parse_filename_timestamp,
45
- )
46
- from db_process.executable import find_designbuilder
47
- from db_process.runner import (
48
- ProcessStatus,
49
- RunHandle,
50
- RunResult,
51
- find_process,
52
- is_running,
53
- kill_process,
54
- kill_when_idle,
55
- run,
56
- run_async,
57
- status,
58
- )
59
-
60
- __all__ = [
61
- # Executable
62
- "find_designbuilder",
63
- # Commands
64
- "ChangeAttributeValue",
65
- "ExportAsXML",
66
- "ExternalCommand",
67
- "ImportLibraryData",
68
- "ImportModelData",
69
- "NoClose",
70
- "ProcessChain",
71
- "RunCalculation",
72
- "Screen",
73
- "SimEndDate",
74
- "SimStartDate",
75
- "SwitchScreen",
76
- "TabChange",
77
- "UseSimManager",
78
- # Convenience factories
79
- "cfd_simulation",
80
- "daylighting",
81
- "eplus_simulation",
82
- "export_xml",
83
- "heating_and_cooling_design",
84
- "sbem_calculation",
85
- # Runner / status
86
- "RunHandle",
87
- "RunResult",
88
- "ProcessStatus",
89
- "find_process",
90
- "is_running",
91
- "kill_process",
92
- "kill_when_idle",
93
- "run",
94
- "run_async",
95
- "status",
96
- # Diagnostics
97
- "DEFAULT_DIAGNOSTICS_DIR",
98
- "DiagnosticsLog",
99
- "find_logs",
100
- "latest_log",
101
- "parse_filename_timestamp",
102
- ]
1
+ """
2
+ db-process
3
+ ====================================
4
+ Python interface to DesignBuilder command line processing.
5
+
6
+ This package provides:
7
+
8
+ - **Executable discovery** — find DesignBuilder.exe across env vars,
9
+ default install paths, and the system PATH.
10
+ - **Typed command model** — dataclasses for every ``/process=`` command
11
+ documented in DesignBuilder Help, with a fluent builder API.
12
+ - **Subprocess execution** — blocking and non-blocking modes, timeout
13
+ handling, and idle-detection termination.
14
+ """
15
+
16
+ from db_process.commands import (
17
+ ChangeAttributeValue,
18
+ ExportAsXML,
19
+ ExternalCommand,
20
+ ImportLibraryData,
21
+ ImportModelData,
22
+ NoClose,
23
+ ProcessChain,
24
+ RunCalculation,
25
+ Screen,
26
+ SimEndDate,
27
+ SimStartDate,
28
+ SwitchScreen,
29
+ TabChange,
30
+ UseSimManager,
31
+ # Convenience factories
32
+ cfd_simulation,
33
+ daylighting,
34
+ eplus_simulation,
35
+ export_xml,
36
+ heating_and_cooling_design,
37
+ sbem_calculation,
38
+ )
39
+ from db_process.executable import find_designbuilder
40
+ from db_process.runner import (
41
+ ProcessStatus,
42
+ RunHandle,
43
+ RunResult,
44
+ find_process,
45
+ is_running,
46
+ kill_process,
47
+ kill_when_idle,
48
+ run,
49
+ run_async,
50
+ status,
51
+ )
52
+
53
+ __all__ = [
54
+ # Executable
55
+ "find_designbuilder",
56
+ # Commands
57
+ "ChangeAttributeValue",
58
+ "ExportAsXML",
59
+ "ExternalCommand",
60
+ "ImportLibraryData",
61
+ "ImportModelData",
62
+ "NoClose",
63
+ "ProcessChain",
64
+ "RunCalculation",
65
+ "Screen",
66
+ "SimEndDate",
67
+ "SimStartDate",
68
+ "SwitchScreen",
69
+ "TabChange",
70
+ "UseSimManager",
71
+ # Convenience factories
72
+ "cfd_simulation",
73
+ "daylighting",
74
+ "eplus_simulation",
75
+ "export_xml",
76
+ "heating_and_cooling_design",
77
+ "sbem_calculation",
78
+ # Runner / status
79
+ "RunHandle",
80
+ "RunResult",
81
+ "ProcessStatus",
82
+ "find_process",
83
+ "is_running",
84
+ "kill_process",
85
+ "kill_when_idle",
86
+ "run",
87
+ "run_async",
88
+ "status",
89
+ ]
@@ -1,6 +1,6 @@
1
- """Allow `python -m db_process [subcommand]`."""
2
-
3
- from .cli import main
4
-
5
- if __name__ == "__main__":
6
- raise SystemExit(main())
1
+ """Allow `python -m db_process [subcommand]`."""
2
+
3
+ from .cli import main
4
+
5
+ if __name__ == "__main__":
6
+ raise SystemExit(main())