cetk 0.0.8.dev0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. {cetk-0.0.8.dev0 → cetk-0.1.1}/CONTRIBUTING.md +2 -2
  2. {cetk-0.0.8.dev0 → cetk-0.1.1}/PKG-INFO +12 -12
  3. {cetk-0.0.8.dev0 → cetk-0.1.1}/constraints-lowest.txt +28 -29
  4. {cetk-0.0.8.dev0 → cetk-0.1.1}/noxfile.py +2 -2
  5. {cetk-0.0.8.dev0 → cetk-0.1.1}/pyproject.toml +12 -13
  6. cetk-0.1.1/requirements-dev.in +17 -0
  7. {cetk-0.0.8.dev0 → cetk-0.1.1}/requirements-dev.txt +33 -21
  8. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/__init__.py +1 -1
  9. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/roadsource_import.py +7 -4
  10. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/source_import.py +7 -6
  11. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/road_models.py +1 -1
  12. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/timevar_models.py +4 -2
  13. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/calc.py +7 -7
  14. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/settings.py +12 -4
  15. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk.egg-info/PKG-INFO +12 -12
  16. cetk-0.1.1/src/cetk.egg-info/requires.txt +12 -0
  17. cetk-0.0.8.dev0/requirements-dev.in +0 -13
  18. cetk-0.0.8.dev0/src/cetk.egg-info/requires.txt +0 -12
  19. {cetk-0.0.8.dev0 → cetk-0.1.1}/.pre-commit-config.yaml +0 -0
  20. {cetk-0.0.8.dev0 → cetk-0.1.1}/LICENSE +0 -0
  21. {cetk-0.0.8.dev0 → cetk-0.1.1}/MANIFEST.in +0 -0
  22. {cetk-0.0.8.dev0 → cetk-0.1.1}/README.md +0 -0
  23. {cetk-0.0.8.dev0 → cetk-0.1.1}/flatpak_install.sh +0 -0
  24. {cetk-0.0.8.dev0 → cetk-0.1.1}/manage.py +0 -0
  25. {cetk-0.0.8.dev0 → cetk-0.1.1}/setup.cfg +0 -0
  26. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/db.py +0 -0
  27. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/__init__.py +0 -0
  28. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/apps.py +0 -0
  29. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/cache.py +0 -0
  30. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/const.py +0 -0
  31. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/copy.py +0 -0
  32. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/exporters.py +0 -0
  33. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/fixtures/edb-ref.json +0 -0
  34. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/__init__.py +0 -0
  35. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/activity_import.py +0 -0
  36. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/codeset_import.py +0 -0
  37. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/gridsource_import.py +0 -0
  38. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/timevar_import.py +0 -0
  39. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/utils.py +0 -0
  40. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/importers/validation.py +0 -0
  41. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/ltreefield.py +0 -0
  42. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/migrations/0001_initial.py +0 -0
  43. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/migrations/0002_data.py +0 -0
  44. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/migrations/0003_create_gpkg_tables.py +0 -0
  45. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/migrations/__init__.py +0 -0
  46. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/__init__.py +0 -0
  47. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/base.py +0 -0
  48. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/common_models.py +0 -0
  49. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/fleets.py +0 -0
  50. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/gridsource_models.py +0 -0
  51. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/road_classes.py +0 -0
  52. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/models/source_models.py +0 -0
  53. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/rasterize/__init__.py +0 -0
  54. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/rasterize/rasterizer.py +0 -0
  55. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/signals.py +0 -0
  56. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/traffic.py +0 -0
  57. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/units.py +0 -0
  58. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/edb/utils.py +0 -0
  59. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/__init__.py +0 -0
  60. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/aggregate_emissions.sql +0 -0
  61. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/areasource_emissions.sql +0 -0
  62. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/filters.py +0 -0
  63. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/gridsource_emissions.sql +0 -0
  64. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/pointsource_emissions.sql +0 -0
  65. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/queries.py +0 -0
  66. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/roadsource_emissions.sql +0 -0
  67. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/used_substances.sql +0 -0
  68. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/emissions/views.py +0 -0
  69. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/logging.py +0 -0
  70. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/tools/__init__.py +0 -0
  71. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/tools/cetk_command.py +0 -0
  72. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/tools/manage.py +0 -0
  73. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/tools/utils.py +0 -0
  74. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk/utils.py +0 -0
  75. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk.egg-info/SOURCES.txt +0 -0
  76. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk.egg-info/dependency_links.txt +0 -0
  77. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk.egg-info/entry_points.txt +0 -0
  78. {cetk-0.0.8.dev0 → cetk-0.1.1}/src/cetk.egg-info/top_level.txt +0 -0
  79. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/conftest.py +0 -0
  80. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/TrafficImportFormat.xlsx +0 -0
  81. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/__init__.py +0 -0
  82. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/all_sources.xlsx +0 -0
  83. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/areasourceactivities.xlsx +0 -0
  84. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/areasources.xlsx +0 -0
  85. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/congestion_profiles.json +0 -0
  86. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/fleets.json +0 -0
  87. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/fleets.xlsx +0 -0
  88. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/gridsource_rasters/vasterbotten_conc_NOx_1990010100_1991010100.tif +0 -0
  89. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/gridsource_rasters/vasterbotten_conc_PM25_1990010100_1991010100.tif +0 -0
  90. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/gridsource_rasters/vasterbotten_conc_PM25_2000010100_2001010100.tif +0 -0
  91. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/gridsource_rasters/vasterbotten_conc_PM25_2011010100_2012010100.tif +0 -0
  92. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/gridsources.xlsx +0 -0
  93. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/gridsources_tmp.xlsx +0 -0
  94. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/pointsourceactivities.xlsx +0 -0
  95. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/pointsources.csv +0 -0
  96. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/pointsources.xlsx +0 -0
  97. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/roadclass_settings.xlsx +0 -0
  98. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/roadclasses.csv +0 -0
  99. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/roadclasses.json +0 -0
  100. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/roadclasses_1attr.csv +0 -0
  101. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/roadclasses_1attr.json +0 -0
  102. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/roaddata.gpkg +0 -0
  103. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/roads.json +0 -0
  104. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/roads.xlsx +0 -0
  105. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/sinuous_road.geojson +0 -0
  106. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/timevars.json +0 -0
  107. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/vehicle_settings.xlsx +0 -0
  108. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/vehicles.csv +0 -0
  109. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/vehicles.json +0 -0
  110. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/data/vehicles.xlsx +0 -0
  111. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_common_models.py +0 -0
  112. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_fleets.py +0 -0
  113. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_gridsource_models.py +0 -0
  114. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_importers.py +0 -0
  115. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_ltreefield.py +0 -0
  116. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_rasterize.py +0 -0
  117. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_road_classes.py +0 -0
  118. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_road_importers.py +0 -0
  119. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/edb/test_road_models.py +0 -0
  120. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/emissions/__init__.py +0 -0
  121. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/emissions/test_aggregate_emissions.py +0 -0
  122. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/emissions/test_areasource_emissions.py +0 -0
  123. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/emissions/test_custom_sqlite_functions.py +0 -0
  124. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/emissions/test_gridsource_emissions.py +0 -0
  125. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/emissions/test_pointsource_emissions.py +0 -0
  126. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/emissions/test_roadsource_emissions.py +0 -0
  127. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/emissions/test_utils.py +0 -0
  128. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/test_db.py +0 -0
  129. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/conftest.py +0 -0
  130. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/data/__init__.py +0 -0
  131. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/data/inventory.xlsx +0 -0
  132. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/data/validation.xlsx +0 -0
  133. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/test_calculate.py +0 -0
  134. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/test_create.py +0 -0
  135. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/test_delete.py +0 -0
  136. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/test_exports.py +0 -0
  137. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/test_imports.py +0 -0
  138. {cetk-0.0.8.dev0 → cetk-0.1.1}/tests/tools/test_info.py +0 -0
  139. {cetk-0.0.8.dev0 → cetk-0.1.1}/windows_find_gdal.py +0 -0
