From ca63a7f6a97cd62b9a7edec0898caf15d0cdbb7b Mon Sep 17 00:00:00 2001 From: alexj0se Date: Fri, 22 Mar 2024 14:06:06 -0400 Subject: [PATCH 1/5] Add tests for 24a --- .github/workflows/{qualify_23b.yml => qualify_24a.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{qualify_23b.yml => qualify_24a.yml} (91%) diff --git a/.github/workflows/qualify_23b.yml b/.github/workflows/qualify_24a.yml similarity index 91% rename from .github/workflows/qualify_23b.yml rename to .github/workflows/qualify_24a.yml index daa00d8..832712b 100644 --- a/.github/workflows/qualify_23b.yml +++ b/.github/workflows/qualify_24a.yml @@ -1,15 +1,15 @@ # Run tInstall on Ubuntu against python versions 3.11, 3.10 and 3.9 -name: Test R2023b +name: Test R2024a on: push: branches: - - R2023b + - R2024a pull_request: branches: - - R2023b + - R2024a # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -34,7 +34,7 @@ jobs: - name: Set up MATLAB uses: matlab-actions/setup-matlab@v1 with: - release: R2023b + release: R2024a - uses: actions/checkout@v3 From 521d0ca01c78a981a54052fdff984e7ea27f85e3 Mon Sep 17 00:00:00 2001 From: Alex Jose <48287331+alexj0se@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:44:54 -0400 Subject: [PATCH 2/5] Use latest version of setup-matlab action (#41) --- .github/workflows/qualify_24a.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qualify_24a.yml b/.github/workflows/qualify_24a.yml index 832712b..1f4d2f1 100644 --- a/.github/workflows/qualify_24a.yml +++ b/.github/workflows/qualify_24a.yml @@ -32,7 +32,7 @@ jobs: python-version: ${{ matrix.python }} - name: Set up MATLAB - uses: matlab-actions/setup-matlab@v1 + uses: matlab-actions/setup-matlab@v2 with: release: R2024a From afb4816fe5cd62728d26d792d75afc375e3519b9 Mon Sep 17 00:00:00 2001 From: AlanF-MW <103284994+alanfmw@users.noreply.github.com> Date: Sun, 24 Mar 2024 11:29:32 -0400 Subject: [PATCH 3/5] 24.1.2 --- README.md | 6 +++--- setup.py | 4 ++-- src/matlab/engine/__init__.py | 17 +++++++++++------ src/matlab/engine/fevalfuture.py | 6 ------ src/matlab/engine/futureresult.py | 7 +------ 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index db33104..7469d49 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The MATLAB® Engine API for Python® provides a package to integrate MATLA MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.1 +$ python -m pip install matlabengine==24.1.2 ``` @@ -46,7 +46,7 @@ setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/bin/glnxa64 MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.1 +$ python -m pip install matlabengine==24.1.2 ``` ### macOS @@ -70,7 +70,7 @@ setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/bin/maci64 MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.1 +$ python -m pip install matlabengine==24.1.2 ``` --- diff --git a/setup.py b/setup.py index 1e6f24a..286746c 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ class _MatlabFinder(build_py): MATLAB_REL = 'R2024a' # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) - MATLAB_VER = '24.1.1' + MATLAB_VER = '24.1.2' # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) SUPPORTED_PYTHON_VERSIONS = set(['3.9', '3.10', '3.11']) @@ -416,7 +416,7 @@ def run(self): setup( name="matlabengine", # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) - version="24.1.1", + version="24.1.2", description='A module to call MATLAB from Python', author='MathWorks', license="LICENSE.txt, located in this repository", diff --git a/src/matlab/engine/__init__.py b/src/matlab/engine/__init__.py index c3c9710..244205e 100644 --- a/src/matlab/engine/__init__.py +++ b/src/matlab/engine/__init__.py @@ -1,4 +1,4 @@ -#Copyright 2014-2022 MathWorks, Inc. +#Copyright 2014-2023 MathWorks, Inc. """ The MATLAB Engine enables you to call any MATLAB statement either synchronously @@ -44,7 +44,10 @@ firstExceptionMessage = '' secondExceptionMessage = '' try: - pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION) + if _PYTHONVERSION != '3_9' and _PYTHONVERSION != '3_10': + pythonengine = importlib.import_module("matlabengineforpython_abi3") + else: + pythonengine = importlib.import_module("matlabengineforpython" + _PYTHONVERSION) except Exception as firstE: firstExceptionMessage = str(firstE) @@ -65,7 +68,10 @@ else: os.environ[_envs[_arch]] = _bin_dir os.add_dll_directory(_bin_dir) - pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION) + if _PYTHONVERSION != '3_9' or _PYTHONVERSION != '3_10': + pythonengine = importlib.import_module("matlabengineforpython_abi3") + else: + pythonengine = importlib.import_module("matlabengineforpython" + _PYTHONVERSION) except Exception as secondE: str1 = 'Please reinstall MATLAB Engine for Python or contact ' str2 = 'MathWorks Technical Support for assistance:\nFirst issue: {}\nSecond issue: {}'.format( @@ -106,9 +112,8 @@ def start_matlab(option="-nodesktop", **kwargs): Parameters option - MATLAB startup option. - async, background: bool - start MATLAB asynchronously or not. This parameter - is optional and false by default. "async" is a synonym for "background" - that will be removed in a future release. + background: bool - start MATLAB asynchronously or not. This parameter + is optional and false by default. Returns MatlabEngine - if aync or background is false. This object can be used to evaluate diff --git a/src/matlab/engine/fevalfuture.py b/src/matlab/engine/fevalfuture.py index ede123a..33a4501 100644 --- a/src/matlab/engine/fevalfuture.py +++ b/src/matlab/engine/fevalfuture.py @@ -19,12 +19,6 @@ import time import weakref -try: - long -except NameError: - long = int - - class FevalFuture(BaseFuture): """ A FevalFuture object is used to hold the future result of a MATLAB diff --git a/src/matlab/engine/futureresult.py b/src/matlab/engine/futureresult.py index 3bcdf9d..591d4b1 100644 --- a/src/matlab/engine/futureresult.py +++ b/src/matlab/engine/futureresult.py @@ -16,11 +16,6 @@ from matlab.engine import MatlabFuture from matlab.engine import FevalFuture -try: - long -except NameError: - long = int - class FutureResult(): """ A FutureResult object is used to hold the future result of a function call. @@ -58,7 +53,7 @@ def result(self, timeout=None): RejectedExecutionError - an error occurs if the engine is terminated. """ if timeout is not None: - if not isinstance(timeout, (int, long, float)): + if not isinstance(timeout, (int, float)): raise TypeError(pythonengine.getMessage('TimeoutMustBeNumeric', type(timeout).__name__)) if timeout < 0: From c8c1af03e4e44d9037fc06b35648928477af9368 Mon Sep 17 00:00:00 2001 From: AlanF-MW <103284994+alanfmw@users.noreply.github.com> Date: Thu, 26 Dec 2024 13:56:40 -0500 Subject: [PATCH 4/5] removed patch number from suggested commands in readme --- README.md | 6 +++--- setup.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7469d49..a547b06 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The MATLAB® Engine API for Python® provides a package to integrate MATLA MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.2 +$ python -m pip install matlabengine==24.1 ``` @@ -46,7 +46,7 @@ setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/bin/glnxa64 MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.2 +$ python -m pip install matlabengine==24.1 ``` ### macOS @@ -70,7 +70,7 @@ setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/bin/maci64 MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.2 +$ python -m pip install matlabengine==24.1 ``` --- diff --git a/setup.py b/setup.py index 286746c..7e4a0da 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ class _MatlabFinder(build_py): MATLAB_REL = 'R2024a' # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) - MATLAB_VER = '24.1.2' + MATLAB_VER = '24.1.3' # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) SUPPORTED_PYTHON_VERSIONS = set(['3.9', '3.10', '3.11']) @@ -416,7 +416,7 @@ def run(self): setup( name="matlabengine", # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) - version="24.1.2", + version="24.1.3", description='A module to call MATLAB from Python', author='MathWorks', license="LICENSE.txt, located in this repository", From e8d80df715310a3b0cf7f7dabe69625058588157 Mon Sep 17 00:00:00 2001 From: AlanF-MW <103284994+alanfmw@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:04:06 -0500 Subject: [PATCH 5/5] returned to listing three-part version number in documentation --- README.md | 6 +++--- setup.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a547b06..198cb1f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The MATLAB® Engine API for Python® provides a package to integrate MATLA MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1 +$ python -m pip install matlabengine==24.1.4 ``` @@ -46,7 +46,7 @@ setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/bin/glnxa64 MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1 +$ python -m pip install matlabengine==24.1.4 ``` ### macOS @@ -70,7 +70,7 @@ setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/bin/maci64 MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1 +$ python -m pip install matlabengine==24.1.4 ``` --- diff --git a/setup.py b/setup.py index 7e4a0da..a4df27c 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ class _MatlabFinder(build_py): MATLAB_REL = 'R2024a' # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) - MATLAB_VER = '24.1.3' + MATLAB_VER = '24.1.4' # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) SUPPORTED_PYTHON_VERSIONS = set(['3.9', '3.10', '3.11']) @@ -416,7 +416,7 @@ def run(self): setup( name="matlabengine", # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) - version="24.1.3", + version="24.1.4", description='A module to call MATLAB from Python', author='MathWorks', license="LICENSE.txt, located in this repository",