Skip to content

docs: modernize documentation structure - #167

Open
galjos wants to merge 31 commits into
devfrom
agent/modernize-docs
Open

docs: modernize documentation structure#167
galjos wants to merge 31 commits into
devfrom
agent/modernize-docs

Conversation

@galjos

@galjos galjos commented Aug 7, 2026

Copy link
Copy Markdown
Member

Scope

  • reorganize the manual around getting started, analyses, data, CLI reference, Python functions and development
  • add focused RDF, MSD, VACF, vibration and momentum guides; each is a short usage page (definition, input, output, Python recipe, checklist) with a nested "Theory and Validity" page
  • document the Python analysis API with worked recipes
  • add a checkout-only water fixture (examples/water), an atom-selection page and a load-RDF-MSD-plot workflow
  • document package architecture, analysis extensions, validation and releases
  • adopt the shared Furo layout and logo treatment used by the other MolarVerse projects; tables and captions left-aligned with the text column
  • replace the legacy Pages job with strict pull-request builds and GitHub Pages deployment actions

Library change (separate commit, feat:)

Filenames inside an analysis input file (traj_files, out_file, restart_file, hessian_file, ...) and glob patterns now resolve against the directory of the input file instead of the working directory. pqanalysis rdf examples/water/rdf.in and rdf("examples/water/rdf.in") therefore work from the repository root and write next to the input file. Absolute paths and --export / export_files are unchanged; an input file in the working directory behaves exactly as before. Covered by new reader, RDF-inference and end-to-end tests.

This is a behaviour change for anyone who runs pqanalysis rdf subdir/rdf.in with data paths written relative to the shell's working directory.

Rebased onto current dev

  • resolved userGuide / developerGuide conflicts by keeping the task-oriented redirect and modern development guide
  • RDF: vacuum trajectories are rejected; legacy bin count uses half the shortest box edge; float32 delta_r note restored
  • restored performance-validation rules for compiled fast paths

Cleanup after review

Test plan

  • python -m sphinx -W -b html docs/source docs/build/html
  • every console and python block in the user-facing pages extracted and executed: 12 CLI commands from examples/water, 9 page sessions as scripts, 26 cells as a Jupyter notebook (inline figure renders)
  • python -m pytest tests (1056 passed)
  • CI docs workflow green

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.33%. Comparing base (61bb2ef) to head (e916ae8).

Files with missing lines Patch % Lines
PQAnalysis/analysis/rdf/rdf_input_file_reader.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #167      +/-   ##
==========================================
- Coverage   96.34%   96.33%   -0.01%     
==========================================
  Files         177      177              
  Lines        9374     9393      +19     
