pthelma 2.0.0__tar.gz → 2.1.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. {pthelma-2.0.0 → pthelma-2.1.0}/.github/workflows/run-tests.yml +1 -0
  2. {pthelma-2.0.0 → pthelma-2.1.0}/CHANGELOG.rst +8 -0
  3. {pthelma-2.0.0/src/pthelma.egg-info → pthelma-2.1.0}/PKG-INFO +2 -2
  4. {pthelma-2.0.0 → pthelma-2.1.0}/docs/haggregate/api.rst +8 -1
  5. {pthelma-2.0.0 → pthelma-2.1.0}/docs/haggregate/usage.rst +3 -2
  6. {pthelma-2.0.0 → pthelma-2.1.0}/src/haggregate/haggregate.py +2 -2
  7. {pthelma-2.0.0 → pthelma-2.1.0}/src/haggregate/regularize.c +123 -123
  8. {pthelma-2.0.0 → pthelma-2.1.0}/src/pthelma/_version.py +2 -2
  9. {pthelma-2.0.0 → pthelma-2.1.0/src/pthelma.egg-info}/PKG-INFO +2 -2
  10. {pthelma-2.0.0 → pthelma-2.1.0}/src/rocc/calculation.c +123 -123
  11. {pthelma-2.0.0 → pthelma-2.1.0}/tests/haggregate/test_haggregate.py +19 -1
  12. {pthelma-2.0.0 → pthelma-2.1.0}/.github/workflows/build_wheels.yml +0 -0
  13. {pthelma-2.0.0 → pthelma-2.1.0}/.gitignore +0 -0
  14. {pthelma-2.0.0 → pthelma-2.1.0}/.readthedocs.yaml +0 -0
  15. {pthelma-2.0.0 → pthelma-2.1.0}/GPL-3 +0 -0
  16. {pthelma-2.0.0 → pthelma-2.1.0}/LICENSE.rst +0 -0
  17. {pthelma-2.0.0 → pthelma-2.1.0}/MANIFEST.in +0 -0
  18. {pthelma-2.0.0 → pthelma-2.1.0}/README.rst +0 -0
  19. {pthelma-2.0.0 → pthelma-2.1.0}/docs/Makefile +0 -0
  20. {pthelma-2.0.0 → pthelma-2.1.0}/docs/changelog.rst +0 -0
  21. {pthelma-2.0.0 → pthelma-2.1.0}/docs/conf.py +0 -0
  22. {pthelma-2.0.0 → pthelma-2.1.0}/docs/enhydris_api_client.rst +0 -0
  23. {pthelma-2.0.0 → pthelma-2.1.0}/docs/enhydris_cache/api.rst +0 -0
  24. {pthelma-2.0.0 → pthelma-2.1.0}/docs/enhydris_cache/usage.rst +0 -0
  25. {pthelma-2.0.0 → pthelma-2.1.0}/docs/evaporation/api.rst +0 -0
  26. {pthelma-2.0.0 → pthelma-2.1.0}/docs/evaporation/usage.rst +0 -0
  27. {pthelma-2.0.0 → pthelma-2.1.0}/docs/hspatial/api.rst +0 -0
  28. {pthelma-2.0.0 → pthelma-2.1.0}/docs/hspatial/testutils.rst +0 -0
  29. {pthelma-2.0.0 → pthelma-2.1.0}/docs/hspatial/usage.rst +0 -0
  30. {pthelma-2.0.0 → pthelma-2.1.0}/docs/htimeseries.rst +0 -0
  31. {pthelma-2.0.0 → pthelma-2.1.0}/docs/index.rst +0 -0
  32. {pthelma-2.0.0 → pthelma-2.1.0}/docs/install.rst +0 -0
  33. {pthelma-2.0.0 → pthelma-2.1.0}/docs/license.rst +0 -0
  34. {pthelma-2.0.0 → pthelma-2.1.0}/docs/requirements.txt +0 -0
  35. {pthelma-2.0.0 → pthelma-2.1.0}/docs/rocc.rst +0 -0
  36. {pthelma-2.0.0 → pthelma-2.1.0}/pyproject.toml +0 -0
  37. {pthelma-2.0.0 → pthelma-2.1.0}/setup.cfg +0 -0
  38. {pthelma-2.0.0 → pthelma-2.1.0}/setup.py +0 -0
  39. {pthelma-2.0.0 → pthelma-2.1.0}/src/enhydris_api_client/__init__.py +0 -0
  40. {pthelma-2.0.0 → pthelma-2.1.0}/src/enhydris_cache/__init__.py +0 -0
  41. {pthelma-2.0.0 → pthelma-2.1.0}/src/enhydris_cache/cli.py +0 -0
  42. {pthelma-2.0.0 → pthelma-2.1.0}/src/enhydris_cache/enhydris_cache.py +0 -0
  43. {pthelma-2.0.0 → pthelma-2.1.0}/src/evaporation/__init__.py +0 -0
  44. {pthelma-2.0.0 → pthelma-2.1.0}/src/evaporation/cli.py +0 -0
  45. {pthelma-2.0.0 → pthelma-2.1.0}/src/evaporation/evaporation.py +0 -0
  46. {pthelma-2.0.0 → pthelma-2.1.0}/src/haggregate/__init__.py +0 -0
  47. {pthelma-2.0.0 → pthelma-2.1.0}/src/haggregate/cli.py +0 -0
  48. {pthelma-2.0.0 → pthelma-2.1.0}/src/haggregate/regularize.pyx +0 -0
  49. {pthelma-2.0.0 → pthelma-2.1.0}/src/hspatial/__init__.py +0 -0
  50. {pthelma-2.0.0 → pthelma-2.1.0}/src/hspatial/cli.py +0 -0
  51. {pthelma-2.0.0 → pthelma-2.1.0}/src/hspatial/hspatial.py +0 -0
  52. {pthelma-2.0.0 → pthelma-2.1.0}/src/hspatial/test.py +0 -0
  53. {pthelma-2.0.0 → pthelma-2.1.0}/src/htimeseries/__init__.py +0 -0
  54. {pthelma-2.0.0 → pthelma-2.1.0}/src/htimeseries/htimeseries.py +0 -0
  55. {pthelma-2.0.0 → pthelma-2.1.0}/src/htimeseries/timezone_utils.py +0 -0
  56. {pthelma-2.0.0 → pthelma-2.1.0}/src/pthelma/__init__.py +0 -0
  57. {pthelma-2.0.0 → pthelma-2.1.0}/src/pthelma.egg-info/SOURCES.txt +0 -0
  58. {pthelma-2.0.0 → pthelma-2.1.0}/src/pthelma.egg-info/dependency_links.txt +0 -0
  59. {pthelma-2.0.0 → pthelma-2.1.0}/src/pthelma.egg-info/entry_points.txt +0 -0
  60. {pthelma-2.0.0 → pthelma-2.1.0}/src/pthelma.egg-info/requires.txt +0 -0
  61. {pthelma-2.0.0 → pthelma-2.1.0}/src/pthelma.egg-info/top_level.txt +0 -0
  62. {pthelma-2.0.0 → pthelma-2.1.0}/src/rocc/__init__.py +0 -0
  63. {pthelma-2.0.0 → pthelma-2.1.0}/src/rocc/calculation.pyx +0 -0
  64. {pthelma-2.0.0 → pthelma-2.1.0}/tests/__init__.py +0 -0
  65. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_api_client/__init__.py +0 -0
  66. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_api_client/test_e2e.py +0 -0
  67. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_api_client/test_misc.py +0 -0
  68. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_api_client/test_station.py +0 -0
  69. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_api_client/test_timeseries.py +0 -0
  70. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_api_client/test_timeseriesgroup.py +0 -0
  71. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_api_client/test_tsdata.py +0 -0
  72. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_cache/__init__.py +0 -0
  73. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_cache/test_cli.py +0 -0
  74. {pthelma-2.0.0 → pthelma-2.1.0}/tests/enhydris_cache/test_enhydris_cache.py +0 -0
  75. {pthelma-2.0.0 → pthelma-2.1.0}/tests/evaporation/__init__.py +0 -0
  76. {pthelma-2.0.0 → pthelma-2.1.0}/tests/evaporation/test_cli.py +0 -0
  77. {pthelma-2.0.0 → pthelma-2.1.0}/tests/evaporation/test_evaporation.py +0 -0
  78. {pthelma-2.0.0 → pthelma-2.1.0}/tests/haggregate/__init__.py +0 -0
  79. {pthelma-2.0.0 → pthelma-2.1.0}/tests/haggregate/test_cli.py +0 -0
  80. {pthelma-2.0.0 → pthelma-2.1.0}/tests/haggregate/test_regularize.py +0 -0
  81. {pthelma-2.0.0 → pthelma-2.1.0}/tests/hspatial/__init__.py +0 -0
  82. {pthelma-2.0.0 → pthelma-2.1.0}/tests/hspatial/test_cli.py +0 -0
  83. {pthelma-2.0.0 → pthelma-2.1.0}/tests/hspatial/test_hspatial.py +0 -0
  84. {pthelma-2.0.0 → pthelma-2.1.0}/tests/htimeseries/__init__.py +0 -0
  85. {pthelma-2.0.0 → pthelma-2.1.0}/tests/htimeseries/test_htimeseries.py +0 -0
  86. {pthelma-2.0.0 → pthelma-2.1.0}/tests/htimeseries/test_timezone_utils.py +0 -0
  87. {pthelma-2.0.0 → pthelma-2.1.0}/tests/rocc/__init__.py +0 -0
  88. {pthelma-2.0.0 → pthelma-2.1.0}/tests/rocc/test_rocc.py +0 -0
