Skip to content

chore: release v1.6.0 - #218

Merged
galjos merged 48 commits into
mainfrom
dev
Aug 31, 2026
Merged

chore: release v1.6.0#218
galjos merged 48 commits into
mainfrom
dev

Conversation

@galjos

@galjos galjos commented Aug 31, 2026

Copy link
Copy Markdown
Member

Release v1.6.0.

Features since v1.5.0: extxyz trajectory conversion and output profiles, moltype inference for xyz2rst, faster CLI startup and batched file-backed analyses. Fixes: input file parsing of paths and unbracketed lists (#216), selection index parsing, traj2qmcfc file arguments, log-level independent error raising, cell validation, uninitialised analysis buffers, element lookup by atomic number.

galjos added 30 commits August 9, 2026 17:45
perf: make VACF, MSD, RDF, and momentum bitwise exact
perf: reduce exact RDF execution overhead
The vibrational input file documents hessian_sign as one of auto,
positive, negative, 1 and -1, but neither number worked. The parser
reports an unquoted number as an integer, which the string-only key
reader rejected, and the sign resolver only recognized the numbers as
numbers, so the whitelisted strings "1" and "-1" fell through to its
error branch.

Read the key as an integer when the parser reports one, and let the
sign resolver accept the numeric spellings. All five documented values
now select the intended convention; anything else is still rejected.
lark calls terminal callbacks with the token itself, so indexing it
returned its first character and any selection index above 9 selected
the wrong atom. Read the token as a whole, still accepting a list for
direct callers.

Closes #173
The positional argument was declared without nargs, so argparse passed
a single string where a list is required and every invocation failed.
Declare it like the other converters.

Closes #175
The exception belonging to an error was raised inside the logging call,
which was only reached when the logger was enabled for that level. A
higher level therefore turned every guard into a no-op, so that an
existing output file was overwritten instead of reported.

Move the raising into its own method and call it when the record is not
logged.

Closes #177
fix: accept the documented numeric hessian_sign values
fix: read whole integer tokens in selections
galjos added 18 commits August 23, 2026 21:08
fix: accept trajectory files on the traj2qmcfc command line
…f-log-level

fix: raise logged errors independently of the logging level
The reverse lookup table was built by inverting atomicNumbers with a
dict comprehension. Several symbols map onto the same atomic number, so
the last one written won: atomic number 1 resolved to the dummy element
"dum" rather than hydrogen, and 999 resolved to "x" rather than "q".

Constructing an element from its atomic number therefore produced the
wrong species. Element(1) was not equal to Element("H") and carried a
mass of 1.0 instead of 1.00794, so a water molecule built as
Atom("O1", 8) plus two Atom("H1", 1) weighed 17.9994 amu instead of
18.01528 amu and its centre of mass was displaced accordingly. An
elem(1) selection matched no atoms at all.

Build the table by iterating in insertion order and keeping the first
symbol seen for each atomic number, which is the canonical one.
The exact batch estimators size their position and velocity buffers from
the frame count reported by the trajectory reader and then fill them from
the frame generator without checking how many frames actually arrived. A
trajectory whose counted frame number exceeds the number of frames the
parser yields, for instance an xyz file with surplus blank lines between
frames whose surplus happens to be a multiple of the frame size, leaves
the trailing rows of the np.empty buffers uninitialised, and those rows
are passed straight to the kernels. The analyses then returned NaN or
arbitrary numbers, or aborted with a misleading zero-norm error, while
the command line tools still exited successfully and wrote the result to
the output file.

Both batch paths now compare the number of frames they received against
the expected one and raise MSDError or VACFError on a mismatch, so a
miscounted trajectory fails loudly instead of producing meaningless
diffusion coefficients or correlation functions.
The -n and --n-molecules aliases were passed to add_argument as a
single comma-joined string, so argparse registered one malformed
option. The help text advertised --n-molecules, but using it failed
with unrecognized arguments and only -n worked via prefix matching.
Splitting the aliases into separate option strings makes both work.
The --periodic option declared choices=[True, False, None] without a
type converter, so argparse compared the raw command-line string
against Python objects and rejected every value, including the ones
its own error message suggested. The option could therefore never
hold anything but its None default. A converter now maps the strings
True, False and None (case-insensitive) to the corresponding Python
values and reports a proper error for anything else.
The --progress option was registered with store_false, so passing
it disabled the progress bar although its help reads "Show progress
bar." It now uses BooleanOptionalAction: --progress shows the bar,
--no-progress hides it, and the default stays enabled.

The RDF module also copied config.with_progress_bar into its
namespace at import time, before the CLI parses arguments, so the
flag never reached the two tqdm loops in the analysis. It now reads
the config attribute at call time like msd, vacf and momentum do.
Cell built its box matrix without any validation, so a zero-length
box escaped as a raw numpy.linalg.LinAlgError from the inverse-matrix
setter, far from the offending input, and geometrically impossible
angle triples produced a NaN box matrix that silently corrupted
volumes, imaging and downstream analysis output. setup_box_matrix now
rejects non-positive box lengths, angles outside (0, 180) degrees and
angle triples whose box-matrix radicand is not positive, raising a
new CellError that names the offending values. Valid cells, including
the vacuum cell, are unaffected.
TrajectoryReader.read() unconditionally assigned its optional topology
argument to self.topology, so calling read() without an argument reset
the topology passed to the constructor back to None. As a consequence,
read_trajectory(file, topology=...) silently ignored the given topology
and rebuilt a guessed one from the file, replacing user-supplied atom
types and residue ids. read() now only overrides the stored topology
when one is explicitly given.
fix: resolve atomic numbers to the canonical element symbol
fix: detect short frame generators in the batch analysis paths
fix: validate box lengths and angles on Cell construction
fix: keep the constructor topology in TrajectoryReader.read
fix: make the progress flag match its help text
fix: register -n and --n-molecules as separate option strings
fix: parse xyz2gen --periodic values from the command line
The WORD terminal did not allow '/', so a value like
qm_script_full_path = /path/to/script; failed to parse, and
unbracketed comma-separated lists like inner_region_center = 0,3,6;
were not part of the grammar at all. continue_input died on both with
a lark UnexpectedCharacters error before writing any output.

WORD now accepts '/', and the PQ grammar accepts an unbracketed
comma-separated list of primitives as a value, transformed like a
bracketed array. The rule is limited to the PQ grammar so QMCFC
selector lists keep their string element type.

Fixes #216.
fix: parse paths and unbracketed lists in PQ input files
@github-actions

Copy link
Copy Markdown
Contributor

PYLINT REPORT

Your code has been rated at 9.78/10

Full report

Raw metrics

type number % previous difference
code 15718 45.61 NC NC
docstring 13105 38.03 NC NC
comment 465 1.35 NC NC
empty 5172 15.01 NC NC

Duplication

now previous difference
nb duplicated lines 0 NC NC
percent duplicated lines 0.000 NC NC

Messages by category

type number previous difference
convention 16 NC NC
refactor 136 NC NC
warning 17 NC NC
error 5 NC NC

% errors / warnings by module

module error warning refactor convention
PQAnalysis.type_checking 40.00 0.00 0.00 0.00
PQAnalysis.atomic_system.atomic_system 20.00 11.76 6.62 0.00
PQAnalysis.analysis.vibrational.vibrational_analysis 20.00 0.00 7.35 0.00
PQAnalysis 20.00 0.00 0.00 0.00
PQAnalysis.analysis.vacf._vacf_kernel_py 0.00 11.76 1.47 0.00
PQAnalysis.tools.traj_to_com_traj 0.00 11.76 0.00 0.00
PQAnalysis.io.traj_file._process_lines_py 0.00 11.76 0.00 0.00
PQAnalysis.io.moldescriptor_reader 0.00 11.76 0.00 0.00
PQAnalysis.tools.add_molecule 0.00 5.88 4.41 0.00
PQAnalysis.analysis.rdf._rdf_kernel_py 0.00 5.88 2.21 0.00
PQAnalysis.analysis.msd._msd_kernel_py 0.00 5.88 2.21 0.00
PQAnalysis.io.conversion_api 0.00 5.88 1.47 0.00
PQAnalysis.version 0.00 5.88 0.00 0.00
PQAnalysis.utils.custom_logging 0.00 5.88 0.00 0.00
PQAnalysis.io.write_api 0.00 5.88 0.00 0.00
PQAnalysis.io.restart_file.restart_writer 0.00 0.00 15.44 0.00
PQAnalysis.analysis.rdf.rdf 0.00 0.00 6.62 6.25
PQAnalysis.analysis.msd.msd 0.00 0.00 5.88 31.25
PQAnalysis.io.nep.nep_writer 0.00 0.00 5.15 6.25
PQAnalysis.analysis.vacf.vacf 0.00 0.00 4.41 12.50
PQAnalysis.io.traj_file._slab_parser_py 0.00 0.00 3.68 0.00
PQAnalysis.analysis.vacf.spectrum 0.00 0.00 3.68 0.00
PQAnalysis.io.traj_file.trajectory_reader 0.00 0.00 2.94 0.00
PQAnalysis.topology.bonded_topology.dihedral 0.00 0.00 2.21 0.00
PQAnalysis.core.residue 0.00 0.00 2.21 0.00
PQAnalysis.topology.bonded_topology.bonded_topology 0.00 0.00 1.47 0.00
PQAnalysis.topology.bonded_topology.bond 0.00 0.00 1.47 0.00
PQAnalysis.topology.bonded_topology.angle 0.00 0.00 1.47 0.00
PQAnalysis.io.traj_file.raw_frame_reader 0.00 0.00 1.47 0.00
PQAnalysis.core.cell.cell 0.00 0.00 1.47 0.00
PQAnalysis.atomic_system._standard_properties 0.00 0.00 1.47 0.00
PQAnalysis.analysis.vacf.api 0.00 0.00 1.47 0.00
PQAnalysis.analysis.spectrum_broadening.api 0.00 0.00 1.47 0.00
PQAnalysis.analysis.momentum.api 0.00 0.00 1.47 0.00
PQAnalysis.analysis.vibrational.vibrational_input_file_reader 0.00 0.00 0.74 6.25
PQAnalysis.traj.formats 0.00 0.00 0.74 0.00
PQAnalysis.topology.topology 0.00 0.00 0.74 0.00
PQAnalysis.topology.selection 0.00 0.00 0.74 0.00
PQAnalysis.io.traj_file.frame_reader 0.00 0.00 0.74 0.00
PQAnalysis.io.restart_file.restart_reader 0.00 0.00 0.74 0.00
PQAnalysis.io.input_file_reader.pq_analysis._parse 0.00 0.00 0.74 0.00
PQAnalysis.io.input_file_reader.pq.pq_input_file_reader 0.00 0.00 0.74 0.00
PQAnalysis.io.input_file_reader.input_file_parser 0.00 0.00 0.74 0.00
PQAnalysis.io.info_file_reader 0.00 0.00 0.74 0.00
PQAnalysis.io.formats 0.00 0.00 0.74 0.00
PQAnalysis.analysis.momentum.momentum 0.00 0.00 0.74 0.00
PQAnalysis.core.atom.element 0.00 0.00 0.00 18.75
PQAnalysis.analysis.vacf.vacf_input_file_reader 0.00 0.00 0.00 6.25
PQAnalysis.analysis.rdf.rdf_input_file_reader 0.00 0.00 0.00 6.25
PQAnalysis.analysis.msd.msd_input_file_reader 0.00 0.00 0.00 6.25

Messages

message id occurrences
too-many-positional-arguments 29
too-many-arguments 29
duplicate-code 21
too-many-locals 15
too-many-instance-attributes 13
invalid-name 13
too-complex 9
inconsistent-return-statements 8
fixme 7
too-many-branches 5
missing-type-doc 4
too-many-return-statements 3
too-many-lines 3
unused-import 2
too-many-statements 2
redefined-builtin 2
missing-kwoa 2
use-set-for-membership 1
unexpected-keyword-arg 1
too-many-public-methods 1
possibly-used-before-assignment 1
no-member 1
missing-param-doc 1
arguments-differ 1

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.72727% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.02%. Comparing base (570bb6c) to head (51e6daa).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...QAnalysis/analysis/momentum/_momentum_kernel_py.py 70.96% 9 Missing ⚠️
...lysis/vibrational/vibrational_input_file_reader.py 66.66% 2 Missing ⚠️
PQAnalysis/utils/custom_logging.py 90.00% 2 Missing ⚠️
PQAnalysis/__init__.py 0.00% 1 Missing ⚠️
PQAnalysis/_lazy_import.py 96.29% 1 Missing ⚠️
PQAnalysis/analysis/msd/msd.py 99.21% 1 Missing ⚠️
PQAnalysis/analysis/rdf/rdf.py 99.31% 1 Missing ⚠️
PQAnalysis/io/traj_file/_slab_parser_py.py 97.56% 1 Missing ⚠️
PQAnalysis/io/traj_file/raw_frame_reader.py 99.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #218      +/-   ##
==========================================
+ Coverage   93.32%   94.02%   +0.69%     
==========================================
  Files         175      177       +2     
  Lines        8588     9259     +671     
==========================================
+ Hits         8015     8706     +691     
+ Misses        573      553      -20     
Flag Coverage Δ
unittests 94.02% <97.72%> (+0.69%) ⬆️
Files with missing lines Coverage Δ
PQAnalysis/analysis/__init__.py 100.00% <100.00%> (ø)
PQAnalysis/analysis/momentum/momentum.py 100.00% <100.00%> (ø)
...s/analysis/momentum/momentum_output_file_writer.py 100.00% <100.00%> (ø)
PQAnalysis/analysis/msd/_msd_kernel_py.py 100.00% <ø> (ø)
PQAnalysis/analysis/rdf/_rdf_kernel_py.py 100.00% <100.00%> (ø)
PQAnalysis/analysis/vacf/_raw_charge_reader.py 100.00% <100.00%> (ø)
PQAnalysis/analysis/vacf/_vacf_kernel_py.py 100.00% <ø> (ø)
PQAnalysis/analysis/vacf/vacf.py 99.59% <100.00%> (-0.41%) ⬇️
...lysis/analysis/vibrational/vibrational_analysis.py 100.00% <100.00%> (ø)
PQAnalysis/cli/_argument_parser.py 98.21% <100.00%> (+0.10%) ⬆️
... and 31 more

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@galjos
galjos merged commit 71d4c39 into main Aug 31, 2026
9 checks passed
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.

1 participant