Skip to content

Commit

Permalink
raise an exception if there's no data for eval
Browse files Browse the repository at this point in the history
  • Loading branch information
thayeral committed Jan 16, 2024
1 parent f5488b7 commit 2ef3d95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -2777,6 +2777,7 @@ def evaluate_object_sizes(
x_voxel_size=.097,
y_voxel_size=.097,
z_voxel_size=.2,
use_theoretical_widefield_simulator=False,
)
w = Wavefront(np.zeros(15))

Expand Down Expand Up @@ -2865,7 +2866,7 @@ def evaluate_object_sizes(
np.save(f"{savepath}_predictions", preds)

residuals = ys - preds

sizes = [s * samplegen.x_voxel_size for s in sizes]
df = pd.DataFrame([w for w in sizes], columns=['size'])
df['prediction'] = [Wavefront(i, lam_detection=modelgen.lam_detection).peak2valley(na=na) for i in preds]
df['residuals'] = [Wavefront(i, lam_detection=modelgen.lam_detection).peak2valley(na=na) for i in residuals]
Expand Down
3 changes: 1 addition & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def multiprocess(
file=sys.stdout,
))
else:
logging.error('Jobs must be a positive integer')
return False
raise Exception(f'No data found in {jobs=}')

return np.array(results)

Expand Down

0 comments on commit 2ef3d95

Please sign in to comment.