Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisIsKing committed Oct 2, 2024
1 parent 003972d commit cada819
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions jac/jaclang/runtimelib/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,23 @@ def update_walker(
logger.warning(f"Module {module_name} not found in loaded modules.")
return ()

def spawn_node(self, node_name: str, attributes: dict = {}, module_name: str = '__main__') -> NodeArchitype:
def spawn_node(self, node_name: str, attributes: dict = None, module_name: str = '__main__') -> NodeArchitype:
"""Spawn a node instance of the given node_name with attributes."""
node_class = self.get_architype(module_name, node_name)
if isinstance(node_class, type) and issubclass(node_class, NodeArchitype):
if attributes is None:
attributes = {}
node_instance = node_class(**attributes)
return node_instance
else:
raise ValueError(f"Node {node_name} not found.")

def spawn_walker(self, walker_name: str, attributes: dict = {}, module_name: str = '__main__') -> WalkerArchitype:
def spawn_walker(self, walker_name: str, attributes: dict = None, module_name: str = '__main__') -> WalkerArchitype:
"""Spawn a walker instance of the given walker_name."""
walker_class = self.get_architype(module_name, walker_name)
if isinstance(walker_class, type) and issubclass(walker_class, WalkerArchitype):
if attributes is None:
attributes = {}
walker_instance = walker_class(**attributes)
return walker_instance
else:
Expand Down

0 comments on commit cada819

Please sign in to comment.