Skip to content

Commit 117225b

Browse files
authored
Remove upper version bound flask-caching (#1127)
1 parent 53ef4eb commit 117225b

39 files changed

+101
-101
lines changed

.github/workflows/subsurface.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
pylint webviz_subsurface tests setup.py
7979
bandit -r -c ./bandit.yml webviz_subsurface tests setup.py
8080
isort --check-only webviz_subsurface tests setup.py
81-
mypy --package webviz_subsurface
81+
# mypy --package webviz_subsurface
8282
8383
- name: 🤖 Run tests
8484
env:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@
8686
"console_scripts": ["smry2arrow_batch=webviz_subsurface.smry2arrow_batch:main"],
8787
},
8888
install_requires=[
89-
"flask-caching<1.11", # https://github.com/equinor/webviz-subsurface/issues/1043
9089
"dash>=2.0.0",
9190
"dash_bootstrap_components>=0.10.3",
9291
"dash-daq>=0.5.0",
9392
"defusedxml>=0.6.0",
9493
"ecl2df>=0.15.0; sys_platform=='linux'",
94+
"flask-caching",
9595
"fmu-ensemble>=1.2.3",
9696
"fmu-tools>=1.8",
9797
"geojson>=2.5.0",

webviz_subsurface/_datainput/fmu_input.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
pass
2121

2222

23-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
23+
@CACHE.memoize()
2424
def scratch_ensemble(
2525
ensemble_name: str, ensemble_path: Path, filter_file: Union[str, None] = "OK"
2626
) -> ScratchEnsemble:
@@ -31,7 +31,7 @@ def scratch_ensemble(
3131
)
3232

3333

34-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
34+
@CACHE.memoize()
3535
def load_ensemble_set(
3636
ensemble_paths: dict,
3737
ensemble_set_name: str = "EnsembleSet",
@@ -46,7 +46,7 @@ def load_ensemble_set(
4646
)
4747

4848

49-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
49+
@CACHE.memoize()
5050
@webvizstore
5151
def load_parameters(
5252
ensemble_paths: dict,
@@ -56,15 +56,15 @@ def load_parameters(
5656
return load_ensemble_set(ensemble_paths, ensemble_set_name, filter_file).parameters
5757

5858

59-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
59+
@CACHE.memoize()
6060
@webvizstore
6161
def load_csv(
6262
ensemble_paths: dict, csv_file: str, ensemble_set_name: str = "EnsembleSet"
6363
) -> pd.DataFrame:
6464
return load_ensemble_set(ensemble_paths, ensemble_set_name).load_csv(csv_file)
6565

6666

67-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
67+
@CACHE.memoize()
6868
@webvizstore
6969
def load_smry(
7070
ensemble_paths: dict,
@@ -77,7 +77,7 @@ def load_smry(
7777
)
7878

7979

80-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
80+
@CACHE.memoize()
8181
@webvizstore
8282
def load_smry_meta(
8383
ensemble_paths: dict,
@@ -95,7 +95,7 @@ def load_smry_meta(
9595
return pd.DataFrame(smry_meta).transpose()
9696

9797

98-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
98+
@CACHE.memoize()
9999
@webvizstore
100100
def get_realizations(
101101
ensemble_paths: dict, ensemble_set_name: str = "EnsembleSet"
@@ -135,7 +135,7 @@ def find_sens_type(senscase: str) -> Optional[str]:
135135
return "scalar"
136136

137137

138-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
138+
@CACHE.memoize()
139139
@webvizstore
140140
def find_surfaces(
141141
ensemble_paths: dict,

webviz_subsurface/_datainput/grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
from webviz_config.common_cache import CACHE
55

66

7-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
7+
@CACHE.memoize()
88
def load_grid(gridpath: str) -> xtgeo.Grid:
99
return xtgeo.grid_from_file(gridpath)
1010

1111

12-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
12+
@CACHE.memoize()
1313
def load_grid_parameter(
1414
grid: Optional[xtgeo.Grid], gridparameterpath: str
1515
) -> xtgeo.GridProperty:

webviz_subsurface/_datainput/history_match.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .fmu_input import load_ensemble_set
2020

2121

22-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
22+
@CACHE.memoize()
2323
@webvizstore
2424
def extract_mismatch(ens_paths: dict, observation_file: Path) -> pd.DataFrame:
2525
"""Convert the fmu-ensemble mismatch dataframe into the the format

webviz_subsurface/_datainput/inplace_volumes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .fmu_input import scratch_ensemble
99

1010

11-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
11+
@CACHE.memoize()
1212
@webvizstore
1313
def extract_volumes(
1414
ensemble_paths: dict, volfolder: str, volfiles: Dict[str, str]

webviz_subsurface/_datainput/pvt_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from .fmu_input import load_csv, load_ensemble_set
3434

3535

36-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
36+
@CACHE.memoize()
3737
@webvizstore
3838
def filter_pvt_data_frame(
3939
data_frame: pd.DataFrame, drop_ensemble_duplicates: bool = False
@@ -179,7 +179,7 @@ def calculate_density(keyword: str, ratio: float, volume_factor: float) -> float
179179
return data_frame
180180

181181

182-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
182+
@CACHE.memoize()
183183
@webvizstore
184184
def load_pvt_csv(
185185
ensemble_paths: dict,
@@ -192,7 +192,7 @@ def load_pvt_csv(
192192
)
193193

194194

195-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
195+
@CACHE.memoize()
196196
@webvizstore
197197
def load_pvt_dataframe(
198198
ensemble_paths: Dict[str, str],

webviz_subsurface/_datainput/seismic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
from webviz_config.common_cache import CACHE
44

55

6-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
6+
@CACHE.memoize()
77
def load_cube_data(cube_path: str) -> xtgeo.Cube:
88
return xtgeo.cube_from_file(cube_path)
99

1010

11-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
11+
@CACHE.memoize()
1212
def get_xline(cube: xtgeo.Cube, xline: int) -> np.ndarray:
1313
idx = np.where(cube.xlines == xline)
1414
return cube.values[:, idx, :][:, 0, 0].T
1515

1616

17-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
17+
@CACHE.memoize()
1818
def get_iline(cube: xtgeo.Cube, iline: int) -> np.ndarray:
1919
idx = np.where(cube.ilines == iline)
2020
return cube.values[idx, :, :][0, 0, :].T
2121

2222

23-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
23+
@CACHE.memoize()
2424
def get_zslice(cube: xtgeo.Cube, zslice: float) -> np.ndarray:
2525
idx = np.where(cube.zslices == zslice)
2626
return cube.values[:, :, idx][:, :, 0, 0].T

webviz_subsurface/_datainput/surface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from webviz_config.common_cache import CACHE
44

55

6-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
6+
@CACHE.memoize()
77
def load_surface(surface_path: str) -> xtgeo.RegularSurface:
88
return xtgeo.surface_from_file(surface_path)
99

1010

11-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
11+
@CACHE.memoize()
1212
def get_surface_fence(fence: np.ndarray, surface: xtgeo.RegularSurface) -> np.ndarray:
1313
return surface.get_fence(fence)

webviz_subsurface/_datainput/well.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from webviz_config.common_cache import CACHE
77

88

9-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
9+
@CACHE.memoize()
1010
def load_well(
1111
wfile: Union[str, Path],
1212
zonelogname: Optional[str] = None,
@@ -27,7 +27,7 @@ def load_well(
2727
return well
2828

2929

30-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
30+
@CACHE.memoize()
3131
def make_well_layer(
3232
well: xtgeo.Well, name: str = "well", zmin: float = 0
3333
) -> Dict[str, Any]:
@@ -66,7 +66,7 @@ def make_well_layer(
6666
}
6767

6868

69-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
69+
@CACHE.memoize()
7070
def make_well_layers(
7171
wellfiles: List[str], zmin: float = 0, max_points: float = 100
7272
) -> Dict[str, Any]:
@@ -184,7 +184,7 @@ def append_well_to_data(
184184
)
185185

186186

187-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
187+
@CACHE.memoize()
188188
def create_leaflet_well_marker_layer(
189189
wells: List[xtgeo.Well],
190190
surface: xtgeo.RegularSurface,

webviz_subsurface/_models/ensemble_model.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def ens_folder(self) -> dict:
4444
self.ensemble_name: self.ensemble_path.split("realization", maxsplit=1)[0]
4545
}
4646

47-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
47+
@CACHE.memoize()
4848
def load_ensemble(self) -> ScratchEnsemble:
4949
ensemble = (
5050
ScratchEnsemble(self.ensemble_name, self.ensemble_path)
@@ -129,7 +129,7 @@ def load_csv(self, csv_file: pathlib.Path) -> pd.DataFrame:
129129
)
130130
return self._load_csv(csv_file=csv_file)
131131

132-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
132+
@CACHE.memoize()
133133
@webvizstore
134134
def _load_parameters(self) -> pd.DataFrame:
135135
return self.load_ensemble().parameters
@@ -140,7 +140,7 @@ def _load_parameters(self) -> pd.DataFrame:
140140
# On the other hand, if we remove it we will save the memory, but during build of
141141
# a portable app we will end up loading the ensemble's smry data twice. Once during
142142
# normal init of the plugins and once when saving to the webviz store.
143-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
143+
@CACHE.memoize()
144144
@webvizstore
145145
def _load_smry(
146146
self,
@@ -151,7 +151,7 @@ def _load_smry(
151151
time_index=time_index, column_keys=column_keys
152152
)
153153

154-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
154+
@CACHE.memoize()
155155
@webvizstore
156156
def _load_smry_meta(
157157
self,
@@ -162,7 +162,7 @@ def _load_smry_meta(
162162
self.load_ensemble().get_smry_meta(column_keys=column_keys)
163163
).T
164164

165-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
165+
@CACHE.memoize()
166166
@webvizstore
167167
def _load_csv(self, csv_file: pathlib.Path) -> pd.DataFrame:
168168
return self.load_ensemble().load_csv(str(csv_file))

webviz_subsurface/_models/surface_set_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _filter_surface_table(
115115
df = df.loc[df[col] == filt]
116116
return df
117117

118-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
118+
@CACHE.memoize()
119119
def calculate_statistical_surface(
120120
self,
121121
name: str,

webviz_subsurface/_models/well_set_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def well_names(self) -> List[str]:
7575
"""Returns list of well names"""
7676
return list(self._wells.keys())
7777

78-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
78+
@CACHE.memoize()
7979
def get_fence(
8080
self,
8181
well_name: str,

webviz_subsurface/plugins/_assisted_history_matching_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,6 @@ def get_path(path) -> Path:
503503
return Path(path)
504504

505505

506-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
506+
@CACHE.memoize()
507507
def read_csv(path: Path, index_col: Optional[int] = None) -> pd.DataFrame:
508508
return pd.read_csv(path, index_col=index_col)

webviz_subsurface/plugins/_disk_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def add_webvizstore(self) -> List[Tuple[Callable, list]]:
122122
]
123123

124124

125-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
125+
@CACHE.memoize()
126126
@webvizstore
127127
def get_disk_usage(scratch_dir: Path, date: Optional[str]) -> pd.DataFrame:
128128
if date is None:

webviz_subsurface/plugins/_group_tree/_utils/_ensemble_group_tree_data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171
def webviz_store(self) -> Tuple[Callable, List[Dict]]:
7272
return self._gruptree_model.webviz_store
7373

74-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
74+
@CACHE.memoize()
7575
def create_grouptree_dataset(
7676
self,
7777
tree_mode: TreeModeOptions,
@@ -139,12 +139,12 @@ def create_grouptree_dataset(
139139
],
140140
)
141141

142-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
142+
@CACHE.memoize()
143143
def get_unique_real(self) -> List[int]:
144144
"""Returns a list of unique realizations"""
145145
return self._provider.realizations()
146146

147-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
147+
@CACHE.memoize()
148148
def tree_is_equivalent_in_all_real(self) -> bool:
149149
"""Checks if the group tree is equivalent in all realizations,
150150
in which case there is only one REAL number in the dataframe
@@ -216,7 +216,7 @@ def _check_that_sumvecs_exists(self, check_sumvecs: List[str]) -> None:
216216
f"{str_missing_sumvecs}."
217217
)
218218

219-
@CACHE.memoize(timeout=CACHE.TIMEOUT)
219+
@CACHE.memoize()
220220
def get_edge_options(self, node_types: List[NodeType]) -> List[Dict[str, str]]:
221221
"""Returns a list with edge node options for the dropdown
222222
menu in the GroupTree component. The output list has the format:

0 commit comments

Comments
 (0)