pthelma 1.0.0__tar.gz → 1.1.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. {pthelma-1.0.0 → pthelma-1.1.0}/.github/workflows/build_wheels.yml +1 -6
  2. {pthelma-1.0.0 → pthelma-1.1.0}/.github/workflows/run-tests.yml +1 -1
  3. {pthelma-1.0.0 → pthelma-1.1.0}/.gitignore +1 -0
  4. {pthelma-1.0.0 → pthelma-1.1.0}/CHANGELOG.rst +5 -0
  5. {pthelma-1.0.0/src/pthelma.egg-info → pthelma-1.1.0}/PKG-INFO +3 -7
  6. {pthelma-1.0.0 → pthelma-1.1.0}/README.rst +2 -6
  7. {pthelma-1.0.0 → pthelma-1.1.0}/docs/index.rst +1 -0
  8. pthelma-1.1.0/docs/rocc.rst +77 -0
  9. {pthelma-1.0.0 → pthelma-1.1.0}/pyproject.toml +1 -1
  10. pthelma-1.1.0/setup.py +20 -0
  11. pthelma-1.1.0/src/haggregate/__init__.py +2 -0
  12. {pthelma-1.0.0 → pthelma-1.1.0}/src/haggregate/regularize.c +123 -123
  13. {pthelma-1.0.0 → pthelma-1.1.0}/src/pthelma/_version.py +2 -2
  14. {pthelma-1.0.0 → pthelma-1.1.0/src/pthelma.egg-info}/PKG-INFO +3 -7
  15. {pthelma-1.0.0 → pthelma-1.1.0}/src/pthelma.egg-info/SOURCES.txt +7 -1
  16. {pthelma-1.0.0 → pthelma-1.1.0}/src/pthelma.egg-info/top_level.txt +1 -0
  17. pthelma-1.1.0/src/rocc/__init__.py +9 -0
  18. pthelma-1.1.0/src/rocc/calculation.c +17231 -0
  19. pthelma-1.1.0/src/rocc/calculation.pyx +182 -0
  20. pthelma-1.1.0/tests/rocc/__init__.py +0 -0
  21. pthelma-1.1.0/tests/rocc/test_rocc.py +190 -0
  22. pthelma-1.0.0/setup.py +0 -13
  23. pthelma-1.0.0/src/haggregate/__init__.py +0 -5
  24. {pthelma-1.0.0 → pthelma-1.1.0}/.readthedocs.yaml +0 -0
  25. {pthelma-1.0.0 → pthelma-1.1.0}/GPL-3 +0 -0
  26. {pthelma-1.0.0 → pthelma-1.1.0}/LICENSE.rst +0 -0
  27. {pthelma-1.0.0 → pthelma-1.1.0}/MANIFEST.in +0 -0
  28. {pthelma-1.0.0 → pthelma-1.1.0}/docs/Makefile +0 -0
  29. {pthelma-1.0.0 → pthelma-1.1.0}/docs/changelog.rst +0 -0
  30. {pthelma-1.0.0 → pthelma-1.1.0}/docs/conf.py +0 -0
  31. {pthelma-1.0.0 → pthelma-1.1.0}/docs/enhydris_api_client.rst +0 -0
  32. {pthelma-1.0.0 → pthelma-1.1.0}/docs/enhydris_cache/api.rst +0 -0
  33. {pthelma-1.0.0 → pthelma-1.1.0}/docs/enhydris_cache/usage.rst +0 -0
  34. {pthelma-1.0.0 → pthelma-1.1.0}/docs/evaporation/api.rst +0 -0
  35. {pthelma-1.0.0 → pthelma-1.1.0}/docs/evaporation/usage.rst +0 -0
  36. {pthelma-1.0.0 → pthelma-1.1.0}/docs/haggregate/api.rst +0 -0
  37. {pthelma-1.0.0 → pthelma-1.1.0}/docs/haggregate/usage.rst +0 -0
  38. {pthelma-1.0.0 → pthelma-1.1.0}/docs/hspatial/api.rst +0 -0
  39. {pthelma-1.0.0 → pthelma-1.1.0}/docs/hspatial/testutils.rst +0 -0
  40. {pthelma-1.0.0 → pthelma-1.1.0}/docs/hspatial/usage.rst +0 -0
  41. {pthelma-1.0.0 → pthelma-1.1.0}/docs/htimeseries.rst +0 -0
  42. {pthelma-1.0.0 → pthelma-1.1.0}/docs/install.rst +0 -0
  43. {pthelma-1.0.0 → pthelma-1.1.0}/docs/license.rst +0 -0
  44. {pthelma-1.0.0 → pthelma-1.1.0}/docs/requirements.txt +0 -0
  45. {pthelma-1.0.0 → pthelma-1.1.0}/setup.cfg +0 -0
  46. {pthelma-1.0.0 → pthelma-1.1.0}/src/enhydris_api_client/__init__.py +0 -0
  47. {pthelma-1.0.0 → pthelma-1.1.0}/src/enhydris_cache/__init__.py +0 -0
  48. {pthelma-1.0.0 → pthelma-1.1.0}/src/enhydris_cache/cli.py +0 -0
  49. {pthelma-1.0.0 → pthelma-1.1.0}/src/enhydris_cache/enhydris_cache.py +0 -0
  50. {pthelma-1.0.0 → pthelma-1.1.0}/src/evaporation/__init__.py +0 -0
  51. {pthelma-1.0.0 → pthelma-1.1.0}/src/evaporation/cli.py +0 -0
  52. {pthelma-1.0.0 → pthelma-1.1.0}/src/evaporation/evaporation.py +0 -0
  53. {pthelma-1.0.0 → pthelma-1.1.0}/src/haggregate/cli.py +0 -0
  54. {pthelma-1.0.0 → pthelma-1.1.0}/src/haggregate/haggregate.py +0 -0
  55. {pthelma-1.0.0 → pthelma-1.1.0}/src/haggregate/regularize.pyx +0 -0
  56. {pthelma-1.0.0 → pthelma-1.1.0}/src/hspatial/__init__.py +0 -0
  57. {pthelma-1.0.0 → pthelma-1.1.0}/src/hspatial/cli.py +0 -0
  58. {pthelma-1.0.0 → pthelma-1.1.0}/src/hspatial/hspatial.py +0 -0
  59. {pthelma-1.0.0 → pthelma-1.1.0}/src/hspatial/test.py +0 -0
  60. {pthelma-1.0.0 → pthelma-1.1.0}/src/htimeseries/__init__.py +0 -0
  61. {pthelma-1.0.0 → pthelma-1.1.0}/src/htimeseries/htimeseries.py +0 -0
  62. {pthelma-1.0.0 → pthelma-1.1.0}/src/htimeseries/timezone_utils.py +0 -0
  63. {pthelma-1.0.0 → pthelma-1.1.0}/src/pthelma/__init__.py +0 -0
  64. {pthelma-1.0.0 → pthelma-1.1.0}/src/pthelma.egg-info/dependency_links.txt +0 -0
  65. {pthelma-1.0.0 → pthelma-1.1.0}/src/pthelma.egg-info/entry_points.txt +0 -0
  66. {pthelma-1.0.0 → pthelma-1.1.0}/src/pthelma.egg-info/requires.txt +0 -0
  67. {pthelma-1.0.0 → pthelma-1.1.0}/tests/__init__.py +0 -0
  68. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_api_client/__init__.py +0 -0
  69. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_api_client/test_e2e.py +0 -0
  70. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_api_client/test_misc.py +0 -0
  71. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_api_client/test_station.py +0 -0
  72. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_api_client/test_timeseries.py +0 -0
  73. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_api_client/test_timeseriesgroup.py +0 -0
  74. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_api_client/test_tsdata.py +0 -0
  75. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_cache/__init__.py +0 -0
  76. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_cache/test_cli.py +0 -0
  77. {pthelma-1.0.0 → pthelma-1.1.0}/tests/enhydris_cache/test_enhydris_cache.py +0 -0
  78. {pthelma-1.0.0 → pthelma-1.1.0}/tests/evaporation/__init__.py +0 -0
  79. {pthelma-1.0.0 → pthelma-1.1.0}/tests/evaporation/test_cli.py +0 -0
  80. {pthelma-1.0.0 → pthelma-1.1.0}/tests/evaporation/test_evaporation.py +0 -0
  81. {pthelma-1.0.0 → pthelma-1.1.0}/tests/haggregate/__init__.py +0 -0
  82. {pthelma-1.0.0 → pthelma-1.1.0}/tests/haggregate/test_cli.py +0 -0
  83. {pthelma-1.0.0 → pthelma-1.1.0}/tests/haggregate/test_haggregate.py +0 -0
  84. {pthelma-1.0.0 → pthelma-1.1.0}/tests/haggregate/test_regularize.py +0 -0
  85. {pthelma-1.0.0 → pthelma-1.1.0}/tests/hspatial/__init__.py +0 -0
  86. {pthelma-1.0.0 → pthelma-1.1.0}/tests/hspatial/test_cli.py +0 -0
  87. {pthelma-1.0.0 → pthelma-1.1.0}/tests/hspatial/test_hspatial.py +0 -0
  88. {pthelma-1.0.0 → pthelma-1.1.0}/tests/htimeseries/__init__.py +0 -0
  89. {pthelma-1.0.0 → pthelma-1.1.0}/tests/htimeseries/test_htimeseries.py +0 -0
  90. {pthelma-1.0.0 → pthelma-1.1.0}/tests/htimeseries/test_timezone_utils.py +0 -0
