@@ -187,15 +187,15 @@ def check_fields_input_spec(self):
187
187
or "pydra.engine.specs.File" in str (fld .type )
188
188
or "pydra.engine.specs.Directory" in str (fld .type )
189
189
):
190
- self ._file_check_n_bindings (fld )
190
+ self ._file_check (fld )
191
191
192
192
for nm , required in require_to_check .items ():
193
193
required_notfound = [el for el in required if el not in names ]
194
194
if required_notfound :
195
195
raise AttributeError (f"{ nm } requires { required_notfound } " )
196
196
197
- def _file_check_n_bindings (self , field ):
198
- """for tasks without container, this is simple check if the file exists"""
197
+ def _file_check (self , field ):
198
+ """checking if the file exists"""
199
199
if isinstance (getattr (self , field .name ), list ):
200
200
# if value is a list and type is a list of Files/Directory, checking all elements
201
201
if field .type in [ty .List [File ], ty .List [Directory ]]:
@@ -682,39 +682,6 @@ class ContainerSpec(ShellSpec):
682
682
container_xargs : ty .Optional [ty .List [str ]] = attr .ib (
683
683
default = None , metadata = {"help_string" : "todo" }
684
684
)
685
- """Execution arguments to run the image."""
686
- bindings : ty .Optional [
687
- ty .List [
688
- ty .Tuple [
689
- Path , # local path
690
- Path , # container path
691
- ty .Optional [str ], # mount mode
692
- ]
693
- ]
694
- ] = attr .ib (default = None , metadata = {"help_string" : "bindings" })
695
- """Mount points to be bound into the container."""
696
-
697
- def _file_check_n_bindings (self , field ):
698
- if field .name == "image" :
699
- return
700
- file = Path (getattr (self , field .name ))
701
- if field .metadata .get ("container_path" ):
702
- # if the path is in a container the input should be treated as a str (hash as a str)
703
- # field.type = "str"
704
- # setattr(self, field.name, str(file))
705
- pass
706
- # if this is a local path, checking if the path exists
707
- elif file .exists ():
708
- if self .bindings is None :
709
- self .bindings = []
710
- self .bindings .append ((file .parent , f"/pydra_inp_{ field .name } " , "ro" ))
711
- # error should be raised only if the type is strictly File or Directory
712
- elif field .type in [File , Directory ]:
713
- raise FileNotFoundError (
714
- f"the file { file } from { field .name } input does not exist, "
715
- f"if the file comes from the container, "
716
- f"use field.metadata['container_path']=True"
717
- )
718
685
719
686
720
687
@attr .s (auto_attribs = True , kw_only = True )
0 commit comments