Skip to content

Commit

Permalink
switch to raise TypeError when wrong type of data is handed to QpHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed Oct 24, 2023
1 parent c75f324 commit 3873f48
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rail/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,7 @@ def _finalize_write(cls, data, fileObj, **kwargs):
@classmethod
def _validate_data(cls, data):
if not isinstance(data, qp.Ensemble):
print(f"Expected `data` to be a `qp.Ensemble`, but {type(data)} was provided. Perhaps you meant to use `TableHandle`?")
assert isinstance(data, qp.Ensemble)
raise TypeError(f"Expected `data` to be a `qp.Ensemble`, but {type(data)} was provided. Perhaps you meant to use `TableHandle`?")


def default_model_read(modelfile):
Expand Down

0 comments on commit 3873f48

Please sign in to comment.