Skip to content

Release 0.13.2: one viewer with pick modes; PyFock step energies - #181

Merged
NCCU-Schultz-Lab merged 6 commits into
mainfrom
claude/relaxed-allen-yl8454
Dec 5, 2026
Merged

NCCU-Schultz-Lab merged 6 commits into
mainfrom
claude/relaxed-allen-yl8454

Conversation

@NCCU-Schultz-Lab

Copy link
Copy Markdown
Collaborator

One molecule viewer when the two-pane workspace is on, and a fix for PyFock optimization step energies. Merging this releases 0.13.2 automatically.

One viewer (workspace on)

  • The Calculate tab no longer shows its own 3D viewer. Edit Structure and click-to-pick for PES scans use the workspace pane's viewer through an explicit pick mode (quantui/app_pick_mode.py): measure (normal), edit, scan — one at a time, active while the Calculate tab is selected.
  • Opening Edit Structure or choosing PES Scan shows a banner in the pane ("Clicking picks atoms for … [Done]"); the atom list, highlights, Clear selection and the status footer follow the tool; the Measurement readout says measuring is off. A result arriving during a pick mode pauses it (banner offers "Pick atoms" to resume).
  • The tools' Python handlers and highlight pushes are unchanged: a pick mode wires their existing click inbox and highlight slot into the pane viewer.
  • With the workspace off, nothing changes: the Calculate viewer stays and the tools use it.
  • Also fixed: picking an atom scrolled the whole pane to its row, sliding the viewer away from the pointer; now only the atom list scrolls.

PyFock step energies

  • PyFock's ASE calculator reports energies in eV using its own constant (27.211324570273); the optimizer divided by QuantUI's CODATA 2018 value, so every step energy except the final one was high by 2.3e-6 of the total (1.7e-4 Eh for water; ~1.4 kcal/mol near −1000 Eh). Converted back with PyFock's factor now. The final energy was already correct (required single point).
  • The backend cross-check now compares the first optimization step's energy too; the PyFock case fails without the fix and passes with it.

Testing

  • pytest -m "not network and not weekly": 5464 passed, 11 skipped. ruff, black, mypy (CI invocation) clean.
  • New: tests/test_app_pick_mode.py (35), tests/test_pyfock_energy_units.py (3).
  • PyFock cross-check (quantui xcheck --engine pyfock --case pf-opt-h2o-pbe-def2svp, PyFock 0.2.7): PASS (3) with the fix, FAIL (1.73e-4 Eh) without.
  • Headless Voilà screenshots (1400/800 px, Dark/Light, workspace on/off, Edit Structure and PES pick modes) reviewed; live-browser checks are not done.

Authorship

  • Claude (Opus 5.5): code edits, review, and conceptual discussion
  • Jonathan Schultz: overall vision, planning, review, and orchestration

Generated by Claude Code

claude and others added 6 commits December 5, 2026 19:59
PyFock's ASE calculator reports energies in eV using its own constant
(pyfock.Data.au2eVFactor = 27.211324570273), while the optimizer divided
by QuantUI's CODATA 2018 value (27.211386...). Every optimization step
energy except the final one (which comes from the required single point)
was therefore high by 2.3e-6 of the total energy: 1.7225e-4 Eh for
water, predicted exactly by the ratio of the two constants, and about
1.4 kcal/mol near -1000 Eh. The optimizer now converts PyFock energies
with PyFock's factor (falling back to QuantUI's if PyFock cannot be
imported). Forces carried the same 2.3e-6 relative factor, which does
not affect convergence.

Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration

Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
The app path's saved result keeps only the final energy, which comes from
the required single point, so a constant offset in the optimization's
step energies went unnoticed. The geometry-optimization check now also
compares the first step's energy (starting geometry) with the backend.
Without the previous commit the PyFock case fails here (1.73e-4 Eh);
with it, it passes.

Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration

Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Selection sync brought the picked atom's row into view with
scrollIntoView, which also scrolls every scrollable ancestor: the
height-capped pane body (and the page). Each click on an atom therefore
slid the 3D viewer up, away from the pointer, while the student was
still clicking atoms in it. Scroll the atom list's own box instead,
leaving the pane and the page where they are.

Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration

Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
… scans

With the two-pane workspace on, the Calculate tab still drew its own 3D
viewer, so the molecule appeared twice. It was kept because Edit
Structure and PES scan click-to-pick wired their clicks and highlights
into it. Those tools now pick on the pane's viewer instead, and the
Calculate tab's viewer, its backend toggle and style dropdown are hidden
(and left empty) while the workspace is on.

New companion module app_pick_mode gives the pane's viewer an explicit
pick mode, exactly one at a time:
- measure (normal): click-to-measure and atom-list selection;
- edit: while the Edit Structure panel is open;
- scan: while Calc. Type is PES Scan (Edit Structure wins if both).
A pick mode is entered only while the Calculate tab is selected. It
shows the Calculate-tab molecule with atom numbers and wires the tool's
own click inbox and highlight slot into the viewer, so the tools'
handlers and highlight pushes are unchanged. Atom-list row clicks, the
row highlights, Clear selection and the status footer follow the active
tool. A banner at the top of the pane says "Clicking picks atoms for
..." with Done (Done closes Edit Structure, or pauses scan picking).
Leaving the mode puts back what the viewer showed before, so a result
stays a result. A result arriving during a pick mode pauses it; the
banner then offers "Pick atoms" to resume, as does reopening Edit
Structure or choosing PES Scan again. With PlotlyMol the banner says
that picking by clicking needs py3Dmol.

app.py gets hooks only: _refresh_calc_mol_viewer syncs the pick mode
instead of drawing when the workspace is on, the root-tab observer
syncs it, _rerender_3d_views keeps the tool's wiring on a redraw, and a
lighting change redraws the workspace viewer. Switching the workspace
off leaves any pick mode and gives the Calculate viewer (with its tool
wiring) back; that path is unchanged.

The setup dialog still covers the page, so its hint ("close the dialog
first" to pick scan atoms) stays accurate. Help text for measuring,
Edit Structure and PES picking says where the clicks go. Tests that
check the Calculate viewer itself now switch the workspace off first.

Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration

Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Version 0.13.2; CHANGELOG [0.13.2] - 2026-12-05: one molecule viewer with
the two-pane workspace (Edit Structure and PES-scan picking in the pane),
and the PyFock optimization step-energy fix.

Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration

Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
@NCCU-Schultz-Lab
NCCU-Schultz-Lab merged commit e57f2f9 into main Dec 5, 2026
7 checks passed
@NCCU-Schultz-Lab
NCCU-Schultz-Lab deleted the claude/relaxed-allen-yl8454 branch December 5, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants