Skip to content

Commit c5af93c

Browse files
committed
Remove legacy DataCube.flatten() #155 #209 #324
1 parent 30c6a1c commit c5af93c

File tree

5 files changed

+3
-17
lines changed

5 files changed

+3
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525

2626
### Removed
2727

28-
- Remove legacy `DataCube.graph` property to prevent usage patterns that cause interoperability issues
28+
- Remove legacy `DataCube.graph` and `DataCube.flatten()` to prevent usage patterns that cause interoperability issues
2929
([#155](https://github.com/Open-EO/openeo-python-client/issues/155), [#209](https://github.com/Open-EO/openeo-python-client/issues/209), [#324](https://github.com/Open-EO/openeo-python-client/issues/324))
3030

3131
### Fixed

examples/notebooks/ProcessAsAService.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
"\n",
264264
"#for visualizing the process graph in Jupyter notebook\n",
265265
"from IPython.display import JSON\n",
266-
"JSON(ndvi.flatten())"
266+
"JSON(ndvi.flat_graph())"
267267
]
268268
},
269269
{
@@ -480,7 +480,7 @@
480480
" schema={\"type\": \"string\", \"subtype\": \"date-time\"}\n",
481481
" )\n",
482482
"\n",
483-
"graph_with_parameters = ndvi.flatten()\n",
483+
"graph_with_parameters = ndvi.flat_graph()\n",
484484
"graph_with_parameters['filtertemporal1']['arguments']['extent'][0]={'from_parameter':'date'}\n",
485485
"graph_with_parameters['filtertemporal1']['arguments']['extent'][1]={'from_parameter':'date'}\n",
486486
"\n",

openeo/internal/graph_building.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ def flat_graph(self) -> dict:
117117
"""Get the process graph in internal flat dict representation."""
118118
return GraphFlattener().flatten(node=self)
119119

120-
flatten = legacy_alias(flat_graph, name="flatten")
121-
122120
@staticmethod
123121
def to_process_graph_argument(value: Union['PGNode', str, dict]) -> dict:
124122
"""

openeo/rest/_datacube.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def flat_graph(self) -> dict:
4545
# TODO: wrap in {"process_graph":...} by default/optionally?
4646
return self._pg.flat_graph()
4747

48-
flatten = legacy_alias(flat_graph, name="flatten")
49-
5048
def to_json(self, *, indent: Union[int, None] = 2, separators: Optional[Tuple[str, str]] = None) -> str:
5149
"""
5250
Get interoperable JSON representation of the process graph.

tests/rest/datacube/test_datacube100.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,6 @@ def test_datacube_flat_graph(con100):
7474
}}
7575

7676

77-
def test_datacube_legacy_flatten(con100):
78-
s2cube = con100.load_collection("S2")
79-
with pytest.warns(DeprecationWarning, match="Call to deprecated method `flatten`, use `flat_graph` instead."):
80-
assert s2cube.flatten() == {'loadcollection1': {
81-
'process_id': 'load_collection',
82-
'arguments': {'id': 'S2', 'spatial_extent': None, 'temporal_extent': None},
83-
'result': True
84-
}}
85-
86-
8777
@pytest.mark.parametrize(["kwargs", "expected"], [
8878
({"west": 3, "south": 51, "east": 4, "north": 52}, {"west": 3, "south": 51, "east": 4, "north": 52}),
8979
(

0 commit comments

Comments
 (0)