Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare 0300 release #1032

Merged
merged 6 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.29.1
current_version = 0.30.0
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ authors:
orcid: https://orcid.org/0000-0002-6349-818X
title: "dfm_tools: A Python package for pre- and postprocessing D-FlowFM model input and output files"
type: software
version: 0.29.1
version: 0.30.0
doi: https://doi.org/10.5281/zenodo.7857393
2 changes: 1 addition & 1 deletion dfm_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """Jelmer Veenstra"""
__email__ = "jelmer.veenstra@deltares.nl"
__version__ = "0.29.1"
__version__ = "0.30.0"

from dfm_tools.deprecated import *
from dfm_tools.download import *
Expand Down
80 changes: 41 additions & 39 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,83 @@
# Contributing

## Checkout dfm_tools git repository
## Checkout git repository

- this is just a suggestion, feel free to work with VScode or any other git-compatible workflow
- download git from [git-scm.com](https://git-scm.com/download/win), install with default settings
- open git bash window where you want to clone the dfm_tools github repository (e.g. ``C:\DATA\``)
- ``git clone https://github.com/deltares/dfm_tools`` (creates a folder dfm_tools with the checked out repository)
- ``cd dfm_tools``
- optional: ``git config --global user.email [emailaddress]``
- optional: ``git config --global user.name [username]``
- open git bash window where you want to clone the dfm_tools github repository (e.g. `C:\DATA\`)
- `git clone https://github.com/deltares/dfm_tools` (creates a folder dfm_tools with the checked out repository)
- `cd dfm_tools`
- optional: `git config --global user.email [emailaddress]`
- optional: `git config --global user.name [username]`

## Setup local developer environment

- python 3.11 is recommended, [python>=3.9 is required](https://github.com/Deltares/dfm_tools/issues/267), [python 3.13 not yet supported](https://github.com/Deltares/dfm_tools/issues/559)
- download Miniforge3 from [the miniforge github](https://github.com/conda-forge/miniforge?tab=readme-ov-file#download) and install it with the recommended settings.
- open Miniforge Prompt and navigate to the local checkout folder of the repository
- ``conda create --name dfm_tools_env python=3.11 git spyder -y`` (``git`` and ``spyder`` are optional)
- ``conda activate dfm_tools_env``
- ``python -m pip install -e .[dev,docs,examples]`` (pip developer mode, any updates to the local folder are immediately available in your python. It also installs all requirements via pip, square brackets are to install optional dependency groups)
- ``conda deactivate``
- to remove dfm_tools_env when necessary: ``conda remove -n dfm_tools_env --all``
- `conda create --name dfm_tools_env python=3.11 git spyder -y` (`git` and `spyder` are optional)
- `conda activate dfm_tools_env`
- `python -m pip install -e .[dev,docs,examples]` (pip developer mode, any updates to the local folder are immediately available in your python. It also installs all requirements via pip, square brackets are to install optional dependency groups)
- `conda deactivate`
- to remove dfm_tools_env when necessary: `conda remove -n dfm_tools_env --all`

## Contributing

- open an existing issue or create a new issue at [the issues page](https://github.com/Deltares/dfm_tools/issues)
- create a branch via ``Development`` on the right. This branch is now linked to the issue and the issue will be closed once the branch is merged with main again
- create a branch via `Development` on the right. This branch is now linked to the issue and the issue will be closed once the branch is merged with main again
- alternatively fork the repository and do your edits there
- open git bash window in local dfm_tools folder (e.g. ``C:\DATA\dfm_tools``)
- ``git fetch origin`` followed by ``git checkout [branchname]``
- make your local changes to the dfm_tools code (including docstrings and unittests for functions), after each subtask do ``git commit -am 'description of what you did'`` (``-am`` adds all changed files to the commit)
- check if all edits were committed with ``git status``, if there are new files created also do ``git add [path-to-file]`` and commit again
- ``git push`` to push your committed changes your branch on github
- open git bash window in local dfm_tools folder (e.g. `C:\DATA\dfm_tools`)
- `git fetch origin` followed by `git checkout [branchname]`
- make your local changes to the dfm_tools code (including docstrings and unittests for functions), after each subtask do `git commit -am 'description of what you did'` (`-am` adds all changed files to the commit)
- check if all edits were committed with `git status`, if there are new files created also do `git add [path-to-file]` and commit again
- `git push` to push your committed changes your branch on github
- open a pull request at the branch on github, there you can see what you just pushed and the automated checks will show up (testbank and code quality analysis).
- optionally make additional local changes (+commit+push) untill you are done with the issue and the automated checks have passed
- optionally increase the dfm_tools version with: ``bumpversion patch``
- optionally increase the dfm_tools version with: `bumpversion patch`
- request a review on the pull request
- after review, squash+merge the branch into main

## Running the testbank

- open Miniforge Prompt and navigate to the local checkout folder of the repository
- ``conda activate dfm_tools_env``
- ``pytest`` (runs all tests)
- ``pytest -m "not acceptance"``
- ``pytest -m acceptance`` (runs the acceptance tests, which are the scripts in [the examples folder](https://github.com/Deltares/dfm_tools/tree/main/tests/examples))
- ``pytest -m "not requireslocaldata"`` (this is what runs on github)
- `conda activate dfm_tools_env`
- `pytest` (runs all tests)
- `pytest -m "not acceptance"`
- `pytest -m acceptance` (runs the acceptance tests, which are the scripts in [the examples folder](https://github.com/Deltares/dfm_tools/tree/main/tests/examples))
- `pytest -m "not requireslocaldata"` (this is what runs on github)
- this workflow automatically runs via Github Actions upon push and pullrequest to main

## Generate documentation with sphinx

- open Miniforge Prompt and navigate to the local checkout folder of the repository
- ``conda activate dfm_tools_env``
- ``sphinx-build docs docs/_build``
- `conda activate dfm_tools_env`
- `sphinx-build docs docs/_build`
- this workflow automatically runs via Github Actions upon push to main

## Increase the dfm_tools version number
## Increase the version number

- commit all changes via git
- open Miniforge Prompt and navigate to the local checkout folder of the repository
- ``conda activate dfm_tools_env``
- ``bumpversion major`` or ``bumpversion minor`` or ``bumpversion patch`` (changes version numbers in files and commits changes)
- push changes with ``git push`` (from git bash window)
- `conda activate dfm_tools_env`
- `bumpversion major` or `bumpversion minor` or `bumpversion patch` (changes version numbers in files and commits changes)
- push changes with `git push` (from git bash window)

## Create release

- make sure the ``main`` branch is up to date (important issues solved, all pullrequests and branches closed)
- bump the versionnumber with ``bumpversion minor``
- update ``docs/whats-new.md`` and add a date to the current release heading
- run local testbank
- local check with: ``python -m build`` and ``twine check dist/*`` ([does not work on WCF](https://github.com/pypa/setuptools/issues/4133))
- copy the dfm_tools version from [pyproject.toml](https://github.com/Deltares/dfm_tools/blob/main/pyproject.toml) (e.g. ``0.11.0``)
- make sure the `main` branch is up to date (check pytest warnings, important issues solved, all pullrequests and branches closed)
- bump the versionnumber with `bumpversion minor`
- update `docs/whats-new.md` and add a date to the current release heading
- run local testbank with `pytest -m "not era5slow and not requireslocaldata and not acceptance"`
- local check with: `python -m build` and `twine check dist/*` ([does not work on WCF](https://github.com/pypa/setuptools/issues/4133))
- commit+push to github via PR
- copy the dfm_tools version from [pyproject.toml](https://github.com/Deltares/dfm_tools/blob/main/pyproject.toml) (e.g. `0.11.0`)
- create a [new release](https://github.com/Deltares/dfm_tools/releases/new)
- click ``choose a tag`` and type v+versionnumber (e.g. ``v0.11.0``), click ``create new tag: v0.11.0 on publish``
- set the release title to the tagname (e.g. ``v0.11.0``)
- click `Generate release notes` and replace the `What's Changed` info by a tagged link to ``docs/whats-new.md``
- if all is set, click ``Publish release``
- click `choose a tag` and type v+versionnumber (e.g. `v0.11.0`), click `create new tag: v0.11.0 on publish`
- set the release title to the tagname (e.g. `v0.11.0`)
- click `Generate release notes` and replace the `What's Changed` info by a tagged link to `docs/whats-new.md`
- if all is set, click `Publish release`
- a release is created and the github action publishes it [on PyPI](https://pypi.org/project/dfm-tools)
- post-release: commit+push `bumpversion patch` and `UNRELEASED` header in `docs/whats-new.md` to distinct between release and dev version

## What are all these packages for?

Expand Down
2 changes: 1 addition & 1 deletion docs/whats-new.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# What's new

## UNRELEASED
## 0.30.0 (2024-10-20)

### Fix
- fixed cmems-nrt insitu again by dropping station with varying coordinates again in [#1023](https://github.com/Deltares/dfm_tools/pull/1023)
Expand Down
44 changes: 22 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,56 @@ build-backend = "setuptools.build_meta"

[project]
name = "dfm_tools"
version = "0.29.1"
version = "0.30.0"
maintainers = [{ name = "Jelmer Veenstra", email = "jelmer.veenstra@deltares.nl" }]
description = "dfm_tools are pre- and post-processing tools for Delft3D FM"
readme = "README.md"
keywords = ["dfm_tools", "D-FlowFM", "D-HYDRO", "post-processing", "pre-processing", "mapfiles", "hisfiles", "modelbuilder"]
license = { text = "LGPLv3" }
requires-python = ">=3.9"
dependencies = [
#scipy<1.6.0 pip install fails in py39, is also 3 years old
#scipy>=1.6.0 successfully pip installs in py39, is also 3 years old
"scipy>=1.6.0",
#numpy<1.23 is EOL since june 2024
#numpy>=1.23 is first not-EOL since june 2024
"numpy>=1.23",
#contour colorbar on uniform values fails with matplotlib<3.7.0, several other features with matplotlib<3.6.0
#matplotlib>=3.7.0 successfully creates contour colorbar on uniform values and has several other features
"matplotlib>=3.7.0",
#pandas>=1.4 is required by xarray>=2023.3.0
"pandas>=1.4.0",
#shapely<2.0.0 give "AttributeError: module 'shapely' has no attribute 'GeometryType'"
#shapely>=2.0.0 fixes "AttributeError: module 'shapely' has no attribute 'GeometryType'"
"shapely>=2.0.0",
#geopandas<0.13.0 require shapely<2.0.0
#geopandas>=0.13.0 supports shapely>=2.0.0
"geopandas>=0.13.0",
#fiona<1.9 does not contain sql where filter
#fiona>=1.9 contains sql where filter
"fiona>=1.9",
#contextily<1.6.2 has incorrect axis scaling: https://github.com/geopandas/contextily/issues/251
#contextily>=1.6.2 has fixed axis scaling: https://github.com/geopandas/contextily/issues/251
"contextily>=1.6.2",
#xarray<2023.9.0 does not support multidimensional coordinates (used in e.g. HIRLAM meteo data)
#xarray>=2023.9.0 supports multidimensional coordinates (used in e.g. HIRLAM meteo data)
"xarray>=2023.9.0",
#dask version is aligned with xarray
"dask>=2023.9.0",
#netcdf4<1.5.4 pip install fails in py39
#netcdf4>=1.5.4 successfully pip installs in py39
"netcdf4>=1.5.4",
#bottleneck<1.3.3 pip install fails in py39
#bottleneck>=1.3.3 successfully pip installs in py39
"bottleneck>=1.3.3",
#xugrid<0.12.1 has issue with fill_value and no flexible start_index
#xugrid>=0.12.1 fixed issue with fill_value and no flexible start_index
"xugrid>=0.12.1",
#cdsapi<0.7.2 has different error upon dummy dataset
#cdsapi>=0.7.2 has different error upon dummy dataset
"cdsapi>=0.7.2",
#pydap<3.4.0 is from May 2017 and does not support newer python versions
#pydap>=3.4.0 is the first with support for newer python versions
"pydap>=3.4.0",
#erddapy<2.0.0 does not support pandas>=2.0.0
#erddapy>=2.0.0 supports pandas>=2.0.0
"erddapy>=2.0.0",
#copernicusmarine<1.3.2 is not the latest version and the developers recommend to always use the latest version until 2.0.0 is released: https://github.com/Deltares/dfm_tools/issues/936
"copernicusmarine>=1.3.2",
#copernicusmarine>=1.3.3 is the latest version and the developers recommend to always use the latest version until 2.0.0 is released: https://github.com/Deltares/dfm_tools/issues/936
"copernicusmarine>=1.3.3",
"copernicusmarine<2.0.0", # TODO: remove when dfm_tools is adjusted to not-yet-released 2.0 version: https://github.com/Deltares/dfm_tools/issues/933
#rws-ddlpy<0.4.0 does not yet have `ddlpy.dataframe_to_xarray()`
"rws-ddlpy>=0.4.0",
#pooch<1.1.0 do not have attribute retrieve
#rws-ddlpy>=0.6.0 `ddlpy.measurements_amount()` returns all amounts
"rws-ddlpy>=0.6.0",
#pooch>=1.1.0 has attribute retrieve
"pooch>=1.1.0",
#hydrolib-core 0.8.0 support for many more mdu keywords and correct dimr_config.xml for parallel runs
#hydrolib-core>=0.8.0 supports many more mdu keywords and correct dimr_config.xml for parallel runs
"hydrolib-core>=0.8.0",
#meshkernel<4.2.0 support for more gridded_samples dtypes and workarounds for non-orthogonal grids
#meshkernel>=4.2.0 supports more gridded_samples dtypes and workarounds for non-orthogonal grids
"meshkernel>=4.2.0",
]
classifiers = [
Expand Down
Loading