Contributing to pymicrostructure

First off, thank you for considering contributing to pymicrostructure! It’s people like you that make pymicrostructure such a great tool for financial market simulations.

Table of Contents

  1. Code of Conduct

  2. Getting Started

  3. How Can I Contribute?

  4. Style Guidelines

  5. Commit Messages

  6. Pull Requests

  7. Testing

  8. Documentation

Code of Conduct

This project and everyone participating in it is governed by the pymicrostructure Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to me directly.

Getting Started

  1. Fork the repository on GitHub.

  2. Clone your fork locally: git clone https://github.com/BBieganowski/pymicrostructure.git

  3. Create a new branch for your feature or bug fix: git checkout -b your-branch-name

  4. Make your changes and commit them with a clear commit message.

  5. Push your changes to your fork on GitHub.

  6. Submit a pull request to the main repository.

How Can I Contribute?

Reporting Bugs

  • Ensure the bug was not already reported by searching on GitHub under Issues.

  • If you’re unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.

Suggesting Enhancements

  • Open a new issue with a clear title and detailed description of the proposed enhancement.

  • Explain why this enhancement would be useful to most pymicrostructure users.

Pull Requests

  • Fill in the required template

  • Do not include issue numbers in the PR title

  • Include screenshots and animated GIFs in your pull request whenever possible.

Style Guidelines

Python Style Guide

pymicrostructure follows the PEP 8 style guide for Python code. Additionally:

  • Use docstrings for all public classes, methods, and functions.

  • Keep line length to a maximum of 88 characters.

  • Use type hints for function arguments and return values.

Documentation Style Guide

Commit Messages

  • Use the present tense (“Add feature” not “Added feature”)

  • Use the imperative mood (“Move cursor to…” not “Moves cursor to…”)

  • Limit the first line to 72 characters or less

  • Reference issues and pull requests liberally after the first line

Pull Requests

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.

  2. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.

  3. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent.

  4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.

Testing

  • Write unit tests for all new code using pytest.

  • Ensure all tests pass before submitting a pull request.

  • Aim for at least 80% code coverage for new features.

Documentation

  • Update the documentation accordingly when you add or modify features.

  • Write clear, concise docstrings for all functions, classes, and modules.

  • Update the README.md file if necessary.

Thank you for your contributions to pymicrostructure! Your efforts help make this project better for everyone.