@@ -1,15 +1,10 @@
1
1
  name: Build wheels
2
2
 
3
3
  on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
4
  release:
11
5
  types:
12
6
  - published
7
+ workflow_dispatch:
13
8
 
14
9
  jobs:
15
10
  build_wheels:
@@ -1,4 +1,4 @@
1
- name: Run tests
1
+ name: Tests
2
2
 
3
3
  on:
4
4
  push:
@@ -40,3 +40,4 @@ _version.py
40
40
 
41
41
  # cython
42
42
  src/haggregate/regularize.c
43
+ src/rocc/calculation.c
@@ -2,6 +2,11 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ 1.1.0 (2024-12-01)
6
+ ==================
7
+
8
+ Added package rocc (equivalent to rocc 3.0).
9
+
5
10
  1.0.0 (2024-11-29)
6
11
  ==================
7
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pthelma
3
- Version: 1.0.0
3
+ Version: 1.1.0
4
4
  Summary: Utilities for hydrological and meteorological time series processing
5
5
  Author-email: Antonis Christofides <antonis@antonischristofides.com>
6
6
  Maintainer-email: Antonis Christofides <antonis@antonischristofides.com>
@@ -34,9 +34,9 @@ Requires-Dist: gdal<4,>=1.10; extra == "all"
34
34
  pthelma
