weatherdb 1.1.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. weatherdb-1.1.0/.dockerignore +30 -0
  2. weatherdb-1.1.0/.github/workflows/cleanup-cache.yml +34 -0
  3. weatherdb-1.1.0/.github/workflows/python-publish.yml +39 -0
  4. weatherdb-1.1.0/.github/workflows/python-test.yml +76 -0
  5. weatherdb-1.1.0/.gitignore +35 -0
  6. weatherdb-1.1.0/.gitlab/merge_request_templates/new_version.md +3 -0
  7. weatherdb-1.1.0/.gitlab-ci.yml +118 -0
  8. weatherdb-1.1.0/.readthedocs.yaml +27 -0
  9. weatherdb-1.1.0/CHANGES.md +379 -0
  10. weatherdb-1.1.0/LICENSE +674 -0
  11. weatherdb-1.1.0/MANIFEST.in +8 -0
  12. weatherdb-1.1.0/PKG-INFO +746 -0
  13. weatherdb-1.1.0/README.md +48 -0
  14. weatherdb-1.1.0/docker/Dockerfile +30 -0
  15. weatherdb-1.1.0/docker/docker-compose.yaml +58 -0
  16. weatherdb-1.1.0/docker/docker-compose_test.yaml +24 -0
  17. weatherdb-1.1.0/docker/start-docker-test.sh +6 -0
  18. weatherdb-1.1.0/docs/requirements.txt +10 -0
  19. weatherdb-1.1.0/docs/source/Changelog.md +2 -0
  20. weatherdb-1.1.0/docs/source/License.rst +7 -0
  21. weatherdb-1.1.0/docs/source/Methode.md +161 -0
  22. weatherdb-1.1.0/docs/source/_static/custom.css +8 -0
  23. weatherdb-1.1.0/docs/source/_static/favicon.ico +0 -0
  24. weatherdb-1.1.0/docs/source/_static/logo.png +0 -0
  25. weatherdb-1.1.0/docs/source/api/api.rst +15 -0
  26. weatherdb-1.1.0/docs/source/api/cli.rst +8 -0
  27. weatherdb-1.1.0/docs/source/api/weatherDB.broker.rst +10 -0
  28. weatherdb-1.1.0/docs/source/api/weatherDB.config.rst +7 -0
  29. weatherdb-1.1.0/docs/source/api/weatherDB.db.rst +23 -0
  30. weatherdb-1.1.0/docs/source/api/weatherDB.rst +22 -0
  31. weatherdb-1.1.0/docs/source/api/weatherDB.station.rst +56 -0
  32. weatherdb-1.1.0/docs/source/api/weatherDB.stations.rst +46 -0
  33. weatherdb-1.1.0/docs/source/api/weatherDB.utils.rst +22 -0
  34. weatherdb-1.1.0/docs/source/conf.py +137 -0
  35. weatherdb-1.1.0/docs/source/index.rst +33 -0
  36. weatherdb-1.1.0/docs/source/setup/Configuration.md +127 -0
  37. weatherdb-1.1.0/docs/source/setup/Hosting.md +9 -0
  38. weatherdb-1.1.0/docs/source/setup/Install.md +49 -0
  39. weatherdb-1.1.0/docs/source/setup/Quickstart.md +183 -0
  40. weatherdb-1.1.0/docs/source/setup/setup.rst +12 -0
  41. weatherdb-1.1.0/pyproject.toml +71 -0
  42. weatherdb-1.1.0/setup.cfg +4 -0
  43. weatherdb-1.1.0/weatherDB.egg-info/PKG-INFO +761 -0
  44. weatherdb-1.1.0/weatherDB.egg-info/SOURCES.txt +84 -0
  45. weatherdb-1.1.0/weatherDB.egg-info/dependency_links.txt +1 -0
  46. weatherdb-1.1.0/weatherDB.egg-info/entry_points.txt +2 -0
  47. weatherdb-1.1.0/weatherDB.egg-info/requires.txt +21 -0
  48. weatherdb-1.1.0/weatherDB.egg-info/top_level.txt +5 -0
  49. weatherdb-1.1.0/weatherdb/__init__.py +24 -0
  50. weatherdb-1.1.0/weatherdb/_version.py +1 -0
  51. weatherdb-1.1.0/weatherdb/alembic/README.md +8 -0
  52. weatherdb-1.1.0/weatherdb/alembic/alembic.ini +80 -0
  53. weatherdb-1.1.0/weatherdb/alembic/config.py +9 -0
  54. weatherdb-1.1.0/weatherdb/alembic/env.py +100 -0
  55. weatherdb-1.1.0/weatherdb/alembic/script.py.mako +26 -0
  56. weatherdb-1.1.0/weatherdb/alembic/versions/V1.0.0_initial_database_creation.py +898 -0
  57. weatherdb-1.1.0/weatherdb/alembic/versions/V1.0.2_more_charachters_for_settings+term_station_ma_raster.py +88 -0
  58. weatherdb-1.1.0/weatherdb/alembic/versions/V1.0.5_fix-ma-raster-values.py +152 -0
  59. weatherdb-1.1.0/weatherdb/alembic/versions/V1.0.6_update-views.py +22 -0
  60. weatherdb-1.1.0/weatherdb/broker.py +667 -0
  61. weatherdb-1.1.0/weatherdb/cli.py +214 -0
  62. weatherdb-1.1.0/weatherdb/config/ConfigParser.py +663 -0
  63. weatherdb-1.1.0/weatherdb/config/__init__.py +5 -0
  64. weatherdb-1.1.0/weatherdb/config/config_default.ini +162 -0
  65. weatherdb-1.1.0/weatherdb/db/__init__.py +3 -0
  66. weatherdb-1.1.0/weatherdb/db/connections.py +374 -0
  67. weatherdb-1.1.0/weatherdb/db/fixtures/RichterParameters.json +34 -0
  68. weatherdb-1.1.0/weatherdb/db/models.py +402 -0
  69. weatherdb-1.1.0/weatherdb/db/queries/get_quotient.py +155 -0
  70. weatherdb-1.1.0/weatherdb/db/views.py +165 -0
  71. weatherdb-1.1.0/weatherdb/station/GroupStation.py +710 -0
  72. weatherdb-1.1.0/weatherdb/station/StationBases.py +3108 -0
  73. weatherdb-1.1.0/weatherdb/station/StationET.py +111 -0
  74. weatherdb-1.1.0/weatherdb/station/StationP.py +807 -0
  75. weatherdb-1.1.0/weatherdb/station/StationPD.py +98 -0
  76. weatherdb-1.1.0/weatherdb/station/StationT.py +164 -0
  77. weatherdb-1.1.0/weatherdb/station/__init__.py +13 -0
  78. weatherdb-1.1.0/weatherdb/station/constants.py +21 -0
  79. weatherdb-1.1.0/weatherdb/stations/GroupStations.py +519 -0
  80. weatherdb-1.1.0/weatherdb/stations/StationsBase.py +1021 -0
  81. weatherdb-1.1.0/weatherdb/stations/StationsBaseTET.py +30 -0
  82. weatherdb-1.1.0/weatherdb/stations/StationsET.py +17 -0
  83. weatherdb-1.1.0/weatherdb/stations/StationsP.py +128 -0
  84. weatherdb-1.1.0/weatherdb/stations/StationsPD.py +24 -0
  85. weatherdb-1.1.0/weatherdb/stations/StationsT.py +21 -0
  86. weatherdb-1.1.0/weatherdb/stations/__init__.py +11 -0
  87. weatherdb-1.1.0/weatherdb/utils/TimestampPeriod.py +369 -0
  88. weatherdb-1.1.0/weatherdb/utils/__init__.py +3 -0
  89. weatherdb-1.1.0/weatherdb/utils/dwd.py +350 -0
  90. weatherdb-1.1.0/weatherdb/utils/geometry.py +69 -0
  91. weatherdb-1.1.0/weatherdb/utils/get_data.py +285 -0
  92. weatherdb-1.1.0/weatherdb/utils/logging.py +126 -0
  93. weatherdb-1.1.0/weatherdb.egg-info/PKG-INFO +746 -0
  94. weatherdb-1.1.0/weatherdb.egg-info/SOURCES.txt +96 -0
  95. weatherdb-1.1.0/weatherdb.egg-info/dependency_links.txt +1 -0
  96. weatherdb-1.1.0/weatherdb.egg-info/entry_points.txt +2 -0
  97. weatherdb-1.1.0/weatherdb.egg-info/requires.txt +23 -0
  98. weatherdb-1.1.0/weatherdb.egg-info/top_level.txt +5 -0
