Commit graph

34 commits

Author SHA1 Message Date
7cf323df23 feat: surface the Plotly page console in the Console dock
A plotly failure inside the WebEngine page was invisible from Python - the
react promise just rejected and the canvas looked frozen with no evidence.
PlotlyCanvas now installs a QWebEnginePage that forwards
javaScriptConsoleMessage into the Console dock with the right severity
(error/warning/info), so the next silent failure is diagnosable.
2026-09-16 20:18:23 -04:00
0611153555 fix: stop the Plotly canvas wedging on rapid or overlapping updates
Three defects in the view-preservation path could leave the plot frozen
(no updates, no orbit, stale colours):

1. The merge injected raw _fullLayout objects - including undefined when a
   push landed before the previous react resolved - and plotly validates
   layouts, so one bad value made every later react fail permanently.
   currentView() now deep-copies and validates eye/center/up and each
   range, and mergeView() is wrapped so it can never block an update.
2. Updates were not serialized: overlapping Plotly.react calls on one graph
   div left it unresponsive. otkoUpdate now queues and coalesces (one react
   at a time, latest payload wins), and logs instead of failing silently.
3. A style change re-framed the camera, so re-colouring yanked a view the
   user had orbited. Colour/opacity ride the traces and background/outline
   ride the layout, so set_style is now a non-framing push.

Verified in the browser: a user orbit survives colour changes, 30 rapid
preview updates land on the final value and stay responsive, and deleting
the live camera no longer wedges the plot.
2026-09-16 20:14:05 -04:00
8f7bc3cf4f fix: keep the Plotly camera and axis ranges through data updates
Plotly.react resets any scene attribute the incoming layout omits, so every
selection change snapped the camera back to the default and re-fit the
ranges - the pinned framing was meaningless. Data-only pushes now pass
preserveView and html.py merges the live camera and axis ranges into the
incoming layout; only an explicit re-frame sends computed framing.

Also fixes the ordering bug where the framing flag was consumed before the
not-ready early return, which dropped the very first framing on the floor
(show_project runs before loadFinished).

