Developer Guide¶
This guide addresses contributors and library developers working on MolPy as a research software library. It is organized around what you came here to do:
- Fix a bug or land a first PR → Development Setup, then Contributing Workflow and Testing
- Add an analysis operation, file format, or tool integration → the plug-in recipes under Extending MolPy; no core changes required
- Change typification, the data model, or force-field internals → read the Architecture Overview first, open a GitHub issue to discuss, then follow Extending Typifiers, Extending the Data Model, or Extending the Force Field
- Understand how MolPy is put together → Architecture Overview and molrs Backend
- Cut a release → Release Process
Canonical field names and topology keys live in the Naming Conventions appendix of the Tutorials.
Contributing¶
Day-to-day development practices:
- Development Setup — repository cloning, editable installation, building molrs from source, and test execution
- Contributing Workflow — the pull request workflow, commit message conventions, and the pre-commit hook suite
- Coding Style — identifier style, formatting requirements, and the mutation contract
- Testing — pytest conventions, test markers, coverage requirements, and the distinction between local and external tests
- Release Process — the shared molpy/molrs minor line and CI-driven package publication
- Third-Party Attributions — licenses of ported code and bundled parameter data
Architecture¶
The design context that the extension recipes assume:
- Architecture Overview — module responsibilities, the graph and tabular layers, the formatter hierarchy, the mutation contract, and the build-loop performance model
- molrs Backend — how the Rust column store and compute kernels surface in Python: boxes, neighbor lists, RDF, and the analysis catalog
Extending MolPy¶
Ordered from plug-in interfaces (implement a subclass, register a handler) to core internals (discuss in a GitHub issue before implementation):
- Adding a Compute Operation — the
Computeprotocol for reusable analysis operations - Adding an I/O Format — reader and writer base classes and the
FieldFormattercanonicalization interface - Adding a Wrapper or Adapter — subprocess wrapper conventions and in-memory adapter patterns
- Extending Typifiers — graph-in, graph-out typifier contracts,
typify_*naming, matcher boundaries, and the CL&P overlay plan - Extending the Data Model — new
EntityandLinksubtypes, customStructsubclasses, and identity-hashing invariants - Extending the Force Field — molrs kernels, named
Styleclasses, and export formatter registration
Issue Tracking and Discussion¶
- Bug reports and feature requests: https://github.com/MolCrafts/molpy/issues
- Design discussions: https://github.com/MolCrafts/molpy/discussions
- Agent-assisted development: the MCP Suite exposes MolPy's symbol index to LLM agents