Skip to content

Commit

Permalink
Merge pull request #324 from sentinel-hub/develop
Browse files Browse the repository at this point in the history
Release 1.7.4
  • Loading branch information
zigaLuksic authored Jan 10, 2024
2 parents ddae975 + 8c7bba4 commit ed5978c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [Version 1.7.4] - 2024-01-10

- Parameter `raise_if_failed` renamed to `raise_on_failure` and is now enabled by default.
- Numpy version restricted in anticipation of numpy 2.0 release.


## [Version 1.7.4] - 2024-01-03

- Pipelines now have an additional parameter `raise_if_failed` to raise an error if the pipeline failed.
Expand Down
2 changes: 1 addition & 1 deletion eogrow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The main module of the eo-grow package."""

__version__ = "1.7.4"
__version__ = "1.7.5"
2 changes: 1 addition & 1 deletion eogrow/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def run(self) -> None:
pipeline_execution_name=self.current_execution_name, finished=finished, failed=failed
)

if failed and self.config.raise_if_failed:
if failed and self.config.raise_on_failure:
raise PipelineExecutionError(f"Pipeline failed some executions. Check {log_folder}.")
finally:
self.logging_manager.stop_logging(root_logger, handlers)
Expand Down
4 changes: 2 additions & 2 deletions eogrow/core/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class PipelineSchema(BaseSchema):
raise_on_temporal_mismatch: bool = Field(
False, description="Treat `TemporalDimensionWarning` as an exception during EOExecution."
)
raise_if_failed: bool = Field(
False, description="Raise an exception if `run_procedure` returns some executions in `failed`."
raise_on_failure: bool = Field(
True, description="Raise an exception if `run_procedure` returns some executions in `failed`."
)
debug: bool = Field(False, description="Run pipeline without the `ray` wrapper to enable debugging.")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies = [
"fiona",
"fs>=2.2.0",
"geopandas>=0.8.1",
"numpy",
"numpy<2",
"opencv-python-headless",
"pandas",
"pydantic>=1.8.0, <2.0",
Expand Down
4 changes: 3 additions & 1 deletion tests/core/area/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

@pytest.fixture(name="configured_requests_mock")
def request_mock_setup(requests_mock):
requests_mock.post(url="/oauth/token", real_http=True)
requests_mock.post(
url="https://services.sentinel-hub.com/auth/realms/main/protocol/openid-connect/token", real_http=True
)

batch_bounds = {
"geometry": {
Expand Down
8 changes: 4 additions & 4 deletions tests/core/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ def test_get_patch_list_filtration_error(test_subset: List[Union[int, str]], sim


@pytest.mark.parametrize("fail", [True, False])
@pytest.mark.parametrize("raise_if_failed", [True, False])
def test_pipeline_raises_on_failure(fail: bool, raise_if_failed: bool, simple_config_filename: str):
@pytest.mark.parametrize("raise_on_failure", [True, False])
def test_pipeline_raises_on_failure(fail: bool, raise_on_failure: bool, simple_config_filename: str):
config = interpret_config_from_path(simple_config_filename)
config.pop("test_param")
pipeline = FailingPipeline.from_raw_config({"fail": fail, "raise_if_failed": raise_if_failed, **config})
pipeline = FailingPipeline.from_raw_config({**config, "fail": fail, "raise_on_failure": raise_on_failure})

if fail and raise_if_failed:
if fail and raise_on_failure:
with pytest.raises(PipelineExecutionError):
pipeline.run()
else:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def test_pipeline_chain_validation(config_folder):
assert subprocess.call(f"eogrow-validate {config_folder}/chain_pipeline.json", shell=True) == 0


@pytest.mark.order(after=["test_zipmap.py::test_zipmap_pipeline"])
@pytest.mark.integration()
@pytest.mark.order(after="tests/pipelines/test_zipmap.py::test_zipmap_pipeline")
def test_pipeline_chain_execution(config_folder):
"""Tests a simple execution from command line"""
assert subprocess.call(f"eogrow {config_folder}/chain_pipeline.json", shell=True) == 0
Expand Down
3 changes: 2 additions & 1 deletion tests/test_config_files/other/simple_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"save_logs": true,
"show_logs": true,
"capture_warnings": true
}
},
"raise_on_failure": false
}

0 comments on commit ed5978c

Please sign in to comment.