@@ -11,7 +11,7 @@
11
11
  ``` console
12
12
  $ git clone https://git.smhi.se/foclair/cetk.git
13
13
  $ cd cetk
14
- $ python3.11 -m venv --prompt cetk .venv
14
+ $ python3.12 -m venv --prompt cetk .venv
15
15
  $ . .venv/bin/activate
16
16
  $ pip install -U pip setuptools wheel
17
17
  $ pip install -r requirements.txt
@@ -23,7 +23,7 @@ $ pip install -e .
23
23
  ``` console
24
24
  $ git clone https://git.smhi.se/foclair/cetk.git
25
25
  $ cd cetk
26
- $ python3.11 -m venv --prompt cetk .venv
26
+ $ python3.12 -m venv --prompt cetk .venv
27
27
  $ . .venv/Scripts/activate
28
28
  $ pip install pre-commit
29
29
  $ pip install -e .
@@ -1,27 +1,27 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cetk
3
- Version: 0.0.8.dev0
3
+ Version: 0.1.1
4
4
  Summary: CLAIRs Emission ToolKit cetk
5
5
  Author: Christian Asker, Mattias Jakobsson, David Segersson, Eef van Dongen
6
6
  Maintainer-email: FO Luft <foluftadmin@smhi.se>
7
7
  License-Expression: Apache-2.0
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
10
- Requires-Python: >=3.11
10
+ Requires-Python: >=3.12
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Requires-Dist: affine<3.0.1
14
- Requires-Dist: django<6,>=5.2.16
15
- Requires-Dist: fiona>=1.8.22
14
+ Requires-Dist: django>=6.1
15
+ Requires-Dist: fiona>=1.9.5
16
16
  Requires-Dist: geopandas>=0.12
