Skip to content

Commit 6519e80

Browse files
andyclaude
andcommitted
Merge origin/main into wip/win-merge
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFPK14wBcLD1s4dYUowpP4
2 parents 9e08284 + f6cae4a commit 6519e80

41 files changed

Lines changed: 1276 additions & 13 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CMakeLists.txt‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,6 +1939,15 @@ if(PYTHON3_EXECUTABLE)
19391939
set_tests_properties(apps_panel_layouts PROPERTIES TIMEOUT 900
19401940
SKIP_RETURN_CODE 77)
19411941

1942+
# ORCA orbitals in the MOs panel (#239): a 24-function cc-pVDZ water run
1943+
# draws; a 23-function one gives one plain dialog; the pane fits its rows.
1944+
add_test(NAME apps_orca_mo
1945+
COMMAND ${PYTHON3_EXECUTABLE}
1946+
${CMAKE_CURRENT_SOURCE_DIR}/tests/apps/orca_mo_test.py
1947+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/apps)
1948+
set_tests_properties(apps_orca_mo PROPERTIES TIMEOUT 1200
1949+
SKIP_RETURN_CODE 77)
1950+
19421951
# Every app's main window and every codereg Theory/Runtype dialog fits a
19431952
# small screen (#189): measured on private Xvfb screens, no window may
19441953
# extend past the screen. Same installed tree and isolation as `apps`.
@@ -2154,6 +2163,19 @@ if(PYTHON3_EXECUTABLE)
21542163
$<TARGET_FILE:importmeta>)
21552164
set_tests_properties(importmeta PROPERTIES TIMEOUT 300 ENVIRONMENT
21562165
"ECCE_HOME=${CMAKE_SOURCE_DIR};ECCE_REALUSER=fragreaders")
2166+
# tests/basis/testCoordSys: the spherical/Cartesian convention recorded
2167+
# for a basis, per code (ORCA is spherical-only).
2168+
add_executable(gbscoordsys tests/basis/testCoordSys.C)
2169+
target_include_directories(gbscoordsys PRIVATE ${XercesC_INCLUDE_DIRS})
2170+
# The data-model libraries refer to each other in a cycle that the
2171+
# code under test does not happen to pull in the right order.
2172+
target_link_libraries(gbscoordsys PRIVATE -Wl,--start-group
2173+
eccecommxt eccecomm eccercmd eccedsi eccedav eccecipc eccefaces eccexml
2174+
eccetdat ecceutil -Wl,--end-group ${XercesC_LIBRARIES})
2175+
add_test(NAME gbscoordsys
2176+
COMMAND gbscoordsys ${CMAKE_CURRENT_SOURCE_DIR}/data/admin/basissets)
2177+
set_tests_properties(gbscoordsys PROPERTIES ENVIRONMENT
2178+
"ECCE_HOME=${CMAKE_SOURCE_DIR};ECCE_REALUSER=fragreaders;ECCE_REALUSERHOME=${CMAKE_BINARY_DIR}/fragreaders-home")
21572179
# tests/mocomp: ecce-mocomp's Mulliken and c^2 compositions against
21582180
# checked-in Multiwfn numbers (#161); re-derives them where Multiwfn is
21592181
# installed (MULTIWFN, or Multiwfn_noGUI on PATH).

‎data/client/cap/ORCA.edml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
<MaxPrimitives>100 100 100 100 100 100</MaxPrimitives>
2929
<MaxSharedExponent> 1 </MaxSharedExponent>
3030
<SphericalCoordinates> True </SphericalCoordinates>
31+
<!-- ORCA has no Cartesian d/f functions: the basis is recorded as
32+
spherical whatever the library says, or the MO code expects six
33+
d functions where ORCA wrote five (GBSRules::sphericalOnly). -->
34+
<SphericalOnly>True</SphericalOnly>
3135
<DFTFitting> False</DFTFitting>
3236
<RecommendDFTCharge> False </RecommendDFTCharge>
3337
<RequireFullDFT> False </RequireFullDFT>

