Skip to content

Commit

Permalink
adding better descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
empEvil committed Jul 23, 2024
1 parent 0481d59 commit 8a5a6ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ceci/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ def run(self): # pragma: no cover
raise NotImplementedError("run")

def validate(self):
"""Check that the inputs actually have the data needed for execution"""
"""Check that the inputs actually have the data needed for execution,
This is called before the run method. It is an optional stage, meant
for checking that the input to the stage is actual in the form and
shape needed before an expensive run is executed."""
pass

def load_configs(self, args):
Expand Down Expand Up @@ -670,8 +673,10 @@ def execute(cls, args, comm=None):
try:
stage.validate()
except Exception as error:
print(f"Looks like there is an validation error in: {cls.name}")
print(error)
if stage.rank==0:
print(f"Looks like there is an validation error in: {cls.name}",
"the input data for this stage did not pass the checks implemented on it.")
print(error)
raise


Expand Down

0 comments on commit 8a5a6ed

Please sign in to comment.