You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discussion topic / vote - derived from investigation of dials/dials#2253
We should use assert to control program flow e.g.
def datablocks_from_imagesets(imagesets):
"""Load a list of datablocks from imagesets."""
datablocks = []
if not isinstance(imagesets, list):
imagesets = [imagesets]
for imageset in imagesets:
try:
datablocks[-1].append(imageset)
except (IndexError, AssertionError):
datablocks.append(DataBlock([imageset]))
return datablocks
it is appropriate to use raising of AssertionError to indcate that we should have a new DataBlock not a continuation of an existing one. Vote 👍 if you agree or 👎 if you do not, or comment below.
The text was updated successfully, but these errors were encountered:
graeme-winter
changed the title
We should not use assert to control program flow?
We should [not] use assert to control program flow?
Oct 24, 2022
Discussion topic / vote - derived from investigation of dials/dials#2253
We should use
assert
to control program flow e.g.it is appropriate to use raising of
AssertionError
to indcate that we should have a newDataBlock
not a continuation of an existing one. Vote 👍 if you agree or 👎 if you do not, or comment below.The text was updated successfully, but these errors were encountered: