Skip to content

api-docs/chemistry: add Doxygen documentation to chemistry and restraints headers - #420

Merged
wojdyr merged 16 commits into
project-gemmi:masterfrom
CV-GPhL:api-docs/chemistry
Apr 23, 2026
Merged

wojdyr merged 16 commits into
project-gemmi:masterfrom
CV-GPhL:api-docs/chemistry

Conversation

@CV-GPhL

@CV-GPhL CV-GPhL commented Apr 23, 2026

Copy link
Copy Markdown
Member

Summary

Adds Doxygen /// triple-slash API documentation to 9 headers covering
chemical components, the monomer library, restraint topology, hydrogen
placement, link hunting, and related I/O helpers.

Headers documented:

Header Purpose
chemcomp.hpp Chemical component definitions (BondType, ChiralityType, Restraints, ChemComp)
chemcomp_xyz.hpp Geometry generation and refinement from restraints
ener_lib.hpp EnerLib energy library data (atom types, bond lengths)
monlib.hpp Monomer library: ChemLink, ChemMod, MonLib
topo.hpp Restraint topology applied to a model (Topo, ResInfo, ChainInfo, …)
riding_h.hpp Riding hydrogen placement
linkhunt.hpp Inter-residue link search (LinkHunt)
to_chemcomp.hpp Serialise ChemComp to CIF block
mmcif_impl.hpp Shared mmCIF/refln helpers

docs/api.rst: new Chemistry and Restraints section registers all 9 headers.

Part of the incremental API documentation series (#413#419 preceding PRs).

Test plan

  • CI docs-build job (Doxygen + Sphinx/Breathe) passes
  • No C++ compilation errors (GEMMI_DLL macros preserved throughout)
  • New RST section renders correctly in the HTML docs

🤖 Generated with Claude Code

C. Vonrhein and others added 16 commits April 22, 2026 23:22
Wires up Doxygen XML generation + Breathe Sphinx extension so that
C++ API documentation from header comments renders in the existing
Sphinx/readthedocs site at docs/api.rst.

- docs/Doxyfile: Doxygen config (XML-only output, internal headers excluded)
- docs/conf.py: runs Doxygen as subprocess, adds breathe extension
- docs/api.rst: stub C++ API reference page (expanded by subsequent PRs)
- docs/index.rst: replace external cxx-api link with internal api.rst
- docs/requirements.txt: add breathe >= 4.35
- .readthedocs.yaml: add apt_packages: [doxygen]
- .gitignore: exclude docs/_doxygen/ (generated)

Builds on prior work in project-gemmi#402 (Paul Emsley / pemsley).
Co-authored-by: C. Vonrhein / CV-GPhL
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add comprehensive /// comments to all public enums, structs, nested types,
and functions in chemcomp.hpp, including:
- BondType and ChiralityType enums with value descriptions
- Restraints struct with nested AtomId, Bond, Angle, Torsion, Chirality, Plane types
- All Restraints methods for finding and managing bond, angle, torsion, chirality,
  and planarity restraints
- ChemComp struct with Group enum, Atom and Aliasing nested types
- ChemComp atom lookup and manipulation methods
- Standalone utility functions for bond/chirality type conversion
- make_chemcomp_from_block CIF parser

All documentation follows Doxygen conventions with @brief, @PARAM, @return, @tparam,
@throws tags as appropriate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Enhance /// comments for the two main functions:
- generate_chemcomp_xyz_from_restraints: Detailed description of idealized
  coordinate generation from bond/angle/torsion restraints
- refine_chemcomp_xyz: Levenberg-Marquardt refinement against restraints

Add @brief, @PARAM, @return tags with parameter descriptions and
implementation notes about coordinate initialization and optimization.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- find_shortest_path @return: path goes from a to b, not b to a
- get_from const overload: rename alt2 -> altloc2 to match non-const signature

Co-authored-by: C. Vonrhein / CV-GPhL
Add comprehensive Doxygen documentation for EnerLib struct and its nested
components including RadiusType enum, Atom and Bond structs, along with
free function operators. Follows Gemmi documentation standards.

Co-authored-by: C. Vonrhein / CV-GPhL
Add comprehensive Doxygen documentation for MonLib, ChemLink, ChemMod structs
and all their nested types, along with free functions. Document all data members,
methods, and parameters. Mark deprecated read_monomer_lib free function with
@deprecated tag. Follows Gemmi documentation standards.

Co-authored-by: C. Vonrhein / CV-GPhL
Add comprehensive Doxygen triple-slash comments documenting:
- HydrogenChange enum with all 6 enumerators
- Topo struct and internal pointer constraints
- Bond, Angle, Torsion, Chirality, and Plane restraint structs
- RKind enum and Rule struct
- Link and Mod structs with all members
- FinalChemComp and ResInfo structs
- ChainInfo struct with group_end() method
- has_atom() template
- All Topo data members and indices
- Helper methods (find_resinfo, take_bond, take_angle, etc.)
- Public methods with @note for pointer stability constraints
- Free functions (prepare_topology, make_chemcomp_with_restraints, find_missing_atoms)

Co-authored-by: C. Vonrhein / CV-GPhL
Co-authored-by: C. Vonrhein / CV-GPhL
Co-authored-by: C. Vonrhein / CV-GPhL
Co-authored-by: C. Vonrhein / CV-GPhL
Co-authored-by: C. Vonrhein / CV-GPhL
Registers all 9 headers documented in api-docs/chemistry:
chemcomp.hpp, chemcomp_xyz.hpp, ener_lib.hpp, monlib.hpp, topo.hpp,
riding_h.hpp, linkhunt.hpp, to_chemcomp.hpp, mmcif_impl.hpp.

Co-authored-by: C. Vonrhein / CV-GPhL
conf.py runs Doxygen when available (which it is on VS2022 workers)
and conditionally loads breathe when the XML output dir exists.
Without breathe installed, the Sphinx build fails with an ImportError.

Co-authored-by: C. Vonrhein / CV-GPhL
@wojdyr
wojdyr merged commit a662cff into project-gemmi:master Apr 23, 2026
8 of 10 checks passed
@CV-GPhL
CV-GPhL deleted the api-docs/chemistry branch July 28, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants