weatherdb 1.1.2__tar.gz → 1.2.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. {weatherdb-1.1.2 → weatherdb-1.2.1}/.gitlab-ci.yml +40 -10
  2. {weatherdb-1.1.2 → weatherdb-1.2.1}/CHANGES.md +21 -1
  3. {weatherdb-1.1.2 → weatherdb-1.2.1}/PKG-INFO +1 -1
  4. {weatherdb-1.1.2 → weatherdb-1.2.1}/docker/docker-compose.yaml +5 -1
  5. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/Methode.md +5 -1
  6. weatherdb-1.2.1/docs/source/api/weatherdb.broker.rst +7 -0
  7. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/weatherdb.db.rst +10 -0
  8. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/weatherdb.rst +0 -1
  9. weatherdb-1.2.1/docs/source/api/weatherdb.station.GroupStation.rst +5 -0
  10. weatherdb-1.2.1/docs/source/api/weatherdb.station.StationBases.rst +18 -0
  11. weatherdb-1.2.1/docs/source/api/weatherdb.station.StationET.rst +5 -0
  12. weatherdb-1.2.1/docs/source/api/weatherdb.station.StationP.rst +5 -0
  13. weatherdb-1.2.1/docs/source/api/weatherdb.station.StationPD.rst +6 -0
  14. weatherdb-1.2.1/docs/source/api/weatherdb.station.StationT.rst +5 -0
  15. weatherdb-1.2.1/docs/source/api/weatherdb.station.rst +17 -0
  16. weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsBase.rst +15 -0
  17. weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsET.rst +6 -0
  18. weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsP.rst +6 -0
  19. weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsPD.rst +7 -0
  20. weatherdb-1.2.1/docs/source/api/weatherdb.stations.StationsT.rst +7 -0
  21. weatherdb-1.2.1/docs/source/api/weatherdb.stations.rst +15 -0
  22. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/weatherdb.utils.rst +2 -0
  23. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/conf.py +3 -0
  24. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/Quickstart.md +2 -1
  25. weatherdb-1.2.1/tests/test-data/DEM/COP-DEM_GLO-30-DGED__2023_1_clipped.tif +0 -0
  26. weatherdb-1.2.1/tests/test-data/DEM/README.md +3 -0
  27. weatherdb-1.2.1/tests/test-data/DEM/eula_F.pdf +0 -0
  28. weatherdb-1.2.1/tests/test-data/regionalisation/DWD-grid_ma_1991_2020_DGM25_clipped.tif +0 -0
  29. weatherdb-1.2.1/tests/test-data/regionalisation/HYRAS_ma_1991_2020_DGM25_clipped.tif +0 -0
  30. weatherdb-1.2.1/tests/test-data/regionalisation/README.md +3 -0
  31. weatherdb-1.2.1/tests/test-data/test-data-config.ini +28 -0
  32. weatherdb-1.2.1/weatherdb/_version.py +1 -0
  33. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/broker.py +12 -2
  34. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/cli.py +20 -5
  35. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/config/config_default.ini +30 -1
  36. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationBases.py +91 -17
  37. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsBase.py +16 -3
  38. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/get_data.py +12 -7
  39. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/PKG-INFO +1 -1
  40. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/SOURCES.txt +19 -7
  41. weatherdb-1.1.2/docs/source/api/weatherDB.broker.rst +0 -10
  42. weatherdb-1.1.2/docs/source/api/weatherdb.station.rst +0 -56
  43. weatherdb-1.1.2/docs/source/api/weatherdb.stations.rst +0 -46
  44. weatherdb-1.1.2/weatherDB.egg-info/PKG-INFO +0 -761
  45. weatherdb-1.1.2/weatherDB.egg-info/SOURCES.txt +0 -84
  46. weatherdb-1.1.2/weatherDB.egg-info/entry_points.txt +0 -2
  47. weatherdb-1.1.2/weatherDB.egg-info/requires.txt +0 -21
  48. weatherdb-1.1.2/weatherDB.egg-info/top_level.txt +0 -5
  49. weatherdb-1.1.2/weatherdb/_version.py +0 -1
  50. weatherdb-1.1.2/weatherdb.egg-info/dependency_links.txt +0 -1
  51. {weatherdb-1.1.2 → weatherdb-1.2.1}/.dockerignore +0 -0
  52. {weatherdb-1.1.2 → weatherdb-1.2.1}/.github/workflows/cleanup-cache.yml +0 -0
  53. {weatherdb-1.1.2 → weatherdb-1.2.1}/.github/workflows/python-publish.yml +0 -0
  54. {weatherdb-1.1.2 → weatherdb-1.2.1}/.github/workflows/python-test.yml +0 -0
  55. {weatherdb-1.1.2 → weatherdb-1.2.1}/.gitignore +0 -0
  56. {weatherdb-1.1.2 → weatherdb-1.2.1}/.gitlab/merge_request_templates/new_version.md +0 -0
  57. {weatherdb-1.1.2 → weatherdb-1.2.1}/.readthedocs.yaml +0 -0
  58. {weatherdb-1.1.2 → weatherdb-1.2.1}/LICENSE +0 -0
  59. {weatherdb-1.1.2 → weatherdb-1.2.1}/MANIFEST.in +0 -0
  60. {weatherdb-1.1.2 → weatherdb-1.2.1}/README.md +0 -0
  61. {weatherdb-1.1.2 → weatherdb-1.2.1}/docker/Dockerfile +0 -0
  62. {weatherdb-1.1.2 → weatherdb-1.2.1}/docker/docker-compose_test.yaml +0 -0
  63. {weatherdb-1.1.2 → weatherdb-1.2.1}/docker/start-docker-test.sh +0 -0
  64. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/requirements.txt +0 -0
  65. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/Changelog.md +0 -0
  66. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/License.rst +0 -0
  67. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/_static/custom.css +0 -0
  68. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/_static/favicon.ico +0 -0
  69. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/_static/logo.png +0 -0
  70. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/api.rst +0 -0
  71. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/cli.rst +0 -0
  72. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/api/weatherdb.config.rst +0 -0
  73. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/index.rst +0 -0
  74. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/Configuration.md +0 -0
  75. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/Hosting.md +0 -0
  76. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/Install.md +0 -0
  77. {weatherdb-1.1.2 → weatherdb-1.2.1}/docs/source/setup/setup.rst +0 -0
  78. {weatherdb-1.1.2 → weatherdb-1.2.1}/pyproject.toml +0 -0
  79. {weatherdb-1.1.2 → weatherdb-1.2.1}/setup.cfg +0 -0
  80. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/__init__.py +0 -0
  81. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/README.md +0 -0
  82. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/alembic.ini +0 -0
  83. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/config.py +0 -0
  84. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/env.py +0 -0
  85. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/script.py.mako +0 -0
  86. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/versions/V1.0.0_initial_database_creation.py +0 -0
  87. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/versions/V1.0.2_more_charachters_for_settings+term_station_ma_raster.py +0 -0
  88. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/versions/V1.0.5_fix-ma-raster-values.py +0 -0
  89. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/alembic/versions/V1.0.6_update-views.py +0 -0
  90. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/config/ConfigParser.py +0 -0
  91. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/config/__init__.py +0 -0
  92. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/__init__.py +0 -0
  93. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/connections.py +0 -0
  94. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/fixtures/RichterParameters.json +0 -0
  95. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/models.py +0 -0
  96. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/queries/get_quotient.py +0 -0
  97. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/db/views.py +0 -0
  98. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/GroupStation.py +0 -0
  99. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationET.py +0 -0
  100. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationP.py +0 -0
  101. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationPD.py +0 -0
  102. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/StationT.py +0 -0
  103. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/__init__.py +0 -0
  104. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/station/constants.py +0 -0
  105. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/GroupStations.py +0 -0
  106. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsBaseTET.py +0 -0
  107. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsET.py +0 -0
  108. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsP.py +0 -0
  109. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsPD.py +0 -0
  110. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/StationsT.py +0 -0
  111. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/stations/__init__.py +0 -0
  112. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/TimestampPeriod.py +0 -0
  113. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/__init__.py +0 -0
  114. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/dwd.py +0 -0
  115. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/geometry.py +0 -0
  116. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb/utils/logging.py +0 -0
  117. {weatherdb-1.1.2/weatherDB.egg-info → weatherdb-1.2.1/weatherdb.egg-info}/dependency_links.txt +0 -0
  118. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/entry_points.txt +0 -0
  119. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/requires.txt +0 -0
  120. {weatherdb-1.1.2 → weatherdb-1.2.1}/weatherdb.egg-info/top_level.txt +0 -0
