Skip to content

Commit

Permalink
♻️ Pass part_id through to DataPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Jul 11, 2024
1 parent 3c2220d commit 8a24441
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CPAC/pipeline/engine/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,15 @@ def __init__(
pipe_list: Optional[list] = None,
*,
data_paths: Optional[DataPaths | dict] = None,
part_id: Optional[str] = None,
pipeline_name: str = "",
wf: Optional[pe.Workflow] = None,
):
"""Initialize a ResourcePool."""
if isinstance(data_paths, dict):
data_paths = DataPaths(data_paths=data_paths)
elif not data_paths:
data_paths = DataPaths()
data_paths = DataPaths(part_id=part_id)
self.data_paths = data_paths
# pass-through for convenient access
self.creds_path = self.data_paths.creds_path
Expand Down
2 changes: 1 addition & 1 deletion CPAC/resources/tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@pytest.mark.parametrize("pipeline", ALL_PIPELINE_CONFIGS)
def test_packaged_path_exists(pipeline):
"""Check that all local templates are included in at least one resolution."""
rpool = ResourcePool(cfg=Preconfiguration(pipeline), unique_id="pytest")
rpool = ResourcePool(cfg=Preconfiguration(pipeline), part_id="pytest")
rpool.ingress_pipeconfig_paths()
for resource in rpool.rpool.values():
node = next(iter(resource.values())).get("data")[0]
Expand Down

0 comments on commit 8a24441

Please sign in to comment.