pthelma 0.99.4.dev0__tar.gz → 1.1.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/.github/workflows/build_wheels.yml +1 -6
- pthelma-0.99.4.dev0/.github/workflows/run-tests-automatically.yml → pthelma-1.1.0/.github/workflows/run-tests.yml +2 -3
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/.gitignore +1 -0
- pthelma-1.1.0/CHANGELOG.rst +24 -0
- {pthelma-0.99.4.dev0/src/pthelma.egg-info → pthelma-1.1.0}/PKG-INFO +3 -7
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/README.rst +2 -6
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/index.rst +9 -7
- pthelma-1.1.0/docs/install.rst +15 -0
- pthelma-1.1.0/docs/rocc.rst +77 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/pyproject.toml +4 -3
- pthelma-1.1.0/setup.py +20 -0
- pthelma-1.1.0/src/haggregate/__init__.py +2 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/haggregate/regularize.c +123 -123
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/pthelma/_version.py +2 -2
- {pthelma-0.99.4.dev0 → pthelma-1.1.0/src/pthelma.egg-info}/PKG-INFO +3 -7
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/pthelma.egg-info/SOURCES.txt +9 -2
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/pthelma.egg-info/top_level.txt +1 -0
- pthelma-1.1.0/src/rocc/__init__.py +9 -0
- pthelma-1.1.0/src/rocc/calculation.c +17231 -0
- pthelma-1.1.0/src/rocc/calculation.pyx +182 -0
- pthelma-1.1.0/tests/rocc/__init__.py +0 -0
- pthelma-1.1.0/tests/rocc/test_rocc.py +190 -0
- pthelma-0.99.4.dev0/CHANGELOG.rst +0 -11
- pthelma-0.99.4.dev0/setup.py +0 -13
- pthelma-0.99.4.dev0/src/haggregate/__init__.py +0 -5
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/.readthedocs.yaml +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/GPL-3 +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/LICENSE.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/MANIFEST.in +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/Makefile +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/changelog.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/conf.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/enhydris_api_client.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/enhydris_cache/api.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/enhydris_cache/usage.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/evaporation/api.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/evaporation/usage.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/haggregate/api.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/haggregate/usage.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/hspatial/api.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/hspatial/testutils.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/hspatial/usage.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/htimeseries.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/license.rst +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/docs/requirements.txt +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/setup.cfg +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/enhydris_api_client/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/enhydris_cache/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/enhydris_cache/cli.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/enhydris_cache/enhydris_cache.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/evaporation/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/evaporation/cli.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/evaporation/evaporation.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/haggregate/cli.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/haggregate/haggregate.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/haggregate/regularize.pyx +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/hspatial/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/hspatial/cli.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/hspatial/hspatial.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/hspatial/test.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/htimeseries/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/htimeseries/htimeseries.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/htimeseries/timezone_utils.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/pthelma/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/pthelma.egg-info/dependency_links.txt +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/pthelma.egg-info/entry_points.txt +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/src/pthelma.egg-info/requires.txt +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_api_client/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_api_client/test_e2e.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_api_client/test_misc.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_api_client/test_station.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_api_client/test_timeseries.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_api_client/test_timeseriesgroup.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_api_client/test_tsdata.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_cache/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_cache/test_cli.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/enhydris_cache/test_enhydris_cache.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/evaporation/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/evaporation/test_cli.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/evaporation/test_evaporation.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/haggregate/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/haggregate/test_cli.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/haggregate/test_haggregate.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/haggregate/test_regularize.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/hspatial/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/hspatial/test_cli.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/hspatial/test_hspatial.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/htimeseries/__init__.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/htimeseries/test_htimeseries.py +0 -0
- {pthelma-0.99.4.dev0 → pthelma-1.1.0}/tests/htimeseries/test_timezone_utils.py +0 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
=========
|
2
|
+
Changelog
|
3
|
+
=========
|
4
|
+
|
5
|
+
1.1.0 (2024-12-01)
|
6
|
+
==================
|
7
|
+
|
8
|
+
Added package rocc (equivalent to rocc 3.0).
|
9
|
+
|
10
|
+
1.0.0 (2024-11-29)
|
11
|
+
==================
|
12
|
+
|
13
|
+
This is a different pthelma from the old 0.14, which had been abandoned
|
14
|
+
in favor of a number of separate packages. However, maintaining all
|
15
|
+
these separate packages was too cumbersome and now we re-combine them
|
16
|
+
here.
|
17
|
+
|
18
|
+
The packages recombined in pthelma 1.0.0 are:
|
19
|
+
* htimeseries 8.0
|
20
|
+
* hspatial 4.1
|
21
|
+
* evaporation 2.0
|
22
|
+
* haggregate 3.1
|
23
|
+
* enhydris-api-client 4.0
|
24
|
+
* enhydris-cache 2.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pthelma
|
3
|
-
Version:
|
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
|
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
|
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
|
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
|
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
|
|
@@ -3,6 +3,14 @@ pthelma - Utilities for hydrological and meteorological time series processing
|
|
3
3
|
==============================================================================
|
4
4
|
|
5
5
|
|
6
|
+
.. toctree::
|
7
|
+
:maxdepth: 1
|
8
|
+
|
9
|
+
install
|
10
|
+
license
|
11
|
+
changelog
|
12
|
+
|
13
|
+
|
6
14
|
.. toctree::
|
7
15
|
:maxdepth: 2
|
8
16
|
|
@@ -21,6 +29,7 @@ pthelma - Utilities for hydrological and meteorological time series processing
|
|
21
29
|
|
22
30
|
haggregate/usage
|
23
31
|
haggregate/api
|
32
|
+
rocc
|
24
33
|
|
25
34
|
|
26
35
|
.. toctree::
|
@@ -37,10 +46,3 @@ pthelma - Utilities for hydrological and meteorological time series processing
|
|
37
46
|
enhydris_api_client
|
38
47
|
enhydris_cache/usage
|
39
48
|
enhydris_cache/api
|
40
|
-
|
41
|
-
|
42
|
-
.. toctree::
|
43
|
-
:maxdepth: 1
|
44
|
-
|
45
|
-
license
|
46
|
-
changelog
|
@@ -0,0 +1,15 @@
|
|
1
|
+
============
|
2
|
+
Installation
|
3
|
+
============
|
4
|
+
|
5
|
+
::
|
6
|
+
|
7
|
+
pip install pthelma[all]
|
8
|
+
|
9
|
+
The above will install ``pthelma`` with all its dependencies. Some of
|
10
|
+
the dependencies, however, may be hard to install, namely ``gdal``. If
|
11
|
+
you don't need the spatial features of ``pthelma`` (such as
|
12
|
+
``hspatial``), use the following, which will install all dependencies
|
13
|
+
except for ``gdal``::
|
14
|
+
|
15
|
+
pip install pthelma
|
@@ -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
|
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"]
|
@@ -65,5 +65,6 @@ write_to = "src/pthelma/_version.py"
|
|
65
65
|
|
66
66
|
[tool.cibuildwheel]
|
67
67
|
# As of November 2024, building on Windows for Python 3.13 causes a "Need
|
68
|
-
# python for x86_64, but found x86" error.
|
69
|
-
|
68
|
+
# python for x86_64, but found x86" error. Pypy builds also occasionally cause
|
69
|
+
# errors.
|
70
|
+
skip = "pp* cp313-*"
|
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
|
+
)
|