Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
80184f3
VectorArray Integration Tests
sankalps0549 Sep 15, 2025
f713c90
Bracket fixes
sankalps0549 Sep 15, 2025
e1e6dce
Add SPDX header
sankalps0549 Sep 16, 2025
90f479c
Removed read only tag
sankalps0549 Sep 16, 2025
2cfa0be
Merge pull request #8 from Autodesk/vector-array-tests
sankalps0549 Sep 16, 2025
018fd4e
Vector Class Integration Tests (#6)
sankalps0549 Sep 16, 2025
d3cd38c
StringArray Class Integration Tests (#11)
sankalps0549 Sep 18, 2025
2927065
IntegerArray Class Integration Tests (#10)
sankalps0549 Sep 18, 2025
2b99c66
DoubleArray Class Integration Tests (#9)
sankalps0549 Sep 18, 2025
35d2f3e
ImportOptions Class Integration Tests (#17)
sankalps0549 Sep 29, 2025
7913dbd
Merge remote-tracking branch 'origin/main' into feature/integration-t…
sankalps0549 Oct 8, 2025
26dc443
Merge remote-tracking branch 'origin/main' into feature/integration-t…
sankalps0549 Oct 30, 2025
d647279
MeshSummary Class Integration Tests (#25)
sankalps0549 Nov 3, 2025
1066876
Synergy Class Integration Tests (#30)
sankalps0549 Nov 12, 2025
a8e4336
CADManager Class Integration Tests (#31)
sankalps0549 Nov 14, 2025
64c4b10
Add Parent-Child Markers, JSON File Name Marker, and Synergy Required…
sankalps0549 Nov 17, 2025
24e8cf5
Property Class Integration Tests (#33)
sankalps0549 Nov 19, 2025
6adc307
Merge remote-tracking branch 'origin/main' into feature/integration-t…
sankalps0549 Nov 19, 2025
bb1f666
New Infrastructural changes for the Integration Tests branch (#35)
sankalps0549 Dec 2, 2025
936140a
EntList Integration Tests (#34)
sankalps0549 Dec 3, 2025
a157bf2
PredicateManager Integration Tests (#38)
sankalps0549 Dec 10, 2025
0af5842
Merge remote-tracking branch 'origin/main' into feature/integration-t…
sankalps0549 Dec 10, 2025
b4ed118
Merge remote-tracking branch 'origin/main' into feature/integration-t…
sankalps0549 Dec 11, 2025
be643bb
Removing metadata file from integration tests (#55)
sankalps0549 Dec 16, 2025
84d4eac
PropertyEditor Integration Tests (#56)
sankalps0549 Dec 17, 2025
6bca018
Merge branch 'feature/integration-tests' of https://github.com/Autode…
sankalps0549 Jan 22, 2026
6e3d2b5
Merge remote-tracking branch 'origin/main' into feature/integration-t…
sankalps0549 Jan 22, 2026
34a972d
MDLKernel test update
sankalps0549 Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,12 @@ Thumbs.db

# Internal Autodesk directories
.adsk/

# Tracking only sdy files in some integration test project folders
# Ignore everything in project_meshed_studies and project_cad_study folders except mpi and sdy files
**/project_meshed_studies/*
**/project_cad_manager_studies/*
!**/project_meshed_studies/*.mpi
!**/project_meshed_studies/*.sdy
!**/project_cad_manager_studies/*.mpi
!**/project_cad_manager_studies/*.sdy
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ repos:
exclude_types: [markdown]
exclude: \.(svg|jpe?g|png|webp|gif|bmp)$
- id: pretty-format-json
args: [--autofix]
args: [--autofix, --no-sort-keys]
exclude_types: [markdown]
exclude: \.(svg|jpe?g|png|webp|gif|bmp)$
19 changes: 19 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,22 @@ markers =
unit: Unit tests that run quickly and test small pieces of functionality
integration: Integration tests that check multiple components together
core: Core functionality tests
file_set(set_name): Mark test to run on a specific FileSet
json_file_name(file_name): Mark test to use a specific JSON file for expected data
cad_manager: Tests the CADManager class
double_array: Tests the DoubleArray class
ent_list: Tests the EntList class
import_options: Tests the ImportOptions class
integer_array: Tests the IntegerArray class
mesh_summary: Tests the MeshSummary class
predicate_manager: Tests the PredicateManager class
prop: Tests the Property class (unit tests)
property_editor: Tests the PropertyEditor class
string_array: Tests the StringArray class
synergy: Tests the Synergy class
vector_array: Tests the VectorArray class
vector: Tests the Vector class

; Property class integration tests are divided in two separate suites.
material_property: Tests the pre-existing materials for Property class
custom_property: Tests a new custom property for Property class
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pathspec==0.12.1
polib==1.2.0
pre-commit==4.2.0
pydata-sphinx-theme==0.16.1
pygetwindow==0.0.9
pylint==3.3.4
pytest==8.3.4
sphinx==8.1.3
Expand Down
14 changes: 14 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
run.py build [-P | --publish] [-i | --install]
run.py build-docs [-t <target> | --target=<target>] [-s | --skip-build] [-l | --local]
run.py format [--check]
run.py generate-expected-data [<markers>...]
run.py install [-s | --skip-build]
run.py install-package-requirements
run.py lint [-s | --skip-build]
Expand All @@ -23,6 +24,7 @@
build Build and optionally publish the moldflow-api package.
build-docs Build the documentation.
format Format all Python files in the repository using black.
generate-expected-data Generate expected data for integration tests.
install Install the moldflow-api package.
install-package-requirements Install package dependencies.
lint Lint all Python files in the repository.
Expand Down Expand Up @@ -52,6 +54,7 @@
--repo-url=<url> Custom PyPI repository URL.
--github-api-url=<url> Custom GitHub API URL.
-l, --local Build documentation locally (single version).
<markers> Markers to filter data generation by: mesh_summary, etc.
"""

import os
Expand Down Expand Up @@ -678,6 +681,13 @@ def clean_up():
os.remove(COVERAGE_XML_FILE_NAME)


def generate_expected_data(markers: list[str]):
"""Generate data for integration tests"""
logging.info('Generating data for integration tests')
generate_data_module = 'tests.api.integration_tests.data_generation.generate_data'
run_command([sys.executable, '-m', generate_data_module] + markers, ROOT_DIR)


def set_version():
"""Set current version and write version file to package directory"""

Expand Down Expand Up @@ -720,6 +730,10 @@ def main():

lint(skip_build=skip_build)

elif args.get('generate-expected-data'):
markers = args.get('<markers>') or []
generate_expected_data(markers=markers)

elif args.get('test'):
tests = args.get('<tests>') or []
marker = args.get('--marker') or args.get('-m')
Expand Down
22 changes: 11 additions & 11 deletions src/moldflow/double_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,47 +35,47 @@ def val(self, index: int) -> float:
Get the value at the specified index.

Args:
index (int): The index of the value to get.
index (int): index between 0 and double_array.size-1 (inclusive).

Returns:
float: The value at the specified index.
The value at the specified index.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="val")
check_type(index, int)
return self.double_array.Val(index)

def add_double(self, value: float) -> None:
def add_double(self, value: float | int) -> None:
"""
Add a double value to the array.
Adds a double value to the end of the array.

Args:
value (float): The value to add.
value (float | int): The value to add.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="add_double")
check_type(value, (int, float))
self.double_array.AddDouble(value)

def to_list(self) -> list[float]:
def to_list(self) -> list[float | int]:
"""
Convert the double array to a list of floats.

Returns:
list[float]: The list of floats.
The list of values.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="to_list")

vb_array = self.double_array.ToVBSArray()
return list(vb_array)

def from_list(self, values: list[float]) -> int:
def from_list(self, values: list[float | int] | tuple[float | int]) -> int:
"""
Convert a list of floats to a double array.

Args:
values (list[float]): The list of floats to convert.
values (list[float | int] | tuple[float | int]): The list of floats to convert.

Returns:
int: The number of elements added to the array.
The number of elements added.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="from_list")

Expand All @@ -91,7 +91,7 @@ def size(self) -> int:
Get the size of the array.

Returns:
int: The size of the array.
The size of the array.
"""
process_log(__name__, LogMessage.PROPERTY_GET, locals(), name="size")
return self.double_array.Size
13 changes: 0 additions & 13 deletions src/moldflow/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,19 +299,6 @@ def check_min_max(min_value: float, max_value: float):
)


def _mf_array_to_list(array_instance):
"""
Generic helper function to convert any array instance to a list.

Args:
array_instance: The array instance that has val(index) method and size property.

Returns:
list: A list containing all values from the array.
"""
return [array_instance.val(i) for i in range(array_instance.size)]


def variant_null_idispatch():
"""Return a VARIANT representing a null IDispatch pointer (VT_DISPATCH, None)."""
return VARIANT(pythoncom.VT_DISPATCH, None)
Expand Down
16 changes: 8 additions & 8 deletions src/moldflow/integer_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ def val(self, index: int) -> int:
Get the value at the specified index.

Args:
index (int): The index of the value to get.
index (int): index between 0 and integer_array.size-1 (inclusive)

Returns:
int: The value at the specified index.
The value at the specified index.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="val")
check_type(index, int)
return self.integer_array.Val(index)

def add_integer(self, value: int) -> None:
"""
Add a integer value to the array.
Adds an integer value to the end of the array.

Args:
value (int): The value to add.
Expand All @@ -60,22 +60,22 @@ def to_list(self) -> list[int]:
Convert the integer array to a list of integers.

Returns:
list[int]: The list of integers.
The list of integers.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="to_list")

vb_array = self.integer_array.ToVBSArray()
return list(vb_array)

def from_list(self, values: list[int]) -> int:
def from_list(self, values: list[int] | tuple[int, ...]) -> int:
"""
Convert a list of integers to an integer array.

Args:
values (list[int]): The list of integers to convert.
values (list[int] | tuple[int, ...]): The list of integers to convert.

Returns:
int: The number of elements added to the array.
The number of elements added.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="from_list")

Expand All @@ -91,7 +91,7 @@ def size(self) -> int:
Get the size of the array.

Returns:
int: The size of the array.
The size of the array.
"""
process_log(__name__, LogMessage.PROPERTY_GET, locals(), name="size")
return self.integer_array.Size
20 changes: 10 additions & 10 deletions src/moldflow/string_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

from .logger import process_log
from .helper import check_type, _mf_array_to_list
from .helper import check_type
from .com_proxy import safe_com, flag_com_method
from .common import LogMessage

Expand All @@ -34,18 +34,18 @@ def val(self, index: int) -> str:
Get the value at the specified index.

Args:
index (int): The index of the value to get.
index (int): index between 0 and string_array.size-1 (inclusive).

Returns:
str: The value at the specified index.
The value at the specified index.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="val")
check_type(index, int)
return self.string_array.Val(index)

def add_string(self, value: str) -> None:
"""
Add a string value to the array.
Adds a string value to the end of the array.

Args:
value (str): The value to add.
Expand All @@ -58,20 +58,20 @@ def to_list(self) -> list[str]:
"""
Convert the string array to a list of strings.
Returns:
list[str]: The list of strings.
The list of values.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="to_list")
return _mf_array_to_list(self)
return [self.val(i) for i in range(self.size)]

def from_list(self, values: list[str]) -> int:
def from_list(self, values: list[str] | tuple[str, ...]) -> int:
"""
Convert a list of strings to a string array.

Args:
values (list[str]): The list of strings to convert.
values (list[str] | tuple[str, ...]): The list of strings to convert.

Returns:
int: The number of elements added to the array.
The number of elements added.
"""
process_log(__name__, LogMessage.FUNCTION_CALL, locals(), name="from_list")
check_type(values, (list, tuple))
Expand All @@ -87,7 +87,7 @@ def size(self) -> int:
Get the size of the array.

Returns:
int: The size of the array.
The size of the array.
"""
process_log(__name__, LogMessage.PROPERTY_GET, locals(), name="size")
return self.string_array.Size
Loading