From 2e68fb8779d13be340d755fe298a87f2f197ec0e Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 26 Feb 2024 11:09:13 +0100 Subject: [PATCH 01/11] flydra-analysis: release 0.7.18 --- .../analysis/flydra_analysis_generate_recalibration.py | 2 +- flydra_analysis/flydra_analysis/version.py | 2 +- flydra_analysis/pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flydra_analysis/flydra_analysis/analysis/flydra_analysis_generate_recalibration.py b/flydra_analysis/flydra_analysis/analysis/flydra_analysis_generate_recalibration.py index 224bf27e..0c43bf0f 100644 --- a/flydra_analysis/flydra_analysis/analysis/flydra_analysis_generate_recalibration.py +++ b/flydra_analysis/flydra_analysis/analysis/flydra_analysis_generate_recalibration.py @@ -469,7 +469,7 @@ def build_parser(): def main(): parser = build_parser() - (options, args) = parser.parse_args(args=[]) + (options, args) = parser.parse_args() if len(args) > 2: print( diff --git a/flydra_analysis/flydra_analysis/version.py b/flydra_analysis/flydra_analysis/version.py index 05b34f6e..68ab67e7 100644 --- a/flydra_analysis/flydra_analysis/version.py +++ b/flydra_analysis/flydra_analysis/version.py @@ -1 +1 @@ -__version__ = "0.7.17" # keep in sync with pyproject.toml +__version__ = "0.7.18" # keep in sync with pyproject.toml diff --git a/flydra_analysis/pyproject.toml b/flydra_analysis/pyproject.toml index c3f8abd9..2d7d2091 100644 --- a/flydra_analysis/pyproject.toml +++ b/flydra_analysis/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "flydra_analysis" -version = "0.7.17" # keep in sync with flydra_analysis/version.py +version = "0.7.18" # keep in sync with flydra_analysis/version.py description = "flydra analysis tools" readme = "README.md" requires-python = ">= 3.8" From a4bb3a1c06a744f9d194a626e1941d481639e512 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:10:37 +0100 Subject: [PATCH 02/11] flydra_core,flydra_analysis: require Python 3.9 Really, I just wanted to upgrade to tables 3.9.0 to fix build errors following https://github.com/PyTables/PyTables/commit/a70e36f0b0d4fb15b0b50e7ca513c4e4452767cc This seems to require Python 3.9. --- .github/workflows/test.yml | 2 +- flydra_analysis/pyproject.toml | 2 +- flydra_core/pyproject.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de138723..bc358a8b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, ubuntu-latest, macos-11, macos-latest, windows-2019, windows-latest] - python-version: [ '3.8', '3.x' ] + python-version: [ '3.9', '3.x' ] steps: - uses: actions/checkout@v3 diff --git a/flydra_analysis/pyproject.toml b/flydra_analysis/pyproject.toml index 2d7d2091..9c20456e 100644 --- a/flydra_analysis/pyproject.toml +++ b/flydra_analysis/pyproject.toml @@ -106,7 +106,7 @@ wt0803 = "flydra_analysis.a2.conditions_draw:wt0803" [build-system] # following advice in https://stackoverflow.com/a/66479252 -requires = ["setuptools >= 61", "cython >= 0.29", "numpy"] +requires = ["setuptools >= 61", "cython >= 0.29.32", "numpy"] build-backend = "setuptools.build_meta" [tool.setuptools] diff --git a/flydra_core/pyproject.toml b/flydra_core/pyproject.toml index 575404f3..6e65ac70 100644 --- a/flydra_core/pyproject.toml +++ b/flydra_core/pyproject.toml @@ -13,7 +13,7 @@ urls.homepage = "https://github.com/strawlab/flydra" dependencies = [ "numpy >= 1.19", - "tables", + "tables>=3.9.0", "cgkit1 >= 1.3.0", "pymvg >= 2.1.0", "adskalman", @@ -29,7 +29,7 @@ flydra_analysis_flip_calibration = "flydra_core.reconstruct:flip_calibration" [build-system] # following advice in https://stackoverflow.com/a/66479252 -requires = ["setuptools >= 61", "cython >= 0.29", "numpy"] +requires = ["setuptools >= 61", "cython >= 0.29.32", "numpy"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] From 36f90899e74b2f269e08182b408089fd1319d1cf Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:10:37 +0100 Subject: [PATCH 03/11] flydra_core: fixes for numpy 2 --- flydra_core/conftest.py | 8 ++++++++ flydra_core/flydra_core/reconstruct.py | 17 +++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 flydra_core/conftest.py diff --git a/flydra_core/conftest.py b/flydra_core/conftest.py new file mode 100644 index 00000000..cb094eb6 --- /dev/null +++ b/flydra_core/conftest.py @@ -0,0 +1,8 @@ +import numpy as np +import pytest + + +@pytest.fixture(scope="session", autouse=True) +def set_numpy_printoptions(): + np.set_printoptions(legacy="1.25") + diff --git a/flydra_core/flydra_core/reconstruct.py b/flydra_core/flydra_core/reconstruct.py index 19c1a362..2a1da6f2 100644 --- a/flydra_core/flydra_core/reconstruct.py +++ b/flydra_core/flydra_core/reconstruct.py @@ -921,8 +921,8 @@ def SingleCameraCalibration_from_xml(elem, helper=None): assert ET.iselement(elem) assert elem.tag == "single_camera_calibration" cam_id = elem.find("cam_id").text - pmat = numpy.array(numpy.mat(elem.find("calibration_matrix").text)) - res = numpy.array(numpy.mat(elem.find("resolution").text))[0, :] + pmat = numpy.array(np.asmatrix(elem.find("calibration_matrix").text)) + res = numpy.array(np.asmatrix(elem.find("resolution").text))[0, :] scale_elem = elem.find("scale_factor") if NO_BACKWARDS_COMPAT: assert scale_elem is None, "XML file has outdated " @@ -2102,12 +2102,13 @@ def add_element(self, parent): for cam_id in self.cam_ids: scc = self.get_SingleCameraCalibration(cam_id) scc.add_element(elem) - if 1: - me_elem = ET.SubElement(elem, "minimum_eccentricity") - me_elem.text = repr(self.minimum_eccentricity) - if self.wateri is not None: - water_elem = ET.SubElement(elem, "water") - water_elem.text = repr(self.wateri.n2) + with np.printoptions(legacy='1.25'): + if 1: + me_elem = ET.SubElement(elem, "minimum_eccentricity") + me_elem.text = repr(self.minimum_eccentricity) + if self.wateri is not None: + water_elem = ET.SubElement(elem, "water") + water_elem.text = repr(self.wateri.n2) def align_calibration(): From 27b1bb441c7de2efb8b5330b0dd3ed2af2d0728c Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:10:37 +0100 Subject: [PATCH 04/11] flydra_analysis: fix for numpy 2 --- flydra_analysis/conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 flydra_analysis/conftest.py diff --git a/flydra_analysis/conftest.py b/flydra_analysis/conftest.py new file mode 100644 index 00000000..cb094eb6 --- /dev/null +++ b/flydra_analysis/conftest.py @@ -0,0 +1,8 @@ +import numpy as np +import pytest + + +@pytest.fixture(scope="session", autouse=True) +def set_numpy_printoptions(): + np.set_printoptions(legacy="1.25") + From 7442ab6ba76c15d73deb5f9b703789f755795b75 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:10:51 +0100 Subject: [PATCH 05/11] CI: install hdf5 on mac --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc358a8b..292ed6f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,14 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install libhdf5 (macOS) + # See https://stackoverflow.com/questions/73029883 + if: runner.os == 'macOS' + run: | + brew install hdf5 + brew install c-blosc + export HDF5_DIR=/opt/homebrew/opt/hdf5 + export BLOSC_DIR=/opt/homebrew/opt/c-blosc - name: Upgrade pip run: python -m pip install --upgrade pip - name: Build and install flydra_core From 0dd9cc78752889ae7037ed2e629e8433644ecd1e Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:10:51 +0100 Subject: [PATCH 06/11] CI: set fail-fast to false --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 292ed6f4..ed172d77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,7 @@ jobs: build: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-20.04, ubuntu-latest, macos-11, macos-latest, windows-2019, windows-latest] python-version: [ '3.9', '3.x' ] @@ -44,6 +45,7 @@ jobs: test-ubuntu-system-python: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-20.04, ubuntu-latest] steps: From ab73d5656d02d74f7cfb8ef1985bd034e005b73c Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:10:51 +0100 Subject: [PATCH 07/11] CI: tables use LZO on MacOS --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed172d77..c8f2adca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,7 @@ jobs: brew install c-blosc export HDF5_DIR=/opt/homebrew/opt/hdf5 export BLOSC_DIR=/opt/homebrew/opt/c-blosc + export LZO_DIR=/opt/homebrew/opt/lzo - name: Upgrade pip run: python -m pip install --upgrade pip - name: Build and install flydra_core From 982ae6bb083006ffff76cc442b17e64fef0cd416 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:10:52 +0100 Subject: [PATCH 08/11] CI: for system python test, upgrade to Ubuntu 24 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8f2adca..0ab59386 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,7 +48,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-latest] + os: [ubuntu-24.04, ubuntu-latest] steps: - uses: actions/checkout@v3 - name: Update package index From 1cfe64e573f733b6ef444cfdf4ea121e486326d4 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:10:52 +0100 Subject: [PATCH 09/11] CI: update minimal macOS to macos-13 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ab59386..fb0f5b2a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-latest, macos-11, macos-latest, windows-2019, windows-latest] + os: [ubuntu-20.04, ubuntu-latest, macos-13, macos-latest, windows-2019, windows-latest] python-version: [ '3.9', '3.x' ] steps: From 83ed02a3673758d75a43e048a5dbb488767ce9ea Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:13:00 +0100 Subject: [PATCH 10/11] flydra_core: release 0.7.18 --- flydra_core/flydra_core/version.py | 2 +- flydra_core/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flydra_core/flydra_core/version.py b/flydra_core/flydra_core/version.py index 6a2495c9..68ab67e7 100644 --- a/flydra_core/flydra_core/version.py +++ b/flydra_core/flydra_core/version.py @@ -1 +1 @@ -__version__ = "0.7.16" # keep in sync with pyproject.toml +__version__ = "0.7.18" # keep in sync with pyproject.toml diff --git a/flydra_core/pyproject.toml b/flydra_core/pyproject.toml index 6e65ac70..5d9113d4 100644 --- a/flydra_core/pyproject.toml +++ b/flydra_core/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "flydra_core" -version = "0.7.16" # keep in sync with flydra_core/version.py +version = "0.7.18" # keep in sync with flydra_core/version.py description = "flydra mainbrain and core lib" readme = "README.md" requires-python = ">= 3.8" From 7c0367fc4565da6aa9441d84727344d8cada94c7 Mon Sep 17 00:00:00 2001 From: Andrew Straw Date: Mon, 9 Dec 2024 11:14:24 +0100 Subject: [PATCH 11/11] flydra_analysis: release 0.7.19 --- flydra_analysis/flydra_analysis/version.py | 2 +- flydra_analysis/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flydra_analysis/flydra_analysis/version.py b/flydra_analysis/flydra_analysis/version.py index 68ab67e7..c48ceb16 100644 --- a/flydra_analysis/flydra_analysis/version.py +++ b/flydra_analysis/flydra_analysis/version.py @@ -1 +1 @@ -__version__ = "0.7.18" # keep in sync with pyproject.toml +__version__ = "0.7.19" # keep in sync with pyproject.toml diff --git a/flydra_analysis/pyproject.toml b/flydra_analysis/pyproject.toml index 9c20456e..7bf84691 100644 --- a/flydra_analysis/pyproject.toml +++ b/flydra_analysis/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "flydra_analysis" -version = "0.7.18" # keep in sync with flydra_analysis/version.py +version = "0.7.19" # keep in sync with flydra_analysis/version.py description = "flydra analysis tools" readme = "README.md" requires-python = ">= 3.8"