‎docs/claude/codereg/index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ unit is produced in `ai.<code>`/the `.tpl`, closest to the input deck.
8080
- [`rdStandardGBS.pm` accepts indented NameBasis lines and an optional `print`; do not re-fix the `*.expt` writers](rdstandardgbs-pms-namebasis-format-used-to-have.md)
8181
- [No `CMakeLists.txt install()` changes needed](no-cmakelists-txt-install-changes-needed.md)
8282
- [An `.expt`'s `.param` keys and `.frag` attributes are read literally; a wrong key is dropped silently (#235)](expt-param-keys-are-read-literally.md)
83+
- [A spherical-only code must say `<SphericalOnly>` in its EDML, or its basis is recorded Cartesian (#239)](spherical-only-code-must-say-so-in-edml.md)
8384

8485
### Added from integrating MOPAC (issue #86) — the second code through
8586

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
type: pitfall
3+
title: "A spherical-only code must say `<SphericalOnly>` in its EDML, or its basis is recorded Cartesian"
4+
area: codereg
5+
section: "New-code checklist (gotchas found integrating ORCA, issue #38)"
6+
paths: ["data/client/cap/ORCA.edml", "src/dsm/chemistry/GBSRules.C", "src/apps/basistool/WxBasisTool.C", "src/apps/calced/CalcEd.C", "tests/basis/testCoordSys.C"]
7+
issues: [239]
8+
---
9+
**`GBSRules::autoOptimize()` records spherical only when the library basis
10+
says it was designed for spherical functions**, and 79 of the shipped
11+
`.BAS.meta` files (cc-pVDZ and def2-SVP among them) leave that flag blank,
12+
so the rule records Cartesian. NWChem and Gaussian are then told Cartesian
13+
and use it, so the record is true for them. ORCA has no Cartesian
14+
functions and ignores the recorded convention, so the record was false:
15+
the MO code expected six d functions where ORCA wrote five and only drew
16+
because `ComputeMoCmd` falls back by coefficient width ("matches the
17+
spherical basis, not the recorded one").
18+
19+
A code with spherical functions only declares `<SphericalOnly>True</SphericalOnly>`
20+
in `<GaussianBasisSetRules>`; `GBSRules::enforceCodeCoordSys()` then sets
21+
spherical in autoOptimize, when CalcEd saves the basis (a basis picked
22+
by an older client), and in the Basis Set Tool, whose Cartesian button is
23+
disabled. Imports were already right: `ORCA.expt` writes
24+
`SphericalBasis: TRUE`. Checked by the `gbscoordsys` test.

‎docs/claude/wx-viewer/index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Read this before changing any dialog, panel, sizer, grid, ewx control or the Ope
1111

1212
### wxWidgets 3.2/GTK3, the 3D viewer, and C++ pitfalls
1313

14+
- [`ComputeMoCmd` caches a grid before computing it; a failed Compute must remove it (#239)](mo-grid-cache-keeps-a-failed-compute.md)
1415
- [The redraw sensor must not be drained inside `schedule()`: `SoWxEventHandler::setUpCallbacks()` only wakes idle](open-inventors-redraw-sensor-is-a-one.md)
1516
- [`ECCE_USE_COIN` (default ON) builds the viewer against Coin3D; `=OFF` keeps the vendored core for one release](ecce-use-coin-builds-the-viewer-against-coin3d.md)
1617
- [Coin SORTED_LAYERS_BLEND is the default lobe transparency (6 passes, alpha canvas); slow scenes fall back to SCREEN_DOOR](coin-sorted-layers-blend-is-the-default-lobe-transparency.md)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
type: pitfall
3+
title: "`ComputeMoCmd` caches a grid before computing it; a failed Compute must remove it"
4+
area: wx-viewer
5+
section: "wxWidgets 3.2/GTK3, the 3D viewer, and C++ pitfalls"
6+
paths: ["src/viz/propsgcommands/ComputeMoCmd.C", "src/apps/builder/MoPanel.C", "tests/apps/orca_mo_test.py"]
7+
issues: [239]
8+
---
9+
**The MO grid is added to the cache (`addMOGrid`, keyed "MO alpha N")
10+
before it is filled.** A Compute that gives up afterwards (coefficients
11+
that do not fit the basis, an orbital index past the stored rows) left an
12+
empty grid under that key, and the next Compute of the same orbital found
13+
it, skipped the computation and reported "The grid value for this MO is
14+
0". So the first press said one thing and every later press another.
15+
Those paths now `removeMOGrid(key)`. The width mismatch is reported to
16+
`MoPanel` through the command's `CoefWidth`/`BasisWidth` parameters, which
17+
gives a dialog naming both counts once per calculation.
18+
`tests/apps/orca_mo_test.py` presses Compute twice on a 23-function ORCA
19+
output and requires exactly one dialog.

‎include/dsm/GBSRules.H‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ class GBSRules
4242
const JCode* code,
4343
const TTheory* theory);
4444

45+
// The code has spherical functions only (<SphericalOnly> in its
46+
// EDML), so the recorded convention may not be Cartesian.
47+
static bool sphericalOnly(const JCode* code);
48+
49+
// Sets Spherical on a spherical-only code's config; true if changed.
50+
static bool enforceCodeCoordSys(TGBSConfig* config, const JCode* code);
51+
4552
};
4653
#endif
4754

‎packaging/gateway/ecce-gateway-reap‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ ECCE_HOME="${ECCE_HOME:-/opt/ecce}"
3737
ECCE_REALUSERHOME="${ECCE_REALUSERHOME:-$HOME}"
3838
STATEDIR="$ECCE_REALUSERHOME/.ECCE"
3939
UID_="$(id -u)"
40+
# Beside the script, else beside its symlink target (plain readlink: no -f
41+
# on macOS 10.15), else in $ECCE_HOME/bin.
4042
_lib="$(dirname "$0")/ecce-session-lib.sh"
43+
if [ ! -r "$_lib" ] && _t=$(readlink "$0" 2>/dev/null); then
44+
case $_t in /*) ;; *) _t="$(dirname "$0")/$_t" ;; esac
45+
_lib="$(dirname "$_t")/ecce-session-lib.sh"
46+
fi
4147
[ -r "$_lib" ] || _lib="$ECCE_HOME/bin/ecce-session-lib.sh"
4248
. "$_lib" || { echo "ecce-gateway-reap: cannot read $_lib" >&2; exit 1; }
4349

‎packaging/gateway/ecce-gateway-start‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ export ECCE_REALUSERHOME="${ECCE_REALUSERHOME:-$HOME}"
2020
export ECCE_REALUSER="${ECCE_REALUSER:-$(id -un)}"
2121
export HOST="${HOST:-$(hostname)}"
2222

23+
# Beside the script, else beside its symlink target (plain readlink: no -f
24+
# on macOS 10.15), else in $ECCE_HOME/bin.
2325
_lib="$(dirname "$0")/ecce-session-lib.sh"
26+
if [ ! -r "$_lib" ] && _t=$(readlink "$0" 2>/dev/null); then
27+
case $_t in /*) ;; *) _t="$(dirname "$0")/$_t" ;; esac
28+
_lib="$(dirname "$_t")/ecce-session-lib.sh"
29+
fi
2430
[ -r "$_lib" ] || _lib="$ECCE_HOME/bin/ecce-session-lib.sh"
2531
. "$_lib" || { echo "ecce-gateway-start: cannot read $_lib" >&2; exit 1; }
2632
ecce_session_ensure

‎packaging/gateway/ecce-gateway-status‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ shared=""
1414

1515
# The broker file is what the processes actually use: this session's, or
1616
# failing that any one of this account's.
17+
# Beside the script, else beside its symlink target (plain readlink: no -f
18+
# on macOS 10.15), else in $ECCE_HOME/bin.
1719
_lib="$(dirname "$0")/ecce-session-lib.sh"
20+
if [ ! -r "$_lib" ] && _t=$(readlink "$0" 2>/dev/null); then
21+
case $_t in /*) ;; *) _t="$(dirname "$0")/$_t" ;; esac
22+
_lib="$(dirname "$_t")/ecce-session-lib.sh"
23+
fi
1824
[ -r "$_lib" ] || _lib="$ECCE_HOME/bin/ecce-session-lib.sh"
1925
. "$_lib" || { echo "ecce-gateway-status: cannot read $_lib" >&2; exit 1; }
2026
bfile="$(ecce_broker_file)" || bfile=""

0 commit comments

Comments
 (0)