@@ -1,8 +1,9 @@
1
1
  stages:
2
2
  - test_single
3
3
  - test_matrix
4
+ - test_manual
4
5
  - build
5
- - deploy
6
+ - release
6
7
 
7
8
  workflow:
8
9
  auto_cancel:
@@ -21,10 +22,10 @@ test_single:
21
22
  before_script:
22
23
  - python3 -m pip install --upgrade pip --root-user-action=ignore
23
24
  - python3 -m pip install unittest-xml-reporting --root-user-action=ignore
24
- script:
25
25
  - python3 -m pip install .[optionals] --root-user-action=ignore
26
26
  - mkdir -p $WEATHERDB_DATA_BASE_DIR
27
27
  - mkdir -p test-reports
28
+ script:
28
29
  - python3 -m xmlrunner discover -s tests -p testSuite.py -o test-reports
29
30
  cache:
30
31
  - key: weatherdb-data-cache-$CI_COMMIT_REF_SLUG
@@ -61,11 +62,13 @@ test_single:
61
62
  WEATHERDB_LOGGING_HANDLER: console
62
63
  WEATHERDB_LOGGING_LEVEL: DEBUG
63
64
  WEATHERDB_HORIZON_RADIUS: 40000
65
+ WEATHERDB_OPENTOPO_API_KEY: $WEATHERDB_OPENTOPO_API_KEY
64
66
  WEATHERDB_TEST_ARTIFACT_DIR: $CI_PROJECT_DIR/artifacts
