Skip to content

Commit

Permalink
99 create ddlpy 050 release (#100)
Browse files Browse the repository at this point in the history
* Bump version: 0.4.1 → 0.5.0

* stricter comparison of geengegevensgevonden error

* updated history.rst
  • Loading branch information
veenstrajelmer authored Apr 26, 2024
1 parent b154cd2 commit dd4d52a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
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.4.1
current_version = 0.5.0
commit = True
tag = True

Expand Down
4 changes: 2 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
History
=======

UNRELEASED
0.5.0 (2024-04-26)
----------
* avoid duplicated periods in dataframe returned by `ddlpy.measurements_amount()` in https://github.com/Deltares/ddlpy/pull/93
* allow for different retrieval frequencies (including None) in `ddlpy.measurements()` in https://github.com/Deltares/ddlpy/pull/95
* only catch "Geen waarnemingen aanwezig!" error message and raise all others (for instance for a too large request) in https://github.com/Deltares/ddlpy/pull/97
* only catch "Geen gegevens gevonden!" error message and raise all others (for instance for a too large request) in https://github.com/Deltares/ddlpy/pull/97
* support for timezones in start_date/end_date in https://github.com/Deltares/ddlpy/pull/98

0.4.0 (2024-04-08)
Expand Down
2 changes: 1 addition & 1 deletion ddlpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """Fedor Baart"""
__email__ = '[email protected]'
__version__ = '0.4.1'
__version__ = '0.5.0'

from ddlpy.ddlpy import locations
from ddlpy.ddlpy import (measurements,
Expand Down
5 changes: 2 additions & 3 deletions ddlpy/ddlpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ def _send_post_request(url, request, timeout=None):
if not result['Succesvol']:
logger.debug('Response result is unsuccessful: {}'.format(result))
error_message = result.get('Foutmelding', 'No error returned')
if "Geen gegevens gevonden" in error_message:
if error_message == "Geen gegevens gevonden!":
# Foutmelding: "Geen gegevens gevonden!"
# this is a valid response for periods where there is no data
# this error is raised here, but catched in ddlpy.ddlpy.measurements() so the process can continue.
raise NoDataError(error_message)
else:
# Foutmelding: "Het max aantal waarnemingen (157681) is overschreven, beperk uw request."
# or any other possible error message
# are raised here and not catched elsewhere in the code
# or any other possible error message are raised here
raise UnsuccessfulRequestError(error_message)

# continue if request was successful
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rws-ddlpy"
version = "0.4.1"
version = "0.5.0"
maintainers = [
{ name = "Fedor Baart", email = "[email protected]"},
{ name = "Jelmer Veenstra", email = "[email protected]"},
Expand Down

0 comments on commit dd4d52a

Please sign in to comment.