Skip to content

Commit 9705b85

Browse files
committed
fix submodule path error, backport changes to 1.9
1 parent e1b0af7 commit 9705b85

File tree

9 files changed

+29
-30
lines changed

9 files changed

+29
-30
lines changed

.gitmodules

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@
5858
[submodule "xai_components/xai_vertexai"]
5959
path = xai_components/xai_vertexai
6060
url = https://github.com/XpressAI/xai-google-vertexai
61-
[submodule "xai_component/xai_tensorflow_keras"]
62-
path = xai_component/xai_tensorflow_keras
61+
[submodule "xai_components/xai_tensorflow_keras"]
62+
path = xai_components/xai_tensorflow_keras
6363
url = https://github.com/XpressAI/xai-tensorflow-keras
64-
[submodule "xai_component/xai_pytorch"]
65-
path = xai_component/xai_pytorch
64+
[submodule "xai_components/xai_pytorch"]
65+
path = xai_components/xai_pytorch
6666
url = https://github.com/XpressAI/xai-pytorch
67-
[submodule "xai_component/xai_sklearn"]
68-
path = xai_component/xai_sklearn
67+
[submodule "xai_components/xai_sklearn"]
68+
path = xai_components/xai_sklearn
6969
url = https://github.com/XpressAI/xai-sklearn
70-
[submodule "xai_component/xai_xgboost"]
71-
path = xai_component/xai_xgboost
70+
[submodule "xai_components/xai_xgboost"]
71+
path = xai_components/xai_xgboost
7272
url = https://github.com/XpressAI/xai-xgboost
73-
[submodule "xai_component/xai_spark"]
74-
path = xai_component/xai_spark
73+
[submodule "xai_components/xai_spark"]
74+
path = xai_components/xai_spark
7575
url = https://github.com/XpressAI/xai-spark

xai_components/base.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,22 @@ class BaseComponent:
6464
def __init__(self):
6565
all_ports = self.__annotations__
6666
for key, type_arg in all_ports.items():
67-
port_class = type_arg.__origin__
68-
port_type = type_arg.__args__[0]
69-
if port_class in (InArg, InCompArg, OutArg):
70-
if hasattr(port_type, 'initial_value'):
71-
port_value = port_type.initial_value()
67+
if hasattr(type_arg, '__origin__'):
68+
port_class = type_arg.__origin__
69+
port_type = type_arg.__args__[0]
70+
if port_class in (InArg, InCompArg, OutArg):
71+
if hasattr(port_type, 'initial_value'):
72+
port_value = port_type.initial_value()
73+
else:
74+
port_value = None
75+
76+
if hasattr(port_type, 'getter'):
77+
port_getter = port_type.getter
78+
else:
79+
port_getter = lambda x: x
80+
setattr(self, key, port_class(port_value, port_getter))
7281
else:
73-
port_value = None
74-
75-
if hasattr(port_type, 'getter'):
76-
port_getter = port_type.getter
77-
else:
78-
port_getter = lambda x: x
79-
setattr(self, key, port_class(port_value, port_getter))
82+
setattr(self, key, None)
8083
else:
8184
setattr(self, key, None)
8285

xai_components/xai_template/example_components.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from xai_components.base import InArg, OutArg, InCompArg, Component, BaseComponent, xai_component, dynalist, dynatuple, dynadict
1+
from xai_components.base import InArg, OutArg, InCompArg, Component, BaseComponent, xai_component, dynalist, dynatuple
22

33
from typing import Union
44
@xai_component(color="red")
@@ -138,23 +138,19 @@ def do(self, ctx) -> BaseComponent:
138138

139139
@xai_component
140140
class DynaPorts(Component):
141-
"""A component showcasing dynamic ports: `dynalist`, `dynatuple`, and `dynadict`.
141+
"""A component showcasing dynamic ports: `dynalist`, and `dynatuple`.
142142
143143
##### inPorts:
144144
- dlist: A `dynalist` port.
145145
- dtuple: A `dynatuple` port.
146-
- ddict: A `dynadict` port. Accepts only Literal Dicts.
147146
148147
"""
149148

150149
dlist: InArg[dynalist]
151150
dtuple: InArg[dynatuple]
152-
ddict: InArg[dynadict]
153151

154152
def execute(self, ctx) -> None:
155153
print("Printing dynalist value:")
156154
print(self.dlist.value)
157155
print("Printing dynatuple value:")
158-
print(self.dtuple.value)
159-
print("Printing dynadict value:")
160-
print(self.ddict.value)
156+
print(self.dtuple.value)

xircuits/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version_info = (1, 9, 3)
1+
version_info = (1, 9, 4)
22
__version__ = ".".join(map(str, version_info))

0 commit comments

Comments
 (0)