diff --git a/.gitignore b/.gitignore index 1f7b829d..4ced815a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ dist/** **myenv/** **venv/** openvpcal.egg-info/** -.pytest_cache/** \ No newline at end of file +.pytest_cache/** +.DS_Store diff --git a/README.md b/README.md index 3cc1a2a8..1cb64752 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,11 @@ Ensure the following dependencies are installed on your system: git git lfs - Python-64-bit=3.10.1 + Python-64-bit=3.11.6 pkg-config + autoconf + automake + autoconf-archive OpenVPCal provides a system for building the following dependencies using vcpkg, however can be picked up from your existing studio production or development environment. diff --git a/compile.py b/compile.py index 2906f47a..7f6fbeea 100644 --- a/compile.py +++ b/compile.py @@ -196,12 +196,12 @@ def check_python_is_64_bit() -> bool: def check_python_version() -> bool: - """ Checks the version of python we have installed is 3.10.1 + """ Checks the version of python we have installed is 3.11.6 - Returns: True if python is 3.10.1, False if not + Returns: True if python is 3.11.6, False if not """ - return '3.10.1' == platform.python_version() + return '3.11.6' == platform.python_version() def is_git_installed() -> bool: @@ -283,19 +283,23 @@ def run_vcpkg_install(folder_path: str) -> None: try: # Each part of the command is a separate item in the list # The "./vcpkg/vcpkg.exe" path should be adjusted to the correct path of your exe file + args = [] if platform.system() == 'Windows': script_name = "vcpkg.exe" triplet = 'x64-windows-release' elif platform.system() == 'Darwin': script_name = "vcpkg" triplet = 'x64-osx' + if platform.processor() == 'arm': + triplet = 'arm64-osx' else: script_name = "vcpkg" triplet = 'x64-linux' vcpkg = os.path.join(folder_path, script_name) + args.extend([vcpkg, 'install', 'openimageio[opencolorio,pybind11, freetype]', '--recurse', '--triplet', triplet]) subprocess.run( - [vcpkg, 'install', 'openimageio[opencolorio,pybind11, freetype]', '--recurse', '--triplet', triplet], + args, check=True) except subprocess.CalledProcessError as exception: raise RuntimeError("Vcpkg install failed:" + exception.output) @@ -386,13 +390,17 @@ def get_additional_library_paths(vcpkg_folder: str) -> List[str]: library_root = os.path.join(vcpkg_folder, "installed", "x64-windows-release", "bin") python_oiio_lib_folder = os.path.join( vcpkg_folder, "installed", "x64-windows-release", "lib", - "python3.10", "site-packages", "OpenImageIO" + "python3.11", "site-packages", "OpenImageIO" ) elif platform.system() == 'Darwin': - library_root = os.path.join(vcpkg_folder, "installed", "x64-osx", "lib") + arch = "x64-osx" + if platform.processor() == "arm": + arch = "arm64-osx" + + library_root = os.path.join(vcpkg_folder, "installed", arch, "lib") python_oiio_lib_folder = os.path.join( library_root, - "python3.10", "site-packages", "OpenImageIO" + "python3.11", "site-packages", "OpenImageIO" ) lib_files = os.listdir(library_root) for lib_file in lib_files: @@ -454,9 +462,12 @@ def osx_sign_app_and_build_dmg(app_name: str, certificate_name: str, version: st version: The version number we are releasing """ + arch = "universal" + if platform.processor() == "arm": + arch = "arm" current_script_directory = get_current_folder() app_path = os.path.join(current_script_directory, "dist/OpenVPCal.app") - dmg_path = os.path.join(current_script_directory, f"dist/OpenVPCal-{version}.dmg") + dmg_path = os.path.join(current_script_directory, f"dist/OpenVPCal-{version}-{arch}.dmg") remove_ds_store(app_path) @@ -468,6 +479,7 @@ def osx_sign_app_and_build_dmg(app_name: str, certificate_name: str, version: st # Resign The App As We Changed The pList app_path_executable = os.path.join(app_path, "Contents", "MacOS", app_name) print("Re Signing The App") + process = subprocess.Popen(["codesign", "--deep", "--force", "--sign", certificate_name, app_path_executable], stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True) print(process.stdout.read()) @@ -524,7 +536,7 @@ def check_dependencies() -> None: if not check_python_is_64_bit(): raise RuntimeError("Python must be 64 bit") if not check_python_version(): - raise RuntimeError("Python must be 3.10.1") + raise RuntimeError("Python must be 3.11.6") if not is_git_installed(): raise RuntimeError("Git must be installed") if not is_pkgconfig_installed(): diff --git a/requirements.txt b/requirements.txt index 295580d7..2d734c60 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,46 +1,70 @@ -altgraph==0.17.3 -astroid==2.15.5 -colour-checker-detection==0.1.4 -colour-science==0.4.2 -contourpy==1.0.7 -coverage==7.2.7 -cycler==0.11.0 -dill==0.3.6 -flake8==6.0.0 -fonttools==4.39.4 -imageio==2.30.0 -importlib-resources==5.12.0 -isort==5.12.0 -kiwisolver==1.4.4 +alabaster==0.7.13 +altgraph==0.17.4 +astroid==3.0.2 +Babel==2.14.0 +certifi==2023.11.17 +charset-normalizer==3.3.2 +colour-checker-detection==0.1.5 +colour-science==0.4.3 +contourpy==1.2.0 +coverage==7.3.3 +cycler==0.12.1 +dill==0.3.7 +docutils==0.20.1 +execnet==2.0.2 +flake8==6.1.0 +fonttools==4.46.0 +idna==3.6 +imageio==2.33.1 +imagesize==1.4.1 +importlib-resources==6.1.1 +iniconfig==2.0.0 +isort==5.13.2 +Jinja2==3.1.2 +kiwisolver==1.4.5 lazy-object-proxy==1.9.0 -macholib==1.16.2 -matplotlib==3.7.1 +macholib==1.16.3 +MarkupSafe==2.1.3 +matplotlib==3.8.2 mccabe==0.7.0 -numpy==1.24.3 -opencolorio==2.2.1 -packaging==23.1 -Pillow==9.5.0 -platformdirs==3.5.1 -pycodestyle==2.10.0 -pyflakes==3.0.1 -pyinstaller==5.11.0 -pyinstaller-hooks-contrib==2023.3 -pylint==2.17.4 -pyparsing==3.0.9 +numpy==1.26.2 +opencolorio==2.3.1 +opencv-python==4.8.1.78 +packaging==23.2 +Pillow==10.1.0 +platformdirs==4.1.0 +pluggy==1.3.0 +pycodestyle==2.11.1 +pyflakes==3.1.0 +Pygments==2.17.2 +pyinstaller==6.3.0 +pyinstaller-hooks-contrib==2023.10 +pylint==3.0.3 +pyparsing==3.1.1 pyqtgraph==0.13.3 -PySide6==6.5.1.1 -PySide6-Addons==6.5.1.1 -PySide6-Essentials==6.5.1.1 +PySide6==6.5.3 +PySide6-Addons==6.5.3 +PySide6-Essentials==6.5.3 +pytest==7.4.3 +pytest-xdist==3.5.0 python-dateutil==2.8.2 requests==2.31.0 -requests -scipy==1.10.1 -shiboken6==6.5.1.1 +scipy==1.11.4 +shiboken6==6.5.3 six==1.16.0 -sphinx==7.2.6 -sphinx-rtd-theme==1.3.0 +snowballstemmer==2.2.0 +Sphinx==7.2.6 +sphinx-rtd-theme==2.0.0 +sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-devhelp==1.0.5 +sphinxcontrib-htmlhelp==2.0.4 +sphinxcontrib-jquery==4.1 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.6 +sphinxcontrib-serializinghtml==1.1.9 tomli==2.0.1 -tomlkit==0.11.8 -typing_extensions==4.6.3 -wrapt==1.15.0 -zipp==3.15.0 +tomlkit==0.12.3 +typing_extensions==4.9.0 +urllib3==2.1.0 +wrapt==1.16.0 +zipp==3.17.0 diff --git a/src/open_vp_cal/__init__.py b/src/open_vp_cal/__init__.py index 46ca053d..e5eef312 100644 --- a/src/open_vp_cal/__init__.py +++ b/src/open_vp_cal/__init__.py @@ -1,7 +1,7 @@ """ Init Module defines a few module level variables """ -__version__ = "1.0.0-rc.6" +__version__ = "1.0.0-rc.7" __authors__ = [ "Adam Davis", "Adrian Pueyo", "Carol Payne", "Francesco Luigi Giardiello" ] diff --git a/src/open_vp_cal/framework/sample_patch.py b/src/open_vp_cal/framework/sample_patch.py index b2dbef7e..8179d7e0 100644 --- a/src/open_vp_cal/framework/sample_patch.py +++ b/src/open_vp_cal/framework/sample_patch.py @@ -1,7 +1,6 @@ """ Module that contains classes who are responsible for sampling and analysing the patches in the image sequence """ -import math import threading import numpy as np from colour_checker_detection.detection.segmentation import detect_colour_checkers_segmentation @@ -214,7 +213,7 @@ def _sample_patch(self) -> None: # Compute the mean for each tuple index across all tuples, if the detection fails and we get nans, then we # replace the nans with black patches as these are not used in the calibration directly averaged_tuple = np.mean(np.array(samples), axis=0) - if not math.isnan(averaged_tuple): + if not np.isnan(averaged_tuple).any(): sample_results.samples = averaged_tuple.tolist() else: list_of_zeros = [[0.0, 0.0, 0.0] for _ in range(24)] diff --git a/src/open_vp_cal/widgets/main_window.py b/src/open_vp_cal/widgets/main_window.py index 43031987..96dcc835 100644 --- a/src/open_vp_cal/widgets/main_window.py +++ b/src/open_vp_cal/widgets/main_window.py @@ -668,7 +668,7 @@ def generate_spg_patterns_for_led_walls( spg_project_settings.image_file_format = project_settings.file_format spg_project_settings.image_file_bit_depth = 10 spg_project_settings.output_folder = os.path.join( - project_settings.output_folder, + project_settings.export_folder, constants.ProjectFolders.SPG ) spg_project_settings.channel_mapping = "RGB" diff --git a/tests/test_open_vp_cal/test_settings.json b/tests/test_open_vp_cal/test_settings.json index 1cd5b329..8a431904 100644 --- a/tests/test_open_vp_cal/test_settings.json +++ b/tests/test_open_vp_cal/test_settings.json @@ -1,5 +1,5 @@ { - "openvp_cal_version": "1.0.0-rc.5", + "openvp_cal_version": "0.1.0a", "project_settings": { "file_format": "exr", "resolution_width": 3840,