17
- Requires-Dist: netCDF4>=1.6.1
18
- Requires-Dist: numpy<2.5,>=1.20.3
19
- Requires-Dist: openpyxl>=3.0.7
20
- Requires-Dist: pandas>=2.0
21
- Requires-Dist: pyogrio>=0.5.0
22
- Requires-Dist: rastafari2>=0.4
23
- Requires-Dist: rasterio>=1.3.3
24
- Requires-Dist: shapely>=2.0
17
+ Requires-Dist: netCDF4>=1.6.5
18
+ Requires-Dist: numpy<2.5,>=1.26
19
+ Requires-Dist: openpyxl>=3.0.10
20
+ Requires-Dist: pandas>=2.1.1
21
+ Requires-Dist: pyogrio>=0.7.0
22
+ Requires-Dist: rastafari>=0.4.4
23
+ Requires-Dist: rasterio>=1.3.9
24
+ Requires-Dist: shapely>=2.0.2
25
25
  Dynamic: license-file
26
26
 
27
27
  # Emission ToolKit cetk
@@ -4,21 +4,22 @@ affine==1.0
4
4
  # via
5
5
  # cetk (pyproject.toml)
6
6
  # rasterio
7
- asgiref==3.12.1
7
+ asgiref==3.13.0
8
8
  # via django
9
9
  attrs==26.1.0
10
10
  # via
11
11
  # fiona
12
12
  # rasterio
13
- certifi==2026.7.22
13
+ certifi==2026.10.23
14
14
  # via
15
15
  # fiona
16
+ # netcdf4
16
17
  # pyogrio
17
18
  # pyproj
18
19
  # rasterio
19
- cftime==1.6.5
20
+ cftime==1.6.6.1
20
21
  # via netcdf4
21
- click==8.5.0
22
+ click==8.5.1
22
23
  # via
23
24
  # click-plugins
24
25
  # cligj
@@ -32,70 +33,68 @@ cligj==0.7.2
32
33
  # via
33
34
  # fiona
34
35
  # rasterio
35
- django==5.2.16
36
+ django==6.1
36
37
  # via cetk (pyproject.toml)
37
38
  et-xmlfile==2.0.0
38
39
  # via openpyxl
39
- fiona==1.8.22
40
+ fiona==1.9.5
40
41
  # via
41
42
  # cetk (pyproject.toml)
42
43
  # geopandas
43
44
  geopandas==0.12.1
44
45
  # via cetk (pyproject.toml)
45
- munch==4.0.0
46
- # via fiona
47
- netcdf4==1.6.1
46
+ netcdf4==1.6.5
48
47
  # via cetk (pyproject.toml)
49
- numpy==1.23.2
48
+ numpy==1.26.0
50
49
  # via
51
50
  # cetk (pyproject.toml)
52
51
  # cftime
53
52
  # netcdf4
54
53
  # pandas
55
54
  # pyogrio
56
- # rastafari2
55
+ # rastafari
57
56
  # rasterio
58
57
  # shapely
59
58
  # snuggs
60
- openpyxl==3.0.7
59
+ openpyxl==3.0.10
61
60
  # via cetk (pyproject.toml)
62
61
  packaging==26.3
63
62
  # via geopandas
64
- pandas==2.0.0
63
+ pandas==2.1.1
65
64
  # via
66
65
  # cetk (pyproject.toml)
67
66
  # geopandas
68
- pyogrio==0.5.0
67
+ pyogrio==0.7.0
69
68
  # via cetk (pyproject.toml)
70
- pyparsing==3.3.2
69
+ pyparsing==3.3.3
71
70
  # via snuggs
72
- pyproj==3.7.2
71
+ pyproj==3.8.0
73
72
  # via
