Skip to content

Commit

Permalink
rename param
Browse files Browse the repository at this point in the history
  • Loading branch information
zigaLuksic committed Oct 17, 2023
1 parent b58e047 commit a9fe747
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eolearn/core/eoexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _ProcessingData:
filter_logs_by_thread: bool
logs_filter: Filter | None
logs_handler_factory: _HandlerFactoryType
temporal_dim_warning_is_error: bool
raise_on_temporal_mismatch: bool


@dataclass(frozen=True)
Expand Down Expand Up @@ -87,7 +87,7 @@ def __init__(
filesystem: FS | None = None,
logs_filter: Filter | None = None,
logs_handler_factory: _HandlerFactoryType = FileHandler,
temporal_dimension_warning_is_error: bool = False,
raise_on_temporal_mismatch: bool = False,
):
"""
:param workflow: A prepared instance of EOWorkflow class
Expand All @@ -110,7 +110,7 @@ def __init__(
object.
The 2nd option is chosen only if `filesystem` parameter exists in the signature.
:param temporal_dimension_warning_is_error: Whether to treat `TemporalDimensionWarning` as an exception.
:param raise_on_temporal_mismatch: Whether to treat `TemporalDimensionWarning` as an exception.
"""
self.workflow = workflow
self.execution_kwargs = self._parse_and_validate_execution_kwargs(execution_kwargs)
Expand All @@ -119,7 +119,7 @@ def __init__(
self.filesystem, self.logs_folder = self._parse_logs_filesystem(filesystem, logs_folder)
self.logs_filter = logs_filter
self.logs_handler_factory = logs_handler_factory
self.temporal_dim_warning_is_error = temporal_dimension_warning_is_error
self.raise_on_temporal_mismatch = raise_on_temporal_mismatch

self.start_time: dt.datetime | None = None
self.report_folder: str | None = None
Expand Down Expand Up @@ -197,7 +197,7 @@ def run(self, workers: int | None = 1, multiprocess: bool = True, **tqdm_kwargs:
filter_logs_by_thread=filter_logs_by_thread,
logs_filter=self.logs_filter,
logs_handler_factory=self.logs_handler_factory,
temporal_dim_warning_is_error=self.temporal_dim_warning_is_error,
raise_on_temporal_mismatch=self.raise_on_temporal_mismatch,
)
for workflow_kwargs, log_path in zip(self.execution_kwargs, log_paths)
]
Expand Down Expand Up @@ -269,7 +269,7 @@ def _execute_workflow(cls, data: _ProcessingData) -> WorkflowResults:
)

with warnings.catch_warnings():
if data.temporal_dim_warning_is_error:
if data.raise_on_temporal_mismatch:
warnings.simplefilter("error", TemporalDimensionWarning)
results = data.workflow.execute(data.workflow_kwargs, raise_errors=False)

Expand Down

0 comments on commit a9fe747

Please sign in to comment.