Skip to content

Commit f250151

Browse files
committed
debug
1 parent 85de325 commit f250151

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/plf/_pipeline.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Component)
1818

1919
from ._transfer_utils import TransferContext
20-
from .context import get_shared_data
20+
from .context import get_shared_data, set_shared_data
2121

2222
class CompsDict(TypedDict):
2323
"""
@@ -172,6 +172,7 @@ def reset(self):
172172
self.__db = Db(db_path=f"{self.settings['data_path']}/ppls.db")
173173

174174
def load_component(self,loc: str, args: Optional[Dict[str, Any]] = None, setup: bool = True):
175+
# if lab_role nopt exists then add the key in json file at self.settings['settings_path]
175176
if self.settings.get("lab_role") != "base":
176177
Tsx = TransferContext()
177178

src/plf/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.0.1"
1+
__version__ = "0.3.0.3"

src/plf/lab.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ def lab_setup(settings_path: Optional[str]) -> None:
158158
if settings_path and os.path.exists(settings_path):
159159
with open(settings_path, encoding="utf-8") as sp:
160160
settings = json.load(sp)
161+
162+
# Check if 'lab_role' exists in settings; add default if missing
163+
if "lab_role" not in settings:
164+
settings["lab_role"] = "base" # or some default value
165+
# Update the JSON settings file
166+
settings_path = settings.get("settings_path")
167+
if settings_path:
168+
with open(settings_path, "w") as f:
169+
json.dump(settings, f, indent=4)
161170
else:
162171
raise ValueError("Provide either settings_path or settings for lab setup")
163172

0 commit comments

Comments
 (0)