From 9781a864a2ae8412e2c6371c72e9598098a2d430 Mon Sep 17 00:00:00 2001 From: John Ingve Olsen Date: Mon, 9 Sep 2024 11:30:08 +0200 Subject: [PATCH] Upgrade Python requirements This fixes a build error in the CI caused by an incompatibility between scikit-build and setuptools versions. Formatting has changed for datamodels after this upgrade. Hence, the datamodels are update also in this commit. --- .../python-requirements/build.txt | 30 ++++--- .../python-requirements/lint.txt | 82 +++++++++++++------ .../python-requirements/setup.txt | 8 +- .../python-requirements/test.txt | 23 ++++-- modules/zivid/_suggest_settings_parameters.py | 4 - modules/zivid/camera_info.py | 8 -- modules/zivid/camera_intrinsics.py | 7 -- modules/zivid/camera_state.py | 11 --- modules/zivid/frame_info.py | 11 --- modules/zivid/network_configuration.py | 6 -- modules/zivid/settings.py | 69 ---------------- modules/zivid/settings_2d.py | 15 ---- 12 files changed, 101 insertions(+), 173 deletions(-) diff --git a/continuous-integration/python-requirements/build.txt b/continuous-integration/python-requirements/build.txt index de153847..2ea6db31 100644 --- a/continuous-integration/python-requirements/build.txt +++ b/continuous-integration/python-requirements/build.txt @@ -1,25 +1,27 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile continuous-integration/python-requirements/build.in +# pip-compile --config=pyproject.toml continuous-integration/python-requirements/build.in # -certifi==2024.6.2 +certifi==2024.8.30 # via requests charset-normalizer==3.3.2 # via requests -cmake==3.29.6 +cmake==3.30.3 # via -r continuous-integration/python-requirements/build.in colorama==0.4.6 # via conan -conan==2.4.1 +conan==2.7.0 # via -r continuous-integration/python-requirements/build.in -distro==1.8.0 +distro==1.9.0 # via scikit-build fasteners==0.19 # via conan -idna==3.7 +idna==3.8 # via requests +importlib-metadata==6.7.0 + # via cmake jinja2==3.1.4 # via conan markupsafe==2.1.5 @@ -30,7 +32,7 @@ packaging==24.0 # via # -r continuous-integration/python-requirements/build.in # scikit-build -patch-ng==1.17.4 +patch-ng==1.18.0 # via conan python-dateutil==2.9.0.post0 # via conan @@ -40,11 +42,17 @@ requests==2.31.0 # via # -r continuous-integration/python-requirements/build.in # conan -scikit-build==0.18.0 +scikit-build==0.18.1 # via -r continuous-integration/python-requirements/build.in six==1.16.0 # via python-dateutil -urllib3==1.26.19 +tomli==2.0.1 + # via scikit-build +typing-extensions==4.7.1 + # via + # importlib-metadata + # scikit-build +urllib3==1.26.20 # via # -r continuous-integration/python-requirements/build.in # conan @@ -53,6 +61,8 @@ wheel==0.42.0 # via # -r continuous-integration/python-requirements/build.in # scikit-build +zipp==3.15.0 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/continuous-integration/python-requirements/lint.txt b/continuous-integration/python-requirements/lint.txt index 69079aa4..da5e031e 100644 --- a/continuous-integration/python-requirements/lint.txt +++ b/continuous-integration/python-requirements/lint.txt @@ -1,80 +1,116 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile continuous-integration/python-requirements/lint.in +# pip-compile --config=pyproject.toml continuous-integration/python-requirements/lint.in # -astroid==3.2.2 +astroid==2.11.7 # via pylint -black==24.4.2 +black==23.3.0 # via -r continuous-integration/python-requirements/lint.in -certifi==2024.6.2 +certifi==2024.8.30 # via requests charset-normalizer==3.3.2 # via requests click==8.1.7 # via black +colorama==0.4.6 + # via + # click + # pylint + # pytest darglint==1.8.1 # via -r continuous-integration/python-requirements/lint.in -dill==0.3.8 +dill==0.3.7 # via pylint distro==1.9.0 # via scikit-build -flake8==7.1.0 +exceptiongroup==1.2.2 + # via pytest +flake8==5.0.4 # via # -r continuous-integration/python-requirements/lint.in # flake8-docstrings flake8-docstrings==1.7.0 # via -r continuous-integration/python-requirements/lint.in -idna==3.7 +idna==3.8 # via requests +importlib-metadata==4.2.0 + # via + # click + # flake8 + # pluggy + # pydocstyle + # pytest inflection==0.5.1 # via -r continuous-integration/python-requirements/lint.in iniconfig==2.0.0 # via pytest -isort==5.13.2 +isort==5.11.5 # via pylint +lazy-object-proxy==1.9.0 + # via astroid mccabe==0.7.0 # via # flake8 # pylint mypy-extensions==1.0.0 # via black -packaging==24.1 +packaging==24.0 # via # black # pytest # scikit-build -pathspec==0.12.1 +pathspec==0.11.2 # via black -platformdirs==4.2.2 +platformdirs==4.0.0 # via # black # pylint -pluggy==1.5.0 +pluggy==1.2.0 # via pytest -pycodestyle==2.12.0 +pycodestyle==2.9.1 # via flake8 pydocstyle==6.3.0 # via flake8-docstrings -pyflakes==3.2.0 +pyflakes==2.5.0 # via flake8 -pylint==3.2.4 +pylint==2.13.9 # via -r continuous-integration/python-requirements/lint.in -pytest==8.2.2 +pytest==7.4.4 # via -r continuous-integration/python-requirements/lint.in -requests==2.32.3 +requests==2.31.0 # via -r continuous-integration/python-requirements/lint.in -scikit-build==0.18.0 +scikit-build==0.18.1 # via -r continuous-integration/python-requirements/lint.in snowballstemmer==2.2.0 # via pydocstyle -tomlkit==0.12.5 - # via pylint -urllib3==2.2.2 +tomli==2.0.1 + # via + # black + # pylint + # pytest + # scikit-build +typed-ast==1.5.5 + # via + # astroid + # black +typing-extensions==4.7.1 + # via + # astroid + # black + # importlib-metadata + # platformdirs + # pylint + # scikit-build +urllib3==2.0.7 # via requests -wheel==0.43.0 +wheel==0.42.0 # via scikit-build +wrapt==1.16.0 + # via astroid +zipp==3.15.0 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/continuous-integration/python-requirements/setup.txt b/continuous-integration/python-requirements/setup.txt index bd0bc2a7..1f9127c7 100644 --- a/continuous-integration/python-requirements/setup.txt +++ b/continuous-integration/python-requirements/setup.txt @@ -1,14 +1,14 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile continuous-integration/python-requirements/setup.in +# pip-compile --config=pyproject.toml continuous-integration/python-requirements/setup.in # -certifi==2024.6.2 +certifi==2024.8.30 # via requests charset-normalizer==3.3.2 # via requests -idna==3.7 +idna==3.8 # via requests requests==2.31.0 # via -r continuous-integration/python-requirements/setup.in diff --git a/continuous-integration/python-requirements/test.txt b/continuous-integration/python-requirements/test.txt index 1c58aae2..5a166cf4 100644 --- a/continuous-integration/python-requirements/test.txt +++ b/continuous-integration/python-requirements/test.txt @@ -1,17 +1,24 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile continuous-integration/python-requirements/test.in +# pip-compile --config=pyproject.toml continuous-integration/python-requirements/test.in # -certifi==2024.6.2 +certifi==2024.8.30 # via requests charset-normalizer==3.3.2 # via requests colorama==0.4.6 # via pytest -idna==3.7 +exceptiongroup==1.2.2 + # via pytest +idna==3.8 # via requests +importlib-metadata==6.7.0 + # via + # pluggy + # pytest + # pytest-randomly iniconfig==2.0.0 # via pytest packaging==24.0 @@ -30,13 +37,19 @@ pytest==7.4.4 # pytest-timeout pytest-helpers-namespace==2021.12.29 # via -r continuous-integration/python-requirements/test.in -pytest-randomly==3.12.0 +pytest-randomly==3.12 # via -r continuous-integration/python-requirements/test.in pytest-timeout==2.3.1 # via -r continuous-integration/python-requirements/test.in requests==2.31.0 # via -r continuous-integration/python-requirements/test.in +tomli==2.0.1 + # via pytest +typing-extensions==4.7.1 + # via importlib-metadata urllib3==2.0.7 # via # -r continuous-integration/python-requirements/test.in # requests +zipp==3.15.0 + # via importlib-metadata diff --git a/modules/zivid/_suggest_settings_parameters.py b/modules/zivid/_suggest_settings_parameters.py index 9c72c93b..6b5d001c 100644 --- a/modules/zivid/_suggest_settings_parameters.py +++ b/modules/zivid/_suggest_settings_parameters.py @@ -1,14 +1,11 @@ """Auto generated, do not edit.""" - # pylint: disable=too-many-lines,protected-access,too-few-public-methods,too-many-arguments,line-too-long,missing-function-docstring,missing-class-docstring,redefined-builtin,too-many-branches,too-many-boolean-expressions import datetime import _zivid class SuggestSettingsParameters: - class AmbientLightFrequency: - hz50 = "hz50" hz60 = "hz60" none = "none" @@ -28,7 +25,6 @@ def __init__( ambient_light_frequency=_zivid.capture_assistant.SuggestSettingsParameters.AmbientLightFrequency().value, max_capture_time=_zivid.capture_assistant.SuggestSettingsParameters.MaxCaptureTime().value, ): - if isinstance( ambient_light_frequency, _zivid.capture_assistant.SuggestSettingsParameters.AmbientLightFrequency.enum, diff --git a/modules/zivid/camera_info.py b/modules/zivid/camera_info.py index a813884f..48db0f0c 100644 --- a/modules/zivid/camera_info.py +++ b/modules/zivid/camera_info.py @@ -1,19 +1,15 @@ """Auto generated, do not edit.""" - # pylint: disable=too-many-lines,protected-access,too-few-public-methods,too-many-arguments,line-too-long,missing-function-docstring,missing-class-docstring,redefined-builtin,too-many-branches,too-many-boolean-expressions import _zivid class CameraInfo: - class Revision: - def __init__( self, major=_zivid.CameraInfo.Revision.Major().value, minor=_zivid.CameraInfo.Revision.Minor().value, ): - if isinstance(major, (int,)): self._major = _zivid.CameraInfo.Revision.Major(major) else: @@ -71,12 +67,10 @@ def __str__(self): return str(_to_internal_camera_info_revision(self)) class UserData: - def __init__( self, max_size_bytes=_zivid.CameraInfo.UserData.MaxSizeBytes().value, ): - if isinstance(max_size_bytes, (int,)): self._max_size_bytes = _zivid.CameraInfo.UserData.MaxSizeBytes( max_size_bytes @@ -112,7 +106,6 @@ def __str__(self): return str(_to_internal_camera_info_user_data(self)) class Model: - zivid2PlusL110 = "zivid2PlusL110" zivid2PlusM130 = "zivid2PlusM130" zivid2PlusM60 = "zivid2PlusM60" @@ -147,7 +140,6 @@ def __init__( revision=None, user_data=None, ): - if isinstance(firmware_version, (str,)): self._firmware_version = _zivid.CameraInfo.FirmwareVersion(firmware_version) else: diff --git a/modules/zivid/camera_intrinsics.py b/modules/zivid/camera_intrinsics.py index ba4b1c16..f970bfd6 100644 --- a/modules/zivid/camera_intrinsics.py +++ b/modules/zivid/camera_intrinsics.py @@ -1,13 +1,10 @@ """Auto generated, do not edit.""" - # pylint: disable=too-many-lines,protected-access,too-few-public-methods,too-many-arguments,line-too-long,missing-function-docstring,missing-class-docstring,redefined-builtin,too-many-branches,too-many-boolean-expressions import _zivid class CameraIntrinsics: - class CameraMatrix: - def __init__( self, cx=_zivid.CameraIntrinsics.CameraMatrix.CX().value, @@ -15,7 +12,6 @@ def __init__( fx=_zivid.CameraIntrinsics.CameraMatrix.FX().value, fy=_zivid.CameraIntrinsics.CameraMatrix.FY().value, ): - if isinstance( cx, ( @@ -174,7 +170,6 @@ def __str__(self): return str(_to_internal_camera_intrinsics_camera_matrix(self)) class Distortion: - def __init__( self, k1=_zivid.CameraIntrinsics.Distortion.K1().value, @@ -183,7 +178,6 @@ def __init__( p1=_zivid.CameraIntrinsics.Distortion.P1().value, p2=_zivid.CameraIntrinsics.Distortion.P2().value, ): - if isinstance( k1, ( @@ -383,7 +377,6 @@ def __init__( camera_matrix=None, distortion=None, ): - if camera_matrix is None: camera_matrix = self.CameraMatrix() if not isinstance(camera_matrix, self.CameraMatrix): diff --git a/modules/zivid/camera_state.py b/modules/zivid/camera_state.py index b459070e..0e1116f1 100644 --- a/modules/zivid/camera_state.py +++ b/modules/zivid/camera_state.py @@ -1,20 +1,15 @@ """Auto generated, do not edit.""" - # pylint: disable=too-many-lines,protected-access,too-few-public-methods,too-many-arguments,line-too-long,missing-function-docstring,missing-class-docstring,redefined-builtin,too-many-branches,too-many-boolean-expressions import _zivid class CameraState: - class Network: - class IPV4: - def __init__( self, address=_zivid.CameraState.Network.IPV4.Address().value, ): - if isinstance(address, (str,)): self._address = _zivid.CameraState.Network.IPV4.Address(address) else: @@ -51,7 +46,6 @@ def __init__( self, ipv4=None, ): - if ipv4 is None: ipv4 = self.IPV4() if not isinstance(ipv4, self.IPV4): @@ -77,7 +71,6 @@ def __str__(self): return str(_to_internal_camera_state_network(self)) class Temperature: - def __init__( self, dmd=_zivid.CameraState.Temperature.DMD().value, @@ -86,7 +79,6 @@ def __init__( lens=_zivid.CameraState.Temperature.Lens().value, pcb=_zivid.CameraState.Temperature.PCB().value, ): - if isinstance( dmd, ( @@ -282,7 +274,6 @@ def __str__(self): return str(_to_internal_camera_state_temperature(self)) class InaccessibleReason: - ipConflictWithAnotherCamera = "ipConflictWithAnotherCamera" ipConflictWithLocalNetworkAdapter = "ipConflictWithLocalNetworkAdapter" ipInMultipleLocalSubnets = "ipInMultipleLocalSubnets" @@ -300,7 +291,6 @@ def valid_values(cls): return list(cls._valid_values.keys()) class Status: - applyingNetworkConfiguration = "applyingNetworkConfiguration" available = "available" busy = "busy" @@ -338,7 +328,6 @@ def __init__( network=None, temperature=None, ): - if isinstance(available, (bool,)): self._available = _zivid.CameraState.Available(available) else: diff --git a/modules/zivid/frame_info.py b/modules/zivid/frame_info.py index d65a10e4..fed3a82e 100644 --- a/modules/zivid/frame_info.py +++ b/modules/zivid/frame_info.py @@ -1,19 +1,15 @@ """Auto generated, do not edit.""" - # pylint: disable=too-many-lines,protected-access,too-few-public-methods,too-many-arguments,line-too-long,missing-function-docstring,missing-class-docstring,redefined-builtin,too-many-branches,too-many-boolean-expressions import datetime import _zivid class FrameInfo: - class SoftwareVersion: - def __init__( self, core=_zivid.FrameInfo.SoftwareVersion.Core().value, ): - if isinstance(core, (str,)): self._core = _zivid.FrameInfo.SoftwareVersion.Core(core) else: @@ -47,14 +43,11 @@ def __str__(self): return str(_to_internal_frame_info_software_version(self)) class SystemInfo: - class CPU: - def __init__( self, model=_zivid.FrameInfo.SystemInfo.CPU.Model().value, ): - if isinstance(model, (str,)): self._model = _zivid.FrameInfo.SystemInfo.CPU.Model(model) else: @@ -88,13 +81,11 @@ def __str__(self): return str(_to_internal_frame_info_system_info_cpu(self)) class ComputeDevice: - def __init__( self, model=_zivid.FrameInfo.SystemInfo.ComputeDevice.Model().value, vendor=_zivid.FrameInfo.SystemInfo.ComputeDevice.Vendor().value, ): - if isinstance(model, (str,)): self._model = _zivid.FrameInfo.SystemInfo.ComputeDevice.Model(model) else: @@ -161,7 +152,6 @@ def __init__( cpu=None, compute_device=None, ): - if isinstance(operating_system, (str,)): self._operating_system = _zivid.FrameInfo.SystemInfo.OperatingSystem( operating_system @@ -242,7 +232,6 @@ def __init__( software_version=None, system_info=None, ): - if isinstance(time_stamp, (datetime.datetime,)): self._time_stamp = _zivid.FrameInfo.TimeStamp(time_stamp) else: diff --git a/modules/zivid/network_configuration.py b/modules/zivid/network_configuration.py index 6ce4d609..3b0413a2 100644 --- a/modules/zivid/network_configuration.py +++ b/modules/zivid/network_configuration.py @@ -1,15 +1,11 @@ """Auto generated, do not edit.""" - # pylint: disable=too-many-lines,protected-access,too-few-public-methods,too-many-arguments,line-too-long,missing-function-docstring,missing-class-docstring,redefined-builtin,too-many-branches,too-many-boolean-expressions import _zivid class NetworkConfiguration: - class IPV4: - class Mode: - dhcp = "dhcp" manual = "manual" @@ -28,7 +24,6 @@ def __init__( mode=_zivid.NetworkConfiguration.IPV4.Mode().value, subnet_mask=_zivid.NetworkConfiguration.IPV4.SubnetMask().value, ): - if isinstance(address, (str,)): self._address = _zivid.NetworkConfiguration.IPV4.Address(address) else: @@ -132,7 +127,6 @@ def __init__( self, ipv4=None, ): - if ipv4 is None: ipv4 = self.IPV4() if not isinstance(ipv4, self.IPV4): diff --git a/modules/zivid/settings.py b/modules/zivid/settings.py index c92f4eda..c05dfd67 100644 --- a/modules/zivid/settings.py +++ b/modules/zivid/settings.py @@ -1,5 +1,4 @@ """Auto generated, do not edit.""" - # pylint: disable=too-many-lines,protected-access,too-few-public-methods,too-many-arguments,line-too-long,missing-function-docstring,missing-class-docstring,redefined-builtin,too-many-branches,too-many-boolean-expressions import datetime import collections.abc @@ -7,9 +6,7 @@ class Settings: - class Acquisition: - def __init__( self, aperture=_zivid.Settings.Acquisition.Aperture().value, @@ -17,7 +14,6 @@ def __init__( exposure_time=_zivid.Settings.Acquisition.ExposureTime().value, gain=_zivid.Settings.Acquisition.Gain().value, ): - if ( isinstance( aperture, @@ -187,12 +183,10 @@ def __str__(self): return str(_to_internal_settings_acquisition(self)) class Diagnostics: - def __init__( self, enabled=_zivid.Settings.Diagnostics.Enabled().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Diagnostics.Enabled(enabled) else: @@ -226,18 +220,14 @@ def __str__(self): return str(_to_internal_settings_diagnostics(self)) class Processing: - class Color: - class Balance: - def __init__( self, blue=_zivid.Settings.Processing.Color.Balance.Blue().value, green=_zivid.Settings.Processing.Color.Balance.Green().value, red=_zivid.Settings.Processing.Color.Balance.Red().value, ): - if ( isinstance( blue, @@ -383,9 +373,7 @@ def __str__(self): return str(_to_internal_settings_processing_color_balance(self)) class Experimental: - class Mode: - automatic = "automatic" toneMapping = "toneMapping" useFirstAcquisition = "useFirstAcquisition" @@ -404,7 +392,6 @@ def __init__( self, mode=_zivid.Settings.Processing.Color.Experimental.Mode().value, ): - if ( isinstance( mode, @@ -476,7 +463,6 @@ def __init__( balance=None, experimental=None, ): - if ( isinstance( gamma, @@ -572,18 +558,14 @@ def __str__(self): return str(_to_internal_settings_processing_color(self)) class Filters: - class Cluster: - class Removal: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Cluster.Removal.Enabled().value, max_neighbor_distance=_zivid.Settings.Processing.Filters.Cluster.Removal.MaxNeighborDistance().value, min_area=_zivid.Settings.Processing.Filters.Cluster.Removal.MinArea().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Processing.Filters.Cluster.Removal.Enabled( enabled @@ -725,7 +707,6 @@ def __init__( self, removal=None, ): - if removal is None: removal = self.Removal() if not isinstance(removal, self.Removal): @@ -755,17 +736,13 @@ def __str__(self): return str(_to_internal_settings_processing_filters_cluster(self)) class Experimental: - class ContrastDistortion: - class Correction: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Experimental.ContrastDistortion.Correction.Enabled().value, strength=_zivid.Settings.Processing.Filters.Experimental.ContrastDistortion.Correction.Strength().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Processing.Filters.Experimental.ContrastDistortion.Correction.Enabled( enabled @@ -856,13 +833,11 @@ def __str__(self): ) class Removal: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Experimental.ContrastDistortion.Removal.Enabled().value, threshold=_zivid.Settings.Processing.Filters.Experimental.ContrastDistortion.Removal.Threshold().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Processing.Filters.Experimental.ContrastDistortion.Removal.Enabled( enabled @@ -957,7 +932,6 @@ def __init__( correction=None, removal=None, ): - if correction is None: correction = self.Correction() if not isinstance(correction, self.Correction): @@ -1019,7 +993,6 @@ def __init__( self, contrast_distortion=None, ): - if contrast_distortion is None: contrast_distortion = self.ContrastDistortion() if not isinstance(contrast_distortion, self.ContrastDistortion): @@ -1053,16 +1026,13 @@ def __str__(self): ) class Hole: - class Repair: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Hole.Repair.Enabled().value, hole_size=_zivid.Settings.Processing.Filters.Hole.Repair.HoleSize().value, strictness=_zivid.Settings.Processing.Filters.Hole.Repair.Strictness().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = ( _zivid.Settings.Processing.Filters.Hole.Repair.Enabled( @@ -1191,7 +1161,6 @@ def __init__( self, repair=None, ): - if repair is None: repair = self.Repair() if not isinstance(repair, self.Repair): @@ -1221,15 +1190,12 @@ def __str__(self): return str(_to_internal_settings_processing_filters_hole(self)) class Noise: - class Removal: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Noise.Removal.Enabled().value, threshold=_zivid.Settings.Processing.Filters.Noise.Removal.Threshold().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Processing.Filters.Noise.Removal.Enabled( enabled @@ -1318,12 +1284,10 @@ def __str__(self): ) class Repair: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Noise.Repair.Enabled().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = ( _zivid.Settings.Processing.Filters.Noise.Repair.Enabled( @@ -1367,12 +1331,10 @@ def __str__(self): ) class Suppression: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Noise.Suppression.Enabled().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Processing.Filters.Noise.Suppression.Enabled( enabled @@ -1419,7 +1381,6 @@ def __init__( repair=None, suppression=None, ): - if removal is None: removal = self.Removal() if not isinstance(removal, self.Removal): @@ -1493,15 +1454,12 @@ def __str__(self): return str(_to_internal_settings_processing_filters_noise(self)) class Outlier: - class Removal: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Outlier.Removal.Enabled().value, threshold=_zivid.Settings.Processing.Filters.Outlier.Removal.Threshold().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Processing.Filters.Outlier.Removal.Enabled( enabled @@ -1595,7 +1553,6 @@ def __init__( self, removal=None, ): - if removal is None: removal = self.Removal() if not isinstance(removal, self.Removal): @@ -1625,11 +1582,8 @@ def __str__(self): return str(_to_internal_settings_processing_filters_outlier(self)) class Reflection: - class Removal: - class Mode: - global_ = "global" local = "local" @@ -1647,7 +1601,6 @@ def __init__( enabled=_zivid.Settings.Processing.Filters.Reflection.Removal.Enabled().value, mode=_zivid.Settings.Processing.Filters.Reflection.Removal.Mode().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Processing.Filters.Reflection.Removal.Enabled( enabled @@ -1750,7 +1703,6 @@ def __init__( self, removal=None, ): - if removal is None: removal = self.Removal() if not isinstance(removal, self.Removal): @@ -1782,15 +1734,12 @@ def __str__(self): ) class Smoothing: - class Gaussian: - def __init__( self, enabled=_zivid.Settings.Processing.Filters.Smoothing.Gaussian.Enabled().value, sigma=_zivid.Settings.Processing.Filters.Smoothing.Gaussian.Sigma().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.Processing.Filters.Smoothing.Gaussian.Enabled( enabled @@ -1884,7 +1833,6 @@ def __init__( self, gaussian=None, ): - if gaussian is None: gaussian = self.Gaussian() if not isinstance(gaussian, self.Gaussian): @@ -1923,7 +1871,6 @@ def __init__( reflection=None, smoothing=None, ): - if cluster is None: cluster = self.Cluster() if not isinstance(cluster, self.Cluster): @@ -2081,9 +2028,7 @@ def __str__(self): return str(_to_internal_settings_processing_filters(self)) class Resampling: - class Mode: - disabled = "disabled" downsample2x2 = "downsample2x2" downsample4x4 = "downsample4x4" @@ -2106,7 +2051,6 @@ def __init__( self, mode=_zivid.Settings.Processing.Resampling.Mode().value, ): - if ( isinstance(mode, _zivid.Settings.Processing.Resampling.Mode.enum) or mode is None @@ -2164,7 +2108,6 @@ def __init__( filters=None, resampling=None, ): - if color is None: color = self.Color() if not isinstance(color, self.Color): @@ -2228,9 +2171,7 @@ def __str__(self): return str(_to_internal_settings_processing(self)) class RegionOfInterest: - class Box: - def __init__( self, enabled=_zivid.Settings.RegionOfInterest.Box.Enabled().value, @@ -2239,7 +2180,6 @@ def __init__( point_b=_zivid.Settings.RegionOfInterest.Box.PointB().value, point_o=_zivid.Settings.RegionOfInterest.Box.PointO().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.RegionOfInterest.Box.Enabled( enabled @@ -2427,13 +2367,11 @@ def __str__(self): return str(_to_internal_settings_region_of_interest_box(self)) class Depth: - def __init__( self, enabled=_zivid.Settings.RegionOfInterest.Depth.Enabled().value, range=_zivid.Settings.RegionOfInterest.Depth.Range().value, ): - if isinstance(enabled, (bool,)) or enabled is None: self._enabled = _zivid.Settings.RegionOfInterest.Depth.Enabled( enabled @@ -2511,7 +2449,6 @@ def __init__( box=None, depth=None, ): - if box is None: box = self.Box() if not isinstance(box, self.Box): @@ -2553,9 +2490,7 @@ def __str__(self): return str(_to_internal_settings_region_of_interest(self)) class Sampling: - class Color: - disabled = "disabled" grayscale = "grayscale" rgb = "rgb" @@ -2571,7 +2506,6 @@ def valid_values(cls): return list(cls._valid_values.keys()) class Pixel: - all = "all" blueSubsample2x2 = "blueSubsample2x2" blueSubsample4x4 = "blueSubsample4x4" @@ -2595,7 +2529,6 @@ def __init__( color=_zivid.Settings.Sampling.Color().value, pixel=_zivid.Settings.Sampling.Pixel().value, ): - if isinstance(color, _zivid.Settings.Sampling.Color.enum) or color is None: self._color = _zivid.Settings.Sampling.Color(color) elif isinstance(color, str): @@ -2683,7 +2616,6 @@ def __str__(self): return str(_to_internal_settings_sampling(self)) class Engine: - omni = "omni" phase = "phase" stripe = "stripe" @@ -2707,7 +2639,6 @@ def __init__( region_of_interest=None, sampling=None, ): - if acquisitions is None: self._acquisitions = [] elif isinstance(acquisitions, (collections.abc.Iterable,)): diff --git a/modules/zivid/settings_2d.py b/modules/zivid/settings_2d.py index 5dd52605..96c5f53b 100644 --- a/modules/zivid/settings_2d.py +++ b/modules/zivid/settings_2d.py @@ -1,5 +1,4 @@ """Auto generated, do not edit.""" - # pylint: disable=too-many-lines,protected-access,too-few-public-methods,too-many-arguments,line-too-long,missing-function-docstring,missing-class-docstring,redefined-builtin,too-many-branches,too-many-boolean-expressions import datetime import collections.abc @@ -7,9 +6,7 @@ class Settings2D: - class Acquisition: - def __init__( self, aperture=_zivid.Settings2D.Acquisition.Aperture().value, @@ -17,7 +14,6 @@ def __init__( exposure_time=_zivid.Settings2D.Acquisition.ExposureTime().value, gain=_zivid.Settings2D.Acquisition.Gain().value, ): - if ( isinstance( aperture, @@ -187,18 +183,14 @@ def __str__(self): return str(_to_internal_settings2d_acquisition(self)) class Processing: - class Color: - class Balance: - def __init__( self, blue=_zivid.Settings2D.Processing.Color.Balance.Blue().value, green=_zivid.Settings2D.Processing.Color.Balance.Green().value, red=_zivid.Settings2D.Processing.Color.Balance.Red().value, ): - if ( isinstance( blue, @@ -352,7 +344,6 @@ def __init__( gamma=_zivid.Settings2D.Processing.Color.Gamma().value, balance=None, ): - if ( isinstance( gamma, @@ -427,7 +418,6 @@ def __init__( self, color=None, ): - if color is None: color = self.Color() if not isinstance(color, self.Color): @@ -453,9 +443,7 @@ def __str__(self): return str(_to_internal_settings2d_processing(self)) class Sampling: - class Color: - grayscale = "grayscale" rgb = "rgb" @@ -469,7 +457,6 @@ def valid_values(cls): return list(cls._valid_values.keys()) class Pixel: - all = "all" blueSubsample2x2 = "blueSubsample2x2" blueSubsample4x4 = "blueSubsample4x4" @@ -493,7 +480,6 @@ def __init__( color=_zivid.Settings2D.Sampling.Color().value, pixel=_zivid.Settings2D.Sampling.Pixel().value, ): - if ( isinstance(color, _zivid.Settings2D.Sampling.Color.enum) or color is None @@ -594,7 +580,6 @@ def __init__( processing=None, sampling=None, ): - if acquisitions is None: self._acquisitions = [] elif isinstance(acquisitions, (collections.abc.Iterable,)):