Skip to content

Commit ee67d22

Browse files
Cleanup
1 parent 7f03200 commit ee67d22

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

src/simple_process_bigraph_runtime/generation/composite_generator.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ def process_composite(model: Model, assembler: Vivarium):
2828
full, section, _, index = match_obj.groups()
2929
if section != "processDefs":
3030
raise ValueError(f"Unexpected section `{section}` for reference `{process.process_def.ref_text}` ({full})`")
31-
# create config
32-
config = {}
33-
# for param in process.config:
34-
# pass
31+
3532
# Identify ports needing to be bound
3633
process_def_actual: ProcessDef = model.processDefs[int(index)]
3734
input_bindings: dict[str, list[str]] = {elem.ref_text : [] for elem in process_def_actual.inputs}
3835
output_bindings: dict[str, list[str]] = {elem.ref_text : [] for elem in process_def_actual.outputs}
3936

37+
# create config
38+
# config = {}
39+
# for param in process_def_actual.params:
40+
# config[param.name] = param.default.val if param.default is not None else determine_builtin_default(param.type.ref_text)
41+
4042
# store validation
4143
store_ref: Reference
4244
for store_ref in process.stores:
@@ -64,7 +66,7 @@ def process_composite(model: Model, assembler: Vivarium):
6466
assembler.add_process(
6567
name=process.name,
6668
process_id=".".join(process_def_actual.python_path.path),
67-
#config={???},
69+
# config=config,
6870
inputs=input_bindings,
6971
outputs=output_bindings,
7072
)

src/simple_process_bigraph_runtime/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def execute(duration: float, pblang_path: Annotated[str, typer.Argument(help="Pa
4949
pb_composite, _0, _1 = performConversion(ast_model)
5050

5151
pb_composite.run(duration)
52+
print("Execution complete")
5253

5354
@app.command()
5455
def playground():

src/simple_process_bigraph_runtime/registry/toy_library.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ def inputs(self):
7070
}
7171

7272
def update(self, state, interval):
73+
value = str(state["result"])
7374
with open(os.path.expanduser("~/Documents/pb_output_dir/output_value.txt"), "w+") as f:
74-
f.write(str(state["result"]))
75+
f.write(value)
7576

7677
class AddComplexNumbers(Step):
7778
def inputs(self):

tests/fixtures/abc.pblang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ process_def add_nums path toy.AddFloatsRepeatedly
88
inputs left_hand_addend right_hand_addend
99
outputs result
1010

11-
process_def print_result path toy.SaveFloatToFileRepeatedly
12-
//param output_file_path: string default "~/result.txt"
11+
process_def print_result path toy.SaveFloatToFile
12+
//param output_file_path: string default "~/abc_result.txt"
1313
var result: float
1414
inputs result
1515

0 commit comments

Comments
 (0)