diff --git a/tofu/data/_class05_legacy.py b/tofu/data/_class05_legacy.py index bb66325f3..ae95f108e 100644 --- a/tofu/data/_class05_legacy.py +++ b/tofu/data/_class05_legacy.py @@ -111,6 +111,23 @@ def _check( f"Arg cryst must be a valid .npz file, loadable!\n{error}" ) raise Exception(msg) + elif isinstance(cryst, dict): + if cryst.dmat is None: + msg = ( + f"Arg cryst must have a valid dmat dict, loadable!\n{error}" + ) + raise Exception(msg) + elif cryst.dgeom is None: + msg = ( + f"Arg cryst must have a valid dgeom dict, loadable!\n{error}" + ) + raise Exception(msg) + elif cryst.dbragg is None: + msg = ( + f"Arg cryst must have a valid dbragg dict, loadable!\n{error}" + ) + raise Exception(msg) + # check class if not cryst.__class__.__name__ == 'CrystalBragg': @@ -222,4 +239,4 @@ def _extract_dmat(cryst): 'power_ratio': cryst._dbragg['rockingcurve']['value'], } - return dmat \ No newline at end of file + return dmat