@@ -37,6 +37,7 @@ jobs:
37
37
 
38
38
  - name: Install Dependencies
39
39
  run: |
40
+ sudo apt-get update
40
41
  sudo apt-get install -y gdal-bin libgdal-dev postgresql-14-postgis-3
41
42
  source ~/.venv/bin/activate
42
43
  # numpy<2 is needed for gdal to contain support for gdal array
@@ -2,6 +2,14 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+
6
+ 2.1.0 (2025-01-10)
7
+ ==================
8
+
9
+ * haggregate: The ``missing_flag`` parameter to ``aggregate()`` can now
10
+ include the substring "{}", which will be replaced with the number of
11
+ missing values.
12
+
5
13
  2.0.0 (2024-12-04)
6
14
  ==================
7
15
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: pthelma
3
- Version: 2.0.0
3
+ Version: 2.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,7 +34,14 @@ haggregate API
34
34
  than *min_count* source records corresponding, the resulting
35
35
  destination record is null; otherwise, the destination record is
36
36
  derived even though some records are missing. In that case, the flag
37
- specified by *missing_flag* is raised in the destination record.
37
+ specified by *missing_flag* is raised in the destination record. If
38
+ missing flag contains the string ``{}``, it is replaced with the
39
+ number of missing records. The recommended setting for *missing_flag*
40
+ is ``MISSING{}``, which, for example, will result in ``MISSING3``
41
+ when three records are missing. The default for *missing_flag* is
42
+ ``MISS`` for backwards compatibility (it was ``MISS`` for some years,
43
+ however this was undocumented), but this is deprecated; use
44
+ ``MISSING{}``.
38
45
 