Verified in the browser: user orbit + zoom survive selection and working
plane updates, while reset_camera re-frames. Regression-tested headlessly
by asserting the emitted preserveView flag.
2026-09-16 20:05:35 -04:00
5f977e9df0 feat: opstool-style scene recipe for the Plotly canvas
Frames the view deterministically: Scene now carries padded per-axis bounds
(opstool's pad_ratio 0.15, with unit slack on degenerate axes) plus
axis_overrides() pinning range + autorange=False, so the model is never
flush against the viewport edge. Adds entity hover templates (Node #n /
Element #n with an empty extra tag), and an optional axis outline (grid +
ticks) - off by default so the SAP2000-like clean viewport is unchanged;
the coloured X/Y/Z axis lines always stay as the orientation cue.

The outline is exposed as a bool in the Plot Properties table, so the
table-driven dialog now builds a checkbox for kind=bool.
2026-09-16 20:05:26 -04:00
bd365be77d feat: Options → Plot Properties dialog with live preview and persistence
Adds a table-driven dialog over RenderStyle.STYLE_FIELDS (colour swatches,
an opacity spin and a label font size), reachable from Options. Edits
preview immediately on every canvas, Cancel restores the style the dialog
opened with, and only OK persists — as JSON under QSettings plot/props,
reloaded on the next launch. Both canvases gain set_style(); the dialog
deliberately exposes plot_style() rather than style() so QWidget.style()
keeps its Qt meaning.
2026-09-16 19:31:38 -04:00
56f1f6c08b feat: route both canvas backends through RenderStyle
Colours that were hard-coded in the renderers now come from the shared
style: nodes, supports, nodal/element loads, section extrusions (+
opacity) and label font size. The PyVista frame LUT becomes a four-slot
palette [beam, truss, link, selected] with the cell scalar carrying the
family slot, so VTK matches the Plotly backend's per-family colouring
that landed earlier. Adds style helpers shared by both backends
(element_family_index, family_palette) and an immutable with_updates().

The style also gains the editable field table (STYLE_FIELDS) the Plot
Properties dialog is built from.
2026-09-16 19:31:30 -04:00
17d2ed21d3 feat: opstool-derived element palette and single-trace frame colours
Ports opstool's per-family element colours and its diverging response
scale; RenderStyle.response_scale_colors now also drives the PyVista
force-diagram colouring instead of a hard-coded "coolwarm".

The frame renderer drops the two-trace normal/selected workaround: my
earlier assumption that plotly cannot colour segments individually was
wrong. Scatter3d.line.color accepts an array mapped through a colorscale,
so one trace now carries per-element colours (family + selection) and is
ready to be coloured by response value later.

Attribution recorded in NOTICE per GPLv3 section 5(a)/(b).
2026-09-16 19:15:55 -04:00
40a673c562 test: isolate QSettings so user preferences cannot fail GUI tests
MainWindow persists preferences (window layout, canvas backend) through
QSettings("OTKO", "OTKO"), so tests constructing it were reading the
developer's real settings: after switching to the Plotly backend the
PyVista-specific viewport-axis tests failed with "PlotlyCanvas has no
attribute renderer". A session fixture now redirects QSettings into a
temp dir and is skipped when Qt is not installed, keeping the headless
job Qt-free.
2026-09-16 19:15:48 -04:00
d09e72e95d chore: clone opstool for visualization reference
opstool v1.0.26 (GPL-3.0) is cloned read-only under
.slim/clonedeps/repos/ to inspect its PyVista/Plotly visualization
settings. GPLv3 section 13 permits combining it with this AGPL-3.0
project. The clone itself is git-ignored; the manifest and the AGENTS.md
pointer are committed.
2026-09-16 19:15:48 -04:00
9a1baa07c2 feat: live canvas backend switching (Options → Canvas Backend)
Both backends share one SelectionState owned by MainWindow and live
side by side in a QStackedWidget — switching is setCurrentWidget, so
no widget is destroyed mid-session (tearing a VTK window down leaves
dangling make-current callbacks). The choice persists in QSettings.
CanvasCapabilities declares per-backend gaps (force diagrams and
video export stay PyVista-only, both are documented and greyed out)
and the UI gates on capabilities rather than the backend name. The
architecture gate now allows the canvas_plotly package.
2026-09-16 18:43:59 -04:00
804bf22f61 feat: plotly.js canvas widget (WebEngine + QWebChannel)
PlotlyCanvas hosts plotly.js in a QWebEngineView driven over
QWebChannel: figures update with Plotly.react (the camera survives
unless a view preset asks for it), and clicks round-trip as
node/element picks or grid-snap clicks. Assets are written to a temp
dir and loaded from file:// because the ~5 MB bundle is past
setHtml's data-URL limit. render() forwards QWidget's overload so
grab() and painting keep working.
2026-09-16 18:43:59 -04:00
fc5971ad3d feat: pure Plotly trace builder for the 3D canvas
Project → plotly.js figure dicts with no Qt/pyvista/plotly import, so
it is unit-tested in the headless job. Mirrors the PyVista renderer's
geometry (grid, nodes, frames, supports, loads, extrusions, local
axes, labels, deformation) while respecting plotly.js's medium:
pixel-sized markers, None-separated line segments, selection as a
second trace (per-segment line colours are impossible), cone traces
for arrows. Pickable traces carry meta.kind + customdata.
2026-09-16 18:43:53 -04:00
f99b3a3efd build: add plotly to the GUI extra
Supplies the offline plotly.js bundle for the new canvas backend. The
GUI CI job now installs the gui extra so the Qt/WebEngine tests run
instead of being import-skipped.
2026-09-16 18:43:53 -04:00
1c8333979f Merge pull request 'chore/adopt-local-tree' (#4) from chore/adopt-local-tree into main
Some checks failed
CI / lint (push) Has been cancelled
CI / type (push) Has been cancelled
CI / test-headless (macos-latest, 3.10) (push) Has been cancelled
CI / test-headless (macos-latest, 3.11) (push) Has been cancelled
CI / test-headless (macos-latest, 3.12) (push) Has been cancelled
CI / test-headless (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test-headless (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test-headless (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test-headless (windows-latest, 3.10) (push) Has been cancelled
CI / test-headless (windows-latest, 3.11) (push) Has been cancelled
CI / test-headless (windows-latest, 3.12) (push) Has been cancelled
CI / test-gui (push) Has been cancelled
CI / test-integration (macos-latest) (push) Has been cancelled
CI / test-integration (ubuntu-latest) (push) Has been cancelled
CI / test-integration (windows-latest) (push) Has been cancelled
Reviewed-on: #4
2026-09-16 15:48:15 -04:00
61b850bf46 style: resolve the remaining ruff findings
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / type (pull_request) Has been cancelled
CI / test-headless (macos-latest, 3.10) (pull_request) Has been cancelled
CI / test-headless (macos-latest, 3.11) (pull_request) Has been cancelled
CI / test-headless (macos-latest, 3.12) (pull_request) Has been cancelled
CI / test-headless (ubuntu-latest, 3.10) (pull_request) Has been cancelled
CI / test-headless (ubuntu-latest, 3.11) (pull_request) Has been cancelled
CI / test-headless (ubuntu-latest, 3.12) (pull_request) Has been cancelled
CI / test-headless (windows-latest, 3.10) (pull_request) Has been cancelled
CI / test-headless (windows-latest, 3.11) (pull_request) Has been cancelled
CI / test-headless (windows-latest, 3.12) (pull_request) Has been cancelled
CI / test-gui (pull_request) Has been cancelled
CI / test-integration (macos-latest) (pull_request) Has been cancelled
CI / test-integration (ubuntu-latest) (pull_request) Has been cancelled
CI / test-integration (windows-latest) (pull_request) Has been cancelled
Auto-fixes (UP037, UP038, F401, I001, SIM105, RUF100) plus hand-fixes:
drop the now-unused `Union` imports, annotate mutable class attributes
with ClassVar, raise ValidationError instead of blind Exception in the
zero-length test, delete two dead locals, and bind the per-iteration
grid-builder closures to their loop variables (B023).
2026-09-16 13:20:36 -04:00
184bb4662b chore: scope ruff ignores to tests, Qt and engineering notation
RUF001-003 are ignored repo-wide: × / ≈ / ² are deliberate in the
engineering docs and formulas, which also makes the scattered inline
noqa suppressions redundant. Tests use engineering symbols (A, I, L, E),
`importorskip` before imports and capitalised test names; Qt requires
camelCase signal names and PascalCase event overrides; OpenSees material
fields (cR1, epsU) mirror the solver verbatim. N806 stays exempt only for
the numeric modules that use L / Iz / Iy as symbols.
2026-09-16 13:20:36 -04:00
1f39cff5b0 ci: split the workflow into lint/type/headless/gui/integration jobs
Reconstructs the workflow stripped during the tree copy to match the
meta-gates: separate type job, headless command over
tests/unit+tests/services, and dedicated GUI / integration jobs.
Tool versions pinned to the pre-commit revisions (ruff 0.4.4,
mypy 1.10.0) so CI and local hooks agree.
2026-09-16 13:08:49 -04:00
ba3cad4eff fix: ElasticSectionForm round-trips the SectionShape union
The form still passed flat b/h/d/tw/tf/diameter fields, which
ElasticSection (extra='forbid') rejects, so reading any elastic
section crashed. Rebuild the display-only hint as a PipeShape /
AngleShape / RectShape member instead; an incomplete shape degrades
to None rather than raising.
2026-09-16 13:08:49 -04:00
ba783718d4 chore: adopt remaining local development state
Catch-all for the intermixed residue of the unpushed otko-development
work ported into this tree: combinations/console-dock/quick-guide wiring
across commands, core, services, views and tests; repo-wide ruff-format
normalization; README/CONTRIBUTING updates; and the toolbar default
(both toolbars now open in the top area, quick guide text updated).

Splitting this further would require hunk-level surgery with low
confidence; the preceding commits in this branch isolate the
self-contained features.
2026-09-16 12:03:22 -04:00
cb4bf8fccd docs: quick guide, docs README, specifications and NOTICE 2026-09-16 12:03:07 -04:00
ff09e38b7c test: meta gates for architecture, CI, docs and packaging 2026-09-16 12:03:07 -04:00
f1d58273b7 feat: shared unit-aware formatting helpers
Pure presentation helpers (labels, number parse/format) shared by docks
and dialogs; no Qt imports.
2026-09-16 12:03:07 -04:00
1d21006281 feat: console log dock 2026-09-16 12:03:07 -04:00
ea352a5de5 feat: load combinations
LoadCombination entity, combination service, manager dialog and
unit/integration coverage.
2026-09-16 12:03:07 -04:00
7093164f75 test: relocate service-layer tests to tests/services/
Mirrors the source layout (core/services split) so unit/ holds core-only
tests and services get their own home.
2026-09-16 12:02:55 -04:00
dd9fa26b52 style: apply ruff format to generated catalog
Mechanical double-quote / line-wrap normalization over the schema-generated
catalog classes; no semantic changes.
2026-09-16 12:02:55 -04:00
12c78ea8cb build: read version from _const.py, drop phantom scipy/pandas deps
Single source of truth for the package + pinned solver versions in
src/otko/_const.py (hatch dynamic version). scipy/pandas were listed in
[gui] but never imported. mypy strict mode rescoped to
core/services/viewmodels; tomli added for tomllib-less Pythons.
2026-09-16 12:02:47 -04:00
4d1b3092f8 Merge pull request 'docs: document Forgejo remote and SSH workflow in AGENTS.md' (#3) from docs/git-remote into main
Some checks failed
CI / lint (push) Has been cancelled
CI / test (macos-latest, 3.10) (push) Has been cancelled
CI / test (macos-latest, 3.11) (push) Has been cancelled
CI / test (macos-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11) (push) Has been cancelled
CI / test (windows-latest, 3.12) (push) Has been cancelled
Reviewed-on: #3
2026-09-08 02:52:58 -04:00
9df51ee1a1 Merge pull request 'fix: bump export solver pin to 3.8.0.0, narrow PathTimeSeries in examples' (#2) from fix/export-pinned-version-and-ex1b-series into main
Some checks failed
CI / lint (push) Has been cancelled
CI / test (macos-latest, 3.10) (push) Has been cancelled
CI / test (macos-latest, 3.11) (push) Has been cancelled
CI / test (macos-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11) (push) Has been cancelled
CI / test (windows-latest, 3.12) (push) Has been cancelled
Reviewed-on: #2
2026-09-08 02:52:24 -04:00
c3b4eed4b2 docs: document Forgejo remote and SSH workflow in AGENTS.md
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / test (macos-latest, 3.10) (pull_request) Has been cancelled
CI / test (macos-latest, 3.11) (pull_request) Has been cancelled
CI / test (macos-latest, 3.12) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.10) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.11) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.12) (pull_request) Has been cancelled
CI / test (windows-latest, 3.10) (pull_request) Has been cancelled
CI / test (windows-latest, 3.11) (pull_request) Has been cancelled
CI / test (windows-latest, 3.12) (pull_request) Has been cancelled
2026-09-08 02:51:15 -04:00
7665b7d031 Merge pull request 'docs: rewrite READMEs dry and blunt, rename Studio to OTKO' (#1) from rewrite-readmes into main
Some checks failed
CI / lint (push) Has been cancelled
CI / test (macos-latest, 3.10) (push) Has been cancelled
CI / test (macos-latest, 3.11) (push) Has been cancelled
CI / test (macos-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11) (push) Has been cancelled
CI / test (windows-latest, 3.12) (push) Has been cancelled
Reviewed-on: #1
2026-09-08 02:43:47 -04:00
a243092f03 fix: bump export solver pin to 3.8.0.0, narrow PathTimeSeries in examples
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / test (macos-latest, 3.10) (pull_request) Has been cancelled
CI / test (macos-latest, 3.11) (pull_request) Has been cancelled
CI / test (macos-latest, 3.12) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.10) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.11) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.12) (pull_request) Has been cancelled
CI / test (windows-latest, 3.10) (pull_request) Has been cancelled
CI / test (windows-latest, 3.11) (pull_request) Has been cancelled
CI / test (windows-latest, 3.12) (pull_request) Has been cancelled
2026-09-08 02:43:23 -04:00
3d809ca301 docs: rewrite READMEs dry and blunt, rename Studio to OTKO
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / test (macos-latest, 3.10) (pull_request) Has been cancelled
CI / test (macos-latest, 3.11) (pull_request) Has been cancelled
CI / test (macos-latest, 3.12) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.10) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.11) (pull_request) Has been cancelled
CI / test (ubuntu-latest, 3.12) (pull_request) Has been cancelled
CI / test (windows-latest, 3.10) (pull_request) Has been cancelled
CI / test (windows-latest, 3.11) (pull_request) Has been cancelled
CI / test (windows-latest, 3.12) (pull_request) Has been cancelled
2026-09-08 02:41:03 -04:00
612936a00b feat: initial otko import
Some checks failed
CI / lint (push) Has been cancelled
CI / test (macos-latest, 3.10) (push) Has been cancelled
CI / test (macos-latest, 3.11) (push) Has been cancelled
CI / test (macos-latest, 3.12) (push) Has been cancelled
CI / test (ubuntu-latest, 3.10) (push) Has been cancelled
CI / test (ubuntu-latest, 3.11) (push) Has been cancelled
CI / test (ubuntu-latest, 3.12) (push) Has been cancelled
CI / test (windows-latest, 3.10) (push) Has been cancelled
CI / test (windows-latest, 3.11) (push) Has been cancelled
CI / test (windows-latest, 3.12) (push) Has been cancelled
2026-09-08 02:12:15 -04:00