代码仓库移植
This commit is contained in:
commit
0f57ba94f3
44 files changed
+7119
No files matched your search
@@ -0,0 +1,23 @@
|
||||
# Repository Guidelines
|
||||
|
||||
## Project Structure & Module Organization
|
||||
Core simulation code lives in `src/`. The base pipe blowdown model is split across `src/tank.py`, `src/pipe.py`, `src/riemann.py`, `src/solver.py`, and `src/output.py`, with `src/main.py` as the entry point. The cryogenic tank variant is isolated under `src/cryo_tank/`. Tests mirror that layout 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 and write plots/reports to `results/`.
|
||||
- `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.
|
||||
Reference in new issue
Block a user