Contributing¶
Contributions are welcome! Whether you want to add new equipment cost correlations, fix a bug, improve documentation, or add a new feature, please follow the guidelines below.
Getting started¶
Fork the repository on GitHub.
Clone your fork locally:
git clone https://github.com/<your-username>/OpenPyTEA.git cd OpenPyTEA
Install the package in editable mode with dev dependencies:
pip install -e ".[test]" # or with uv: uv sync
Create a feature branch:
git checkout -b feat/my-new-feature
Make your changes, add tests, and open a pull request against
main.
Adding equipment cost correlations¶
The cost database lives in src/openpytea/data/cost_correlations.csv.
Each row defines one correlation:
Column |
Description |
|---|---|
|
Unique identifier (e.g., |
|
Display category (e.g., |
|
Sub-type (e.g., |
|
Correlation form: |
|
Minimum valid size parameter |
|
Maximum size parameter for a single unit |
|
Maximum total size (triggers parallelization above |
|
Power-law coefficients (\(C = a + b \cdot S^n\)) |
|
Quad log-log coefficients (\(\log C = k_1 + k_2\log S + k_3(\log S)^2\)) |
|
Reference year for the correlation (used for CEPCI adjustment) |
Please cite the source of any new correlation in the PR description.
Running tests¶
pytest tests/
Adding docstrings¶
OpenPyTEA uses NumPy-style docstrings. New public functions and classes
must include a docstring with at minimum a summary line, Parameters,
Returns, and at least one Examples block.
def my_function(x: float, y: int = 10) -> float:
"""
Brief one-line summary.
Extended description (optional).
Parameters
----------
x : float
Description of x.
y : int, optional
Description of y. Default is 10.
Returns
-------
float
Description of return value.
Examples
--------
>>> my_function(3.5)
35.0
"""
Code style¶
Formatting:
black(line length 60 forsrc/, 88 elsewhere)Linting:
ruff— runruff check src/before committingType hints are encouraged for all public APIs
Reporting bugs¶
Please open an issue on GitHub Issues with:
A minimal reproducible example
The OpenPyTEA version (
import openpytea; print(openpytea.__version__))Your Python version and OS
For citation and license information, see Citation & License.