Skip to content
Christopher Lee edited this page Jan 26, 2024 · 2 revisions

Welcome to the Mem3DG wiki!

Development Notes

Versioning

Versions should follow semantic versions. More specifically, we follow python version specifiers. Versions are derived from git version control metadata using setuptools_scm. Macros.cmake contains logic mimicking setuptools_scm algorithm for computing the version.

Formatting of commit messages

Commit messages should follow the guidelines from conventional commits. In short, the commit message should have the following structure:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

The type of the commit should be feat:, fix:, docs:, style:, refactor:, perf:, test:, build:, ci:, chore:, reverts: depending on the content of the commit. Currently the scope is optional. The short description should be imperative. Additional details about the commit should be supplied in the body. The footer contains contents about BREAKING CHANGE: and other useful details like commit signing etc.

Pre-commit checks

We use a set of pre-commit checks to ensure that commits conform to code formatting, spelling, and other standards. The current set of checks can always be seen in the .pre-commit-config.yaml configuration.

We use clang-format to format C++ code, black to format Python code, and cmake-format to format CMake code.

Mypy stubs and pymem3dg

Changes to the pure python components of pymem3dg should have type hints and documentation included inline with the code. You can learn more about python typing syntax here. The majority of the routines for running simulations are included in pymem3dg._core and imported into the pymem3dg root module namespace by __init__.py. Since pymem3dg._core is compiled interoperability code which uses pybind11, stubs should be generated using stubgen so type hints can be fully supported for end users.

Pull requests, continuous integration, and deployments

Pull requests going to main and development branches must pass continuous integration tests. CI will build the code and run tests present for both the C++ mem3dg library and pymem3dg.

For tagged versions, if CI tests pass, the documentation will be compiled and automatically deployed to gh-pages branch. Furthermore, a source distribution is uploaded to PyPI.