Repository navigation
docs: correct outdated and misleading API docstrings (backport #60) - #61
Merged
Merged
Conversation
* docs: correct outdated and misleading API docstrings
- tpb_diag, tpb_diag_from_files, gdb_diag and get_backend list 'gpu-omp' and
the aliases; gdb_diag says gpu-omp runs GDB on the host.
- get_backend says what None resolves to ('auto' before any init, 'cpu' once
a diag call has initialized) and that cpu + gpu-omp must not share a process.
- init lists gdb_diag among the per-call device overrides.
- tpb_diag_from_files says its one file supplies both alpha and beta.
- TPB_SBD, GDB_SBD, LoadFCIDump and LoadAlphaDets get real docstrings.
- assemble_rdms cites upstream SBD's docs/user-guide.md, not a private repo.
- DeviceConfig's example passes the config to solve_sci_batch instead of the
undocumented apply(); auto() drops development history.
- References to functions not on the API page become literals, so they no
longer render as dead links; from_strings examples use bit_length 62.
- The bit_length row covers odd values in all GDB use, not only the heatbath
expansion: upstream's own diag gives a wrong plain-diagonalization energy at
31 on Fe4S4 (r-ccs-cms/sbd#104).
Docstrings and one table row only; no code changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs: LoadAlphaDets sorts and removes duplicates
Upstream's LoadAlphaDets ends with an unconditional sort_bitarray
(makedeterminants.h:190), so the result is sorted and distinct, not in file
order, and needs no further sort. Also note that only .txt and .bin are read:
any other extension returns an empty list without an error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b3bf3fa)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A scan of everything the docs site renders (the landing page, the three API pages and the 22 docstrings they pull in) turned up statements that are out of date or misleading. Each was checked against the code. This fixes them. Docstrings and one table row only; no code changes.
Wrong
gpu-ompwas missing from the device lists.tpb_diag,tpb_diag_from_filesandgdb_diagdocumenteddeviceas('cpu', 'gpu', or None), andget_backendas'cpu', 'gpu', 'auto', or None. All four passdevicetoget_backend, which accepts'gpu-omp'and its aliases.gdb_diagnow also says that'gpu-omp'runs GDB on the host, since SBD has no OpenMP-offload GDB code.get_backend(None)does not mean "the default". It resolves to_default_device or 'auto', so before anything has initialized it is'auto', which prefers Thrust. Meanwhile the firsttpb_diagorgdb_diagcall initializes with'cpu'. The docstring now says this and recommends callinginit()to avoid depending on call order.bit_lengthrow limited the odd-value hazard to GDB's heatbath expansion. Upstream's owndiagalso gives a wrong plain-diagonalization energy at--bit_length 31on its bundled Fe4S4 data (GDB app: odd --bit_length gives a different energy or a crash (Fe4S4). Is an even value expected? r-ccs-cms/sbd#104), so the row now covers all GDB use with multi-word determinants.Misleading or incomplete
tpb_diag_from_filestakes one determinant file and uses it for both alpha and beta (bdet = adetupstream); the docstring now says so, and points totpb_diagfor different lists.initnow listsgdb_diagamong the calls that take a per-calldevice.get_backendsaid passingdeviceis how you switch between CPU and GPU in one process. That holds except for the CPU backend together withgpu-omp, the combination the 1.7 release notes warn about; it now says so.assemble_rdmscited a private repository for SBD's RDM layout. It now cites upstream SBD'sdocs/user-guide.md, which documents exactly that layout, and no longer refers to code "below".from_strings,get_backendandDeviceConfig.gpu_omplinked tofrom_string,makestringandhas_backend_conflict, none of which is on the API page, so they rendered as plain text. They are now literals, which adds no API surface.DeviceConfig's usage example called the undocumentedapply()on aTPB_SBDobject namedsbd_config, a name that means a dict elsewhere. It now passes the config tosolve_sci_batch(device_config=...).Minor
TPB_SBD,GDB_SBD,LoadFCIDumpandLoadAlphaDetsget real docstrings.LoadAlphaDetsdocuments its arguments, and that it neither sorts nor deduplicates.DeviceConfig.autodrops development history and a reference to a private function.from_stringsexamples usebit_length62 instead of 63; the new outputs were checked by running them and round-tripping throughmakestring.sphinx-build -W -T --keep-going, the commandtox -e docsruns, succeeds with no warnings, and every new passage appears on the rendered pages. Labelled for backport, because the site deploys fromstable/1.7.🤖 Generated with Claude Code
This is an automatic backport of pull request #60 done by [Mergify](https://mergify.com).