dlite icon indicating copy to clipboard operation
dlite copied to clipboard

No identification of error in datamodel

Open francescalb opened this issue 2 years ago • 1 comments

If there is an error in the datamodel, the error reported is that is cannot find it. This is very confusing, because it does acutally find it but it cannot instantiate it. There should be an error saying "Cannot find it" and one that is "Can find the uri, but cannot instantiate it" or similar.

francescalb avatar Oct 13 '22 07:10 francescalb

An example. If you do not have need for "dimensions" (all dims are 1), then it is still needed to have an empty list for "dimensions". If it is missing, the error returned is :

File "/usr/local/lib/python3.9/site-packages/dlite/dlite.py", line 1512, in get_instance raise DLiteError(f"no such instance: {id}")

The error is actually that 'dimensions" was not added in the datamodel itself.

francescalb avatar Oct 13 '22 07:10 francescalb