65
67
  WEATHERDB_TEST_ARTIFACT_DB_DUMP: ON_FAILURE
66
68
  WEATHERDB_TEST_ARTIFACT_LIST_DATA_FILES: ON_FAILURE
67
69
  WEATHERDB_TEST_ARTIFACT_COPY_USER_CONFIG: ON_FAILURE
68
- WEATHERDB_OPENTOPO_API_KEY: $WEATHERDB_OPENTOPO_API_KEY
70
+ WEATHERDB_TEST_DR_COPY_RASTERS: True
71
+ WEATHERDB_TEST_DR_UPDATE_USER_CONFIG: True
69
72
  DOCKER_ENV: test
70
73
  tags:
71
74
  - docker
@@ -73,20 +76,32 @@ test_single:
73
76
  test_matrix:
74
77
  stage: test_matrix
75
78
  extends: test_single
76
- dependencies:
77
- - test_single
78
79
  parallel:
79
80
  matrix:
80
81
  - PY_VERSION: ["3.9","3.10","3.11","3.12","3.13"]
81
82
  variables:
82
83
  PYTHON_VERSION: $PY_VERSION
83
84
 
85
+ test_download_rasters:
86
+ extends: test_single
87
+ stage: test_manual
88
+ rules:
89
+ - when: manual
90
+ allow_failure: true
91
+ script:
92
+ - python3 -m xmlrunner discover -s tests -p test_downloadRasters.py --complete -o test-reports
93
+ variables:
94
+ PYTHON_VERSION: $PY_VERSION
95
+ parallel:
96
+ matrix:
97
+ - PY_VERSION: ["3.9","3.10","3.11","3.12","3.13"]
98
+
84
99
  build:
100
+ stage: build
85
101
  rules:
86
- - if: $CI_COMMIT_TAG =~ /^[Vv]\d+\.\d+\.\d+$/
102
+ - if: $CI_COMMIT_TAG =~ /^[Vv]*\d+\.\d+\.\d+$/
87
103
  dependencies:
88
104
  - test_matrix
89
- stage: build
90
105
  image: python:3.11
91
106
  script:
92
107
  - python -m pip install --upgrade pip --root-user-action=ignore
@@ -100,12 +115,12 @@ build:
100
115
  tags:
101
116
  - docker
102
117
 
103
- deploy:
118
+ release_pypi:
119
+ stage: release
104
120
  rules:
105
121
  - !reference [build, rules]
106
122
  dependencies:
107
123
  - build
108
- stage: deploy
109
124
  image: python:3.11
110
125
  script:
111
126
  - python -m pip install --upgrade pip --root-user-action=ignore
@@ -116,4 +131,19 @@ deploy:
116
131
  TWINE_PASSWORD: $TWINE_PASSWORD
