Skip to content

Commit

Permalink
use Dict
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Oct 20, 2024
1 parent 1d799b0 commit 7e99593
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hvcc/core/hv2ir/types/IR.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import BaseModel, RootModel
from typing import List, Optional, Union, Literal
from typing import Dict, List, Optional, Union, Literal


IRConnectionType = Literal["-->", "~i>", "~f>", "signal"]
Expand Down Expand Up @@ -39,7 +39,7 @@ class IRNode(BaseModel):


class HeavyIRType(RootModel):
root: dict[str, IRNode]
root: Dict[str, IRNode]


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion hvcc/core/hv2ir/types/Lang.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LangNode(BaseModel):


class HeavyLangType(RootModel):
root: dict[str, LangNode]
root: Dict[str, LangNode]


if __name__ == "__main__":
Expand Down
9 changes: 8 additions & 1 deletion hvcc/interpreters/pd2hv/PdGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ def add_parsed_connection(self, from_index: int, from_outlet: int, to_index: int
"Have all inlets and outlets been declared?",
NotificationEnum.ERROR_UNABLE_TO_CONNECT_OBJECTS)

def add_hv_arg(self, arg_index: int, name: str, value_type: str, default_value: str, required: bool) -> None:
def add_hv_arg(
self,
arg_index: int,
name: str,
value_type: str,
default_value: Optional[str],
required: bool
) -> None:
""" Add a Heavy argument to the graph. Indicies are from zero (not one, like Pd).
"""
# ensure that self.hv_args is big enough, as heavy arguments are not
Expand Down

0 comments on commit 7e99593

Please sign in to comment.