Skip to content

Commit

Permalink
revert change
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalvin committed Jan 3, 2025
1 parent f38762a commit b880de4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions flint/imager/wsclean.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,13 @@ def _wsclean_output_callback(line: str) -> None:
if "Iteration" in line and "KJy" in line:
raise CleanDivergenceError(f"Clean divergence detected: {line}")

temp_error_lines = ("Error opening temporary data file", "Input/output error")
# The second commented out line may be related to rerunning a wsclean task with a
# existing set of temporary files in the wsclean context. Look into this.
# TODO: Look at behaviour of wsclean should it be executed in a location where tempoary
# files from a previous execution exist
# temp_error_lines = ("Error opening temporary data file", "Input/output error")

temp_error_lines = ("Error opening temporary data file",)
if any([temp_error_line in line for temp_error_line in temp_error_lines]):
logger.info(f"Detected input/output error in {line}")
from time import sleep
Expand All @@ -297,7 +303,7 @@ def _wsclean_output_callback(line: str) -> None:


# TODO: Update this function to also add int the source list
def get_wsclean_output_names(
def get_wsclean_output_names( #
prefix: str,
subbands: Optional[int] = None,
pols: Optional[Union[str, Tuple[str]]] = None,
Expand Down
5 changes: 3 additions & 2 deletions tests/test_wsclean.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,16 @@ def test_attemptrerun_wsclean_output_callback():
"Opening reordered part 0 spw 0 for /scratch3/gal16b/flint_peel/40470/SB40470.RACS_1237+00.beam4.round1.ms",
"Although Input/output is here, it is not next to error",
"Similar with temporary data file error opening error",
"Input/output error",
)
for g in good:
_wsclean_output_callback(line=g)

bad = (
"Error opening temporary data file",
"Input/output error",
# "Input/output error",
"Some other words Error opening temporary data file",
"Input/output error and more errors to be here",
# "Input/output error and more errors to be here",
)
for b in bad:
with pytest.raises(AttemptRerunException):
Expand Down

0 comments on commit b880de4

Please sign in to comment.