Repository navigation
Density file names that differ from others only in case: Ind and Disp as ind-total and disp-total - #11
Merged
Conversation
The density keys Ind and Disp differ from ind and disp only in case, so their files delta_dm_<key> (cubes, .npy) collided on case-insensitive file systems: on macOS or Windows the Ind and Disp densities were written over the ind and disp files, with no error. prop_sapt.artifacts.density_file_name names the files of single densities, with Ind and Disp as ind-total and disp-total; density_file_names also refuses names that differ only in case. calc_densities names its cubes and .npy files with them, before writing anything. The density keys and the entries of the .npz bundle are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The example that writes cubes from a bundle names them with density_file_name; the usage guide and the changelog say where the Ind and Disp densities are saved now, and that files from 0.4.0 and 0.5.0 written on macOS or Windows need recomputing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
calc_densitiesnames its filesdelta_dm_<key>after the density keys, and the keysInd/indandDisp/disp(with their_Aand_Bvariants: six pairs) differ only in case. On a case-insensitive file system (macOS and Windows by default)indis written first andIndthen goes into the same file. The result isdelta_dm_ind_A.cubeholdingInd(ind+exch-ind_S2), with no error; the same holds fordisp. This affects the cubes and the deprecated.npyfiles since 0.4.0, and files copied from Linux collide in the same way. The.npzbundle is not affected: its entry names are case-sensitive andnp.loadnever puts them on disk.prop_sapt.artifacts.density_file_name(key, suffix)names the files of single densities:delta_dm_<key><suffix>, withIndandDispnamedind-totalanddisp-total, e.g.delta_dm_ind-total_A.cube.density_file_names(keys, suffix)names several and raises aValueErrorif two names differ only in case (or not at all).calc_densitiesnames its cubes, its.npyfiles and the cube list in the bundle metadata with them, checked before anything is written.rho["Ind"],DENSITY_COMPONENTS), the bundle and its format version, and the cube comment line, which still names the key (propSAPT delta_dm_Ind_A: ...).examples/make_cubes_from_mo_matrices.pyuses the helper. The usage guide says whereIndandDispare saved.Fixedentry: users who wrote files with 0.4.0 or 0.5.0 on macOS or Windows should recompute theirdelta_dm_ind*anddelta_dm_disp*files. AI-USAGE entry.Tests: the mapping, the error, and all names from
DENSITY_COMPONENTSwith_A/_Bbeing distinct when case is ignored, so a future key cannot reintroduce the problem. The tests of saved cubes and.npyfiles now expect the new names. Full suite: 472 passed, 2 skipped, 2 xfailed. black and flake8 (critical) clean.After this is merged, #8 needs a rebase that routes its two TREXIO name builders (
export_trexioandtrexio_filenamesincalc_densities) throughdensity_file_names(keys, ".h5"). The rebase will not flag them as conflicts.🤖 Generated with Claude Code