Skip to content

Commit

Permalink
place a bunch of # TODO: remove? comments for #60
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Jul 21, 2022
1 parent ad9defc commit 0f42b42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions skymap_scanner/server/scan_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,23 @@ def diff_pixel_data(
sre_pix: np.ndarray,
ore_pix: np.ndarray,
equal_nan: bool,
do_disqualify_zero_energy_pixels: bool,
do_disqualify_zero_energy_pixels: bool, # TODO: remove?
) -> Tuple[List[float], List[bool]]:
"""Get the diff float-values and test truth-values for the 2 pixel-data.
The datapoints are compared face-to-face (zipped).
If `do_disqualify_zero_energy_pixels=True` there's an
invalid datapoint value in either array, all "require close"
datapoints are considered (vacuously) close enough.
datapoints are considered (vacuously) close enough. # TODO: remove?
"""
diff_vals = []
test_vals = []

# is one of the pixel-datapoints is "so bad" it has
# disqualified all the other "require_close" datapoints?
is_pixel_disqualified = False
if do_disqualify_zero_energy_pixels:
is_pixel_disqualified = False # TODO: remove?
if do_disqualify_zero_energy_pixels: # TODO: remove?
is_pixel_disqualified = any(
sre_pix[self.PIXEL_TYPE.names.index(f)] == 0.0
or ore_pix[self.PIXEL_TYPE.names.index(f)] == 0.0
Expand Down Expand Up @@ -163,7 +163,7 @@ def is_close(
other: "ScanResult",
equal_nan: bool = True,
dump_json_diff: Optional[Path] = None,
do_disqualify_zero_energy_pixels: bool = False,
do_disqualify_zero_energy_pixels: bool = False, # TODO: remove?
) -> bool:
"""
Checks if two results are close by requiring strict equality on pixel indices and close condition on numeric results.
Expand Down
4 changes: 2 additions & 2 deletions tests/compare_reco_pixel_pkl.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def main():
action="store_true",
help="'assert' the results",
)
parser.add_argument(
parser.add_argument( # TODO: remove?
"--disqualify-zero-energy-pixels",
default=False,
action="store_true",
Expand Down Expand Up @@ -91,7 +91,7 @@ def load_from_in_out_pkls(in_pkl_fpath: Path, out_pkl_fpath: Path) -> ScanResult
args.do_assert,
args.diff_out_dir,
logger,
args.disqualify_zero_energy_pixels,
args.disqualify_zero_energy_pixels, # TODO: remove?
)


Expand Down
8 changes: 4 additions & 4 deletions tests/compare_scan_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def main():
action="store_true",
help="'assert' the results",
)
parser.add_argument(
parser.add_argument( # TODO: remove?
"--disqualify-zero-energy-pixels",
default=False,
action="store_true",
Expand All @@ -63,7 +63,7 @@ def main():
args.do_assert,
args.diff_out_dir,
logger,
args.disqualify_zero_energy_pixels,
args.disqualify_zero_energy_pixels, # TODO: remove?
)


Expand All @@ -75,7 +75,7 @@ def compare_then_exit(
do_assert: bool,
diff_out_dir: str,
logger: logging.Logger,
do_disqualify_zero_energy_pixels: bool,
do_disqualify_zero_energy_pixels: bool, # TODO: remove?
) -> None:
"""Compare the results, dump a json diff file, and sys.exit."""
dump_json_diff = (
Expand All @@ -86,7 +86,7 @@ def compare_then_exit(
close = actual.is_close(
expected,
dump_json_diff=dump_json_diff,
do_disqualify_zero_energy_pixels=do_disqualify_zero_energy_pixels,
do_disqualify_zero_energy_pixels=do_disqualify_zero_energy_pixels, # TODO: remove?
)
equal = actual == expected

Expand Down

0 comments on commit 0f42b42

Please sign in to comment.