117
132
  tags:
118
133
  - docker
119
- interruptible: false
134
+ interruptible: false
135
+
136
+ release_gitlab:
137
+ stage: release
138
+ rules:
139
+ - !reference [build, rules]
140
+ image: registry.gitlab.com/gitlab-org/release-cli:latest
141
+ dependencies:
142
+ - build
143
+ - release_pypi
144
+ script:
145
+ - echo "running release_gitlab"
146
+ release:
147
+ name: '$CI_COMMIT_TAG'
148
+ tag_name: '$CI_COMMIT_TAG'
149
+ description: '$CI_COMMIT_TAG_MESSAGE'
@@ -1,5 +1,22 @@
1
1
  # Change-log
2
2
 
3
+ ## Version 1.2.1
4
+
5
+ - fix: filllup linear regression did not take configuration value and therefor did never work
6
+ - config: change LINEAR_INTERPOLATION_LIMIT to be a category
7
+ - cli: add version parameter
8
+ - multiprocessing: make process count configurable through user configuration
9
+ - broker: prevent broker inactivation by other broker
10
+ - broker: add force deactivate all method to forcefully change the database flag of active brokers
11
+
12
+ ## Version 1.2.0
13
+
14
+ > [!WARNING]
15
+ > This versions update did have an error and the lienear regression doesn't work at all. PLease use version 1.2.1
16
+
17
+ - tests: add test rasters and make downloading the rasters a manual job on GitLab as there were many problems
18
+ - fillup: add method to linearly interpolate residual missing values
19
+
3
20
  ## Version 1.1.2
4
21
 
5
22
  - add method to download DEM data from OpenTopography-API
@@ -12,7 +29,10 @@
12
29
 
13
30
  ## Version 1.1.0
14
31
 
15
- - !!rename module from weatherDB to weatherdb to be compliant with PEP 8!!
32
+ > [!NOTE]
33
+ > **major change:** The module got renamed to `weatherdb`, you need to adapt this in your import and cli statements
34
+
35
+ - rename module from weatherDB to weatherdb to be compliant with PEP 8
16
36
  So you need to import the module now with `import weatherdb`
17
37
  - fix some missing stationN variables to stationsP
18
38
  - fix: TimestampPeriod._check_period
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: weatherdb
3
- Version: 1.1.2
3
+ Version: 1.2.1
4
4
  Summary: This is a package to work with and to create the Weather Database which handles, checks, fills and corrects DWD Weather Station data.
5
5
  Author-email: Max Schmit <max.schmit@hydrology.uni-freiburg.de>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -14,12 +14,14 @@ services:
14
14
  WEATHERDB_USER_CONFIG_FILE: /home/config_user.yaml
15
15
  WEATHERDB_DATA_BASE_DIR: /home/data
16
16
  WEATHERDB_HANDLE_NON_EXISTING_CONFIG: create
17
+ WEATHERDB_OPENTOPO_API_KEY: /run/secrets/opentopo_api_key
17
18
  DOCKER_ENV: main
18
19
  volumes:
19
20
  - weatherdb_home:/home
20
21
  command: ["sleep", "infinity"] # to keep awake
21
22
  secrets:
22
23
  - db_password
24
+ - opentopo_api_key
23
25
  develop:
24
26
  watch:
25
27
  - action: rebuild
@@ -53,6 +55,8 @@ volumes:
53
55
  secrets:
54
56
  db_password:
55
57
  file: ./db_password.docker-secret
58
+ opentopo_api_key:
59
+ file: ./opentopo_api_key.docker-secret
56
60
 
57
61
  # start from parent folder with `docker compose -f docker\\docker-compose.yaml up --build`
58
- # To connect to ther weatherdb service use `docker-compose exec weatherdb bash`
62
+ # To connect to the weatherdb service use `docker-compose exec weatherdb bash`
@@ -117,7 +117,11 @@ N_{neighbor} * \dfrac{N_{station,ma,winter}}{N_{neighbor,ma,winter}} \space if\s
117
117
  N_{neighbor} * \dfrac{N_{station,ma,summer}}{N_{neighbor,ma,summer}} \space if\space month\notin[4:9]
118
118
  \end{cases}$
119
119
 
