Skip to content

Python Development

Python is the most popular language in the world for software development and the use of Python at DHI is increasing rapidly.

Contact: Henrik Andersson

DHI Python dev community

The dev community meets online a couple times per year and discusses topics related to software development in Python. Reach out to Jesper Mariegaard if you want to join.

Code sharing

Share re-usable code in dedicated repositories on DHI GitHub.

Recommendations

Below are some recommendations on tools and practices related to developing software in Python at DHI.

  • I use Git for source control
  • I prefer VS Code as IDE
  • I use pyproject.toml for project configuration over setup.py
  • I document dependencies and pin the versions when developing applications to ensure reproducibility.
  • I use pytest for testing
  • I use ruff for linting and formatting
  • I add type hints to all public methods
  • I document my public API
  • I use NumPy style docstrings
  • I automate tests and quality checks with CI (GitHub Actions / Azure Devops Pipelines)
  • I include a license (I prefer MIT for open-source projects)
  • I use virtual environments (e.g., venv) for isolated development
  • I use Snyk for automated code and dependency vulnerability scanning
  • I maintain a README.md with instructions targeted to developers
  • I participate in code reviews and prefer pull requests over direct commits to main branches