|
15 | 15 | from goofi.data import Data, DataType
|
16 | 16 | from goofi.message import Message, MessageType
|
17 | 17 | from goofi.node_helpers import InputSlot, NodeRef, OutputSlot
|
18 |
| -from goofi.params import NodeParams |
| 18 | +from goofi.params import InvalidParamError, NodeParams |
19 | 19 |
|
20 | 20 |
|
21 | 21 | class MultiprocessingForbiddenError(Exception):
|
@@ -496,7 +496,15 @@ def create(cls, initial_params: Optional[Dict[str, Dict[str, Any]]] = None, retr
|
496 | 496 | in_slots, out_slots, params = cls._configure(cls)
|
497 | 497 | # integrate initial parameters if they are provided
|
498 | 498 | if initial_params is not None:
|
499 |
| - params.update(initial_params) |
| 499 | + try: |
| 500 | + params.update(initial_params) |
| 501 | + except InvalidParamError: |
| 502 | + print( |
| 503 | + "\n====================== ERROR ======================\n" |
| 504 | + f"Setting parameters failed for {cls.__name__}. This is likely due to updates" |
| 505 | + " in the node's code. Make sure to reconfigure the node." |
| 506 | + "\n===================================================\n" |
| 507 | + ) |
500 | 508 |
|
501 | 509 | tries = 0
|
502 | 510 | while True:
|
@@ -540,9 +548,19 @@ def create_local(cls, initial_params: Optional[Dict[str, Dict[str, Any]]] = None
|
540 | 548 | """
|
541 | 549 | # generate arguments for the node
|
542 | 550 | in_slots, out_slots, params = cls._configure(cls)
|
| 551 | + |
543 | 552 | # integrate initial parameters if they are provided
|
544 | 553 | if initial_params is not None:
|
545 |
| - params.update(initial_params) |
| 554 | + try: |
| 555 | + params.update(initial_params) |
| 556 | + except InvalidParamError: |
| 557 | + print( |
| 558 | + "\n====================== ERROR ======================\n" |
| 559 | + f"Setting parameters failed for {cls.__name__}. This is likely due to updates" |
| 560 | + " in the node's code. Make sure to reconfigure the node." |
| 561 | + "\n===================================================\n" |
| 562 | + ) |
| 563 | + |
546 | 564 | conn1, conn2 = Connection.create()
|
547 | 565 | # instantiate the node in the current process
|
548 | 566 | node = cls(conn2, in_slots, out_slots, params, NodeEnv.LOCAL)
|
|
0 commit comments