Skip to content

Commit

Permalink
added logging and get methods for inputs, outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
bw2 committed Sep 1, 2024
1 parent 4574f4a commit 246df07
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion step_pipeline/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,4 @@ def delocalize_by(self):

@property
def optional(self):
return self._optional
return self._optional
6 changes: 6 additions & 0 deletions step_pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,12 @@ def outputs(self, local_path, *local_paths, output_dir=None, name=None, delocali
else:
return output_specs

def get_inputs(self):
return list(self._input_specs)

def get_outputs(self):
return list(self._output_specs)

def depends_on(self, upstream_step):
"""Marks this Step as being downstream of another Step in the pipeline, meaning that this Step can only run
after the upstream_step has completed successfully.
Expand Down
9 changes: 9 additions & 0 deletions step_pipeline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,17 @@ def _path_exists__cached(path, only_check_the_cache=False, verbose=False):
raise ValueError(f"Unexpected path type {type(path)}: {path}")

if path in PATH_EXISTS_CACHE:
if args.verbose:
if PATH_EXISTS_CACHE[path]:
print(f"Path exists (cached): {path}")
else:
print(f"Missing path (cached): {path}")

return PATH_EXISTS_CACHE[path]

elif only_check_the_cache:
if args.verbose:
print(f"Missing path (only-checked-in-cache): {path}")
# if we're only checking the cache and the path isn't in the cache, then we can return False
return False

Expand Down

0 comments on commit 246df07

Please sign in to comment.