25 lines
2.6 KiB
Markdown
25 lines
2.6 KiB
Markdown
# Repository Guidelines
|
|
|
|
## Project Structure & Module Organization
|
|
Core simulation code lives in `src/`. The base pipe blowdown model is grouped under `src/tank_pipe/`, the high-pressure gas cylinder model is under `src/cylinder/`, and the cryogenic tank variant is isolated under `src/cryo_tank/`. `src/main.py` remains a compatibility entry point for the tank-pipe simulation. Tests live in `tests/` and `tests/cryo_tank/`. Use `cases/` for scenario inputs, `docs/` for design notes and generated reports, `scripts/` for utilities, and `results/` for run artifacts.
|
|
|
|
## Build, Test, and Development Commands
|
|
There is no checked-in build system; run modules directly from the repository root.
|
|
|
|
- `python3 src/main.py`: run the 0D-1D tank-pipe simulation through the compatibility entry point.
|
|
- `python3 src/tank_pipe/main.py`: run the 0D-1D tank-pipe simulation from its package entry point.
|
|
- `python3 src/cryo_tank/main.py`: run the cryogenic LN2 tank simulation.
|
|
- `pytest -q`: run the full test suite.
|
|
- `pytest -q tests/test_integration.py`: run the main conservation tests only.
|
|
- `pytest -q tests/cryo_tank`: run the cryogenic tank test subset.
|
|
- `python3 generate_doc.py`: regenerate the Word technical document in `docs/` (requires `python-docx`).
|
|
|
|
## Coding Style & Naming Conventions
|
|
Follow the existing Python style: 4-space indentation, `snake_case` for functions/modules, `PascalCase` for classes, and `UPPER_SNAKE_CASE` for configuration constants. Keep modules focused on one responsibility and prefer small helper functions like `_total_mass`. No formatter or linter config is checked in, so match current PEP 8-oriented style and keep imports simple and explicit.
|
|
|
|
## Testing Guidelines
|
|
Tests use `pytest`, with `conftest.py` adding `src/` to `PYTHONPATH`. Name files `test_*.py` and keep related scenarios grouped by subsystem, for example `tests/test_pipe.py` or `tests/cryo_tank/test_integration.py`. Preserve the current emphasis on physical invariants: conservation, steady-state behavior, and plausible output trends. Add targeted regression tests whenever solver logic, property models, or boundary flux handling changes.
|
|
|
|
## Commit & Pull Request Guidelines
|
|
Recent history follows Conventional Commit style: `feat: ...`, `feat(cryo_tank): ...`, `test(cryo_tank): ...`, `docs: ...`. Keep subjects imperative and concise. PRs should state the simulated scenario affected, summarize numerical or API changes, list test commands run, and attach updated plots or report outputs when behavior or post-processing changes. Avoid committing large generated files unless they are the point of the change.
|