Contributing
Thank you for your interest in contributing to the QMCPy package!
Please submit pull requests to the develop branch and issues using a template from .github/ISSUE_TEMPLATE/
If you develop a new component please consider writing a blog for qmcpy.org
Join team communications by reaching out to us at qmc-software@googlegroups.com
Installation
In a git enabled terminal (e.g. bash for Windows) with miniconda installed and C compilers enabled (Windows users may need to install Microsoft C++ Build Tools), run
git clone https://github.com/QMCSoftware/QMCSoftware.git
cd QMCSoftware
git checkout develop
conda create --name qmcpy python=3.12
conda activate qmcpy
pip install -e .[dev]
While dev contains the most complete set of install dependencies, a number of other install dependency groups can be found in our pyproject.toml file. If running in the zsh terminal you may need to use
📚 Using qmcpy in courses (class extra)
qmcpy provides a class optional dependency group that installs a
complete teaching environment (JupyterLab, plotting, statistics, and utilities)
in addition to qmcpy itself.
For a typical course setup, you can do:
or for a heavy-duty version
Tests
Doctests and unittests take a few minute to run with
Optionally, you may install Docker and then run all tests with
Please see the targets in the makefile for more granular control over tests.
Documentation
This installs the documentation extras, including pylint.
Ensure pyreverse is on your PATH
pyreverse must be available as a command-line tool. If it is not, verify your PATH as below.
- MacOS / Linux
conda activate qmcpy
# check that pyreverse is found
which pyreverse || echo "pyreverse not found"
pyreverse --help
Alternative:
# add user scripts dir to PATH (zsh example; use ~/.bashrc for bash)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
# preferred: open a new terminal so the new PATH is picked up
source ~/.zshrc
- Windows (cmd or PowerShell)
If where pyreverse cannot find the command, ensure your Python Scripts directory is on your PATH. A common way to locate it is:
You can update PATH via System settings or in your PowerShell profile ($PROFILE).
Build the documentation
On MacOS / Linux (and on Windows via Git Bash, WSL, or any environment with make):
Download PDF documentation
In the built HTML documentation:
- Navigate to the “Printable Docs” section.
- Use your browser’s print dialog:
- Windows / Linux:
Ctrl+P - MacOS:
Cmd+P - Choose “Save as PDF” and save to your preferred location.
Demos
Demos are Jupyter notebooks which may be launched using the command
Other Developer Tools
The Developers Tools page on qmcpy.org documents additional tools we have found helpful for mathematical software development and presentation.
VSCode Tips
VSCode (Visual Studio Code) is the IDE of choice for many of our developers. Here we compile some helpful notes regarding additional setup for VSCode.
- Run
CMD+pthen> Python: Select Interpreterthen select the('qmcpy')choice from the dropdown to link the qmcpy environment into your workspace. Now when you open a terminal, your command line should read(qmcpy) username@...which indicates the qmcpy environment has been automatically activated. Also, when debugging the qmcpy environment will be automatically used. - Go to
Fileand clickSave Workspace as...to save aqmcpyworkspace for future development.
Some VSCode extensions we found useful include
- Python
- Jupyter
- Markdown Preview Enhanced
- eps-preview, which requires
- Postscript Language
- pdf2svg
- Git Graph
- Code Spell Checker