120
- For the precipitation stations only stations within a 100 km radius are taken to fill missing values. For the potential Evapotranspiration and the temperature this radius is 150km. For the temperature stations the median of the regionalised values from the 5 closest stations (but not more than 150 km away) is taken to fill missing values.
120
+ For the precipitation stations only stations within a 110 km radius are taken to fill missing values. For the potential Evapotranspiration and the temperature this radius is 150km. For the temperature stations the median of the regionalised values from the 5 closest stations (but not more than 150 km away) is taken to fill missing values. Those limits can get configured in the user configurations.
121
+
122
+ ### linear interpolation
123
+
124
+ After missing values got filled with regionalised values from the neighboring stations there can still be missing values left. To fill those residual missing values, they get interpolated linearly. Those linear interpolations have configurable limits for how big the interval of missing values can be. The default values are 1h for precipitation and 2 days for temperature and evapotranspiration.
121
125
 
122
126
  ### adjusting precipitation to daily station measurements
123
127
 
@@ -0,0 +1,7 @@
1
+ broker
2
+ ------
3
+
4
+ .. autoclass:: weatherdb.broker.Broker
5
+
6
+
7
+
@@ -19,5 +19,15 @@ base models
19
19
 
20
20
  .. autoclass:: weatherdb.db.models.MetaBaseQC
21
21
 
22
+ views
23
+ -----
22
24
 
25
+ Those are the database views
26
+
27
+ .. automodule:: weatherdb.db.views
28
+
29
+ connections
30
+ -----------
31
+
32
+ .. automodule:: weatherdb.db.connections
23
33
 
@@ -1,7 +1,6 @@
1
1
  weatherdb
2
2
  =========
3
3
 
4
-
5
4
  .. toctree::
6
5
  :maxdepth: 2
7
6
 
@@ -0,0 +1,5 @@
1
+ GroupStation
2
+ ============
3
+
4
+ .. py:module:: weatherdb.station
5
+ .. autoclass:: weatherdb.station.GroupStation
@@ -0,0 +1,18 @@
1
+ StationBases
2
+ ============
3
+
4
+ Those are the base station classes on which the real station classes above depend on.
5
+ None of them is working on its own, because the class variables are not yet set correctly.
6
+
7
+ .. py:module:: weatherdb.station.StationBases
8
+
9
+ .. autoclass:: weatherdb.station.StationBases.StationBase
10
+
11
+
12
+ .. autoclass:: weatherdb.station.StationBases.StationPBase
13
+
14
+
15
+ .. autoclass:: weatherdb.station.StationBases.StationCanVirtualBase
16
+
17
+
18
+ .. autoclass:: weatherdb.station.StationBases.StationTETBase
@@ -0,0 +1,5 @@
1
+ StationET
2
+ =========
3
+
4
+ .. py:module:: weatherdb.station
5
+ .. autoclass:: weatherdb.station.StationET
@@ -0,0 +1,5 @@
1
+ StationP
2
+ ========
3
+
4
+ .. py:module:: weatherdb.station
5
+ .. autoclass:: weatherdb.station.StationP
@@ -0,0 +1,6 @@
1
+ StationPD
2
+ =========
3
+
4
+ .. py:module:: weatherdb.station
5
+ .. autoclass:: weatherdb.station.StationPD
6
+ :exclude-members: quality_check, last_imp_quality_check, get_corr, get_adj, get_qc
@@ -0,0 +1,5 @@
1
+ StationT
2
+ ========
3
+
4
+ .. py:module:: weatherdb.station
5
+ .. autoclass:: weatherdb.station.StationT
@@ -0,0 +1,17 @@
1
+ station
2
+ --------
3
+
4
+ .. py:module:: weatherdb.station
5
+
6
+ .. toctree::
7
+ :maxdepth: 1
8
+ :titlesonly:
9
+
10
+ weatherdb.station.StationP
11
+ weatherdb.station.StationT
12
+ weatherdb.station.StationET
13
+ weatherdb.station.StationPD
14
+ weatherdb.station.GroupStation
15
+ weatherdb.station.StationBases
16
+
17
+
@@ -0,0 +1,15 @@
1
+ StationsBase
2
+ ============
3
+
4
+ Those are the base stations classes on which the real stations classes above depend on.
5
+ None of them is working on its own, because the class variables are not yet set correctly.
6
+
7
+ .. py:module:: weatherdb.stations.StationsBase
8
+
9
+ .. autoclass:: weatherdb.stations.StationsBase.StationsBase
10
+
11
+ .. autoclasstoc::
12
+
13
+ .. autoclass:: weatherdb.stations.StationsBaseTET.StationsBaseTET
14
+
15
+ .. autoclasstoc::
@@ -0,0 +1,6 @@
1
+ StationsET
2
+ ==========
3
+
4
+ .. py:module:: weatherdb.stations
5
+
6
+ .. autoclass:: weatherdb.stations.StationsET
@@ -0,0 +1,6 @@
1
+ StationsP
2
+ =========
3
+
4
+ .. py:module:: weatherdb.stations
5
+
6
+ .. autoclass:: weatherdb.stations.StationsP
@@ -0,0 +1,7 @@
1
+ StationsPD
2
+ ==========
3
+
4
+ .. py:module:: weatherdb.stations
5
+
6
+ .. autoclass:: weatherdb.stations.StationsP
7
+
@@ -0,0 +1,7 @@
1
+ StationsT
2
+ =========
3
+
4
+ .. py:module:: weatherdb.stations
5
+
6
+ .. autoclass:: weatherdb.stations.StationsT
7
+
@@ -0,0 +1,15 @@
1
+ stations
2
+ --------
3
+
4
+ .. py:module:: weatherdb.stations
5
+
6
+ .. toctree::
7
+ :maxdepth: 1
8
+ :titlesonly:
9
+
10
+ weatherdb.stations.StationsP
11
+ weatherdb.stations.StationsT
12
+ weatherdb.stations.StationsET
13
+ weatherdb.stations.StationsPD
14
+ weatherdb.stations.GroupStations
15
+ weatherdb.stations.StationsBase
@@ -3,6 +3,8 @@ utils
3
3
 
