Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
]
requires-python = ">=3.8"
dependencies = [
"pathsim>=0.8.0",
"pathsim>=0.8.2",
"matplotlib>=3.7.0",
"numpy>=1.24.0",
"plotly>=6.0",
Expand Down
27 changes: 7 additions & 20 deletions src/python/custom_pathsim_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ def create_reset_events(self) -> list[pathsim.events.ScheduleList]:
def func_act(_):
self.reset()

# can be simplified after https://github.com/milanofthe/pathsim/pull/66
event = pathsim.events.ScheduleList(times_evt=reset_times, func_act=func_act)
event.func_act = func_act
event.t_start = 0
event.t_end = None
return [event]


Expand Down Expand Up @@ -168,12 +164,7 @@ def __init__(

add1 = pathsim.blocks.Adder()
add2 = pathsim.blocks.Adder()

# can be simplified when https://github.com/milanofthe/pathsim/pull/65 is merged
interface = Interface()
interface._port_map_in = self._port_map_out
interface._port_map_out = self._port_map_in
interface.__init__() # reinitialize to rebuild registers

self.vials = [vial_1, vial_2, vial_3, vial_4]

Expand All @@ -192,24 +183,24 @@ def __init__(
interface,
]
connections = [
Connection(interface["sample_in_soluble"], col_eff1),
Connection(interface[0], col_eff1),
Connection(col_eff1[0], vial_1),
Connection(col_eff1[1], col_eff2),
Connection(col_eff2[0], vial_2),
Connection(col_eff2[1], conversion_eff),
Connection(conversion_eff[0], add1[0]),
Connection(conversion_eff[1], add2[0]),
Connection(interface["sample_in_insoluble"], add1[1]),
Connection(interface[1], add1[1]),
Connection(add1, col_eff3),
Connection(col_eff3[0], vial_3),
Connection(col_eff3[1], col_eff4),
Connection(col_eff4[0], vial_4),
Connection(col_eff4[1], add2[1]),
Connection(vial_1, interface["vial1"]),
Connection(vial_2, interface["vial2"]),
Connection(vial_3, interface["vial3"]),
Connection(vial_4, interface["vial4"]),
Connection(add2, interface["sample_out"]),
Connection(vial_1, interface[0]),
Connection(vial_2, interface[1]),
Connection(vial_3, interface[2]),
Connection(vial_4, interface[3]),
Connection(add2, interface[4]),
]
super().__init__(blocks, connections)

Expand All @@ -220,10 +211,6 @@ def reset_itg(_):
block.reset()

event = pathsim.events.ScheduleList(times_evt=reset_times, func_act=reset_itg)
# won't be needed after https://github.com/milanofthe/pathsim/pull/66
event.func_act = reset_itg
event.t_start = 0
event.t_end = None
return event

def create_reset_events(self) -> list[pathsim.events.ScheduleList]:
Expand Down
Loading