sgs_tools#
Python tools for sub-grid scale (SGS) fluid dynamics analysis.
๐ Install#
โ ๏ธ This package is under active development. Interfaces, features and dependencies may change without notice. The
develbranch is the actively maintained branch containing the latest features and fixes.
๐๏ธ Development Version#
To install the latest development version (from GitHub devel branch):
pip install git+https://github.com/dvlaykov/sgs_tools.git@devel
Requires Python >=3.11. Installation on older versions will fail with possibly unclear error messages.
โถ๏ธ Usage#
The package can be used both as a Python library and from the command line.
For example, run one of the included analysis scripts directly, e.g.
cs_dynamic --help
In Python, import the usual way
import sgs_tools
print (sgs_tools.__version__)
See documentation for available module and functionality and CLI scripts for sample usage.
๐ Documentation#
The documentation is hosted here. (It is updated via GitHub Actions, so may be a few minutes behind the latest PR merge.)
To build the documentation locally:
Install the package with documentation extras (sphinx and addons)
pip install git+https://github.com/dvlaykov/sgs_tools.git@devel#egg=sgs_tools[doc]Or, if youโre using Poetry
poetry install --with docGenerate
make docThe rendered documentation can be accessed from
<repo_directory>/documentation/index.html.
๐ค Contributing#
We welcome contributions of all kinds โ bug reports, feature requests, documentation improvements, and pull requests.
Open issues for questions, ideas, or feedback. We appreciate your input!
To get started on a pull request follow the Development Setup instructions below.
Clone the repository and create a feature branch from
develUse
make pre_commitortox -e pre_committo fix common formatting/style issuesUse
make testortoxto run checks before submitting a PRSubmit your PR to the
develbranch
๐งช Development Setup & Tooling#
The dev tools are managed using Poetry.
If youโre unfamiliar with Poetry, itโs a Python packaging and publishing tool for dependency management and development workflows. You can still use
pipfor user installations, but we recommend Poetry for contributing to this project.
๐ฅผ Setup#
Clone the repository
git clone https://github.com/dvlaykov/sgs_tools.git cd sgs_tools
Create and activate a virtual environment in the preferred way (venv, conda, โฆ) [Optional, Recommended]
Install Poetry (if not already installed), e.g.
curl -sSL https://install.python-poetry.org | python3 -Install all dependencies including dev tools:
poetry install --with devThis adds dev tools like
tox,pytest,ruff,mypy, andpre-committo the dependencies.Activate Git hooks to help clean up formatting etc. on commit (this may slow down the commit somewhat).
pre-commit install
๐ฌ Testing & Style#
Testing and code style is managed via tox or a convenience make targets defined in the Makefile.
Run all checks (formatting, linting, type checks, tests, and coverage) across the repo with
make testor
toxApply standard formatting fixes and checks (that would be applied anyway for PRs) with
make pre_commitor
tox pre_commit
See the Makefile or tox.ini for more grannular options.
๐ง Tooling Overview#
Virtual environment for testing:
toxUnit/Integration Tests:
pytestWill look for tests as
test/test_*.py
Code Style:
ruff: formatting and lintingmypy: static type checkingpre-commit: wraps upruffandmypyand cleans-up staged files before commit. Automatically used in PRs todevel.