Repository navigation
release: DualSPHysics Studio v1.0.2 - #2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b27b94e0e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| result = re.sub( | ||
| r"(?i)\b[A-Z]:[\\/]+Users[\\/]+[^\\/\s\"']+", | ||
| "<USER_HOME>", | ||
| result, | ||
| ) |
There was a problem hiding this comment.
Redact absolute paths outside the known roots
When a tool log or manifest contains an absolute path outside the source, output, or configured tool roots—for example D:\shared\meshes\input.stl—the diagnostic ZIP retains it verbatim. The fallback expression only recognizes paths under X:\Users\..., so exporting and sharing a supposedly path-redacted diagnostic can disclose other local directories and filenames; handle arbitrary Windows absolute paths as well.
Useful? React with 👍 / 👎.
| redaction_paths=( | ||
| source_path.parent, | ||
| session.output_root, | ||
| self.settings.gencase_root, | ||
| ), |
There was a problem hiding this comment.
Omit an empty configured root from redaction paths
When tools are discovered through DUALSPHYSICS_ROOT while the saved gencase_root remains empty, this passes "" to _Redactor. Path("") becomes ., causing every period in exported JSON, summaries, and logs—including versions, timestamps, decimals, and filenames—to be replaced with <LOCAL_PATH_3>, substantially corrupting the diagnostic package; only pass this path when the setting is non-empty.
Useful? React with 👍 / 👎.
| def _refresh_run_history(self, source: Path) -> tuple[RunSession, ...]: | ||
| sessions = find_case_sessions(source) | ||
| for session in sessions: | ||
| session.mark_interrupted() |
There was a problem hiding this comment.
Preserve sessions owned by another running instance
When the same case is open in a second Studio process while the first process is still running a stage, refreshing history unconditionally rewrites the first process's live session as interrupted. Since streaming logs do not rewrite run.json, that record and the second instance's UI remain falsely interrupted until the active stage finishes; use an ownership/liveness marker or locking before recovering a running session.
Useful? React with 👍 / 👎.
| counts = [ | ||
| max(1, math.floor(span / dp + 1e-9) + 1) | ||
| for span in spans |
There was a problem hiding this comment.
Guard grid-ratio overflow in resource estimation
For a parseable case with a finite but extremely small positive dp relative to the definition span, span / dp becomes infinity and math.floor() raises OverflowError. Estimation runs automatically when a document is loaded and before a full run, so such an input aborts those handlers instead of reporting an unavailable or over-budget estimate; validate that the ratio is finite and bounded before converting it to an integer.
Useful? React with 👍 / 👎.
| self._run_session = None | ||
| self._selected_session = None | ||
| self._full_run_active = False | ||
| self._manual_session_active = False | ||
| self._pending_full_stage = None |
There was a problem hiding this comment.
Keep active workflow state when another XML is opened
If the user opens another XML while a manual or one-click stage is running, the Open action remains enabled and set_document() reaches this handler, which clears the active session and full-workflow flags even though the worker continues. The current stage then finishes without updating its run record, and a one-click run never schedules its remaining solver or PartVTK stages, leaving run.json stuck as running; either prevent document replacement during execution or retain the active workflow state independently of the displayed document.
Useful? React with 👍 / 👎.
What changed
.dss-runrecords, XML snapshots and diagnostic exportsImpact
Users can evaluate likely resource requirements before launching, follow a complete simulation pipeline from one place, and retain auditable records suitable for reruns and support diagnostics. PartVTK is always retained in the one-click workflow.
Validation
python -m dualsphysics_studio --smoke-testpassedgit diff --checkpassed