74
73
  # geopandas
75
- # rastafari2
76
- python-dateutil==2.9.0.post0
74
+ # rastafari
75
+ python-dateutil==4.0.0
77
76
  # via pandas
78
- pytz==2026.3.post1
77
+ pytz==2026.6
79
78
  # via pandas
80
- rastafari2==0.4.1.2
79
+ rastafari==0.4.4
81
80
  # via cetk (pyproject.toml)
82
- rasterio==1.3.3
81
+ rasterio==1.3.9
83
82
  # via cetk (pyproject.toml)
84
- setuptools==84.0.0
83
+ setuptools==84.2.1
85
84
  # via
86
85
  # fiona
87
86
  # rasterio
88
- shapely==2.0.0
87
+ shapely==2.0.2
89
88
  # via
90
89
  # cetk (pyproject.toml)
91
90
  # geopandas
92
91
  six==1.17.0
93
- # via
94
- # fiona
95
- # python-dateutil
92
+ # via fiona
96
93
  snuggs==1.4.7
97
94
  # via rasterio
98
- sqlparse==0.6.0
95
+ sqlparse==0.6.1
99
96
  # via django
100
- tzdata==2026.4
101
- # via pandas
97
+ tzdata==2026.6
98
+ # via
99
+ # pandas
100
+ # python-dateutil
@@ -19,7 +19,7 @@ def requirements_dev(session):
19
19
  pip_compile(session, "requirements-dev.txt", "requirements-dev.in")
20
20
 
21
21
 
22
- @nox.session(name="constraints-lowest", python="3.11")
22
+ @nox.session(name="constraints-lowest", python="3.12")
23
23
  def constraints_lowest(session):
24
24
  """Re-compile the constraints for the lowest allowed dependency versions"""
25
25
  session.install("-c", "requirements-dev.txt", "uv")
@@ -58,7 +58,7 @@ def test(session):
58
58
  session.run("pytest", *session.posargs)
59
59
 
60
60
 
61
- @nox.session(name="test-lowest", python="3.11")
61
+ @nox.session(name="test-lowest", python="3.12")
62
62
  def test_lowest(session):
63
63
  """Run the unit and regression tests with the lowest allowed versions."""
