Skip to content

Commit

Permalink
add error messages for keys that are now required
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-nikiforov-umn committed Jul 30, 2024
1 parent 51f47ea commit 0397504
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docker/config/excerpts/kimobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,11 @@ def matching_models(self):
"""
Specifies what types of subjects the runner can match with, as a list of strings. Required to be present.
"""
if not self.kimspec:
return None
if not self.kimspec.get("matching-models"):
raise cf.MetadataKeyMissing(
"Required key 'matching-models' not found in "
"kimspec.edn file of {}".format(self.kim_code)
)
else:
return self.kimspec["matching-models"]

Expand Down Expand Up @@ -630,8 +633,11 @@ def run_compatibility(self):
against portable models) as opposed to Tests that are specifically
constructed to run against a particular subclass of SMs.
"""
if not self.kimspec:
return None
if not self.kimspec.get("run-compatibility"):
raise cf.MetadataKeyMissing(
"Required key 'run-compatibility' not found in "
"kimspec.edn file of {}".format(self.kim_code)
)
else:
return self.kimspec["run-compatibility"]

Expand Down

0 comments on commit 0397504

Please sign in to comment.