File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change 4545def update (local = False , overwrite = True , silent = False ):
4646 """Update an existing DataLad or S3 home."""
4747 if TF_USE_DATALAD and _update_datalad ():
48- return True
49-
50- from ._s3 import update as _update_s3
48+ success = True
49+ else :
50+ from ._s3 import update as _update_s3
51+ success = _update_s3 (TF_HOME , local = local , overwrite = overwrite , silent = silent )
5152
52- return _update_s3 (TF_HOME , local = local , overwrite = overwrite , silent = silent )
53+ # update Layout only if necessary
54+ if success and TF_LAYOUT is not None :
55+ init_layout ()
56+ # ensure the api uses the updated layout
57+ import importlib
58+ from .. import api
59+ importlib .reload (api )
60+ return success
5361
5462
5563def setup_home (force = False ):
@@ -76,9 +84,12 @@ def _update_datalad():
7684
7785
7886TF_LAYOUT = None
79- try :
87+
88+
89+ def init_layout ():
8090 from .bids import Layout
8191
92+ global TF_LAYOUT
8293 TF_LAYOUT = Layout (
8394 TF_HOME ,
8495 validate = False ,
@@ -92,5 +103,9 @@ def _update_datalad():
92103 "scripts" ,
93104 ],
94105 )
106+
107+
108+ try :
109+ init_layout ()
95110except ImportError :
96111 pass
You can’t perform that action at this time.
0 commit comments