Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
env:
CIBW_SKIP: 'pp*'
CIBW_ARCHS: 'auto64'
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.9'
CIBW_PROJECT_REQUIRES_PYTHON: '>=3.10'
CIBW_TEST_REQUIRES: 'pytest'
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
version: ["3.9", "3.13"]
version: ["3.10", "3.13"]
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ issue has not been reported already) or submitting a pull request.

Create Developer Environment
----------------------------
This project targets Python 3.9 or later. Install an appropriate version of Python and other dependencies
This project targets Python 3.10 or later. Install an appropriate version of Python and other dependencies

Then create a fork of the python-RAT repo, and clone the fork

Expand Down
6 changes: 5 additions & 1 deletion RATapi/classlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,15 @@ def extend(self, other: Sequence[T]) -> None:
self._check_unique_name_fields(other)
self.data.extend(other)

def set_fields(self, index: int, **kwargs) -> None:
def set_fields(self, index: Union[int, slice, str, T], **kwargs) -> None:
"""Assign the values of an existing object's attributes using keyword arguments."""
self._validate_name_field(kwargs)
pydantic_object = False

# Find index if name or object is supplied
if isinstance(index, (str, self._class_handle)):
index = self.index(index)

if importlib.util.find_spec("pydantic"):
# Pydantic is installed, so set up a context manager that will
# suppress custom validation errors until all fields have been set.
Expand Down
10 changes: 4 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def build_libraries(self, libraries):
cmdclass={"build_clib": BuildClib, "build_ext": BuildExt},
libraries=[libevent],
ext_modules=ext_modules,
python_requires=">=3.9",
python_requires=">=3.10",
install_requires=[
"numpy >= 1.20",
"prettytable >= 3.9.0",
Expand All @@ -178,13 +178,11 @@ def build_libraries(self, libraries):
':python_version < "3.11"': ["StrEnum >= 0.4.15"],
"Dev": ["pytest>=7.4.0", "pytest-cov>=4.1.0", "ruff>=0.4.10"],
"Matlab_latest": ["matlabengine"],
"Matlab_2024a": ["matlabengine == 24.1.*"],
"Matlab_2025a": ["matlabengine == 25.1.*"],
"Matlab_2024b": ["matlabengine == 24.2.2"],
"Matlab_2024a": ["matlabengine == 24.1.4"],
"Matlab_2023b": ["matlabengine == 23.2.3"],
"Matlab_2023a": ["matlabengine == 9.14.3"],
"Matlab_2022b": ["matlabengine == 9.13.9"],
"Matlab_2022a": ["matlabengine == 9.12.19"],
"Matlab_2021b": ["matlabengine == 9.11.21"],
"Matlab_2021a": ["matlabengine == 9.10.3"],
},
zip_safe=False,
)
7 changes: 5 additions & 2 deletions tests/test_classlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ def test_extend_empty_classlist(extended_list: Sequence, one_name_class_list: Cl
assert isinstance(extended_list[-1], class_list._class_handle)


@pytest.mark.parametrize("index", [0, "Alice", InputAttributes(name="Alice")])
@pytest.mark.parametrize(
["new_values", "expected_classlist"],
[
Expand All @@ -739,10 +740,12 @@ def test_extend_empty_classlist(extended_list: Sequence, one_name_class_list: Cl
),
],
)
def test_set_fields(two_name_class_list: ClassList, new_values: dict[str, Any], expected_classlist: ClassList) -> None:
def test_set_fields(
two_name_class_list: ClassList, index: Union[int, str], new_values: dict[str, Any], expected_classlist: ClassList
) -> None:
"""We should be able to set field values in an element of a ClassList using keyword arguments."""
class_list = two_name_class_list
class_list.set_fields(0, **new_values)
class_list.set_fields(index, **new_values)
assert class_list == expected_classlist


Expand Down