35
35
  =======
36
36
 
37
- .. image:: https://github.com/openmeteo/pthelma/actions/workflows/run-tests-automatically.yml/badge.svg
37
+ .. image:: https://github.com/openmeteo/pthelma/actions/workflows/run-tests.yml/badge.svg
38
38
  :alt: Build button
39
- :target: https://github.com/openmeteo/pthelma/actions/workflows/run-tests-automatically.yml
39
+ :target: https://github.com/openmeteo/pthelma/actions/workflows/run-tests.yml
40
40
 
41
41
  .. image:: https://codecov.io/github/openmeteo/pthelma/coverage.svg?branch=master
42
42
  :alt: Coverage
@@ -45,10 +45,6 @@ pthelma
45
45
  .. image:: https://img.shields.io/pypi/v/pthelma.svg
46
46
  :target: https://pypi.python.org/pypi/pthelma
47
47
 
48
- .. image:: https://pyup.io/repos/github/openmeteo/pthelma/shield.svg
49
- :target: https://pyup.io/repos/github/openmeteo/pthelma/
50
- :alt: Updates
51
-
52
48
  A Python library with utilities for hydrological and meteorological time
53
49
  series processing.
54
50
 
@@ -1,9 +1,9 @@
1
1
  pthelma
2
2
  =======
3
3
 
4
- .. image:: https://github.com/openmeteo/pthelma/actions/workflows/run-tests-automatically.yml/badge.svg
4
+ .. image:: https://github.com/openmeteo/pthelma/actions/workflows/run-tests.yml/badge.svg
5
5
  :alt: Build button
6
- :target: https://github.com/openmeteo/pthelma/actions/workflows/run-tests-automatically.yml
6
+ :target: https://github.com/openmeteo/pthelma/actions/workflows/run-tests.yml
7
7
 
8
8
  .. image:: https://codecov.io/github/openmeteo/pthelma/coverage.svg?branch=master
9
9
  :alt: Coverage
@@ -12,10 +12,6 @@ pthelma
12
12
  .. image:: https://img.shields.io/pypi/v/pthelma.svg
13
13
  :target: https://pypi.python.org/pypi/pthelma
14
14
 
15
- .. image:: https://pyup.io/repos/github/openmeteo/pthelma/shield.svg
16
- :target: https://pyup.io/repos/github/openmeteo/pthelma/
17
- :alt: Updates
18
-
19
15
  A Python library with utilities for hydrological and meteorological time
20
16
  series processing.
21
17
 
@@ -29,6 +29,7 @@ pthelma - Utilities for hydrological and meteorological time series processing
29
29
 
30
30
  haggregate/usage
31
31
  haggregate/api
32
+ rocc
32
33
 
33
34
 
34
35
  .. toctree::