39
46
  If an error occurs, such as *ts* not having a strictly regular step,
40
47
  :exc:`AggregateError` (or a subclass) is raised.
@@ -55,7 +55,7 @@ explanatory comments that follow it:
55
55
  base_dir = /var/cache/timeseries/
56
56
  target_step = 1h
57
57
  min_count = 2
58
- missing_flag = DATEINSERT
58
+ missing_flag = MISSING{}
59
59
 
60
60
  [temperature]
61
61
  source_file = temperature-10min.hts
@@ -133,7 +133,8 @@ General parameters
133
133
  to a destination record, the resulting destination record is null;
134
134
  otherwise, the destination record is derived even though some records
135
135
  are missing. In that case, the flag specified by
136
- :option:`missing_flag` is raised in the destination record.
136
+ :option:`missing_flag` is raised in the destination record. See
137
+ :meth:`~haggregate.aggregate` for details on :option:`missing_flag`.
137
138
 
138
139
  Time series sections
139
140
  --------------------
@@ -75,8 +75,8 @@ class Aggregation:
75
75
  def get_result_flags(self):
76
76
  max_count = int(pd.Timedelta(self.result.time_step) / self.source.freq)
77
77
  values_count = self.resampler.count()
78
- self.result.data["flags"] = (values_count < max_count).apply(
79
- lambda x: self.missing_flag if x else ""
78
+ self.result.data["flags"] = (max_count - values_count).apply(
79
+ lambda x: self.missing_flag.format(x) if x else ""
80
80
  )
81
81
 
82
82