64
64
  session.install("-c", "requirements-dev.txt", *TEST_REQUIREMENTS)
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools >= 77.0.3", "setuptools-scm >= 8"]
2
+ requires = ["setuptools >= 84.1.0", "setuptools-scm >= 8"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
@@ -15,7 +15,7 @@ maintainers = [
15
15
  ]
16
16
  description = "CLAIRs Emission ToolKit cetk"
17
17
  readme = "README.md"
18
- requires-python = ">=3.11"
18
+ requires-python = ">=3.12"
19
19
  license = "Apache-2.0"
20
20
  license-files = ["LICENSE"]
21
21
  classifiers = [
@@ -24,17 +24,17 @@ classifiers = [
24
24
  ]
25
25
  dependencies = [ # Release date Comment
26
26
  "affine<3.0.1", # 2026-08-28 required by rasterio - support for 3.0.1+ pending
27
- "django >=5.2.16,<6",# 2026-07-07 due to dependabot alerts
28
- "fiona >=1.8.22", # 2022-10-17 first version with cp311 wheel
27
+ "django >=6.1", # 2026-08-05 introduced support for GDAL3.13 - QGIS4.2 depends on GDAL3.13
28
+ "fiona >=1.9.5", # 2023-10-12 first version with cp312 wheel
29
29
  "geopandas >=0.12", # 2022-10-24 first version with shapely 2 support
30
- "netCDF4 >=1.6.1", # 2022-09-15 first version with cp311 wheel
31
- "numpy >=1.20.3, <2.5", # 2021-05-10 required by pandas 2.0.0, numpy 2.5 not compatible with NetCDF4
32
- "openpyxl >=3.0.7", # 2021-03-09 required by pandas 2.0.0
33
- "pandas >=2.0", # 2023-04-03 cetk import test fails with earlier versions
34
- "pyogrio >=0.5.0", # 2023-01-16 first version with cp311 wheel
35
- "rastafari2 >=0.4",
36
- "rasterio >=1.3.3", # 2022-10-19 first version with cp311 wheel
37
- "shapely >=2.0", # 2022-12-12 cetk calc --rasterize fails with earlier versions
30
+ "netCDF4 >=1.6.5", # 2023-10-25 first version with cp312 wheel
31
+ "numpy >=1.26,<2.5", # 2021-05-10 first version with cp312 wheel, numpy 2.5 not compatible with NetCDF4
32
+ "openpyxl >=3.0.10", # 2021-03-09 required by pandas
33
+ "pandas >=2.1.1", # 2023-09-20 first version with cp312 wheel
34
+ "pyogrio >=0.7.0", # 2023-10-25 first version with cp312 wheel
35
+ "rastafari >=0.4.4",
36
+ "rasterio >=1.3.9", # 2023-10-19 first version with cp312 wheel
37
+ "shapely >=2.0.2", # 2023-10-12 first version with cp312 wheel
38
38
  ]
39
39
  dynamic = ["version"]
40
40
 
@@ -58,7 +58,6 @@ filterwarnings = [
58
58
  "error",
59
59
  "ignore:numpy\\.ndarray size changed:RuntimeWarning",
60
60
  "ignore:CheckConstraint\\.check is deprecated:DeprecationWarning",
61
- "ignore:coord_dim setter is deprecated:DeprecationWarning",
62
61
  ]
63
62
 
64
63
  [tool.ruff.lint]
@@ -0,0 +1,17 @@
1
+ # CI/CD and development requirements
2
+ build
3
+ coverage[toml]
4
+ filelock >=4.2.1
5
+ nox
6
+ pip >=26.2.0
7
+ pip-tools
8
+ pre-commit
9
+ pytest >=9.0.3
10
+ pytest-cov
11
+ pytest-django
12
+ ruff
13
+ setuptools >=84.1.0
14
+ setuptools-scm >= 8
15
+ uv >=0.13.4
16
+ virtualenv >=21.14.9
17
+ wheel >=0.46.2
@@ -2,8 +2,6 @@
2
2
  # nox -s requirements-dev
3
3
  argcomplete==3.6.2
4
4
  # via nox
5
- asgiref==3.8.1
6
- # via django
7
5
  attrs==25.3.0
8
6
  # via nox
9
7
  build==0.10.0
@@ -22,12 +20,13 @@ coverage==7.3.0
22
20
  # pytest-cov
23
21
  dependency-groups==1.3.1
24
22
  # via nox
25
- distlib==0.3.7
26
- # via virtualenv
27
- django==5.2.17
28
- # via -r requirements-dev.in
29
- filelock==3.12.3
23
+ distlib==0.4.4
30
24
  # via virtualenv
25
+ filelock==4.2.9
26
+ # via
27
+ # -r requirements-dev.in
28
+ # python-discovery
29
+ # virtualenv
31
30
  identify==2.5.27
32
31
  # via pre-commit
33
32
  iniconfig==2.0.0
@@ -36,26 +35,33 @@ nodeenv==1.8.0
36
35
  # via pre-commit
37
36
  nox==2025.5.1
38
37
  # via -r requirements-dev.in
39
- packaging==24.1
38
+ packaging==26.3
40
39
  # via
41
40
  # build
42
41
  # dependency-groups
43
42
  # nox
44
43
  # pytest
45
44
  # setuptools-scm
46
- pip==23.2.1
47
- # via pip-tools
45
+ # vcs-versioning
46
+ # virtualenv
47
+ # wheel
48
+ pip==26.2.1
49
+ # via
50
+ # -r requirements-dev.in
51
+ # pip-tools
48
52
  pip-tools==7.3.0
49
53
  # via -r requirements-dev.in
50
- platformdirs==3.10.0
54
+ platformdirs==4.14.5
51
55
  # via virtualenv
52
- pluggy==1.3.0
56
+ pluggy==1.6.0
53
57
  # via pytest
54
58
  pre-commit==3.3.3
55
59
  # via -r requirements-dev.in
60
+ pygments==2.21.0
61
+ # via pytest
56
62
  pyproject-hooks==1.0.0
57
63
  # via build
58
- pytest==7.4.0
64
+ pytest==9.1.1
59
65
  # via
60
66
  # -r requirements-dev.in
61
67
  # pytest-cov
@@ -64,24 +70,30 @@ pytest-cov==4.1.0
64
70
  # via -r requirements-dev.in
65
71
  pytest-django==4.5.2
66
72
  # via -r requirements-dev.in
73
+ python-discovery==1.6.1
74
+ # via virtualenv
67
75
  pyyaml==6.0.1
68
76
  # via pre-commit
69
77
  ruff==0.11.11
70
78
  # via -r requirements-dev.in
71
- setuptools==69.1.1
79
+ setuptools==84.2.1
72
80
  # via
81
+ # -r requirements-dev.in
73
82
  # nodeenv
74
83
  # pip-tools
75
84
  # setuptools-scm
76
- setuptools-scm==8.3.1
85
+ setuptools-scm==10.3.4
77
86
  # via -r requirements-dev.in
78
- sqlparse==0.4.3
79
- # via django
80
- uv==0.7.9
87
+ uv==0.13.7
81
88
  # via -r requirements-dev.in
82
- virtualenv==20.24.3
89
+ vcs-versioning==2.6.0
90
+ # via setuptools-scm
91
+ virtualenv==21.15.6
83
92
  # via
93
+ # -r requirements-dev.in
84
94
  # nox
85
95
  # pre-commit
86
- wheel==0.41.2
87
- # via pip-tools
96
+ wheel==0.48.0
97
+ # via
98
+ # -r requirements-dev.in
99
+ # pip-tools
@@ -1,6 +1,6 @@
1
1
  """cetk, a python library for editing Clair emission inventories offline."""
2
2
 
3
- __version__ = "0.0.8.dev0"
3
+ __version__ = "0.1.1"
4
4
 
5
5
  import os
6
6
 
@@ -851,11 +851,10 @@ def import_roadclasses(
851
851
  sheet_name="TrafficSituation",
852
852
  usecols=column_names,
853
853
  )
854
- df.rename(
854
+ df = df.rename(
855
855
  columns={"attr:" + rc: rc for rc in roadclass_attributes},
856
- inplace=True,
857
856
  )
858
- df.set_index([a.slug for a in defined_attributes], inplace=True)
857
+ df = df.set_index([a.slug for a in defined_attributes])
859
858
  except Exception as err:
860
859
  raise ImportError(
861
860
  "could not read xlsx, are all roadclass attributes "
@@ -1377,7 +1376,11 @@ def import_roads(
1377
1376
  raise ValidationError(msg)
1378
1377
 
1379
1378
  gdalgeom = GDALLineString(source_geom.wkt)
1380
- gdalgeom.coord_dim = 2
1379
+ if gdalgeom.coord_dim == 3:
1380
+ xy_coords = [point[:2] for point in gdalgeom.tuple]
1381
+ wkt_string = f"LINESTRING ({', '.join(f'{x} {y}' for x, y in xy_coords)})"
1382
+ gdalgeom = GDALLineString(wkt_string)
1383
+
1381
1384
  gdalgeom.transform(trans)
1382
1385
  geom = gdalgeom.geos
1383
1386
  road_data = {"geom": geom}
@@ -171,12 +171,13 @@ def import_sources(
171
171
 
172
172
  df = set_datatypes(df, sourcetype)
173
173
 
174
- return create_or_update_sources(
174
+ return_dict, return_message, _ = create_or_update_sources(
175
175
  df,
176
176
  validation=validation,
177
177
  srid=None,
178
178
  sourcetype=sourcetype,
179
179
  )
180
+ return return_dict, return_message
180
181
 
181
182
 
182
183
  def set_datatypes(df, sourcetype):
@@ -261,7 +262,7 @@ def create_or_update_sources(
261
262
 
262
263
  # set dataframe index
263
264
  try:
264
- df.set_index(["facility_id", "source_name"], inplace=True)
265
+ df = df.set_index(["facility_id", "source_name"])
265
266
  except ValueError as err:
266
267
  return_message.append(
267
268
  import_error(
@@ -290,7 +291,7 @@ def create_or_update_sources(
290
291
  "created": 0,
291
292
  },
292
293
  }
293
- return return_dict, return_message
294
+ return return_dict, return_message, df
294
295
 
295
296
  row_dict = row.to_dict()
296
297
 
@@ -751,7 +752,7 @@ def create_or_update_sources(
751
752
  },
752
753
  }
753
754
  # print(datetime.now().strftime("%H:%M:%S") + "finish point import")
754
- return return_dict, return_message
755
+ return return_dict, return_message, df
755
756
 
756
757
 
757
758
  # @profile
@@ -820,7 +821,7 @@ def import_sourceactivities(
820
821
 
821
822
  # import pointsources and pointsourcesubstances
822
823
  caching_sources = len(df_pointsource) > PointSource.objects.count()
823
- ps, msgs = create_or_update_sources(
824
+ ps, msgs, df_pointsource = create_or_update_sources(
824
825
  df_pointsource,
825
826
  srid=srid,
826
827
  validation=validation,
@@ -913,7 +914,7 @@ def import_sourceactivities(
913
914
  data = workbook["AreaSource"].values
914
915
  df_areasource = worksheet_to_dataframe(data)
915
916
  df_areasource = set_datatypes(df_areasource, "area")
916
- ps, msgs = create_or_update_sources(
917
+ ps, msgs, df_areasource = create_or_update_sources(
917
918
  df_areasource,
918
919
  srid=srid,
919
920
  validation=validation,
@@ -77,7 +77,7 @@ class CongestionProfile(models.Model):
77
77
  traffic_condition = np.array(ast.literal_eval(self.traffic_condition))
78
78
  local_time_index = time_index.tz_convert(timezone)
79
79
  return pd.Series(
80
- traffic_condition[local_time_index.hour, local_time_index.weekday],
80
+ traffic_condition[local_time_index.hour, local_time_index.day_of_week],
81
81
  index=time_index,
82
82
  )
83
83
 
@@ -18,7 +18,9 @@ def default_timevar_month():
18
18
 
19
19
  def get_normalization_constant(typeday, month, timezone):
20
20
  commonyear = pd.date_range("2018", periods=24 * 365, freq="h", tz=timezone)
21
- values = typeday[commonyear.hour, commonyear.weekday] * month[commonyear.month - 1]
21
+ values = (
22
+ typeday[commonyear.hour, commonyear.day_of_week] * month[commonyear.month - 1]
23
+ )
22
24
  return len(values) / values.sum()
23
25
 
24
26
 
@@ -37,7 +39,7 @@ def timevar_to_series(time_index, *timevars, timezone=None):
37
39
 
38
40
  local_time_index = time_index.tz_convert(timezone)
39
41
  values = (
40
- typeday[local_time_index.hour, local_time_index.weekday]
42
+ typeday[local_time_index.hour, local_time_index.day_of_week]
41
43
  * month[local_time_index.month - 1]
42
44
  )
43
45
  return pd.Series(normalization_constant * values, index=time_index)
@@ -72,19 +72,19 @@ def calculate_source_emissions_df(
72
72
  )
73
73
  df = pd.DataFrame(cur.fetchall(), columns=[col[0] for col in cur.description])
74
74
  if sourcetype == "grid":
75
- df.set_index(["source_id", "substance", "raster"], inplace=True)
75
+ df = df.set_index(["source_id", "substance", "raster"])
76
76
  elif sourcetype == "road":
77
- df.set_index(["source_id", "substance", "vehicle"], inplace=True)
77
+ df = df.set_index(["source_id", "substance", "vehicle"])
78
78
  traffic_work = df.loc[(slice(None), "traffic_work"), :]["emis"]
79
79
  traffic_work.name = "traffic_work"
80
80
  traffic_work.index = traffic_work.index.droplevel("substance")
81
- df.drop(level="substance", labels=["traffic_work"], inplace=True)
81
+ df = df.drop(level="substance", labels=["traffic_work"])
82
82
  df = df.join(traffic_work)
83
83
  df = df.reorder_levels(["source_id", "substance", "vehicle"])
84
84
  else:
85
- df.set_index(["source_id", "substance"], inplace=True)
85
+ df = df.set_index(["source_id", "substance"])
86
86
  df.loc[:, "emis"] *= emis_conversion_factor_from_si(unit)
87
- df.sort_index(inplace=True)
87
+ df = df.sort_index()
88
88
  return df
89
89
 
90
90
 
@@ -128,11 +128,11 @@ def aggregate_emissions(
128
128
  if not pd.isna(code):
129
129
  df.loc[ind, "activity"] = code_labels[code]
130
130
  # add to index (to remain also after pivoting)
131
- df.set_index(["activitycode", "activity"], inplace=True)
131
+ df = df.set_index(["activitycode", "activity"])
132
132
  df = df.pivot(columns="substance")
133
133
  else:
134
134
  df.insert(1, "activity", "total")
135
- df.set_index(["activity"], inplace=True)
135
+ df = df.set_index(["activity"])
136
136
  df = df.pivot(columns="substance")
137
137
  df.columns = df.columns.set_names(["quantity", "substance"])
138
138
  if "traffic_work" in df.columns.get_level_values("substance"):
@@ -5,13 +5,21 @@ import os
5
5
  DEBUG = os.environ.get("CETK_DEBUG", False)
6
6
 
7
7
  if "FLATPAK_ID" in os.environ:
8
- SPATIALITE_LIBRARY_PATH = "/app/lib/mod_spatialite.so"
8
+ SPATIALITE_LIBRARY_PATH = os.environ.get(
9
+ "SPATIALITE_LIBRARY_PATH", "/app/lib/mod_spatialite.so"
10
+ )
9
11
  elif os.name == "posix":
10
- SPATIALITE_LIBRARY_PATH = "/usr/lib64/mod_spatialite.so"
12
+ SPATIALITE_LIBRARY_PATH = os.environ.get(
13
+ "SPATIALITE_LIBRARY_PATH", "/usr/lib64/mod_spatialite.so"
14
+ )
11
15
  elif os.name == "nt":
12
- SPATIALITE_LIBRARY_PATH = r"C:\OSGeo4W\bin\mod_spatialite.dll"
16
+ SPATIALITE_LIBRARY_PATH = os.environ.get(
17
+ "SPATIALITE_LIBRARY_PATH", r"C:\OSGeo4W\bin\mod_spatialite.dll"
18
+ )
13
19
  else:
14
- SPATIALITE_LIBRARY_PATH = "/usr/lib64/mod_spatialite.so"
20
+ SPATIALITE_LIBRARY_PATH = os.environ.get(
21
+ "SPATIALITE_LIBRARY_PATH", "/usr/lib64/mod_spatialite.so"
22
+ )
15
23
 
16
24
  # Application definition
17
25
  INSTALLED_APPS = [
@@ -1,27 +1,27 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cetk
3
- Version: 0.0.8.dev0
3
+ Version: 0.1.1
4
4
  Summary: CLAIRs Emission ToolKit cetk
5
5
  Author: Christian Asker, Mattias Jakobsson, David Segersson, Eef van Dongen
6
6
  Maintainer-email: FO Luft <foluftadmin@smhi.se>
7
7
  License-Expression: Apache-2.0
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
10
- Requires-Python: >=3.11
10
+ Requires-Python: >=3.12
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Requires-Dist: affine<3.0.1
14
- Requires-Dist: django<6,>=5.2.16
15
- Requires-Dist: fiona>=1.8.22
14
+ Requires-Dist: django>=6.1
15
+ Requires-Dist: fiona>=1.9.5
16
16
  Requires-Dist: geopandas>=0.12
17
- Requires-Dist: netCDF4>=1.6.1
18
- Requires-Dist: numpy<2.5,>=1.20.3
19
- Requires-Dist: openpyxl>=3.0.7
20
- Requires-Dist: pandas>=2.0
21
- Requires-Dist: pyogrio>=0.5.0
22
- Requires-Dist: rastafari2>=0.4
23
- Requires-Dist: rasterio>=1.3.3
24
- Requires-Dist: shapely>=2.0
17
+ Requires-Dist: netCDF4>=1.6.5
18
+ Requires-Dist: numpy<2.5,>=1.26
19
+ Requires-Dist: openpyxl>=3.0.10
20
+ Requires-Dist: pandas>=2.1.1
21
+ Requires-Dist: pyogrio>=0.7.0
22
+ Requires-Dist: rastafari>=0.4.4
23
+ Requires-Dist: rasterio>=1.3.9
24
+ Requires-Dist: shapely>=2.0.2
25
25
  Dynamic: license-file
26
26
 
27
27
  # Emission ToolKit cetk
@@ -0,0 +1,12 @@
1
+ affine<3.0.1
2
+ django>=6.1
3
+ fiona>=1.9.5
4
+ geopandas>=0.12
5
+ netCDF4>=1.6.5
6
+ numpy<2.5,>=1.26
7
+ openpyxl>=3.0.10
8
+ pandas>=2.1.1
9
+ pyogrio>=0.7.0
10
+ rastafari>=0.4.4
11
+ rasterio>=1.3.9
12
+ shapely>=2.0.2
@@ -1,13 +0,0 @@
1
- # CI/CD and development requirements for the Gadget
2
- build
3
- coverage[toml]
4
- django >=5.2.16,<6
5
- nox
6
- pip-tools
7
- pre-commit
8
- pytest
9
- pytest-cov
10
- pytest-django
11
- ruff
12
- setuptools-scm
13
- uv
@@ -1,12 +0,0 @@
1
- affine<3.0.1
2
- django<6,>=5.2.16
3
- fiona>=1.8.22
4
- geopandas>=0.12
5
- netCDF4>=1.6.1
6
- numpy<2.5,>=1.20.3
7
- openpyxl>=3.0.7
8
- pandas>=2.0
9
- pyogrio>=0.5.0
10
- rastafari2>=0.4
11
- rasterio>=1.3.3
12
- shapely>=2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes