Skip to content

Commit 29dbbaa

Browse files
committed
fix types and remove non-existing function
1 parent 3574fc0 commit 29dbbaa

3 files changed

Lines changed: 7 additions & 17 deletions

File tree

src/moldflow/double_array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def to_list(self) -> list[float]:
6767
vb_array = self.double_array.ToVBSArray()
6868
return list(vb_array)
6969

70-
def from_list(self, values: list[float]) -> None:
70+
def from_list(self, values: list[float]) -> int:
7171
"""
7272
Convert a list of floats to a double array.
7373
@@ -80,7 +80,7 @@ def from_list(self, values: list[float]) -> None:
8080
for value in values:
8181
check_type(value, (int, float))
8282

83-
self.double_array.FromVBSArray(list(values))
83+
return self.double_array.FromVBSArray(list(values))
8484

8585
@property
8686
def size(self) -> int:

src/moldflow/integer_array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def to_list(self) -> list[int]:
6767
vb_array = self.integer_array.ToVBSArray()
6868
return list(vb_array)
6969

70-
def from_list(self, values: list[int]) -> None:
70+
def from_list(self, values: list[int]) -> int:
7171
"""
7272
Convert a list of integers to an integer array.
7373
@@ -80,7 +80,7 @@ def from_list(self, values: list[int]) -> None:
8080
for value in values:
8181
check_type(value, int)
8282

83-
self.integer_array.FromVBSArray(list(values))
83+
return self.integer_array.FromVBSArray(list(values))
8484

8585
@property
8686
def size(self) -> int:

src/moldflow/string_array.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88

99
from .logger import process_log
10-
from .helper import check_type, _mf_array_to_list
10+
from .helper import check_type
1111
from .com_proxy import safe_com, flag_com_method
1212
from .common import LogMessage
1313

@@ -54,17 +54,7 @@ def add_string(self, value: str) -> None:
5454
check_type(value, str)
5555
self.string_array.AddString(value)
5656

57-
def to_list(self) -> list[str]:
58-
"""
59-
Convert the string array to a list of strings.
60-
61-
Returns:
62-
list[str]: The list of strings.
63-
"""
64-
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="to_list")
65-
return _mf_array_to_list(self)
66-
67-
def from_list(self, values: list[str]) -> None:
57+
def from_list(self, values: list[str]) -> int:
6858
"""
6959
Convert a list of strings to a string array.
7060
@@ -77,7 +67,7 @@ def from_list(self, values: list[str]) -> None:
7767
for value in values:
7868
check_type(value, str)
7969

80-
self.string_array.FromVBSArray(list(values))
70+
return self.string_array.FromVBSArray(list(values))
8171

8272
@property
8373
def size(self) -> int:

0 commit comments

Comments
 (0)