@@ -0,0 +1,30 @@
1
+ __pycache__
2
+ .vscode
3
+
4
+ # Ignore the created distribution files
5
+ build
6
+ dist
7
+ weatherdb.egg-info
8
+ weatherdb.egg-info/*
9
+ dist/*
10
+
11
+ # Ignore the created docs files
12
+ docs/source/README.md
13
+ docs/source/CHANGES.md
14
+ docs/html/*
15
+ docs/html
16
+ docs/source/Methode.html
17
+ latex
18
+ _build
19
+
20
+ # Ignore the user specifiv created files
21
+ weatherdb/data/
22
+ *.log
23
+ weatherdb/logs
24
+ tests/db_dumps
25
+
26
+ # ignore the main (system) configuration file as it is user specific
27
+ weatherdb/config/config_main.ini
28
+
29
+ # other system files
30
+ sync.ffs_db
@@ -0,0 +1,34 @@
1
+ name: cleanup caches by a branch
2
+ on:
3
+ pull_request:
4
+ branches:
5
+ - master
6
+ types:
7
+ - closed
8
+ push:
9
+ branches:
10
+ - master
11
+
12
+ jobs:
13
+ cleanup:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Cleanup
17
+ run: |
18
+ gh extension install actions/gh-actions-cache
19
+
20
+ echo "Fetching list of cache key"
21
+ cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
22
+
23
+ ## Setting this to not fail the workflow while deleting cache keys.
24
+ set +e
25
+ echo "Deleting caches..."
26
+ for cacheKey in $cacheKeysForPR
27
+ do
28
+ gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
29
+ done
30
+ echo "Done"
31
+ env:
32
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
+ REPO: ${{ github.repository }}
34
+ BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
@@ -0,0 +1,39 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ deploy:
20
+
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v3
27
+ with:
28
+ python-version: '3.x'
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install build
33
+ - name: Build package
34
+ run: python -m build
35
+ - name: Publish package
36
+ uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37
+ with:
38
+ user: __token__
39
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,76 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python package
5
+
6
+ on:
7
+ push:
8
+ branches: [ "master" ]
9
+ pull_request:
10
+ branches: [ "master" ]
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+
16
+ services:
17
+ postgres:
18
+ image: postgres:13
19
+ env:
20
+ POSTGRES_USER: postgres
21
+ POSTGRES_PASSWORD: postgres
22
+ POSTGRES_DB: test_db
23
+ ports:
24
+ - 5432:5432
25
+ options: >-
26
+ --health-cmd pg_isready
27
+ --health-interval 10s
28
+ --health-timeout 5s
29
+ --health-retries 5
30
+
31
+ strategy:
32
+ matrix:
33
+ python-version: ["3.8", "3.9", "3.10", "3.11"]
34
+
35
+ steps:
36
+ - name: Checkout code
37
+ uses: actions/checkout@v4
38
+
39
+ - name: Set up Python ${{ matrix.python-version }}
40
+ uses: actions/setup-python@v3
41
+ with:
42
+ python-version: ${{ matrix.python-version }}
43
+
44
+ - name: Install dependencies
45
+ run: |
46
+ python -m pip install --upgrade pip
47
+
48
+ - name: Install Package
49
+ run: |
50
+ python -m pip install .
51
+
52
+ - name: Cache data directory
53
+ uses: actions/cache@v3
54
+ with:
55
+ path: /home/data
56
+ key: weatherDB-data
57
+
58
+ - name: Test with unittest
59
+ env:
60
+ WEATHERDB_DB_HOST: localhost
61
+ WEATHERDB_DB_PORT: 5432
62
+ WEATHERDB_DB_DATABASE: test_db
63
+ WEATHERDB_DB_USER: postgres
64
+ WEATHERDB_DB_PASSWORD: postgres
65
+ WEATHERDB_USER_CONFIG_FILE: /home/config_user.yaml
66
+ WEATHERDB_DATA_BASE_DIR: /home/data
67
+ WEATHERDB_HANDLE_NON_EXISTING_CONFIG: create
68
+ DOCKER_ENV: test
69
+ run: |
70
+ python test_emptyDB.py ||
71
+ python test_downloadRasters.py ||
72
+ python test_initDB.py ||
73
+ python test_filledDB.py ||
74
+ with:
75
+ working-directory: tests
76
+
@@ -0,0 +1,35 @@
1
+ __pycache__
2
+
3
+ # Ignore the created distribution files
4
+ build
5
+ dist
6
+ weatherdb.egg-info
7
+ weatherdb.egg-info/*
8
+ dist/*
9
+ _version.py
10
+
11
+ # Ignore the created docs files
12
+ docs/source/README.md
13
+ docs/source/CHANGES.md
14
+ docs/html/*
15
+ docs/html
16
+ docs/source/Methode.html
17
+ latex
18
+ _build
19
+
20
+ # Ignore the user specific created files
21
+ data/
22
+ *.log
23
+ logs
24
+ tests/db_dumps
25
+
26
+ # ignore the main (system) configuration file as it is user specific
27
+ weatherdb/config/config_main.ini
28
+
29
+ # ignore docker files
30
+ *.docker-secret
31
+ *.docker-env
32
+
33
+ # other system files
34
+ sync.ffs_db
35
+ .vscode/
@@ -0,0 +1,3 @@
1
+ Changes since the last Merge-request:
2
+
3
+ %{all_commits}
@@ -0,0 +1,118 @@
1
+ stages:
2
+ - test_single
3
+ - test_matrix
4
+ - build
5
+ - deploy
6
+
7
+ workflow:
8
+ auto_cancel:
9
+ on_new_commit: interruptible
10
+
11
+ test_single:
12
+ stage: test_single
13
+ rules:
14
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
15
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
16
+ image: "python:$PYTHON_VERSION"
17
+ services:
18
+ - name: postgis/postgis:16-3.4
19
+ alias: postgres
20
+ command: ["postgres", "-c", "fsync=off"]
21
+ before_script:
22
+ - python3 -m pip install --upgrade pip --root-user-action=ignore
23
+ - python3 -m pip install unittest-xml-reporting --root-user-action=ignore
24
+ script:
25
+ - python3 -m pip install .[optionals] --root-user-action=ignore
26
+ - mkdir -p $WEATHERDB_DATA_BASE_DIR
27
+ - mkdir -p test-reports
28
+ - python3 -m xmlrunner discover -s tests -p testSuite.py -o test-reports
29
+ cache:
30
+ - key: weatherdb-data-cache-$CI_COMMIT_REF_SLUG
31
+ paths:
32
+ - user/
33
+ - key: python-dep
34
+ paths:
35
+ - .cache/pip
36
+ artifacts:
37
+ when: always
38
+ reports:
39
+ junit: test-reports/*.xml
40
+ expire_in: 2 weeks
41
+ paths:
42
+ - $WEATHERDB_TEST_ARTIFACT_DIR/**/*
43
+ - $WEATHERDB_TEST_ARTIFACT_DIR/*
44
+ interruptible: true
45
+ variables:
46
+ PYTHON_VERSION: 3.8
47
+ PYTHON_VERSION_ESCAPED: $PY_VERSION | replace(".", "_")
48
+ PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
49
+ POSTGRES_USER: postgres
50
+ POSTGRES_PASSWORD: postgres
51
+ POSTGRES_DB: test_db_$PYTHON_VERSION_ESCAPED
52
+ POSTGRES_HOST_AUTH_METHOD: trust
53
+ WEATHERDB_DB_HOST: postgres
54
+ WEATHERDB_DB_PORT: 5432
55
+ WEATHERDB_DB_DATABASE: $POSTGRES_DB
56
+ WEATHERDB_DB_USER: $POSTGRES_USER
57
+ WEATHERDB_DB_PASSWORD: $POSTGRES_PASSWORD
58
+ WEATHERDB_USER_CONFIG_FILE: $CI_PROJECT_DIR/user/config_user.ini
59
+ WEATHERDB_DATA_BASE_DIR: $CI_PROJECT_DIR/user/data
60
+ WEATHERDB_HANDLE_NON_EXISTING_CONFIG: create
61
+ WEATHERDB_LOGGING_HANDLER: console
62
+ WEATHERDB_LOGGING_LEVEL: DEBUG
63
+ WEATHERDB_HORIZON_RADIUS: 40000
64
+ WEATHERDB_TEST_ARTIFACT_DIR: $CI_PROJECT_DIR/artifacts
65
+ WEATHERDB_TEST_ARTIFACT_DB_DUMP: ON_FAILURE
66
+ WEATHERDB_TEST_ARTIFACT_LIST_DATA_FILES: ON_FAILURE
67
+ WEATHERDB_TEST_ARTIFACT_COPY_USER_CONFIG: ON_FAILURE
68
+ DOCKER_ENV: test
69
+ tags:
70
+ - docker
71
+
72
+ test_matrix:
73
+ stage: test_matrix
74
+ extends: test_single
75
+ dependencies:
76
+ - test_single
77
+ parallel:
78
+ matrix:
79
+ - PY_VERSION: ["3.9","3.10","3.11","3.12","3.13"]
80
+ variables:
81
+ PYTHON_VERSION: $PY_VERSION
82
+
83
+ build:
84
+ rules:
85
+ - if: $CI_COMMIT_TAG =~ /^[Vv]\d+\.\d+\.\d+$/
86
+ dependencies:
87
+ - test_matrix
88
+ stage: build
89
+ image: python:3.11
90
+ script:
91
+ - python -m pip install --upgrade pip --root-user-action=ignore
92
+ - python -m pip install setuptools wheel build setuptools-scm --root-user-action=ignore
93
+ - python -m build --no-isolation --outdir dist
94
+ artifacts:
95
+ paths:
96
+ - dist/
97
+ variables:
98
+ PYTHON_VERSION: $PYTHON_VERSION
99
+ tags:
100
+ - docker
101
+
102
+ deploy:
103
+ rules:
104
+ - !reference [build, rules]
105
+ dependencies:
106
+ - build
107
+ stage: deploy
108
+ image: python:3.11
109
+ script:
110
+ - python -m pip install --upgrade pip --root-user-action=ignore
111
+ - python -m pip install twine --root-user-action=ignore
112
+ - twine upload dist/*
113
+ variables:
114
+ TWINE_USERNAME: $TWINE_USERNAME
115
+ TWINE_PASSWORD: $TWINE_PASSWORD
116
+ tags:
117
+ - docker
118
+ interruptible: false
@@ -0,0 +1,27 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Set the version of Python and other tools you might need
9
+ build:
10
+ os: ubuntu-20.04
11
+ tools:
12
+ python: "3.10"
13
+
14
+ # Build documentation in the docs/ directory with Sphinx
15
+ sphinx:
16
+ configuration: docs/source/conf.py
17
+
18
+ # formats
19
+ # formats:
20
+ # - html
21
+
22
+ # Optionally declare the Python requirements required to build your docs
23
+ python:
24
+ install:
25
+ - requirements: docs/requirements.txt
26
+ - method: pip
27
+ path: .