pyelq 1.1.0__tar.gz → 1.1.2__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.
- {pyelq-1.1.0 → pyelq-1.1.2}/PKG-INFO +5 -3
- {pyelq-1.1.0 → pyelq-1.1.2}/pyproject.toml +4 -4
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/dlm.py +5 -3
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/gas_species.py +22 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/plotting/plot.py +11 -8
- {pyelq-1.1.0 → pyelq-1.1.2}/LICENSE.md +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/LICENSES/Apache-2.0.txt +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/README.md +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/__init__.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/component/__init__.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/component/background.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/component/component.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/component/error_model.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/component/offset.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/component/source_model.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/coordinate_system.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/data_access/__init__.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/data_access/data_access.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/dispersion_model/__init__.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/dispersion_model/gaussian_plume.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/meteorology.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/model.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/plotting/__init__.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/preprocessing.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/sensor/__init__.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/sensor/beam.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/sensor/satellite.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/sensor/sensor.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/source_map.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/support_functions/__init__.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/support_functions/post_processing.py +0 -0
- {pyelq-1.1.0 → pyelq-1.1.2}/src/pyelq/support_functions/spatio_temporal_interpolation.py +0 -0
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pyelq
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: Package for detection, localization and quantification code.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: gas dispersion,emission,detection,localization,quantification
|
|
7
7
|
Author: Bas van de Kerkhof
|
|
8
|
-
Requires-Python: >=3.9
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
9
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
16
|
Requires-Dist: geojson (>=3.2.0)
|
|
15
17
|
Requires-Dist: numpy (>=2.0.2)
|
|
16
|
-
Requires-Dist: openmcmc (==1.0.
|
|
18
|
+
Requires-Dist: openmcmc (==1.0.6)
|
|
17
19
|
Requires-Dist: pandas (>=2.2.3)
|
|
18
20
|
Requires-Dist: plotly (>=6.0.0)
|
|
19
21
|
Requires-Dist: pymap3d (>=3.1.0)
|
|
@@ -8,7 +8,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
8
8
|
|
|
9
9
|
[tool.poetry]
|
|
10
10
|
name = "pyelq"
|
|
11
|
-
version = "1.1.
|
|
11
|
+
version = "1.1.2"
|
|
12
12
|
description = "Package for detection, localization and quantification code."
|
|
13
13
|
authors = ["Bas van de Kerkhof", "Matthew Jones", "David Randell"]
|
|
14
14
|
homepage = "https://sede-open.github.io/pyELQ/"
|
|
@@ -20,7 +20,7 @@ keywords = ["gas dispersion", "emission", "detection", "localization", "quantifi
|
|
|
20
20
|
packages = [{ include = "pyelq", from = "src" }]
|
|
21
21
|
|
|
22
22
|
[tool.poetry.dependencies]
|
|
23
|
-
python = ">=3.9
|
|
23
|
+
python = ">=3.9"
|
|
24
24
|
pandas = ">=2.2.3"
|
|
25
25
|
numpy = ">=2.0.2"
|
|
26
26
|
plotly = ">=6.0.0"
|
|
@@ -29,7 +29,7 @@ pymap3d = ">=3.1.0"
|
|
|
29
29
|
geojson = ">=3.2.0"
|
|
30
30
|
shapely = ">=2.0.7"
|
|
31
31
|
scikit-learn = ">=1.6.1"
|
|
32
|
-
openmcmc = "==1.0.
|
|
32
|
+
openmcmc = "==1.0.6"
|
|
33
33
|
|
|
34
34
|
[tool.poetry.group.contributor]
|
|
35
35
|
optional = true
|
|
@@ -67,7 +67,7 @@ py-version=3.11
|
|
|
67
67
|
|
|
68
68
|
[tool.black]
|
|
69
69
|
line-length = 120
|
|
70
|
-
target-version = ['
|
|
70
|
+
target-version = ['py311']
|
|
71
71
|
|
|
72
72
|
[tool.pydocstyle]
|
|
73
73
|
convention = "google"
|
|
@@ -119,20 +119,22 @@ class DLM:
|
|
|
119
119
|
mean_state_noise = np.zeros(self.nof_state_parameters)
|
|
120
120
|
mean_observation_noise = np.zeros(self.nof_observables)
|
|
121
121
|
|
|
122
|
+
random_generator = np.random.default_rng(seed=None)
|
|
123
|
+
|
|
122
124
|
for i in range(nof_timesteps):
|
|
123
125
|
if i == 0:
|
|
124
126
|
state[:, [i]] = (
|
|
125
127
|
self.g_matrix @ init_state
|
|
126
|
-
+
|
|
128
|
+
+ random_generator.multivariate_normal(mean_state_noise, self.w_matrix, size=1).T
|
|
127
129
|
)
|
|
128
130
|
else:
|
|
129
131
|
state[:, [i]] = (
|
|
130
132
|
self.g_matrix @ state[:, [i - 1]]
|
|
131
|
-
+
|
|
133
|
+
+ random_generator.multivariate_normal(mean_state_noise, self.w_matrix, size=1).T
|
|
132
134
|
)
|
|
133
135
|
obs[:, [i]] = (
|
|
134
136
|
self.f_matrix.T @ state[:, [i]]
|
|
135
|
-
+
|
|
137
|
+
+ random_generator.multivariate_normal(mean_observation_noise, self.v_matrix, size=1).T
|
|
136
138
|
)
|
|
137
139
|
|
|
138
140
|
return state, obs
|
|
@@ -230,3 +230,25 @@ class NO2(GasSpecies):
|
|
|
230
230
|
|
|
231
231
|
global_background = 0
|
|
232
232
|
half_life = 12
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
@dataclass
|
|
236
|
+
class H2(GasSpecies):
|
|
237
|
+
"""Defines the properties of H2."""
|
|
238
|
+
|
|
239
|
+
@property
|
|
240
|
+
def name(self):
|
|
241
|
+
"""Str: Name of gas."""
|
|
242
|
+
return "Hydrogen"
|
|
243
|
+
|
|
244
|
+
@property
|
|
245
|
+
def molar_mass(self):
|
|
246
|
+
"""Float: Molar Mass [g/mol]."""
|
|
247
|
+
return 2.01568
|
|
248
|
+
|
|
249
|
+
@property
|
|
250
|
+
def formula(self):
|
|
251
|
+
"""Str: Chemical formula of gas."""
|
|
252
|
+
return "H2"
|
|
253
|
+
|
|
254
|
+
global_background = 0.5
|
|
@@ -38,6 +38,9 @@ from pyelq.support_functions.post_processing import (
|
|
|
38
38
|
if TYPE_CHECKING:
|
|
39
39
|
from pyelq.model import ELQModel
|
|
40
40
|
|
|
41
|
+
RGB_LIGHT_BLUE = "rgb(102, 197, 204)"
|
|
42
|
+
MCMC_ITERATION_NUMBER_LITERAL = "MCMC Iteration Number"
|
|
43
|
+
|
|
41
44
|
|
|
42
45
|
def lighter_rgb(rbg_string: str) -> str:
|
|
43
46
|
"""Takes in an RGB string and returns a lighter version of this colour.
|
|
@@ -162,7 +165,7 @@ def create_trace_specifics(object_to_plot: Union[Type[SlabAndSpike], SourceModel
|
|
|
162
165
|
if isinstance(object_to_plot, SourceModel):
|
|
163
166
|
dict_key = kwargs.pop("dict_key", "number_of_sources_plot")
|
|
164
167
|
title_text = "Number of Sources 'on' against MCMC iterations"
|
|
165
|
-
x_label =
|
|
168
|
+
x_label = MCMC_ITERATION_NUMBER_LITERAL
|
|
166
169
|
y_label = "Number of Sources 'on'"
|
|
167
170
|
emission_rates = object_to_plot.emission_rate
|
|
168
171
|
if isinstance(object_to_plot, SlabAndSpike):
|
|
@@ -179,11 +182,11 @@ def create_trace_specifics(object_to_plot: Union[Type[SlabAndSpike], SourceModel
|
|
|
179
182
|
elif isinstance(object_to_plot, MCMC):
|
|
180
183
|
dict_key = kwargs.pop("dict_key", "log_posterior_plot")
|
|
181
184
|
title_text = "Log posterior values against MCMC iterations"
|
|
182
|
-
x_label =
|
|
185
|
+
x_label = MCMC_ITERATION_NUMBER_LITERAL
|
|
183
186
|
y_label = "Log Posterior<br>Value"
|
|
184
187
|
y_values = object_to_plot.store["log_post"].flatten()
|
|
185
188
|
x_values = np.array(range(y_values.size))
|
|
186
|
-
color =
|
|
189
|
+
color = RGB_LIGHT_BLUE
|
|
187
190
|
name = "Log Posterior"
|
|
188
191
|
|
|
189
192
|
if "burn_in" not in kwargs:
|
|
@@ -245,7 +248,7 @@ def create_plot_specifics(
|
|
|
245
248
|
if plot_type == "line":
|
|
246
249
|
dict_key = kwargs.pop("dict_key", "error_model_iterations")
|
|
247
250
|
title_text = "Estimated Error Model Values"
|
|
248
|
-
x_label =
|
|
251
|
+
x_label = MCMC_ITERATION_NUMBER_LITERAL
|
|
249
252
|
y_label = "Estimated Error Model<br>Standard Deviation (ppm)"
|
|
250
253
|
|
|
251
254
|
elif plot_type == "box":
|
|
@@ -270,7 +273,7 @@ def create_plot_specifics(
|
|
|
270
273
|
if plot_type == "line":
|
|
271
274
|
dict_key = kwargs.pop("dict_key", "offset_iterations")
|
|
272
275
|
title_text = f"Estimated Value of Offset w.r.t. {offset_sensor_name}"
|
|
273
|
-
x_label =
|
|
276
|
+
x_label = MCMC_ITERATION_NUMBER_LITERAL
|
|
274
277
|
y_label = "Estimated Offset<br>Value (ppm)"
|
|
275
278
|
|
|
276
279
|
elif plot_type == "box":
|
|
@@ -816,7 +819,7 @@ class Plot:
|
|
|
816
819
|
|
|
817
820
|
dict_key = "estimated_values_plot"
|
|
818
821
|
title_text = "Estimated Values of Sources With Respect to MCMC Iterations"
|
|
819
|
-
x_label =
|
|
822
|
+
x_label = MCMC_ITERATION_NUMBER_LITERAL
|
|
820
823
|
y_label = "Estimated Emission<br>Values (kg/hr)"
|
|
821
824
|
|
|
822
825
|
fig = go.Figure()
|
|
@@ -838,7 +841,7 @@ class Plot:
|
|
|
838
841
|
fig=fig,
|
|
839
842
|
x_values=x_values,
|
|
840
843
|
y_values=y_values,
|
|
841
|
-
color=
|
|
844
|
+
color=RGB_LIGHT_BLUE,
|
|
842
845
|
name=f"Source {source_idx}",
|
|
843
846
|
burn_in=burn_in,
|
|
844
847
|
show_legend=False,
|
|
@@ -849,7 +852,7 @@ class Plot:
|
|
|
849
852
|
fig=fig,
|
|
850
853
|
x_values=np.array([None]),
|
|
851
854
|
y_values=np.array([None]),
|
|
852
|
-
color=
|
|
855
|
+
color=RGB_LIGHT_BLUE,
|
|
853
856
|
name="Source traces",
|
|
854
857
|
burn_in=0,
|
|
855
858
|
show_legend=True,
|
|
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
|