4
4
  In this module there are several utilities used by the WeatherDB package, you shouldn't need to use them directly.
5
5
 
6
+ TimestampPeriod
7
+ ---------------
6
8
  .. autoclass:: weatherdb.utils.TimestampPeriod
7
9
 
8
10
  dwd
@@ -84,6 +84,9 @@ autoclasstoc_sections = [
84
84
  # Autosummary options
85
85
  autosummary_generate = True
86
86
  autosummary_generate_overwrite = True
87
+ suppress_warnings = [
88
+ 'autosummary.import_cycle',
89
+ ]
87
90
 
88
91
  # intersphinx
89
92
  intersphinx_mapping = {
@@ -46,7 +46,8 @@ So there is:
46
46
  - "raw" : the raw measurements as on the DWD server
47
47
  - "qc" : The quality checked data
48
48
  - "filled" : The filled timeseries
49
- - "filled_by" : The station ID of the station from which the data was taken to fill the measurements
49
+ - "filled_by" : The station ID of the station from which the data was taken to fill the measurements.
50
+ If the value was filled by linear intrepolation "filled_by" is `-1`
50
51
  - "corr" : The Richter corrected timeserie.
51
52
 
52
53
  If you want more than just one kind of timeseries, e.g. the filled timeseries, together with the id from which station the respective field got filled with use:
@@ -0,0 +1,3 @@
1
+ # Readme
2
+
3
+ The DEM file in this folder originates from Copernicus and got clipped to the region of analysis in the test environment + 40km
@@ -0,0 +1,3 @@
1
+ # Readme
2
+
3
+ The files in this folder originate from https://zenodo.org/records/10066045 and got clipped to the region of analysis in the test environment
@@ -0,0 +1,28 @@
1
+ ; Those are configs that should get loaded, when the test files are loaded
2
+ [data:rasters]
3
+ DEMS = ${data:BASE_DIR}/DEM/COP-DEM_GLO-30-DGED__2023_1_clipped.tif
4
+
5
+ [data:rasters:hyras]
6
+ FILE = ${data:BASE_DIR}/regionalisation/HYRAS_ma_1991_2020_DGM25_clipped.tif
7
+ BAND_P_WIHY = n_hyras_wihj
8
+ BAND_P_SUHY = n_hyras_sohj
9
+ BAND_P_YEAR = n_hyras_year
10
+ SRID = 3035
11
+ FACTOR_P_WIHY = 1
12
+ FACTOR_P_SUHY = 1
13
+ FACTOR_P_YEAR = 1
14
+
15
+ [data:rasters:dwd]
16
+ FILE = ${data:BASE_DIR}/regionalisation/DWD-grid_ma_1991_2020_DGM25_clipped.tif
17
+ BAND_P_WIHY = n_wihj
18
+ BAND_P_SUHY = n_sohj
19
+ BAND_P_YEAR = n_year
20
+ BAND_T_YEAR = t_year
21
+ BAND_ET_YEAR = et_year
22
+ SRID = 3035
23
+ FACTOR_P_WIHY = 1
24
+ FACTOR_P_SUHY = 1
25
+ FACTOR_P_YEAR = 1
26
+ FACTOR_T_YEAR = 0.1
27
+ FACTOR_ET_YEAR = 1
28
+
@@ -0,0 +1 @@
1
+ __version__ = "1.2.1"
@@ -647,8 +647,9 @@ class Broker(object):
647
647
  is_active : bool
648
648
  Whether the broker is active.
649
649
  """
650
+ if self._is_active != is_active:
651
+ self.set_setting("broker_active", str(is_active))
650
652
  self._is_active = is_active
651
- self.set_setting("broker_active", str(is_active))
652
653
 
653
654
  def _deactivate(self):
654
655
  self.is_active = False
@@ -664,4 +665,13 @@ class Broker(object):
664
665
  yield self
665
666
  finally:
666
667
  self._deactivate()
667
- atexit.unregister(self._deactivate)
668
+ atexit.unregister(self._deactivate)
669
+
670
+ def force_deactivate_all(self):
671
+ """Forcefully set the active broker flag in the database to deactivated.
672
+
673
+ This is useful if the broker got exited before it could deactivate itself.
674
+ """
675
+ if self.is_active:
676
+ self._deactivate()
677
+ self.set_setting("broker_active", "False")
@@ -16,6 +16,7 @@ import weatherdb
16
16
  show_default=True
17
17
  )
18
18
  )
19
+ @click.version_option(weatherdb.__version__)
19
20
  @click.option('--do-logging/--no-logging',
20
21
  is_flag=True, default=True, show_default=True,
21
22
  help="Should the logging be done to the console?")
@@ -98,8 +99,11 @@ def create_user_config(file, on_exists):
98
99
  def download_ma_rasters(which, overwrite, update_user_config):
99
100
  """Get the multi annual rasters on which bases the regionalisation is done.
100
101
 
101
- The refined multi annual datasets, that are downloaded are published on Zenodo:
102
- Schmit, M.; Weiler, M. (2023). German weather services (DWD) multi annual meteorological rasters for the climate period 1991-2020 refined to 25m grid (1.0.0) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.10066045
102
+ The refined multi annual datasets, that are downloaded are published on Zenodo. [1]_
103
+
104
+ References:
105
+ -----------
106
+ .. [1] Schmit, M.; Weiler, M. (2023). German weather services (DWD) multi annual meteorological rasters for the climate period 1991-2020 refined to 25m grid (1.0.0) [Data set]. Zenodo. `DOI:10.5281/zenodo.10066045 <https://doi.org/10.5281/zenodo.10066045>`_
103
107
  """
104
108
  click.echo("starting downloading multi annual raster data")
105
109
  from weatherdb.utils.get_data import download_ma_rasters
@@ -127,7 +131,7 @@ def download_ma_rasters(which, overwrite, update_user_config):
127
131
  help="The service to use to download the DEM. Options are 'prism' or 'openTopography'. " +\
128
132
  "You can use this option muultiple times to test both in the given order until the file could be downloaded.")
129
133
  def download_dem(out_dir, overwrite, extent, update_user_config, service="prism"):
130
- """Download the newest DEM data from the Copernicus Sentinel dataset.
134
+ """Download the newest DEM data from the Copernicus Sentinel dataset. [1]_
131
135
 
132
136
  Only the GLO-30 DEM, wich has a 30m resolution, is downloaded as it is freely available.
133
137
  If you register as a scientific researcher also the EEA-10, with 10 m resolution, is available.
@@ -136,8 +140,9 @@ def download_dem(out_dir, overwrite, extent, update_user_config, service="prism"
136
140
  After downloading the data, the files are merged and saved as a single tif file in the data directory in a subfolder called 'dems'.
137
141
  To use the DEM data in the WeatherDB, you will have to define the path to the tif file in the configuration file.
138
142
 
139
- Source:
140
- Copernicus DEM - Global and European Digital Elevation Model. Digital Surface Model (DSM) provided in 3 different resolutions (90m, 30m, 10m) with varying geographical extent (EEA: European and GLO: global) and varying format (INSPIRE, DGED, DTED). DOI:10.5270/ESA-c5d3d65.
143
+ References:
144
+ -----------
145
+ .. [1] Copernicus DEM - Global and European Digital Elevation Model. Digital Surface Model (DSM) provided in 3 different resolutions (90m, 30m, 10m) with varying geographical extent (EEA: European and GLO: global) and varying format (INSPIRE, DGED, DTED). `DOI:10.5270/ESA-c5d3d65 <https://doi.org/10.5270/ESA-c5d3d65>`_
141
146
  """
142
147
  click.echo("Starting downloading digital elevation model from Copernicus")
143
148
  from weatherdb.utils.get_data import download_dem
@@ -221,6 +226,16 @@ def set_db_version():
221
226
  else:
222
227
  click.echo("aborting setting db version")
223
228
 
229
+ @cli.command(short_help="Forcefully set the active broker flag in the database to deactivated. This is useful if the broker got exited before it could deactivate itself. (!!!Only use this if you're sure that the database did all the necessary updates!!!)")
230
+ def force_deactivate_all_broker():
231
+ click.echo(dedent("""
232
+ Are you sure that there is no more broker running? This could lead to problems as multiple brokers could run at the same time contradicting themself."""))
233
+ if click.confirm("Are you sure you want to set the activation flag in the database to deactivated?"):
234
+ click.echo("deactivating the brokers flag")
235
+ broker = weatherdb.broker.Broker()
236
+ broker.force_deactivate_all()
237
+ else:
238
+ click.echo("aborting the deactivation of the brokers flag")
224
239
 
225
240
  # cli
226
241
  # ---------------------------------------
@@ -143,17 +143,46 @@ RASTER_BUFFER_CRS = ${weatherdb:HORIZON_CRS}
143
143
  ; The default is 1999-01-01
144
144
  MIN_DATE = 1999-01-01
145
145
 
146
+ [weatherdb:LINEAR_INTERPOLATION_LIMIT]
147
+ ; When there are still NAs after filling with neighboring stations, the module can use linear interpolation to fill the gaps
148
+ ; The limit defines the maximum interval that is allowed to fill with linear interpolation
149
+ ; The value is given with a unit, e.g. 3 days, 30 minutes, 1 hour
150
+ ; For further explanation about the format see https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT
151
+ ; for precipitation, where the timeseries resolution is 10 minutes, 30 minutes means 3 missing values are interpolated, but not more.
152
+ ; If there shouldn't be any linear interpolation, set the limit to 0
153
+ ; For precipitation, the default is 1 hour
154
+ P = 1 hour
155
+ ; For temperature, the default is 2 days
156
+ T = 2 days
157
+ ; For Evapotranspiration, the default is 2 days
158
+ ET = 2 days
159
+
146
160
 
147
161
  [weatherdb:max_fillup_distance]
148
162
  ; The maximum distance in meters to use for the filling of the station data
149
163
  ; For each parameter (P, T, ET) the module uses a different distance
150
164
  ; Precipitation (P)
151
- P = 110000
165
+ P = 130000
152
166
  ; Temperature (T)
153
167
  T = 150000
154
168
  ; Evapotranspiration (ET)
155
169
  ET = 150000
156
170
 
171
+
172
+ [system:parallel_processes]
173
+ ; You can configure how many processes are getting started in parrallel when tghe database is updated.
174
+ ; depending on your system, the database can handle more or less processes
175
+ ; There are 2 possible ways to configure this.
176
+ ; either define the absolute number of processes:
177
+ ; ABSOLUTE =
178
+
179
+ ; or define the number of processes in relation to the number of CPUs,
180
+ ; by defining how many CPUs should be used less than the maximum available CPUs
181
+ ; if the absolute number is defined, the relative number is ignored
182
+ ; This is the default setting of cpu count -1
183
+ CPU_COUNT_MINUS = 1
184
+
185
+
157
186
  ; for developpers:
158
187
  ; ----------------
159
188
  ;