==========================================
+ Hits         9031     9049      +18     
- Misses        343      344       +1     
Flag Coverage Δ
unittests 96.33% <97.43%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
PQAnalysis/analysis/msd/msd_input_file_reader.py 100.00% <ø> (ø)
PQAnalysis/analysis/vacf/vacf_input_file_reader.py 100.00% <100.00%> (ø)
...lysis/vibrational/vibrational_input_file_reader.py 98.23% <100.00%> (ø)
...Analysis/io/input_file_reader/input_file_parser.py 98.63% <100.00%> (+0.03%) ⬆️
...is/io/input_file_reader/pq_analysis/_file_mixin.py 100.00% <100.00%> (ø)
...reader/pq_analysis/pqanalysis_input_file_reader.py 100.00% <100.00%> (ø)
PQAnalysis/io/restart_file/api.py 100.00% <ø> (ø)
PQAnalysis/analysis/rdf/rdf_input_file_reader.py 98.82% <87.50%> (-1.18%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@galjos
galjos marked this pull request as ready for review August 7, 2026 11:00
@galjos
galjos marked this pull request as draft August 7, 2026 11:01

@galjos galjos left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Large docs draft — leaving a full pass for later. Scope and validation notes in the PR body look solid; merge after the small fix batch if still current vs dev.

Address the review of the documentation draft:

- add a configure-pages step with enablement so the first Pages deploy
  switches the repository source to GitHub Actions instead of failing
  against the legacy gh-pages setting
- set sitemap_url_scheme to the plain link so the sitemap matches the
  flat deployed site instead of 404ing on language/version prefixes
- correct the build_nep_traj description (Neuroevolution Potential
  training data, not nudged elastic band)
- stop tracking the generated docs/source/code pages and ignore them
  together with docs/build, so local docs builds no longer dirty the
  working tree; drop the stale docs/autodoc.sh that conflicted with
  the better-apidoc build
- clarify that only conversion/support tools accept --mode o; the
  input-file analyses have no overwrite flag
- remove the orphaned reference/index.rst page and the unused breathe
  docs dependency; include momentum in the Cython-kernel list; ignore
  the generated momentum kernel source
Add a small local Sphinx extension with a pq-cli-table directive that
renders the command tables of the command-line reference and validates
them at build time: every listed name must exist in the pqanalysis
command registry, and after reading all pages every registered command
must be documented exactly once (prose-documented commands are marked
with pq-cli-covered). A renamed, removed or newly added command now
fails the strict documentation build instead of silently drifting out
of the reference tables. The purpose texts stay editorial.
The command-table extension scraped the attributes of the dispatcher
module. During the documentation build the api-doc generator imports
the package at the same time, so the dispatcher could be observed
half-initialized and the extension then saw no commands at all and
rejected every documented one. The strict build failed on CI while
passing locally, because the outcome depended on import order.

Read the dispatch table from the module source with ast instead and
import only the individual command modules, which have no import cycle
with the dispatcher. Raise immediately if the table cannot be read, so
an unreadable registry can no longer look like an empty one.
The dispatcher now keeps a lazy table that maps every command name to
its module, class and description, so the command tables of the
reference can be validated by reading that table alone. Parse it from
the module source and drop the import of the individual command
modules: the extension no longer depends on import order or on the
package being importable at all, and a table it cannot read is
reported instead of silently looking empty.
The analysis pages described what the software computes but not where
the methods come from or when their results can be trusted.

- add a references page with the primary sources for every implemented
  estimator, and cite them from the analysis pages where the quantity is
  defined; state that the project has no citable DOI of its own yet
- give the vibrational analysis its mathematics: the mass-weighted
  Hessian and its eigenproblem, the wavenumber conversion with its unit
  chain, the automatic sign heuristic, force constants, reduced masses
  and infrared intensities, each matching the implementation
- describe the linear momentum as a drift diagnostic and state the
  precision floor below which a reported norm is parsing noise
- add validity and interpretation sections to the radial distribution,
  mean square displacement and velocity autocorrelation pages: the
  minimum-image limit on r_max, the diffusive regime and fit window, the
  frequency resolution and Nyquist limit, and that no finite-size
  correction of the diffusion coefficient is applied
Vacuum trajectories are rejected, legacy RDF binning uses half the
shortest box edge, analysis objects are single-use, and the developer
guide keeps the performance-validation rules from dev.
@galjos
galjos force-pushed the agent/modernize-docs branch from 289a3f4 to f0ebda3 Compare September 6, 2026 08:58
Add a Learn the Python API page for file wrappers, in-memory objects and
tables, and put a short Python recipe on every method guide and getting
started.
Ship a 25-frame isolated water molecule plus Hessian so CLI and Python
recipes in the manual can be copy-pasted from a clone.
Give the Lark string grammar a user-facing page with the water fixture
as the worked example, including Python Selection.select.
Run the bundled water fixture from trajectory inspect through RDF and
MSD, and render the figure in the Sphinx build so API drift fails CI.
CLI and Python snippets now use examples/water. Vibrational analysis
shows a runnable input before the Hessian algebra.
The path is not on dev yet, so linkcheck 404s. The clone instructions
are enough.
Selection precedence text contradicted the parser (#185) and the list
example raised PQTypeError. Vibrations described the inertia tensor of
uncentered coordinates; the code centers first. Drop the bit-for-bit
claim over a truncated excerpt and three comments that no longer hold.
The rdf()/read_analysis_table snippet lived on five pages; keep it on
getting-started and python-api. Drop the three sentences stamped onto
every method page, fold the RDF interpretation bullets into the validity
section, and state the fixture disclaimer once per page.
Parenthetical em dashes become commas or parentheses, the momentum and
vibration caveat lists become definition lists, the method index on the
Python page becomes a table, and plot labels use mathtext throughout.
Each analysis page now holds the estimator, input, output, Python recipe
and a short checklist. Derivations, legacy-path notes and validity
discussion move to a nested <method>-details page. Momentum stays a
single page with the recipe moved up.
Tested all console and python blocks in the user-facing pages, as scripts
and as notebook cells. Fixes:

- getting-started: the --export rerun collided with rdf.dat from the
  previous step; convert the existing table first, rm before rerunning.
- File wrappers (rdf(), msd(), vacf(), vibrations()) resolve input-file
  paths against the working directory, so calling them from the repo
  root with examples/water/rdf.in failed. Use contextlib.chdir in
  python-api, reload the table in getting-started, and show only the
  direct calculate() route on the vibrations page.
- workflow: add copyable Matplotlib code; the plot directive alone left
  the reader without the plotting step.
- analysisOutputFiles: second convert example no longer rewrites rdf.csv.
Filenames written in a PQAnalysis input file (traj_files, out_file,
log_file, restart_file, moldescriptor_file, charge_file(s), spectrum_file,
windowed_out_file, structure_file, hessian_file, normal_modes_file,
modes_file, modes_prefix) now resolve against the directory containing
the input file instead of the working directory. Glob patterns expand in
that directory too. Absolute paths and command-line/API arguments such as
--export / export_files are unchanged.

pqanalysis rdf examples/water/rdf.in and rdf("examples/water/rdf.in")
therefore work from the repository root and write next to the input file.
For an input file in the working directory nothing changes.

The RDF companion-file inference derives its candidates from the raw
trajectory name so the inferred values are resolved exactly once.

Docs drop the contextlib.chdir workaround and describe the rule in the
input-file guide.
Furo centers table captions and Sphinx centers tables narrower than the
text column; browsers center th. Tables now sit on the text margin with
the caption above, left-aligned, in the same secondary style as figure
captions, and all cells left-aligned and top-anchored. The CLI table
directive no longer requires a title; the three captions that repeated
the heading above them are dropped.
@galjos
galjos marked this pull request as ready for review September 6, 2026 21:27
@galjos
galjos requested a review from 97gamjak September 6, 2026 21:27
Every table sits under a heading or an introducing sentence that already
names it. The Required/Optional keys tables in the input-reader docstrings
keep their captions, which distinguish the two adjacent tables.
No block relies on a caption any more: each table and code block follows
a heading or a sentence that names it. The three VACF output tables get
their own file-name subheadings; the method pages say which file the
input block is saved as; the input-reader docstrings introduce the
required and optional key tables in prose instead of captions.
The sentence before each plot now carries what the caption said (analytic
schematic vs. fixture data, window parameters, mode cut-off). The figures
themselves have labelled axes and legends. Removes the now unused
figcaption style.
Naming both topology files enables no_intra_molecular by itself; the RDF
pages said it was only ever explicit. hessian_sign accepts 1 and -1 in input
files too, not only from Python. The vibrations column order is force
constant then reduced mass. fit_window defaults to max(2, window // 5).
Momentum lists three precision paths, not two. data/index.rst still described
filenames resolving against the working directory.

Removes the --export block duplicated on the landing page, two sentences
repeated within the vibrations and RDF details pages, and filler
("simply", "This means that", "fully", "continue to work").
The pq-cli-table :title: option and the table caption CSS had no remaining
users after the caption removal. conf.py imported __version__ behind a guard
that could not save a build in which the extension and plot scripts import
the package unguarded. The reader built the glob root with os.path beside a
pathlib base_dir; both now come from base_dir. The VACF plot legend is
formatted from the window parameter instead of repeating its value.
@github-actions

github-actions Bot commented Sep 6, 2026

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 16006 45.73 NC NC
docstring 13282 37.95 NC NC
comment 470 1.34 NC NC
empty 5245 14.98 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 143 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.29 0.00
PQAnalysis.analysis.vibrational.vibrational_analysis 20.00 0.00 6.99 0.00
PQAnalysis 20.00 0.00 0.00 0.00
PQAnalysis.analysis.vacf._vacf_kernel_py 0.00 11.76 1.40 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.20 0.00
PQAnalysis.analysis.rdf._rdf_kernel_py 0.00 5.88 2.10 0.00
PQAnalysis.analysis.msd._msd_kernel_py 0.00 5.88 2.10 0.00
PQAnalysis.io.conversion_api 0.00 5.88 1.40 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.cli.build_spectrum 0.00 0.00 18.18 0.00
PQAnalysis.analysis.rdf.rdf 0.00 0.00 6.99 6.25
PQAnalysis.analysis.msd.msd 0.00 0.00 5.59 31.25
PQAnalysis.io.nep.nep_writer 0.00 0.00 5.59 6.25
PQAnalysis.analysis.vacf.vacf 0.00 0.00 4.20 12.50
PQAnalysis.io.traj_file._slab_parser_py 0.00 0.00 3.50 0.00
PQAnalysis.analysis.vacf.spectrum 0.00 0.00 3.50 0.00
PQAnalysis.io.traj_file.trajectory_reader 0.00 0.00 2.80 0.00
PQAnalysis.topology.bonded_topology.dihedral 0.00 0.00 2.10 0.00
PQAnalysis.core.residue 0.00 0.00 2.10 0.00
PQAnalysis.topology.bonded_topology.bonded_topology 0.00 0.00 1.40 0.00
PQAnalysis.topology.bonded_topology.bond 0.00 0.00 1.40 0.00
PQAnalysis.topology.bonded_topology.angle 0.00 0.00 1.40 0.00
PQAnalysis.io.traj_file.raw_frame_reader 0.00 0.00 1.40 0.00
PQAnalysis.core.cell.cell 0.00 0.00 1.40 0.00
PQAnalysis.atomic_system._standard_properties 0.00 0.00 1.40 0.00
PQAnalysis.analysis.vacf.api 0.00 0.00 1.40 0.00
PQAnalysis.analysis.spectrum_broadening.api 0.00 0.00 1.40 0.00
PQAnalysis.analysis.momentum.api 0.00 0.00 1.40 0.00
PQAnalysis.analysis.vibrational.vibrational_input_file_reader 0.00 0.00 0.70 6.25
PQAnalysis.traj.formats 0.00 0.00 0.70 0.00
PQAnalysis.topology.topology 0.00 0.00 0.70 0.00
PQAnalysis.topology.selection 0.00 0.00 0.70 0.00
PQAnalysis.io.traj_file.frame_reader 0.00 0.00 0.70 0.00
PQAnalysis.io.restart_file.restart_reader 0.00 0.00 0.70 0.00
PQAnalysis.io.input_file_reader.pq_analysis._parse 0.00 0.00 0.70 0.00
PQAnalysis.io.input_file_reader.pq.pq_input_file_reader 0.00 0.00 0.70 0.00
PQAnalysis.io.input_file_reader.input_file_parser 0.00 0.00 0.70 0.00
PQAnalysis.io.info_file_reader 0.00 0.00 0.70 0.00
PQAnalysis.io.formats 0.00 0.00 0.70 0.00
PQAnalysis.analysis.momentum.momentum 0.00 0.00 0.70 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 26
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
too-many-statements 4
missing-type-doc 4
too-many-return-statements 3
too-many-lines 3
unused-import 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

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