Overhaul documentation and modernise tqdm usage#13
Merged
Conversation
Rewrite Sphinx docs with narrative pages (getting started, core concepts, guides for recipes, symmetry measures, neighbour analysis, and trajectories), a grouped API reference, and citing/changelog pages. Replace auto-generated module stubs and example notebooks. Modernise Sphinx config: myst-parser, intersphinx, autodoc type hints. Fill ~30 missing docstrings across the codebase. Switch from tqdm/tqdm.notebook to tqdm.auto for automatic terminal/Jupyter detection. Simplify progress parameter from bool | str to bool (breaking change). Bump version to 0.6.0.
3513e30 to
9354cb2
Compare
Review fixes: - Add runtime TypeError guard for progress parameter with migration hint - Fix face_sharing_neighbour_list() example missing required labels argument - Correct projection_xyz docstring return range (minimum is -0.5, not -1.0) - Wrap N! in double backticks to match |G| formatting Pre-existing fixes: - Fix Trajectory.extend() to extend both structures and configurations - Remove dead offset parameter from Trajectory.extend() - Rename SymmetryMeasure.string to SymmetryMeasure.name - Standardise parameter ordering on from_xdatcar() to match from_structures()
There was a problem hiding this comment.
Pull request overview
Modernizes the documentation site and progress-bar handling, while aligning public APIs with the new tqdm.auto approach and updating versioning to reflect breaking changes.
Changes:
- Replaced legacy Sphinx stub pages/notebook-driven docs with narrative guides + a grouped single-page API reference.
- Migrated progress bars from
tqdm/tqdm.notebooktotqdm.autoand removed theprogress="notebook"option (bool-only). - Renamed
SymmetryMeasure.stringtoSymmetryMeasure.name, fixedTrajectory.extend()structure/config sync, and bumped version to 0.6.0.
Reviewed changes
Copilot reviewed 40 out of 41 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_trajectory.py | Adds regression coverage ensuring extend() keeps structures/configurations in sync. |
| tests/test_symmetry_measure.py | Updates tests for SymmetryMeasure.name rename. |
| pyproject.toml | Bumps project version to 0.6.0. |
| polyhedral_analysis/utils.py | Replaces placeholder docstring for prune_neighbour_list() with real documentation. |
| polyhedral_analysis/trajectory.py | Switches to tqdm.auto, removes string-based progress mode, fixes extend() sync, updates docstrings/API. |
| polyhedral_analysis/symmetry_measure.py | Renames string → name, adds/expands docstrings. |
| polyhedral_analysis/rotation_analyser.py | Improves docstring formatting for mathematical expressions. |
| polyhedral_analysis/polyhedra_recipe.py | Adds docstrings to recipe helpers and polyhedra construction functions. |
| polyhedral_analysis/orientation_parameters.py | Adds docstring for projection_xyz(). |
| polyhedral_analysis/octahedral_analysis.py | Fixes docstring markup formatting. |
| polyhedral_analysis/csm.py | Streamlines SymmetryMeasureResult docs using field comments. |
| polyhedral_analysis/coordination_polyhedron.py | Adds extensive docstrings across core API/properties. |
| docs/source/reference/citing.rst | Adds citation guidance page. |
| docs/source/reference/changelog.rst | Adds changelog page including CHANGELOG.md. |
| docs/source/reference/api.rst | Adds grouped API reference page. |
| docs/source/polyhedral_analysis.utils.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.trajectory.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.symmetry_measure.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.rst | Removes old package index stub page. |
| docs/source/polyhedral_analysis.rotation_analyser.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.polyhedron_trajectory.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.polyhedra_recipe.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.orientation_parameters.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.octahedral_analysis.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.coordination_polyhedron.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.configuration.rst | Removes old auto-generated module stub page. |
| docs/source/polyhedral_analysis.atom.rst | Removes old auto-generated module stub page. |
| docs/source/modules.rst | Removes old modules toctree entrypoint. |
| docs/source/index.rst | Replaces default index with narrative landing page and new toctree structure. |
| docs/source/guides/trajectories.rst | Adds trajectory guide (loading/progress/parallelism/combining). |
| docs/source/guides/symmetry-measures.rst | Adds continuous symmetry measures guide. |
| docs/source/guides/recipes.rst | Adds recipe definition guide with examples. |
| docs/source/guides/neighbour-analysis.rst | Adds neighbour analysis guide. |
| docs/source/getting-started.rst | Adds installation + quick start guide. |
| docs/source/core-concepts.rst | Adds core concepts overview and class relationships. |
| docs/source/conf.py | Modernizes Sphinx config (myst-parser, intersphinx, typehints in description). |
| docs/source/_static/config_0000.poscar | Adds static example POSCAR used in documentation/examples. |
| docs/requirements.txt | Updates doc build dependencies (drops recommonmark/nbsphinx, adds myst-parser, bumps Sphinx). |
| CHANGELOG.md | Documents 0.6.0 breaking changes/bug fixes/docs overhaul. |
Comments suppressed due to low confidence (2)
polyhedral_analysis/trajectory.py:126
Trajectory.__add__returns a new Trajectory but reuses the sameStructure/Configurationobjects (shallow concatenation). This is inconsistent withextend(), which deep-copies configurations to avoid shared mutable state, and can lead to surprising aliasing when mutating configurations in the summed trajectory. Consider deep-copying here as well, or explicitly documenting that+is a shallow concat.
polyhedral_analysis/trajectory.py:38Trajectory.__init__doesn’t validate thatstructuresandconfigurationshave the same length. Since the class assumes 1:1 correspondence (and__len__is based onstructures), mismatched inputs can silently create out-of-sync trajectories. Consider raisingValueErrorwhenlen(structures) != len(configurations).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove unused verbose parameter from all Trajectory factory methods. - Fix projection_xyz docstring: minimum is -1/3 (along [1,1,1]), not -0.5. - Remove trailing whitespace in test_symmetry_measure.py.
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.
Summary
myst-parserreplaces deprecatedrecommonmark, addedintersphinxcross-references to pymatgen/numpy/scipy/matplotlib, type hints rendered in descriptions.tqdm/tqdm.notebooktotqdm.autofor automatic terminal/Jupyter detection. Theprogressparameter onTrajectory.from_structures(),from_xdatcar(), andfrom_xdatcars()is nowboolonly ("notebook"option removed) with a runtimeTypeErrorguard — breaking change.Trajectory.extend(): now extends both structures and configurations (previously only configurations), and removed deadoffsetparameter.SymmetryMeasure.stringtoSymmetryMeasure.name.(verbose, ncores, progress)parameter ordering across allTrajectoryfactory methods.