webviz-subsurface 0.2.39__py3-none-any.whl → 0.2.41__py3-none-any.whl
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.
- webviz_subsurface/_figures/timeseries_figure.py +1 -1
- webviz_subsurface/_providers/ensemble_summary_provider/_provider_impl_arrow_lazy.py +3 -1
- webviz_subsurface/_providers/ensemble_summary_provider/_provider_impl_arrow_presampled.py +3 -1
- webviz_subsurface/_providers/ensemble_table_provider/ensemble_table_provider_impl_arrow.py +3 -1
- webviz_subsurface/_utils/dataframe_utils.py +1 -1
- webviz_subsurface/_version.py +34 -0
- webviz_subsurface/plugins/_bhp_qc/views/_view_functions.py +5 -5
- webviz_subsurface/plugins/_co2_migration/__init__.py +1 -0
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_plugin.py +86 -46
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/callbacks.py +53 -30
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/co2volume.py +283 -40
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/color_tables.py +1 -1
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/containment_data_provider.py +6 -4
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/containment_info.py +6 -0
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/ensemble_well_picks.py +1 -1
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/generic.py +59 -6
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/initialization.py +73 -10
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/polygon_handler.py +1 -1
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/summary_graphs.py +20 -18
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/surface_publishing.py +18 -20
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/unsmry_data_provider.py +8 -8
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/views/mainview/mainview.py +98 -44
- webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/views/mainview/settings.py +7 -5
- webviz_subsurface/plugins/_disk_usage.py +19 -8
- webviz_subsurface/plugins/_line_plotter_fmu/controllers/build_figure.py +4 -4
- webviz_subsurface/plugins/_map_viewer_fmu/layout.py +2 -1
- webviz_subsurface/plugins/_map_viewer_fmu/map_viewer_fmu.py +1 -1
- webviz_subsurface/plugins/_parameter_analysis/_utils/_parameters_model.py +5 -5
- webviz_subsurface/plugins/_property_statistics/property_statistics.py +1 -1
- webviz_subsurface/plugins/_relative_permeability.py +6 -6
- webviz_subsurface/plugins/_reservoir_simulation_timeseries_regional.py +12 -12
- webviz_subsurface/plugins/_running_time_analysis_fmu.py +6 -1
- webviz_subsurface/plugins/_seismic_misfit.py +2 -3
- webviz_subsurface/plugins/_simulation_time_series/_views/_subplot_view/_utils/vector_statistics.py +4 -4
- webviz_subsurface/plugins/_structural_uncertainty/views/intersection_and_map.py +1 -1
- webviz_subsurface/plugins/_swatinit_qc/_business_logic.py +1 -1
- webviz_subsurface-0.2.41.dist-info/METADATA +822 -0
- {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.41.dist-info}/RECORD +51 -102
- {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.41.dist-info}/WHEEL +1 -1
- {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.41.dist-info}/entry_points.txt +1 -1
- {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.41.dist-info}/top_level.txt +0 -1
- tests/integration_tests/test_parameter_filter.py +0 -28
- tests/integration_tests/test_surface_selector.py +0 -53
- tests/unit_tests/abbreviations_tests/test_reservoir_simulation.py +0 -94
- tests/unit_tests/data_input/__init__.py +0 -0
- tests/unit_tests/data_input/test_calc_from_cumulatives.py +0 -178
- tests/unit_tests/data_input/test_image_processing.py +0 -11
- tests/unit_tests/mocks/__init__.py +0 -0
- tests/unit_tests/mocks/ensemble_summary_provider_dummy.py +0 -67
- tests/unit_tests/model_tests/__init__.py +0 -0
- tests/unit_tests/model_tests/test_ensemble_model.py +0 -176
- tests/unit_tests/model_tests/test_ensemble_set_model.py +0 -105
- tests/unit_tests/model_tests/test_gruptree_model.py +0 -89
- tests/unit_tests/model_tests/test_property_statistics_model.py +0 -42
- tests/unit_tests/model_tests/test_surface_set_model.py +0 -48
- tests/unit_tests/model_tests/test_well_attributes_model.py +0 -110
- tests/unit_tests/model_tests/test_well_set_model.py +0 -70
- tests/unit_tests/plugin_tests/__init__.py +0 -0
- tests/unit_tests/plugin_tests/test_grouptree.py +0 -175
- tests/unit_tests/plugin_tests/test_simulation_time_series/__init__.py +0 -0
- tests/unit_tests/plugin_tests/test_simulation_time_series/mocks/__init__.py +0 -0
- tests/unit_tests/plugin_tests/test_simulation_time_series/mocks/derived_vectors_accessor_ensemble_summary_provider_mock.py +0 -60
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/__init__.py +0 -0
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_create_vector_traces_utils.py +0 -530
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_dataframe_utils.py +0 -119
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_datetime_utils.py +0 -51
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_delta_ensemble_utils.py +0 -222
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_derived_delta_ensemble_vectors_accessor_impl.py +0 -319
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_derived_ensemble_vectors_accessor_impl.py +0 -271
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_derived_ensemble_vectors_accessor_utils.py +0 -78
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_derived_vector_accessor.py +0 -57
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_ensemble_summary_provider_set_utils.py +0 -213
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_from_timeseries_cumulatives.py +0 -322
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_history_vectors.py +0 -201
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_trace_line_shape.py +0 -56
- tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_vector_statistics.py +0 -171
- tests/unit_tests/plugin_tests/test_tornado_data.py +0 -130
- tests/unit_tests/plugin_tests/test_well_completions.py +0 -158
- tests/unit_tests/provider_tests/__init__.py +0 -0
- tests/unit_tests/provider_tests/test_ensemble_summary_provider.py +0 -255
- tests/unit_tests/provider_tests/test_ensemble_summary_provider_impl_arrow_lazy.py +0 -388
- tests/unit_tests/provider_tests/test_ensemble_summary_provider_impl_arrow_presampled.py +0 -160
- tests/unit_tests/provider_tests/test_ensemble_summary_provider_resampling.py +0 -320
- tests/unit_tests/provider_tests/test_ensemble_table_provider.py +0 -190
- tests/unit_tests/utils_tests/__init__.py +0 -0
- tests/unit_tests/utils_tests/test_dataframe_utils.py +0 -281
- tests/unit_tests/utils_tests/test_ensemble_summary_provider_set/__init__.py +0 -0
- tests/unit_tests/utils_tests/test_ensemble_summary_provider_set/test_ensemble_summary_provider_set.py +0 -306
- tests/unit_tests/utils_tests/test_formatting.py +0 -10
- tests/unit_tests/utils_tests/test_simulation_timeseries.py +0 -51
- webviz_subsurface/plugins/_co2_leakage/__init__.py +0 -1
- webviz_subsurface/plugins/_co2_leakage/_utilities/__init__.py +0 -0
- webviz_subsurface/plugins/_co2_leakage/views/__init__.py +0 -0
- webviz_subsurface/plugins/_co2_leakage/views/mainview/__init__.py +0 -0
- webviz_subsurface-0.2.39.dist-info/METADATA +0 -147
- /webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_error.py +0 -0
- /webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_types.py +0 -0
- {tests/integration_tests → webviz_subsurface/plugins/_co2_migration/_utilities}/__init__.py +0 -0
- /webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/_misc.py +0 -0
- /webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/fault_polygons_handler.py +0 -0
- /webviz_subsurface/plugins/{_co2_leakage → _co2_migration}/_utilities/plume_extent.py +0 -0
- {tests/unit_tests → webviz_subsurface/plugins/_co2_migration/views}/__init__.py +0 -0
- {tests/unit_tests/abbreviations_tests → webviz_subsurface/plugins/_co2_migration/views/mainview}/__init__.py +0 -0
- {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.41.dist-info/licenses}/LICENSE +0 -0
- {webviz_subsurface-0.2.39.dist-info → webviz_subsurface-0.2.41.dist-info/licenses}/LICENSE.chromedriver +0 -0
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
|
|
3
|
-
import pandas as pd
|
|
4
|
-
import pytest
|
|
5
|
-
from pandas._testing import assert_frame_equal
|
|
6
|
-
|
|
7
|
-
from webviz_subsurface._providers import Frequency
|
|
8
|
-
from webviz_subsurface._utils.dataframe_utils import make_date_column_datetime_object
|
|
9
|
-
|
|
10
|
-
# pylint: disable=line-too-long
|
|
11
|
-
from webviz_subsurface.plugins._simulation_time_series._views._subplot_view._utils.from_timeseries_cumulatives import (
|
|
12
|
-
calculate_from_resampled_cumulative_vectors_df,
|
|
13
|
-
create_per_day_vector_name,
|
|
14
|
-
create_per_interval_vector_name,
|
|
15
|
-
datetime_to_intervalstr,
|
|
16
|
-
get_cumulative_vector_name,
|
|
17
|
-
is_per_interval_or_per_day_vector,
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
# *******************************************************************
|
|
21
|
-
#####################################################################
|
|
22
|
-
#
|
|
23
|
-
# CONFIGURE TESTDATA
|
|
24
|
-
#
|
|
25
|
-
#####################################################################
|
|
26
|
-
# *******************************************************************
|
|
27
|
-
|
|
28
|
-
# fmt: off
|
|
29
|
-
# Monthly frequency - rate per day implies divide on days in month
|
|
30
|
-
INPUT_WEEKLY_DF = pd.DataFrame(
|
|
31
|
-
columns=["DATE", "REAL", "A", "B"],
|
|
32
|
-
data=[
|
|
33
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0, 250.0 ],
|
|
34
|
-
[datetime.datetime(2021, 1, 8), 1, 100.0, 500.0 ],
|
|
35
|
-
[datetime.datetime(2021, 1, 15), 1, 150.0, 750.0 ],
|
|
36
|
-
[datetime.datetime(2021, 1, 1), 2, 300.0, 350.0 ],
|
|
37
|
-
[datetime.datetime(2021, 1, 8), 2, 400.0, 700.0 ],
|
|
38
|
-
[datetime.datetime(2021, 1, 15), 2, 500.0, 1050.0],
|
|
39
|
-
[datetime.datetime(2021, 1, 1), 4, 1000.0, 450.0 ],
|
|
40
|
-
[datetime.datetime(2021, 1, 8), 4, 1200.0, 900.0 ],
|
|
41
|
-
[datetime.datetime(2021, 1, 15), 4, 1400.0, 1350.0],
|
|
42
|
-
],
|
|
43
|
-
)
|
|
44
|
-
EXPECTED_PER_INTVL_WEEKLY_DF = pd.DataFrame(
|
|
45
|
-
columns=["DATE", "REAL", "PER_INTVL_A", "PER_INTVL_B"],
|
|
46
|
-
data=[
|
|
47
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0, 250.0],
|
|
48
|
-
[datetime.datetime(2021, 1, 8), 1, 50.0, 250.0],
|
|
49
|
-
[datetime.datetime(2021, 1, 15), 1, 0.0, 0.0 ],
|
|
50
|
-
[datetime.datetime(2021, 1, 1), 2, 100.0, 350.0],
|
|
51
|
-
[datetime.datetime(2021, 1, 8), 2, 100.0, 350.0],
|
|
52
|
-
[datetime.datetime(2021, 1, 15), 2, 0.0, 0.0 ],
|
|
53
|
-
[datetime.datetime(2021, 1, 1), 4, 200.0, 450.0],
|
|
54
|
-
[datetime.datetime(2021, 1, 8), 4, 200.0, 450.0],
|
|
55
|
-
[datetime.datetime(2021, 1, 15), 4, 0.0, 0.0 ],
|
|
56
|
-
],
|
|
57
|
-
)
|
|
58
|
-
EXPECTED_PER_DAY_WEEKLY_DF = pd.DataFrame(
|
|
59
|
-
columns=["DATE", "REAL", "PER_DAY_A", "PER_DAY_B"],
|
|
60
|
-
data=[
|
|
61
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0/7.0, 250.0/7.0],
|
|
62
|
-
[datetime.datetime(2021, 1, 8), 1, 50.0/7.0, 250.0/7.0],
|
|
63
|
-
[datetime.datetime(2021, 1, 15), 1, 0.0, 0.0 ],
|
|
64
|
-
[datetime.datetime(2021, 1, 1), 2, 100.0/7.0, 350.0/7.0],
|
|
65
|
-
[datetime.datetime(2021, 1, 8), 2, 100.0/7.0, 350.0/7.0],
|
|
66
|
-
[datetime.datetime(2021, 1, 15), 2, 0.0, 0.0 ],
|
|
67
|
-
[datetime.datetime(2021, 1, 1), 4, 200.0/7.0, 450.0/7.0],
|
|
68
|
-
[datetime.datetime(2021, 1, 8), 4, 200.0/7.0, 450.0/7.0],
|
|
69
|
-
[datetime.datetime(2021, 1, 15), 4, 0.0, 0.0 ],
|
|
70
|
-
],
|
|
71
|
-
)
|
|
72
|
-
# Convert date columns to datetime.datetime
|
|
73
|
-
make_date_column_datetime_object(INPUT_WEEKLY_DF)
|
|
74
|
-
make_date_column_datetime_object(EXPECTED_PER_INTVL_WEEKLY_DF)
|
|
75
|
-
make_date_column_datetime_object(EXPECTED_PER_DAY_WEEKLY_DF)
|
|
76
|
-
|
|
77
|
-
# Monthly frequency - rate per day implies divide on days in month
|
|
78
|
-
INPUT_MONTHLY_DF = pd.DataFrame(
|
|
79
|
-
columns=["DATE", "REAL", "A", "B"],
|
|
80
|
-
data=[
|
|
81
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0, 250.0 ],
|
|
82
|
-
[datetime.datetime(2021, 2, 1), 1, 100.0, 500.0 ],
|
|
83
|
-
[datetime.datetime(2021, 3, 1), 1, 150.0, 750.0 ],
|
|
84
|
-
[datetime.datetime(2021, 1, 1), 2, 300.0, 350.0 ],
|
|
85
|
-
[datetime.datetime(2021, 2, 1), 2, 400.0, 700.0 ],
|
|
86
|
-
[datetime.datetime(2021, 3, 1), 2, 500.0, 1050.0],
|
|
87
|
-
[datetime.datetime(2021, 1, 1), 4, 1000.0, 450.0 ],
|
|
88
|
-
[datetime.datetime(2021, 2, 1), 4, 1200.0, 900.0 ],
|
|
89
|
-
[datetime.datetime(2021, 3, 1), 4, 1400.0, 1350.0],
|
|
90
|
-
],
|
|
91
|
-
)
|
|
92
|
-
EXPECTED_PER_INTVL_MONTHLY_DF = pd.DataFrame(
|
|
93
|
-
columns=["DATE", "REAL", "PER_INTVL_A", "PER_INTVL_B"],
|
|
94
|
-
data=[
|
|
95
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0, 250.0],
|
|
96
|
-
[datetime.datetime(2021, 2, 1), 1, 50.0, 250.0],
|
|
97
|
-
[datetime.datetime(2021, 3, 1), 1, 0.0, 0.0 ],
|
|
98
|
-
[datetime.datetime(2021, 1, 1), 2, 100.0, 350.0],
|
|
99
|
-
[datetime.datetime(2021, 2, 1), 2, 100.0, 350.0],
|
|
100
|
-
[datetime.datetime(2021, 3, 1), 2, 0.0, 0.0 ],
|
|
101
|
-
[datetime.datetime(2021, 1, 1), 4, 200.0, 450.0],
|
|
102
|
-
[datetime.datetime(2021, 2, 1), 4, 200.0, 450.0],
|
|
103
|
-
[datetime.datetime(2021, 3, 1), 4, 0.0, 0.0 ],
|
|
104
|
-
],
|
|
105
|
-
)
|
|
106
|
-
EXPECTED_PER_DAY_MONTHLY_DF = pd.DataFrame(
|
|
107
|
-
columns=["DATE", "REAL", "PER_DAY_A", "PER_DAY_B"],
|
|
108
|
-
data=[
|
|
109
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0/31.0, 250.0/31.0],
|
|
110
|
-
[datetime.datetime(2021, 2, 1), 1, 50.0/28.0, 250.0/28.0],
|
|
111
|
-
[datetime.datetime(2021, 3, 1), 1, 0.0, 0.0 ],
|
|
112
|
-
[datetime.datetime(2021, 1, 1), 2, 100.0/31.0, 350.0/31.0],
|
|
113
|
-
[datetime.datetime(2021, 2, 1), 2, 100.0/28.0, 350.0/28.0],
|
|
114
|
-
[datetime.datetime(2021, 3, 1), 2, 0.0, 0.0 ],
|
|
115
|
-
[datetime.datetime(2021, 1, 1), 4, 200.0/31.0, 450.0/31.0],
|
|
116
|
-
[datetime.datetime(2021, 2, 1), 4, 200.0/28.0, 450.0/28.0],
|
|
117
|
-
[datetime.datetime(2021, 3, 1), 4, 0.0, 0.0 ],
|
|
118
|
-
],
|
|
119
|
-
)
|
|
120
|
-
# Convert date columns to datetime.datetime
|
|
121
|
-
make_date_column_datetime_object(INPUT_MONTHLY_DF)
|
|
122
|
-
make_date_column_datetime_object(EXPECTED_PER_INTVL_MONTHLY_DF)
|
|
123
|
-
make_date_column_datetime_object(EXPECTED_PER_DAY_MONTHLY_DF)
|
|
124
|
-
|
|
125
|
-
# Yearly frequency - rate per day implies divide on days in year
|
|
126
|
-
INPUT_YEARLY_DF = pd.DataFrame(
|
|
127
|
-
columns=["DATE", "REAL", "A", "B"],
|
|
128
|
-
data=[
|
|
129
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0, 250.0 ],
|
|
130
|
-
[datetime.datetime(2022, 1, 1), 1, 100.0, 500.0 ],
|
|
131
|
-
[datetime.datetime(2023, 1, 1), 1, 150.0, 750.0 ],
|
|
132
|
-
[datetime.datetime(2021, 1, 1), 2, 300.0, 350.0 ],
|
|
133
|
-
[datetime.datetime(2022, 1, 1), 2, 400.0, 700.0 ],
|
|
134
|
-
[datetime.datetime(2023, 1, 1), 2, 500.0, 1050.0],
|
|
135
|
-
[datetime.datetime(2021, 1, 1), 4, 1000.0, 450.0 ],
|
|
136
|
-
[datetime.datetime(2022, 1, 1), 4, 1200.0, 900.0 ],
|
|
137
|
-
[datetime.datetime(2023, 1, 1), 4, 1400.0, 1350.0],
|
|
138
|
-
],
|
|
139
|
-
)
|
|
140
|
-
EXPECTED_PER_INTVL_YEARLY_DF = pd.DataFrame(
|
|
141
|
-
columns=["DATE", "REAL", "PER_INTVL_A", "PER_INTVL_B"],
|
|
142
|
-
data=[
|
|
143
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0, 250.0],
|
|
144
|
-
[datetime.datetime(2022, 1, 1), 1, 50.0, 250.0],
|
|
145
|
-
[datetime.datetime(2023, 1, 1), 1, 0.0, 0.0 ],
|
|
146
|
-
[datetime.datetime(2021, 1, 1), 2, 100.0, 350.0],
|
|
147
|
-
[datetime.datetime(2022, 1, 1), 2, 100.0, 350.0],
|
|
148
|
-
[datetime.datetime(2023, 1, 1), 2, 0.0, 0.0 ],
|
|
149
|
-
[datetime.datetime(2021, 1, 1), 4, 200.0, 450.0],
|
|
150
|
-
[datetime.datetime(2022, 1, 1), 4, 200.0, 450.0],
|
|
151
|
-
[datetime.datetime(2023, 1, 1), 4, 0.0, 0.0 ],
|
|
152
|
-
],
|
|
153
|
-
)
|
|
154
|
-
EXPECTED_PER_DAY_YEARLY_DF = pd.DataFrame(
|
|
155
|
-
columns=["DATE", "REAL", "PER_DAY_A", "PER_DAY_B"],
|
|
156
|
-
data=[
|
|
157
|
-
[datetime.datetime(2021, 1, 1), 1, 50.0/365.0, 250.0/365.0],
|
|
158
|
-
[datetime.datetime(2022, 1, 1), 1, 50.0/365.0, 250.0/365.0],
|
|
159
|
-
[datetime.datetime(2023, 1, 1), 1, 0.0, 0.0 ],
|
|
160
|
-
[datetime.datetime(2021, 1, 1), 2, 100.0/365.0, 350.0/365.0],
|
|
161
|
-
[datetime.datetime(2022, 1, 1), 2, 100.0/365.0, 350.0/365.0],
|
|
162
|
-
[datetime.datetime(2023, 1, 1), 2, 0.0, 0.0 ],
|
|
163
|
-
[datetime.datetime(2021, 1, 1), 4, 200.0/365.0, 450.0/365.0],
|
|
164
|
-
[datetime.datetime(2022, 1, 1), 4, 200.0/365.0, 450.0/365.0],
|
|
165
|
-
[datetime.datetime(2023, 1, 1), 4, 0.0, 0.0 ],
|
|
166
|
-
],
|
|
167
|
-
)
|
|
168
|
-
# Convert date columns to datetime.datetime
|
|
169
|
-
make_date_column_datetime_object(INPUT_YEARLY_DF)
|
|
170
|
-
make_date_column_datetime_object(EXPECTED_PER_INTVL_YEARLY_DF)
|
|
171
|
-
make_date_column_datetime_object(EXPECTED_PER_DAY_YEARLY_DF)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
# Monthly frequency after year 2262 - rate per day implies divide on days in month
|
|
175
|
-
AFTER_2262_MONTHLY_DATES = pd.Series(
|
|
176
|
-
[
|
|
177
|
-
datetime.datetime(2265, 1, 1),
|
|
178
|
-
datetime.datetime(2265, 2, 1),
|
|
179
|
-
datetime.datetime(2265, 3, 1),
|
|
180
|
-
datetime.datetime(2265, 1, 1),
|
|
181
|
-
datetime.datetime(2265, 2, 1),
|
|
182
|
-
datetime.datetime(2265, 3, 1),
|
|
183
|
-
datetime.datetime(2265, 1, 1),
|
|
184
|
-
datetime.datetime(2265, 2, 1),
|
|
185
|
-
datetime.datetime(2265, 3, 1),
|
|
186
|
-
]
|
|
187
|
-
)
|
|
188
|
-
# NOTE: datetime.datetime after year 2262 is not converted to pd.Timestamp!
|
|
189
|
-
INPUT_MONTHLY_AFTER_2262_DF = INPUT_MONTHLY_DF.copy()
|
|
190
|
-
INPUT_MONTHLY_AFTER_2262_DF["DATE"] = AFTER_2262_MONTHLY_DATES
|
|
191
|
-
EXPECTED_PER_INTVL_MONTHLY_AFTER_2262_DF = EXPECTED_PER_INTVL_MONTHLY_DF.copy()
|
|
192
|
-
EXPECTED_PER_INTVL_MONTHLY_AFTER_2262_DF["DATE"] = AFTER_2262_MONTHLY_DATES
|
|
193
|
-
EXPECTED_PER_DAY_MONTHLY_AFTER_2262_DF = EXPECTED_PER_DAY_MONTHLY_DF.copy()
|
|
194
|
-
EXPECTED_PER_DAY_MONTHLY_AFTER_2262_DF["DATE"] = AFTER_2262_MONTHLY_DATES
|
|
195
|
-
|
|
196
|
-
# fmt: on
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
# *******************************************************************
|
|
200
|
-
#####################################################################
|
|
201
|
-
#
|
|
202
|
-
# UNIT TESTS
|
|
203
|
-
#
|
|
204
|
-
#####################################################################
|
|
205
|
-
# *******************************************************************
|
|
206
|
-
|
|
207
|
-
TEST_CASES = [
|
|
208
|
-
pytest.param(
|
|
209
|
-
INPUT_WEEKLY_DF, EXPECTED_PER_INTVL_WEEKLY_DF, EXPECTED_PER_DAY_WEEKLY_DF
|
|
210
|
-
),
|
|
211
|
-
pytest.param(
|
|
212
|
-
INPUT_MONTHLY_DF, EXPECTED_PER_INTVL_MONTHLY_DF, EXPECTED_PER_DAY_MONTHLY_DF
|
|
213
|
-
),
|
|
214
|
-
pytest.param(
|
|
215
|
-
INPUT_YEARLY_DF, EXPECTED_PER_INTVL_YEARLY_DF, EXPECTED_PER_DAY_YEARLY_DF
|
|
216
|
-
),
|
|
217
|
-
pytest.param(
|
|
218
|
-
INPUT_MONTHLY_AFTER_2262_DF,
|
|
219
|
-
EXPECTED_PER_INTVL_MONTHLY_AFTER_2262_DF,
|
|
220
|
-
EXPECTED_PER_DAY_MONTHLY_AFTER_2262_DF,
|
|
221
|
-
),
|
|
222
|
-
]
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
@pytest.mark.parametrize(
|
|
226
|
-
"input_df, expected_per_intvl_df, expected_per_day_df", TEST_CASES
|
|
227
|
-
)
|
|
228
|
-
def test_calculate_from_resampled_cumulative_vectors_df(
|
|
229
|
-
input_df: pd.DataFrame,
|
|
230
|
-
expected_per_intvl_df: pd.DataFrame,
|
|
231
|
-
expected_per_day_df: pd.DataFrame,
|
|
232
|
-
) -> None:
|
|
233
|
-
# PER_INTVL_ due to as_rate_per_day = False
|
|
234
|
-
calculated_per_intvl_df = calculate_from_resampled_cumulative_vectors_df(
|
|
235
|
-
input_df, False
|
|
236
|
-
)
|
|
237
|
-
|
|
238
|
-
# PER_DAY_ due to as_rate_per_day = True
|
|
239
|
-
calculated_per_day_df = calculate_from_resampled_cumulative_vectors_df(
|
|
240
|
-
input_df, True
|
|
241
|
-
)
|
|
242
|
-
|
|
243
|
-
assert_frame_equal(expected_per_intvl_df, calculated_per_intvl_df)
|
|
244
|
-
assert_frame_equal(expected_per_day_df, calculated_per_day_df)
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
def test_calculate_from_resampled_cumulative_vectors_df_invalid_input() -> None:
|
|
248
|
-
"""Test assert check assert_date_column_is_datetime_object() in
|
|
249
|
-
webviz_subsurface._utils.dataframe_utils.py
|
|
250
|
-
"""
|
|
251
|
-
# fmt: off
|
|
252
|
-
input_df = pd.DataFrame(
|
|
253
|
-
columns=["DATE", "REAL", "A", "B"],
|
|
254
|
-
data=[
|
|
255
|
-
[pd.Timestamp(2020, 1, 1), 1, 50.0, 250.0 ],
|
|
256
|
-
[pd.Timestamp(2020, 2, 1), 1, 100.0, 500.0 ],
|
|
257
|
-
[pd.Timestamp(2020, 3, 1), 1, 150.0, 750.0 ],
|
|
258
|
-
[pd.Timestamp(2020, 4, 1), 1, 200.0, 1000.0],
|
|
259
|
-
[pd.Timestamp(2020, 5, 1), 1, 250.0, 1250.0],
|
|
260
|
-
],
|
|
261
|
-
)
|
|
262
|
-
# fmt: on
|
|
263
|
-
|
|
264
|
-
with pytest.raises(ValueError) as err:
|
|
265
|
-
calculate_from_resampled_cumulative_vectors_df(input_df, True)
|
|
266
|
-
assert (
|
|
267
|
-
str(err.value)
|
|
268
|
-
== '"DATE"-column in dataframe is not on datetime.datetime format!'
|
|
269
|
-
)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
def test_is_per_interval_or_per_day_vector() -> None:
|
|
273
|
-
assert is_per_interval_or_per_day_vector("PER_DAY_Vector")
|
|
274
|
-
assert is_per_interval_or_per_day_vector("PER_INTVL_Vector")
|
|
275
|
-
assert not is_per_interval_or_per_day_vector("per_day_Vector")
|
|
276
|
-
assert not is_per_interval_or_per_day_vector("per_intvl_Vector")
|
|
277
|
-
assert not is_per_interval_or_per_day_vector("vector")
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
def test_get_cumulative_vector_name() -> None:
|
|
281
|
-
assert get_cumulative_vector_name("PER_DAY_FOPT") == "FOPT"
|
|
282
|
-
assert get_cumulative_vector_name("PER_INTVL_FOPT") == "FOPT"
|
|
283
|
-
|
|
284
|
-
assert get_cumulative_vector_name("PER_DAY_FOPR") == "FOPR"
|
|
285
|
-
assert get_cumulative_vector_name("PER_INTVL_FOPR") == "FOPR"
|
|
286
|
-
|
|
287
|
-
# Expect ValueError when verifying vector not starting with "PER_DAY_" or "PER_INTVL_"
|
|
288
|
-
try:
|
|
289
|
-
get_cumulative_vector_name("Test_vector")
|
|
290
|
-
pytest.fail('Expected retrieving of cumulative vector name for "Test_vector"')
|
|
291
|
-
except ValueError as err:
|
|
292
|
-
assert (
|
|
293
|
-
f"{err}"
|
|
294
|
-
== 'Expected "Test_vector" to be a vector calculated from cumulative!'
|
|
295
|
-
)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
def test_create_per_day_vector_name() -> None:
|
|
299
|
-
assert create_per_day_vector_name("Vector") == "PER_DAY_Vector"
|
|
300
|
-
assert create_per_day_vector_name("FOPT") == "PER_DAY_FOPT"
|
|
301
|
-
assert create_per_day_vector_name("FOPS") == "PER_DAY_FOPS"
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
def test_create_per_interval_vector_name() -> None:
|
|
305
|
-
assert create_per_interval_vector_name("Vector") == "PER_INTVL_Vector"
|
|
306
|
-
assert create_per_interval_vector_name("FOPT") == "PER_INTVL_FOPT"
|
|
307
|
-
assert create_per_interval_vector_name("FOPS") == "PER_INTVL_FOPS"
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
def test_datetime_to_intervalstr() -> None:
|
|
311
|
-
# Verify early return (ignore mypy)
|
|
312
|
-
assert datetime_to_intervalstr(None, Frequency.WEEKLY) is None # type: ignore
|
|
313
|
-
|
|
314
|
-
test_date = datetime.datetime(2021, 11, 12, 13, 37)
|
|
315
|
-
assert datetime_to_intervalstr(test_date, Frequency.DAILY) == "2021-11-12"
|
|
316
|
-
assert datetime_to_intervalstr(test_date, Frequency.WEEKLY) == "2021-W45"
|
|
317
|
-
assert datetime_to_intervalstr(test_date, Frequency.MONTHLY) == "2021-11"
|
|
318
|
-
assert datetime_to_intervalstr(test_date, Frequency.QUARTERLY) == "2021-Q4"
|
|
319
|
-
assert datetime_to_intervalstr(test_date, Frequency.YEARLY) == "2021"
|
|
320
|
-
|
|
321
|
-
# Verify invalid frequency - i.e. isoformat!
|
|
322
|
-
assert datetime_to_intervalstr(test_date, None) == "2021-11-12T13:37:00" # type: ignore
|
tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_history_vectors.py
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
from typing import List, Optional, Sequence
|
|
3
|
-
|
|
4
|
-
import pandas as pd
|
|
5
|
-
import pytest
|
|
6
|
-
from pandas._testing import assert_frame_equal
|
|
7
|
-
|
|
8
|
-
from webviz_subsurface._providers import Frequency
|
|
9
|
-
from webviz_subsurface._utils.dataframe_utils import make_date_column_datetime_object
|
|
10
|
-
|
|
11
|
-
# pylint: disable=line-too-long
|
|
12
|
-
from webviz_subsurface.plugins._simulation_time_series._views._subplot_view._utils.history_vectors import (
|
|
13
|
-
create_history_vectors_df,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
from ....mocks.ensemble_summary_provider_dummy import EnsembleSummaryProviderDummy
|
|
17
|
-
|
|
18
|
-
# *******************************************************************
|
|
19
|
-
#####################################################################
|
|
20
|
-
#
|
|
21
|
-
# CONFIGURE TESTDATA
|
|
22
|
-
#
|
|
23
|
-
#####################################################################
|
|
24
|
-
# *******************************************************************
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class EnsembleSummaryProviderMock(EnsembleSummaryProviderDummy):
|
|
28
|
-
"""Mock implementation of EnsembleSummaryProvider for testing of creating history
|
|
29
|
-
vector dataframe
|
|
30
|
-
|
|
31
|
-
Implements necessary methods for obtaining wanted test data
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
def __init__(self, input_df: pd.DataFrame) -> None:
|
|
35
|
-
super().__init__()
|
|
36
|
-
|
|
37
|
-
# Configure dataframe
|
|
38
|
-
self._df = input_df
|
|
39
|
-
self._vector_names: List[str] = list(
|
|
40
|
-
set(self._df.columns) ^ set(["DATE", "REAL"])
|
|
41
|
-
)
|
|
42
|
-
self._realizations: List[int] = list(self._df["REAL"].unique())
|
|
43
|
-
|
|
44
|
-
def supports_resampling(self) -> bool:
|
|
45
|
-
return False
|
|
46
|
-
|
|
47
|
-
def vector_names(self) -> List[str]:
|
|
48
|
-
return self._vector_names
|
|
49
|
-
|
|
50
|
-
def realizations(self) -> List[int]:
|
|
51
|
-
return self._realizations
|
|
52
|
-
|
|
53
|
-
def get_vectors_df(
|
|
54
|
-
self,
|
|
55
|
-
vector_names: Sequence[str],
|
|
56
|
-
__resampling_frequency: Optional[Frequency],
|
|
57
|
-
realizations: Optional[Sequence[int]] = None,
|
|
58
|
-
) -> pd.DataFrame:
|
|
59
|
-
if realizations:
|
|
60
|
-
if not set(realizations).issubset(set(self._realizations)):
|
|
61
|
-
raise ValueError(
|
|
62
|
-
"Requested realizations are not subset of provider realizations!"
|
|
63
|
-
)
|
|
64
|
-
return (
|
|
65
|
-
self._df[["DATE", "REAL"] + list(vector_names)]
|
|
66
|
-
.loc[self._df["REAL"] == realizations[0]]
|
|
67
|
-
.reset_index(drop=True)
|
|
68
|
-
)
|
|
69
|
-
raise ValueError("Expected valid realizations argument for mock!")
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
# fmt: off
|
|
73
|
-
# Vector WA and WB, with corresponding historical vectors WAH and WBH, respectively
|
|
74
|
-
# NOTE:
|
|
75
|
-
# - Method utilize guess of historical vector
|
|
76
|
-
# - Assume vectors starting with "F", "G" or "W". Thereby "WA" and "WB" in test
|
|
77
|
-
# - String split on ":" and append "H" on first part, i.e. WA -> WAH,
|
|
78
|
-
# WA:OP_1 -> WAH:OP_1
|
|
79
|
-
|
|
80
|
-
INPUT_DF = pd.DataFrame(
|
|
81
|
-
columns = ["DATE", "REAL", "WA", "WAH", "WB", "WBH"],
|
|
82
|
-
data = [
|
|
83
|
-
[datetime(2000,1,1), 0, 11.0, 13.0, 15.0, 17.0],
|
|
84
|
-
[datetime(2000,2,1), 0, 21.0, 23.0, 25.0, 27.0],
|
|
85
|
-
[datetime(2000,3,1), 0, 31.0, 33.0, 35.0, 37.0],
|
|
86
|
-
[datetime(2000,4,1), 0, 41.0, 43.0, 45.0, 47.0],
|
|
87
|
-
[datetime(2000,5,1), 0, 51.0, 53.0, 55.0, 57.0],
|
|
88
|
-
[datetime(2000,1,1), 3, 110.0, 115.0, 135.0, 139.0],
|
|
89
|
-
[datetime(2000,2,1), 3, 310.0, 215.0, 235.0, 239.0],
|
|
90
|
-
[datetime(2000,3,1), 3, 410.0, 315.0, 335.0, 339.0],
|
|
91
|
-
[datetime(2000,4,1), 3, 510.0, 415.0, 435.0, 439.0],
|
|
92
|
-
[datetime(2000,5,1), 3, 610.0, 515.0, 535.0, 539.0],
|
|
93
|
-
]
|
|
94
|
-
)
|
|
95
|
-
# Data of real = 0 for "WAH"
|
|
96
|
-
EXPECTED_WA_HISTORY_DF = pd.DataFrame(
|
|
97
|
-
columns = ["DATE", "REAL", "WA"],
|
|
98
|
-
data = [
|
|
99
|
-
[datetime(2000,1,1), 0, 13.0],
|
|
100
|
-
[datetime(2000,2,1), 0, 23.0],
|
|
101
|
-
[datetime(2000,3,1), 0, 33.0],
|
|
102
|
-
[datetime(2000,4,1), 0, 43.0],
|
|
103
|
-
[datetime(2000,5,1), 0, 53.0],
|
|
104
|
-
]
|
|
105
|
-
)
|
|
106
|
-
# Data of real = 0 for "WBH" and "WAH"
|
|
107
|
-
EXPECTED_WB_WA_HISTORY_DF = pd.DataFrame(
|
|
108
|
-
columns = ["DATE", "REAL", "WB", "WA"],
|
|
109
|
-
data = [
|
|
110
|
-
[datetime(2000,1,1), 0, 17.0, 13.0],
|
|
111
|
-
[datetime(2000,2,1), 0, 27.0, 23.0],
|
|
112
|
-
[datetime(2000,3,1), 0, 37.0, 33.0],
|
|
113
|
-
[datetime(2000,4,1), 0, 47.0, 43.0],
|
|
114
|
-
[datetime(2000,5,1), 0, 57.0, 53.0],
|
|
115
|
-
]
|
|
116
|
-
)
|
|
117
|
-
make_date_column_datetime_object(INPUT_DF)
|
|
118
|
-
make_date_column_datetime_object(EXPECTED_WA_HISTORY_DF)
|
|
119
|
-
make_date_column_datetime_object(EXPECTED_WB_WA_HISTORY_DF)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
# Dates AFTER year 2262!
|
|
123
|
-
# NOTE: datetime.datetime after year 2262 is not converted to pd.Timestamp, thus
|
|
124
|
-
# no need to make date column datetime object
|
|
125
|
-
INPUT_YEAR_2265_DF = pd.DataFrame(
|
|
126
|
-
columns = ["DATE", "REAL", "WA", "WAH", "WB", "WBH"],
|
|
127
|
-
data = [
|
|
128
|
-
[datetime(2265,1,1), 4, 11.0, 13.0, 15.0, 17.0],
|
|
129
|
-
[datetime(2265,2,1), 4, 21.0, 23.0, 25.0, 27.0],
|
|
130
|
-
[datetime(2265,3,1), 4, 31.0, 33.0, 35.0, 37.0],
|
|
131
|
-
[datetime(2265,4,1), 4, 41.0, 43.0, 45.0, 47.0],
|
|
132
|
-
[datetime(2265,5,1), 4, 51.0, 53.0, 55.0, 57.0],
|
|
133
|
-
[datetime(2265,1,1), 2, 110.0, 115.0, 135.0, 139.0],
|
|
134
|
-
[datetime(2265,2,1), 2, 310.0, 215.0, 235.0, 239.0],
|
|
135
|
-
[datetime(2265,3,1), 2, 410.0, 315.0, 335.0, 339.0],
|
|
136
|
-
[datetime(2265,4,1), 2, 510.0, 415.0, 435.0, 439.0],
|
|
137
|
-
[datetime(2265,5,1), 2, 610.0, 515.0, 535.0, 539.0],
|
|
138
|
-
]
|
|
139
|
-
)
|
|
140
|
-
# Data of real = 2 for "WAH"
|
|
141
|
-
EXPECTED_YEAR_2265_WA_HISTORY_DF = pd.DataFrame(
|
|
142
|
-
columns = ["DATE", "REAL", "WA"],
|
|
143
|
-
data = [
|
|
144
|
-
[datetime(2265,1,1), 2, 115.0],
|
|
145
|
-
[datetime(2265,2,1), 2, 215.0],
|
|
146
|
-
[datetime(2265,3,1), 2, 315.0],
|
|
147
|
-
[datetime(2265,4,1), 2, 415.0],
|
|
148
|
-
[datetime(2265,5,1), 2, 515.0],
|
|
149
|
-
]
|
|
150
|
-
)
|
|
151
|
-
# Data of real = 2 for "WBH" and "WAH"
|
|
152
|
-
EXPECTED_YEAR_2265_WB_WA_HISTORY_DF = pd.DataFrame(
|
|
153
|
-
columns = ["DATE", "REAL", "WB", "WA"],
|
|
154
|
-
data = [
|
|
155
|
-
[datetime(2265,1,1), 2, 139.0, 115.0],
|
|
156
|
-
[datetime(2265,2,1), 2, 239.0, 215.0],
|
|
157
|
-
[datetime(2265,3,1), 2, 339.0, 315.0],
|
|
158
|
-
[datetime(2265,4,1), 2, 439.0, 415.0],
|
|
159
|
-
[datetime(2265,5,1), 2, 539.0, 515.0],
|
|
160
|
-
]
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
# fmt: on
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
# *******************************************************************
|
|
167
|
-
#####################################################################
|
|
168
|
-
#
|
|
169
|
-
# UNIT TESTS
|
|
170
|
-
#
|
|
171
|
-
#####################################################################
|
|
172
|
-
# *******************************************************************
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
TEST_CASES = [
|
|
176
|
-
pytest.param(
|
|
177
|
-
EnsembleSummaryProviderMock(INPUT_DF),
|
|
178
|
-
EXPECTED_WA_HISTORY_DF,
|
|
179
|
-
EXPECTED_WB_WA_HISTORY_DF,
|
|
180
|
-
),
|
|
181
|
-
pytest.param(
|
|
182
|
-
EnsembleSummaryProviderMock(INPUT_YEAR_2265_DF),
|
|
183
|
-
EXPECTED_YEAR_2265_WA_HISTORY_DF,
|
|
184
|
-
EXPECTED_YEAR_2265_WB_WA_HISTORY_DF,
|
|
185
|
-
),
|
|
186
|
-
]
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
@pytest.mark.parametrize(
|
|
190
|
-
"provider, expected_wa_history_df, expected_wb_wa_history_df", TEST_CASES
|
|
191
|
-
)
|
|
192
|
-
def test_create_history_vectors_df(
|
|
193
|
-
provider: pd.DataFrame,
|
|
194
|
-
expected_wa_history_df: pd.DataFrame,
|
|
195
|
-
expected_wb_wa_history_df: pd.DataFrame,
|
|
196
|
-
) -> None:
|
|
197
|
-
create_wa_history_df = create_history_vectors_df(provider, ["WA"], None)
|
|
198
|
-
create_wb_wa_history_df = create_history_vectors_df(provider, ["WB", "WA"], None)
|
|
199
|
-
|
|
200
|
-
assert_frame_equal(create_wa_history_df, expected_wa_history_df)
|
|
201
|
-
assert_frame_equal(create_wb_wa_history_df, expected_wb_wa_history_df)
|
tests/unit_tests/plugin_tests/test_simulation_time_series/test_utils/test_trace_line_shape.py
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
from webviz_subsurface._providers import VectorMetadata
|
|
2
|
-
|
|
3
|
-
# pylint: disable=line-too-long
|
|
4
|
-
from webviz_subsurface.plugins._simulation_time_series._views._subplot_view._utils.trace_line_shape import (
|
|
5
|
-
get_simulation_line_shape,
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def test_get_simulation_line_shape() -> None:
|
|
10
|
-
total_vector_metadata = VectorMetadata(
|
|
11
|
-
unit="M3",
|
|
12
|
-
is_total=True,
|
|
13
|
-
is_rate=False,
|
|
14
|
-
is_historical=False,
|
|
15
|
-
keyword="Test",
|
|
16
|
-
wgname=None,
|
|
17
|
-
get_num=None,
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
rate_vector_metadata = VectorMetadata(
|
|
21
|
-
unit="M3/Day",
|
|
22
|
-
is_total=False,
|
|
23
|
-
is_rate=True,
|
|
24
|
-
is_historical=False,
|
|
25
|
-
keyword="Test rate",
|
|
26
|
-
wgname=None,
|
|
27
|
-
get_num=None,
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
fallthrough_vector_metadata = VectorMetadata(
|
|
31
|
-
unit="M3/M3",
|
|
32
|
-
is_total=False,
|
|
33
|
-
is_rate=False,
|
|
34
|
-
is_historical=False,
|
|
35
|
-
keyword="Test fallthrough",
|
|
36
|
-
wgname=None,
|
|
37
|
-
get_num=None,
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
assert get_simulation_line_shape("Fallback", "PER_INTVL_vector", None) == "hv"
|
|
41
|
-
assert get_simulation_line_shape("Fallback", "PER_DAY_vector", None) == "hv"
|
|
42
|
-
assert get_simulation_line_shape("Fallback", "test_vector", None) == "Fallback"
|
|
43
|
-
assert (
|
|
44
|
-
get_simulation_line_shape("Fallback", "test_vector", total_vector_metadata)
|
|
45
|
-
== "linear"
|
|
46
|
-
)
|
|
47
|
-
assert (
|
|
48
|
-
get_simulation_line_shape("Fallback", "test_vector", rate_vector_metadata)
|
|
49
|
-
== "vh"
|
|
50
|
-
)
|
|
51
|
-
assert (
|
|
52
|
-
get_simulation_line_shape(
|
|
53
|
-
"Fallback", "test_vector", fallthrough_vector_metadata
|
|
54
|
-
)
|
|
55
|
-
== "Fallback"
|
|
56
|
-
)
|