@@ -0,0 +1,77 @@
1
+ ===========================================
2
+ rocc - Rate-of-change check for time series
3
+ ===========================================
4
+
5
+ .. class:: Threshold
6
+
7
+ A named tuple whose items are :attr:`delta_t` (a pandas interval
8
+ specification) and :attr:`allowed_diff` (a floating point number).
9
+
10
+ .. function:: rocc.rocc(ahtimeseries, thresholds, symmetric=False, flag="TEMPORAL")
11
+
12
+ Example ::
13
+
14
+ from rocc import Threshold, rocc
15
+
16
+ result = rocc(
17
+ timeseries=a_htimeseries_object,
18
+ thresholds=(
19
+ Threshold("10min", 10),
20
+ Threshold("20min", 15),
21
+ Threshold("H", 40),
22
+ ),
23
+ symmetric=True,
24
+ flag="MYFLAG",
25
+ )
26
+
27
+ ``timeseries`` is a :class:`HTimeseries` object. ``thresholds`` is
28
+ a list of :class:`Threshold` objects.
29
+
30
+ The function checks whether there exist intervals during which the
31
+ value of the time series changes by more than the specified
32
+ threshold. The offending records are flagged with the specified
33
+ ``flag``.
34
+
35
+ It returns a list of strings describing where the thresholds have been
36
+ exceeded.
37
+
38
+ If ``flag`` is ``None`` or the empty string, then the offending records
39
+ are not flagged, and the only result is the returned value.
40
+
41
+ Here is an example time series::
42
+
43
+ 2020-10-06 14:30 24.0
44
+ 2020-10-06 14:40 25.0
45
+ 2020-10-06 14:50 36.0 *
46
+ 2020-10-06 15:01 51.0
47
+ 2020-10-06 15:21 55.0
48
+ 2020-10-06 15:31 65.0
49
+ 2020-10-06 15:41 75.0 *
50
+ 2020-10-06 15:51 70.0
51
+
52
+ After running ``rocc()`` with the ``thresholds`` specified in the
53
+ example above, the records marked with a star will be flagged. The
54
+ record ``14:50`` will be flagged because in the preceding 10-minute
55
+ interval the value increases by 11, which is more than 10. The record
56
+ ``15:41`` will be flagged because in the preceding 20-minute interval
57
+ the value increases by 20, which is more than 15. The record ``15:01``
58
+ will be unflagged; although there's a large difference since ``14:40``,
59
+ this is 21 minutes, not 20, so the 20-minute threshold of 15 does not
60
+ apply; likewise, there's a difference of 15 from ``14:50``, which does
61
+ not exceed the 20-minute threshold of 15, and while it does exceed the
62
+ 10-minute threshold of 10, it's 11 minutes, not 10. There's also not any
63
+ difference larger than 40 within an hour anywhere.
64
+
65
+ The return value in this example will be a list of two strings::
66
+
67
+ "2020-10-06T14:50 +11.0 in 10min (> 10.0)"
68
+ "2020-10-06T15:41 +20.0 in 20min (> 15.0)"
69
+
70
+ The return value should only be used for consumption by humans; it is
71
+ subject to change.
72
+
73
+ If ``symmetric`` is ``True``, it is the absolute value of the change
74
+ that matters, not its direction. In this case, ``allowed_diff`` must be
75
+ positive. If ``symmetric`` is ``False`` (the default), only rates larger
76
+ than positive ``allow_diff`` or rates smaller than negative
77
+ ``allow_diff`` are flagged.
@@ -1,6 +1,6 @@
1
1
  [build-system]
2
2
  # numpy<2 is not just a dependency, it's a build dependency, because it's
3
- # needed to build regularize.pyx (and the _gdal_array thing, which gdal won't
3
+ # needed to build some .pyx files (and the _gdal_array thing, which gdal won't
4
4
  # build if numpy is not available at build time). It's at "<2" because of gdal;
5
5
  # pthelma can also use ">=2".
6
6
  requires = ["setuptools>=61.0", "setuptools-scm>=7.1", "cython", "numpy<2"]
pthelma-1.1.0/setup.py ADDED
@@ -0,0 +1,20 @@
1
+ import numpy
2
+ from Cython.Build import cythonize
3
+ from setuptools import Extension, setup
4
+
5
+ setup(
6
+ ext_modules=cythonize(
7
+ [
8
+ Extension(
9
+ "haggregate.regularize",
10
+ sources=["src/haggregate/regularize.pyx"],
11
+ include_dirs=[numpy.get_include()],
12
+ ),
13
+ Extension(
14
+ "rocc.calculation",
15
+ sources=["src/rocc/calculation.pyx"],
16
+ include_dirs=[numpy.get_include()],
17
+ ),
18
+ ]
19
+ ),
20
+ )
@@ -0,0 +1,2 @@
1
+ from .haggregate import * # NOQA
2
+ from .regularize import * # NOQA