Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 1.1 KB

File metadata and controls

17 lines (14 loc) · 1.1 KB

Itzi flood model

Common commands

  • Run a single test: uv run pytest tests/my_test.py
  • The GRASS-based tests need --forked so each tests run in a separate process: uv run pytest --forked tests/grass.
  • It is not necessary to run core tests with --forked. Additionally, --forked prevents the display of print statements and other outputs.
  • Enforce code formatting: uvx ruff format .

Code style

  • Use python type hints. When a function that does not yet use hints is substantially edited, take the opportunity to add type hints.
  • Since the arguments types and return types are already documented by the hints, there's no need to duplicate this information in the docstrings.
  • Apart from particular cases, use pydantic BaseModel instead of dataclass
  • Place imports at the top of the file. Only break this rule to prevent heavy imports in a rarely used function (for example, CLI options).

General comments

  • The project uses uv. To run a command in the correct environment, use uv run
  • Running the whole test suite is slow. Do it only after all the specific tests are passing, as a final check.