From 09666435486fa974bd9b1af465ceba96353b15a0 Mon Sep 17 00:00:00 2001 From: paugier Date: Fri, 16 Feb 2024 00:11:12 +0100 Subject: [PATCH] Doc and tests --- .gitlab-ci.yml | 7 +- .hgignore | 3 +- AUTHORS.rst => AUTHORS.md | 1 + CHANGES.rst => CHANGES.md | 42 ++-- doc/HOWTO_build_the_doc | 33 --- doc/Makefile | 10 +- doc/authors.md | 1 + doc/authors.rst | 4 - doc/changes.md | 1 + doc/changes.rst | 4 - doc/conf.py | 73 +++---- doc/index.rst | 2 - doc/ipynb/tuto_calibration2dsimple.ipynb | 4 +- doc/ipynb/tuto_opencv_calibration.ipynb | 25 ++- doc/ipynb/tuto_stereo_reconstruction.ipynb | 4 +- noxfile.py | 2 +- pdm.lock | 217 +++++++------------- pylintrc | 2 +- pyproject.toml | 7 +- src/fluidimage/calcul/correl.py | 12 +- src/fluidimage/calibration/calib_cv.py | 7 +- src/fluidimage/calibration/test_calib_cv.py | 11 +- src/fluidimage/gui/launcher/main.py | 17 +- src/fluidimage/works/surface_tracking.py | 2 +- 24 files changed, 180 insertions(+), 311 deletions(-) rename AUTHORS.rst => AUTHORS.md (90%) rename CHANGES.rst => CHANGES.md (56%) delete mode 100644 doc/HOWTO_build_the_doc create mode 120000 doc/authors.md delete mode 100644 doc/authors.rst create mode 120000 doc/changes.md delete mode 100644 doc/changes.rst diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5e7177cd..564194f2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,12 +84,7 @@ pages: variables: FLUIDFFT_TRANSONIC_BACKEND: "python" script: - - python -m venv .venv - - . .venv/bin/activate - - pip install fluidfft --no-deps - - pdm sync -G doc -G fft -G test --no-self - - pip install . --config-settings=setup-args=-Dtransonic-backend=python --no-deps - - pdm run xvfb-run --auto-servernum sphinx-build -W -b html -d doc/_build/doctrees doc doc/_build/html + - xvfb-run --auto-servernum nox -s doc - mkdir -p public/$CI_COMMIT_REF_NAME - rsync -rvc --delete doc/_build/html/* public/$CI_COMMIT_REF_NAME/ # This directory can become too large leading to error. diff --git a/.hgignore b/.hgignore index 511066f1..42a986f1 100644 --- a/.hgignore +++ b/.hgignore @@ -63,7 +63,8 @@ doc/ipynb/*.nbconvert.ipynb doc/ipynb/**.png doc/examples/oar_launcher* doc/examples/topo.dot -*/.ipynb_checkpoints/* +**/.ipynb_checkpoints/* +doc/_jupyter_cache fluidimage/post_proc/*.h5 diff --git a/AUTHORS.rst b/AUTHORS.md similarity index 90% rename from AUTHORS.rst rename to AUTHORS.md index 47c5d13d..2b50c6b8 100644 --- a/AUTHORS.rst +++ b/AUTHORS.md @@ -1,3 +1,4 @@ +# Main contributors The main contributors are: diff --git a/CHANGES.rst b/CHANGES.md similarity index 56% rename from CHANGES.rst rename to CHANGES.md index a67c3cd6..be8b26fe 100644 --- a/CHANGES.rst +++ b/CHANGES.md @@ -1,44 +1,41 @@ +# Release notes -0.1.5_ (2023-02-15) -------------------- +See also the +[unreleased changes](https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.5...branch%2Fdefault). + +# [0.1.5] (2023-02-15) - Requires Python 3.9 - Improves legend, warnings, error log and documentation -0.1.4_ (2022-12-13) -------------------- +# [0.1.4] (2022-12-13) - Support Python 3.10 - Avoid a bug with pyfftw 0.13 -0.1.3_ (2021-09-29) -------------------- +# [0.1.3] (2021-09-29) - Many bugfixes! - Improve VectorFieldOnGrid and ArrayOfVectorFieldsOnGrid - UVmat compatibility - Fix incompatibility OpenCV and PyQt5 -0.1.2_ (2019-06-05) -------------------- +# [0.1.2] (2019-06-05) - Bugfix install Windows -0.1.1_ (2019-05-23) -------------------- +# [0.1.1] (2019-05-23) - Optical flow computation - Bugfixes + internal code improvements -0.1.0 (2018-10-03) ------------------- +# 0.1.0 (2018-10-03) - New topologies and executors with Trio! - Much better coverage & many bugfixes! - Better surface tracking -0.0.3 (2018-08-29) ------------------- +# 0.0.3 (2018-08-29) - Requirement Python >= 3.6 - Surface tracking @@ -49,22 +46,21 @@ - fluidimslideshow-pg and fluidimviewer-pg (based on PyQtgraph) - OpenCV backend for preprocessing -0.0.2 (2017-04-13) ------------------- +# 0.0.2 (2017-04-13) - Bug fixes and documentation changes. - Continuous integration (python 2.7 and 3.5) with bitbucket pipelines - (`coverage ~40% `_) + ([coverage ~40%](https://codecov.io/gh/fluiddyn/fluidimage)) - Preprocessing of images. - First simple GUI (`fluidimviewer` and `fluidimlauncher`). -0.0.1b (2016-05-31) -------------------- +# 0.0.1b (2016-05-31) - Topology and waiting queues classes to run work in parallel. - PIV work and topology (multipass, different correlation methods). -.. _0.1.3: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.3...0.1.4 -.. _0.1.3: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.2...0.1.3 -.. _0.1.2: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.1...0.1.2 -.. _0.1.1: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.0...0.1.1 +[0.1.1]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.0...0.1.1 +[0.1.2]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.1...0.1.2 +[0.1.3]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.2...0.1.3 +[0.1.4]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.3...0.1.4 +[0.1.5]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.1.4...0.1.5 \ No newline at end of file diff --git a/doc/HOWTO_build_the_doc b/doc/HOWTO_build_the_doc deleted file mode 100644 index c3c83329..00000000 --- a/doc/HOWTO_build_the_doc +++ /dev/null @@ -1,33 +0,0 @@ -Run in a terminal from this directory:: - - make - -Also useful:: - - make clean - make cleanall - -Dependencies to build the documentation: - -- sphinx -- numpydoc - -Build the doc nearly as in readthedocs with conda -------------------------------------------------- - -```bash - -export READTHEDOCS=1 -cd ~/Dev/fluidimage -conda remove --name latest --all -y -conda env create --name latest --file doc/environment.yml -conda install --yes --quiet --name latest mock pillow sphinx sphinx_rtd_theme -conda activate latest -pip install -U recommonmark readthedocs-sphinx-ext -python ./setup.py install --force - -cd doc -make cleanall -sphinx-build -T -b readthedocs -d _build/doctrees-readthedocs -D language=en . _build/html - -``` diff --git a/doc/Makefile b/doc/Makefile index 3b0715c0..9c15aa48 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -48,20 +48,12 @@ help: @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" -cleanipynb: - rm -rf $(IPYTHON_NOTEBOOKS_DIR) - rm -f $(IPYTHON_NOTEBOOKS_RST) - rm -f ipynb/*.nbconvert.ipynb - -clean: cleanipynb +clean: rm -rf $(BUILDDIR)/* cleanall: clean rm -rf generated html.zip -cleannbconvert.ipynb: - rm -f ipynb/*.nbconvert.ipynb - dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo diff --git a/doc/authors.md b/doc/authors.md new file mode 120000 index 00000000..3234d6e0 --- /dev/null +++ b/doc/authors.md @@ -0,0 +1 @@ +../AUTHORS.md \ No newline at end of file diff --git a/doc/authors.rst b/doc/authors.rst deleted file mode 100644 index 0661b54d..00000000 --- a/doc/authors.rst +++ /dev/null @@ -1,4 +0,0 @@ -Authors -======= - -.. include:: ../AUTHORS.rst diff --git a/doc/changes.md b/doc/changes.md new file mode 120000 index 00000000..cf547089 --- /dev/null +++ b/doc/changes.md @@ -0,0 +1 @@ +../CHANGES.md \ No newline at end of file diff --git a/doc/changes.rst b/doc/changes.rst deleted file mode 100644 index 955deaf2..00000000 --- a/doc/changes.rst +++ /dev/null @@ -1,4 +0,0 @@ -Changes -======= - -.. include:: ../CHANGES.rst diff --git a/doc/conf.py b/doc/conf.py index a09e04ef..b7323d74 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -11,27 +11,10 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os os.environ["OMP_NUM_THREADS"] = "1" -# to be able to build the doc without h5py with Read the docs - -import fluiddoc - -if fluiddoc.on_rtd: - print("Mock modules to build the documentation on READTHEDOCS.") - # this package comes from fluiddyn - fluiddoc.mock_modules( - [ - "theano", - "reikna.cluda", - "reikna.fft", - "reikna.transformations", - ] - ) - import fluidimage # we want this module to be importable. @@ -42,16 +25,6 @@ traceback.print_exc() -from fluiddoc.ipynb_maker import ipynb_to_rst - -ipynb_to_rst() - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("../scripts")) -sys.path.insert(0, os.path.abspath("./")) - # -- General configuration ---------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -70,21 +43,27 @@ "sphinx.ext.autosummary", "numpydoc", "fluiddoc.mathmacro", + "sphinx.ext.inheritance_diagram", # requires Graphviz + "myst_nb", + "sphinx_copybutton", ] -try: - import readthedocs_ext -except ImportError: - pass -else: - extensions.append("readthedocs_ext.readthedocs") - +# Execute ipynb files into with a cache ... +nb_execution_mode = "cache" +nb_execution_cache_path = "./_jupyter_cache" +os.makedirs(nb_execution_cache_path, exist_ok=True) +# ... except these ipynb files +nb_execution_excludepatterns = ["ipynbslides/*"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = ".rst" +source_suffix = { + ".rst": "restructuredtext", + ".ipynb": "myst-nb", + ".myst": "myst-nb", +} # The encoding of source files. # source_encoding = 'utf-8-sig' @@ -149,7 +128,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'default' -html_theme = "sphinx_rtd_theme" +html_theme = "pydata_sphinx_theme" # Theme options are theme-specific and customize the look and feel of a theme @@ -312,3 +291,25 @@ autodoc_member_order = "bysource" todo_include_todos = True + +nb_execution_raise_on_error = True +nb_execution_show_tb = True +nb_merge_streams = True +nb_execution_timeout = 120 + +myst_enable_extensions = [ + "amsmath", + # "attrs_inline", + "colon_fence", + # "deflist", + "dollarmath", + # "fieldlist", + # "linkify", + # "replacements", + # "smartquotes", + # "strikethrough", + "substitution", + # "tasklist", +] + +suppress_warnings = ["mystnb.unknown_mime_type"] diff --git a/doc/index.rst b/doc/index.rst index a0ea56ff..819001cb 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,7 +1,5 @@ .. FluidImage documentation master file -.. include:: ../README.rst - User Guide ---------- diff --git a/doc/ipynb/tuto_calibration2dsimple.ipynb b/doc/ipynb/tuto_calibration2dsimple.ipynb index 72e31cd8..b4dd0244 100644 --- a/doc/ipynb/tuto_calibration2dsimple.ipynb +++ b/doc/ipynb/tuto_calibration2dsimple.ipynb @@ -59,7 +59,7 @@ "outputs": [], "source": [ "with h5py.File(path_piv) as file:\n", - " shape_im = file['couple/shape_images'].value\n", + " shape_im = file['couple/shape_images'][...]\n", "\n", "point0 = (10, 20)\n", "point1 = (10, 10)\n", @@ -310,4 +310,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} diff --git a/doc/ipynb/tuto_opencv_calibration.ipynb b/doc/ipynb/tuto_opencv_calibration.ipynb index 066034b9..e651ee1a 100644 --- a/doc/ipynb/tuto_opencv_calibration.ipynb +++ b/doc/ipynb/tuto_opencv_calibration.ipynb @@ -9,8 +9,7 @@ "The calibration was performed using the Python bindings of the OpenCV [Bradski, 2000] library. This has been\n", "made easier to use through the module `fluidimage.calibration.calib_cv`. We shall use this module on a set of\n", "5 calibration images of a target which has a circle grid. The white dots on this particular target is evenly\n", - "spaced at `3 mm`. For the same camera position, the target'sworld coordinate `z` varies as `[-6, -3, 0, 3, 6]` mm.\n", - "\n", + "spaced at `3 mm`. For the same camera position, the target coordinate `z` varies as `[-6, -3, 0, 3, 6]` mm.\n", "\n", "We shall proceed as follows:\n", "\n", @@ -41,8 +40,8 @@ "from fluidimage import get_path_image_samples\n", "\n", "path = get_path_image_samples() / \"TomoPIV\" / \"calibration\" / \"cam0\"\n", - "calib_files = list(path.glob(\"*.tif\"))\n", - "calib_files" + "calib_files = sorted(path.glob(\"*.tif\"))\n", + "[path.name for path in calib_files]" ] }, { @@ -71,7 +70,7 @@ "\n", "def imshow(image, ax=plt):\n", " ax.imshow(image, cmap='gray', vmax=255)\n", - " \n", + "\n", "image = imread(str(calib_files[2])) # z = 0 image\n", "imshow(image)" ] @@ -150,7 +149,7 @@ "def find_origin(filename):\n", " params = SimpleCircleGrid.create_default_params()\n", " params.minArea = 18.\n", - " \n", + "\n", " circle_grid = SimpleCircleGrid(params)\n", "\n", " # Pass the filled image to detect the square\n", @@ -215,7 +214,7 @@ " image, origin, nx=7, ny=7, ds=50, debug=debug)\n", "\n", " return centers\n", - " \n", + "\n", "centers = construct_image_points(calib_files[2], debug=True)" ] }, @@ -289,7 +288,7 @@ "def calibrate_camera(cam=\"cam0\", debug=False):\n", " path_calib_h5 = path_output / (cam + \".h5\")\n", " calib = CalibCV(path_calib_h5)\n", - " \n", + "\n", " objpoints = []\n", " imgpoints = []\n", " zs = []\n", @@ -306,7 +305,7 @@ " )\n", " centers = construct_image_points(str(filename))\n", " imgpoints.append(centers)\n", - " \n", + "\n", " im_shape = imread(str(filename)).shape[::-1]\n", " origin = find_origin(str(files[2]))\n", " return calib.calibrate(imgpoints, objpoints, zs, im_shape, origin, debug)\n", @@ -367,7 +366,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -381,9 +380,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.0" + "version": "3.9.2" } }, "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file + "nbformat_minor": 4 +} diff --git a/doc/ipynb/tuto_stereo_reconstruction.ipynb b/doc/ipynb/tuto_stereo_reconstruction.ipynb index b19bb411..6c83e163 100644 --- a/doc/ipynb/tuto_stereo_reconstruction.ipynb +++ b/doc/ipynb/tuto_stereo_reconstruction.ipynb @@ -37,12 +37,12 @@ "source": [ "def make_calib_path(index_cam):\n", " path_cam = pathbase / f'E_Calibration_Images/Camera_0{index_cam}'\n", - " path = path_cam / f'calib{index_cam}.npy'\n", + " path = path_cam / f'calib{index_cam}.npz'\n", " if not os.path.exists(path):\n", " # we need to create this calib file.\n", " from fluidimage.calibration import CalibDirect\n", " calib = CalibDirect(\n", - " glob_str_xml=str(path_cam / 'img*.xml'), \n", + " glob_str_xml=str(path_cam / 'img*.xml'),\n", " shape_img=(1024, 1024))\n", " calib.compute_interpolents()\n", " nb_lines_x, nb_lines_y = 64, 64\n", diff --git a/noxfile.py b/noxfile.py index 32702c71..a66d5183 100644 --- a/noxfile.py +++ b/noxfile.py @@ -93,7 +93,7 @@ def test_cov(session): def doc(session): """Build the documentation""" print_times = TimePrinter() - command = "pdm sync -G doc -G fft -G test --no-self" + command = "pdm sync -G doc -G opencv --no-self" session.run_always(*command.split(), external=True) print_times("pdm sync") diff --git a/pdm.lock b/pdm.lock index b588b1d5..88885209 100644 --- a/pdm.lock +++ b/pdm.lock @@ -2,10 +2,23 @@ # It is not intended for manual editing. [metadata] -groups = ["default", "build", "dev", "doc", "opencv", "pims", "qt", "test"] +groups = ["default", "build", "dev", "doc", "opencv", "pims", "test"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.1" -content_hash = "sha256:7b1bb22ce5425422acd3e3e8012c4922bd3f076d03502096f942aff39755c436" +content_hash = "sha256:5906b55ac62cff1d16936f86be16b07f474de091161f26de85fa4f97c9e5b5cd" + +[[package]] +name = "accessible-pygments" +version = "0.0.4" +summary = "A collection of accessible pygments styles" +groups = ["doc"] +dependencies = [ + "pygments>=1.5", +] +files = [ + {file = "accessible-pygments-0.0.4.tar.gz", hash = "sha256:e7b57a9b15958e9601c7e9eb07a440c813283545a20973f2574a5f453d0e953e"}, + {file = "accessible_pygments-0.0.4-py2.py3-none-any.whl", hash = "sha256:416c6d8c1ea1c5ad8701903a20fcedf953c6e720d64f33dc47bfb2d3f2fa4e8d"}, +] [[package]] name = "alabaster" @@ -803,45 +816,45 @@ files = [ [[package]] name = "fonttools" -version = "4.48.1" +version = "4.49.0" requires_python = ">=3.8" summary = "Tools to manipulate font files" groups = ["default", "test"] files = [ - {file = "fonttools-4.48.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:702ae93058c81f46461dc4b2c79f11d3c3d8fd7296eaf8f75b4ba5bbf813cd5f"}, - {file = "fonttools-4.48.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:97f0a49fa6aa2d6205c6f72f4f98b74ef4b9bfdcb06fd78e6fe6c7af4989b63e"}, - {file = "fonttools-4.48.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3260db55f1843e57115256e91247ad9f68cb02a434b51262fe0019e95a98738"}, - {file = "fonttools-4.48.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e740a7602c2bb71e1091269b5dbe89549749a8817dc294b34628ffd8b2bf7124"}, - {file = "fonttools-4.48.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4108b1d247953dd7c90ec8f457a2dec5fceb373485973cc852b14200118a51ee"}, - {file = "fonttools-4.48.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:56339ec557f0c342bddd7c175f5e41c45fc21282bee58a86bd9aa322bec715f2"}, - {file = "fonttools-4.48.1-cp310-cp310-win32.whl", hash = "sha256:bff5b38d0e76eb18e0b8abbf35d384e60b3371be92f7be36128ee3e67483b3ec"}, - {file = "fonttools-4.48.1-cp310-cp310-win_amd64.whl", hash = "sha256:f7449493886da6a17472004d3818cc050ba3f4a0aa03fb47972e4fa5578e6703"}, - {file = "fonttools-4.48.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:18b35fd1a850ed7233a99bbd6774485271756f717dac8b594958224b54118b61"}, - {file = "fonttools-4.48.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cad5cfd044ea2e306fda44482b3dd32ee47830fa82dfa4679374b41baa294f5f"}, - {file = "fonttools-4.48.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f30e605c7565d0da6f0aec75a30ec372072d016957cd8fc4469721a36ea59b7"}, - {file = "fonttools-4.48.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aee76fd81a8571c68841d6ef0da750d5ff08ff2c5f025576473016f16ac3bcf7"}, - {file = "fonttools-4.48.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5057ade278e67923000041e2b195c9ea53e87f227690d499b6a4edd3702f7f01"}, - {file = "fonttools-4.48.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b10633aafc5932995a391ec07eba5e79f52af0003a1735b2306b3dab8a056d48"}, - {file = "fonttools-4.48.1-cp311-cp311-win32.whl", hash = "sha256:0d533f89819f9b3ee2dbedf0fed3825c425850e32bdda24c558563c71be0064e"}, - {file = "fonttools-4.48.1-cp311-cp311-win_amd64.whl", hash = "sha256:d20588466367f05025bb1efdf4e5d498ca6d14bde07b6928b79199c588800f0a"}, - {file = "fonttools-4.48.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0a2417547462e468edf35b32e3dd06a6215ac26aa6316b41e03b8eeaf9f079ea"}, - {file = "fonttools-4.48.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:cf5a0cd974f85a80b74785db2d5c3c1fd6cc09a2ba3c837359b2b5da629ee1b0"}, - {file = "fonttools-4.48.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0452fcbfbce752ba596737a7c5ec5cf76bc5f83847ce1781f4f90eab14ece252"}, - {file = "fonttools-4.48.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:578c00f93868f64a4102ecc5aa600a03b49162c654676c3fadc33de2ddb88a81"}, - {file = "fonttools-4.48.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:63dc592a16cd08388d8c4c7502b59ac74190b23e16dfc863c69fe1ea74605b68"}, - {file = "fonttools-4.48.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9b58638d8a85e3a1b32ec0a91d9f8171a877b4b81c408d4cb3257d0dee63e092"}, - {file = "fonttools-4.48.1-cp312-cp312-win32.whl", hash = "sha256:d10979ef14a8beaaa32f613bb698743f7241d92f437a3b5e32356dfb9769c65d"}, - {file = "fonttools-4.48.1-cp312-cp312-win_amd64.whl", hash = "sha256:cdfd7557d1bd294a200bd211aa665ca3b02998dcc18f8211a5532da5b8fad5c5"}, - {file = "fonttools-4.48.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:0d2b01428f7da26f229a5656defc824427b741e454b4e210ad2b25ed6ea2aed4"}, - {file = "fonttools-4.48.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:df48798f9a4fc4c315ab46e17873436c8746f5df6eddd02fad91299b2af7af95"}, - {file = "fonttools-4.48.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2eb4167bde04e172a93cf22c875d8b0cff76a2491f67f5eb069566215302d45d"}, - {file = "fonttools-4.48.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c900508c46274d32d308ae8e82335117f11aaee1f7d369ac16502c9a78930b0a"}, - {file = "fonttools-4.48.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:594206b31c95fcfa65f484385171fabb4ec69f7d2d7f56d27f17db26b7a31814"}, - {file = "fonttools-4.48.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:292922dc356d7f11f5063b4111a8b719efb8faea92a2a88ed296408d449d8c2e"}, - {file = "fonttools-4.48.1-cp39-cp39-win32.whl", hash = "sha256:4709c5bf123ba10eac210d2d5c9027d3f472591d9f1a04262122710fa3d23199"}, - {file = "fonttools-4.48.1-cp39-cp39-win_amd64.whl", hash = "sha256:63c73b9dd56a94a3cbd2f90544b5fca83666948a9e03370888994143b8d7c070"}, - {file = "fonttools-4.48.1-py3-none-any.whl", hash = "sha256:e3e33862fc5261d46d9aae3544acb36203b1a337d00bdb5d3753aae50dac860e"}, - {file = "fonttools-4.48.1.tar.gz", hash = "sha256:8b8a45254218679c7f1127812761e7854ed5c8e34349aebf581e8c9204e7495a"}, + {file = "fonttools-4.49.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d970ecca0aac90d399e458f0b7a8a597e08f95de021f17785fb68e2dc0b99717"}, + {file = "fonttools-4.49.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ac9a745b7609f489faa65e1dc842168c18530874a5f5b742ac3dd79e26bca8bc"}, + {file = "fonttools-4.49.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ba0e00620ca28d4ca11fc700806fd69144b463aa3275e1b36e56c7c09915559"}, + {file = "fonttools-4.49.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdee3ab220283057e7840d5fb768ad4c2ebe65bdba6f75d5d7bf47f4e0ed7d29"}, + {file = "fonttools-4.49.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ce7033cb61f2bb65d8849658d3786188afd80f53dad8366a7232654804529532"}, + {file = "fonttools-4.49.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:07bc5ea02bb7bc3aa40a1eb0481ce20e8d9b9642a9536cde0218290dd6085828"}, + {file = "fonttools-4.49.0-cp310-cp310-win32.whl", hash = "sha256:86eef6aab7fd7c6c8545f3ebd00fd1d6729ca1f63b0cb4d621bccb7d1d1c852b"}, + {file = "fonttools-4.49.0-cp310-cp310-win_amd64.whl", hash = "sha256:1fac1b7eebfce75ea663e860e7c5b4a8831b858c17acd68263bc156125201abf"}, + {file = "fonttools-4.49.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:edc0cce355984bb3c1d1e89d6a661934d39586bb32191ebff98c600f8957c63e"}, + {file = "fonttools-4.49.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:83a0d9336de2cba86d886507dd6e0153df333ac787377325a39a2797ec529814"}, + {file = "fonttools-4.49.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:36c8865bdb5cfeec88f5028e7e592370a0657b676c6f1d84a2108e0564f90e22"}, + {file = "fonttools-4.49.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:33037d9e56e2562c710c8954d0f20d25b8386b397250d65581e544edc9d6b942"}, + {file = "fonttools-4.49.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8fb022d799b96df3eaa27263e9eea306bd3d437cc9aa981820850281a02b6c9a"}, + {file = "fonttools-4.49.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:33c584c0ef7dc54f5dd4f84082eabd8d09d1871a3d8ca2986b0c0c98165f8e86"}, + {file = "fonttools-4.49.0-cp311-cp311-win32.whl", hash = "sha256:cbe61b158deb09cffdd8540dc4a948d6e8f4d5b4f3bf5cd7db09bd6a61fee64e"}, + {file = "fonttools-4.49.0-cp311-cp311-win_amd64.whl", hash = "sha256:fc11e5114f3f978d0cea7e9853627935b30d451742eeb4239a81a677bdee6bf6"}, + {file = "fonttools-4.49.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:d647a0e697e5daa98c87993726da8281c7233d9d4ffe410812a4896c7c57c075"}, + {file = "fonttools-4.49.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f3bbe672df03563d1f3a691ae531f2e31f84061724c319652039e5a70927167e"}, + {file = "fonttools-4.49.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bebd91041dda0d511b0d303180ed36e31f4f54b106b1259b69fade68413aa7ff"}, + {file = "fonttools-4.49.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4145f91531fd43c50f9eb893faa08399816bb0b13c425667c48475c9f3a2b9b5"}, + {file = "fonttools-4.49.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ea329dafb9670ffbdf4dbc3b0e5c264104abcd8441d56de77f06967f032943cb"}, + {file = "fonttools-4.49.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c076a9e548521ecc13d944b1d261ff3d7825048c338722a4bd126d22316087b7"}, + {file = "fonttools-4.49.0-cp312-cp312-win32.whl", hash = "sha256:b607ea1e96768d13be26d2b400d10d3ebd1456343eb5eaddd2f47d1c4bd00880"}, + {file = "fonttools-4.49.0-cp312-cp312-win_amd64.whl", hash = "sha256:a974c49a981e187381b9cc2c07c6b902d0079b88ff01aed34695ec5360767034"}, + {file = "fonttools-4.49.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:08877e355d3dde1c11973bb58d4acad1981e6d1140711230a4bfb40b2b937ccc"}, + {file = "fonttools-4.49.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fdb54b076f25d6b0f0298dc706acee5052de20c83530fa165b60d1f2e9cbe3cb"}, + {file = "fonttools-4.49.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0af65c720520710cc01c293f9c70bd69684365c6015cc3671db2b7d807fe51f2"}, + {file = "fonttools-4.49.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f255ce8ed7556658f6d23f6afd22a6d9bbc3edb9b96c96682124dc487e1bf42"}, + {file = "fonttools-4.49.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d00af0884c0e65f60dfaf9340e26658836b935052fdd0439952ae42e44fdd2be"}, + {file = "fonttools-4.49.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:263832fae27481d48dfafcc43174644b6706639661e242902ceb30553557e16c"}, + {file = "fonttools-4.49.0-cp39-cp39-win32.whl", hash = "sha256:0404faea044577a01bb82d47a8fa4bc7a54067fa7e324785dd65d200d6dd1133"}, + {file = "fonttools-4.49.0-cp39-cp39-win_amd64.whl", hash = "sha256:b050d362df50fc6e38ae3954d8c29bf2da52be384649ee8245fdb5186b620836"}, + {file = "fonttools-4.49.0-py3-none-any.whl", hash = "sha256:af281525e5dd7fa0b39fb1667b8d5ca0e2a9079967e14c4bfe90fd1cd13e0f18"}, + {file = "fonttools-4.49.0.tar.gz", hash = "sha256:ebf46e7f01b7af7861310417d7c49591a85d99146fc23a5ba82fdb28af156321"}, ] [[package]] @@ -2482,6 +2495,27 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pydata-sphinx-theme" +version = "0.15.2" +requires_python = ">=3.9" +summary = "Bootstrap-based Sphinx theme from the PyData community" +groups = ["doc"] +dependencies = [ + "Babel", + "accessible-pygments", + "beautifulsoup4", + "docutils!=0.17.0", + "packaging", + "pygments>=2.7", + "sphinx>=5.0", + "typing-extensions", +] +files = [ + {file = "pydata_sphinx_theme-0.15.2-py3-none-any.whl", hash = "sha256:0c5fa1fa98a9b26dae590666ff576f27e26c7ba708fee754ecb9e07359ed4588"}, + {file = "pydata_sphinx_theme-0.15.2.tar.gz", hash = "sha256:4243fee85b3afcfae9df64f83210a04e7182e53bc3db8841ffff6d21d95ae320"}, +] + [[package]] name = "pyfftw" version = "0.13.1" @@ -2574,57 +2608,6 @@ files = [ {file = "pyproject_metadata-0.7.1-py3-none-any.whl", hash = "sha256:28691fbb36266a819ec56c9fa1ecaf36f879d6944dfde5411e87fc4ff793aa60"}, ] -[[package]] -name = "pyside6" -version = "6.6.2" -requires_python = "<3.13,>=3.8" -summary = "Python bindings for the Qt cross-platform application and UI framework" -groups = ["qt"] -dependencies = [ - "PySide6-Addons==6.6.2", - "PySide6-Essentials==6.6.2", - "shiboken6==6.6.2", -] -files = [ - {file = "PySide6-6.6.2-cp38-abi3-macosx_11_0_universal2.whl", hash = "sha256:5bdaa27d1a921c35764d82a2ec86943488c818cb33b9e16b2784d539b45f6171"}, - {file = "PySide6-6.6.2-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3b6266fb29bab66526f2bbab2a6610f9f47a4df42ae6fb3713cd8329f593a561"}, - {file = "PySide6-6.6.2-cp38-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:a8200b2a1f02e42adfd1f41bc60d52d157398778b6ba232d46ad7402bc6f91ec"}, - {file = "PySide6-6.6.2-cp38-abi3-win_amd64.whl", hash = "sha256:e359ebccd3f90fba85ebd5b93bdeadfa9e5d2fd06b3b5e8985aa5da50ca6243b"}, -] - -[[package]] -name = "pyside6-addons" -version = "6.6.2" -requires_python = "<3.13,>=3.8" -summary = "Python bindings for the Qt cross-platform application and UI framework (Addons)" -groups = ["qt"] -dependencies = [ - "PySide6-Essentials==6.6.2", - "shiboken6==6.6.2", -] -files = [ - {file = "PySide6_Addons-6.6.2-cp38-abi3-macosx_11_0_universal2.whl", hash = "sha256:4fb00bc98bc8335177eaa8f6d70ba687ab9bf00b3ee343abbc7156040f3e586d"}, - {file = "PySide6_Addons-6.6.2-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:cbdb7393de88a916ed1e9bd8407149f911717d1e06aee04119e26042679d8cce"}, - {file = "PySide6_Addons-6.6.2-cp38-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:90f20dcf2caf69307e20d3d682cbe2b1a38e7ddb1f50f4f0e3ae4306219f8883"}, - {file = "PySide6_Addons-6.6.2-cp38-abi3-win_amd64.whl", hash = "sha256:748151fb49d5fe760b7cf6c88c4ec851e68d66a119939567407115948bf8a08f"}, -] - -[[package]] -name = "pyside6-essentials" -version = "6.6.2" -requires_python = "<3.13,>=3.8" -summary = "Python bindings for the Qt cross-platform application and UI framework (Essentials)" -groups = ["qt"] -dependencies = [ - "shiboken6==6.6.2", -] -files = [ - {file = "PySide6_Essentials-6.6.2-cp38-abi3-macosx_11_0_universal2.whl", hash = "sha256:41373f9b8fd17bb39a7dc7da85168508fe288955a17117c2e993339f387b23c1"}, - {file = "PySide6_Essentials-6.6.2-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:90be2cf1a404f1c62777ccc6898895c864376f1fd68ae9f82f7622522bce5814"}, - {file = "PySide6_Essentials-6.6.2-cp38-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:11496a322138eab4579c3683d2e3afebb41435412d4109394cb2b9ddaac66fe3"}, - {file = "PySide6_Essentials-6.6.2-cp38-abi3-win_amd64.whl", hash = "sha256:030a0565ad2d6361ed8be7826f81fe3dbb7a98330837687608e75cbede5f0ca2"}, -] - [[package]] name = "pytest" version = "8.0.0" @@ -2659,21 +2642,6 @@ files = [ {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, ] -[[package]] -name = "pytest-qt" -version = "4.4.0" -requires_python = ">=3.8" -summary = "pytest support for PyQt and PySide applications" -groups = ["test"] -dependencies = [ - "pluggy>=1.1", - "pytest", -] -files = [ - {file = "pytest-qt-4.4.0.tar.gz", hash = "sha256:76896142a940a4285339008d6928a36d4be74afec7e634577e842c9cc5c56844"}, - {file = "pytest_qt-4.4.0-py3-none-any.whl", hash = "sha256:001ed2f8641764b394cf286dc8a4203e40eaf9fff75bf0bfe5103f7f8d0c591d"}, -] - [[package]] name = "python-dateutil" version = "2.8.2" @@ -3165,19 +3133,6 @@ files = [ {file = "setuptools-69.1.0.tar.gz", hash = "sha256:850894c4195f09c4ed30dba56213bf7c3f21d86ed6bdaafb5df5972593bfc401"}, ] -[[package]] -name = "shiboken6" -version = "6.6.2" -requires_python = "<3.13,>=3.8" -summary = "Python/C++ bindings helper module" -groups = ["qt"] -files = [ - {file = "shiboken6-6.6.2-cp38-abi3-macosx_11_0_universal2.whl", hash = "sha256:531728324ad3ad4ed7b1d85d2dff548d618182d67024e16e84079f7db104590d"}, - {file = "shiboken6-6.6.2-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:9da86622cee5e7201bafe9c5beee3c06d9168c6b8f3e2fac52c1b7df00956bff"}, - {file = "shiboken6-6.6.2-cp38-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:60dbad15901ad6fff6e198d8668091bbb2f20b82729412e5fd4d47ac86c97d42"}, - {file = "shiboken6-6.6.2-cp38-abi3-win_amd64.whl", hash = "sha256:d4e99e7d1137a7d2c665a465b80baf820829dfba5fe474549d49b0ef81b0abf2"}, -] - [[package]] name = "six" version = "1.16.0" @@ -3285,22 +3240,6 @@ files = [ {file = "sphinx_copybutton-0.5.2-py3-none-any.whl", hash = "sha256:fb543fd386d917746c9a2c50360c7905b605726b9355cd26e9974857afeae06e"}, ] -[[package]] -name = "sphinx-rtd-theme" -version = "2.0.0" -requires_python = ">=3.6" -summary = "Read the Docs theme for Sphinx" -groups = ["doc"] -dependencies = [ - "docutils<0.21", - "sphinx<8,>=5", - "sphinxcontrib-jquery<5,>=4", -] -files = [ - {file = "sphinx_rtd_theme-2.0.0-py2.py3-none-any.whl", hash = "sha256:ec93d0856dc280cf3aee9a4c9807c60e027c7f7b461b77aeffed682e68f0e586"}, - {file = "sphinx_rtd_theme-2.0.0.tar.gz", hash = "sha256:bd5d7b80622406762073a04ef8fadc5f9151261563d47027de09910ce03afe6b"}, -] - [[package]] name = "sphinxcontrib-applehelp" version = "1.0.8" @@ -3334,20 +3273,6 @@ files = [ {file = "sphinxcontrib_htmlhelp-2.0.5.tar.gz", hash = "sha256:0dc87637d5de53dd5eec3a6a01753b1ccf99494bd756aafecd74b4fa9e729015"}, ] -[[package]] -name = "sphinxcontrib-jquery" -version = "4.1" -requires_python = ">=2.7" -summary = "Extension to include jQuery on newer Sphinx releases" -groups = ["doc"] -dependencies = [ - "Sphinx>=1.8", -] -files = [ - {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, - {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, -] - [[package]] name = "sphinxcontrib-jsmath" version = "1.0.1" diff --git a/pylintrc b/pylintrc index 2d186d83..67fac493 100644 --- a/pylintrc +++ b/pylintrc @@ -165,7 +165,7 @@ class-naming-style=PascalCase #class-rgx= # Naming style matching correct constant names. -const-naming-style=UPPER_CASE +const-naming-style=snake_case # Regular expression matching correct constant names. Overrides const-naming- # style. If left empty, constant names will be checked with the set naming diff --git a/pyproject.toml b/pyproject.toml index 48d362df..886f19df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,7 @@ fluidimlauncher = "fluidimage.gui.launcher.main:main" [project.optional-dependencies] pims = ["pims"] opencv = ["opencv-python"] -qt = ["PySide6"] +# qt = ["PySide6"] [tool.meson-python.args] setup = ['-Doptimization=3'] @@ -81,7 +81,7 @@ build = [ ] doc = [ "sphinx", - "sphinx_rtd_theme", + "pydata-sphinx-theme", "numpydoc", "jupyter", "pandas", @@ -92,9 +92,10 @@ test = [ "pytest", "coverage", "pytest-cov", - "pytest-qt", "fluidimage[opencv]" ] +# test-qt = ["pytest-qt"] + dev = [ "pip", "black", diff --git a/src/fluidimage/calcul/correl.py b/src/fluidimage/calcul/correl.py index 3ea1bde1..0bfca3f6 100644 --- a/src/fluidimage/calcul/correl.py +++ b/src/fluidimage/calcul/correl.py @@ -154,8 +154,8 @@ def compute_displacements_from_correl(self, correl, norm=1.0): try: ix, iy, correl_max = _compute_indices_max(correl, norm) - except PIVError as e: - ix, iy, correl_max = e.results + except PIVError as piv_error: + ix, iy, correl_max = piv_error.results # second chance to find a better peak... correl[ iy - self.particle_radius : iy + self.particle_radius + 1, @@ -163,10 +163,10 @@ def compute_displacements_from_correl(self, correl, norm=1.0): ] = np.nan try: ix2, iy2, correl_max2 = _compute_indices_max(correl, norm) - except PIVError as e2: + except PIVError as _piv_error: dx, dy = self.compute_displacement_from_indices(ix, iy) - e.results = (dx, dy, correl_max) - raise e + _piv_error.results = (dx, dy, correl_max) + raise _piv_error else: ix, iy, correl_max = ix2, iy2, correl_max2 @@ -221,7 +221,7 @@ def correl_numpy(im0: A, im1: A, disp_max: int): displacement max. Notes - ------- + ----- im1_shape inf to im0_shape diff --git a/src/fluidimage/calibration/calib_cv.py b/src/fluidimage/calibration/calib_cv.py index 7d27536f..38782b33 100644 --- a/src/fluidimage/calibration/calib_cv.py +++ b/src/fluidimage/calibration/calib_cv.py @@ -60,8 +60,8 @@ class SimpleCircleGrid: def create_default_params(): params_cv = cv2.SimpleBlobDetector_Params() # Slightly nicer defaults - # params_cv.filterByColor = False - # params_cv.minArea = 0.0 + params_cv.filterByColor = False + params_cv.minArea = 0.1 return ParamContainerCV(params_cv, "SimpleBlobDetector") def __init__(self, params: ParamContainerCV) -> None: @@ -117,8 +117,7 @@ def detect_grid( Plot the detected points and the bounding box """ - - keypoints = self.detect_all(image, debug=True) + keypoints = self.detect_all(image) # Add 1 so that the points at the edge of the bounding box are included w = (nx + 1) * ds h = (ny + 1) * ds diff --git a/src/fluidimage/calibration/test_calib_cv.py b/src/fluidimage/calibration/test_calib_cv.py index ff315cea..b854915e 100644 --- a/src/fluidimage/calibration/test_calib_cv.py +++ b/src/fluidimage/calibration/test_calib_cv.py @@ -2,7 +2,6 @@ from numpy.testing import assert_almost_equal, assert_array_equal -from fluiddyn.io import stdout_redirected from fluidimage import get_path_image_samples from fluidimage.calibration.calib_cv import ( CalibCV, @@ -36,7 +35,6 @@ class TestCalib(unittest.TestCase): @classmethod def setUpClass(cls): path_cache = pathbase / "cam0.h5" - # with stdout_redirected(): cls.calib_cache = CalibCV(str(path_cache)) def test_interpolate(self): @@ -44,12 +42,11 @@ def test_interpolate(self): self.calib_cache.get_rotation(2) self.calib_cache.get_translate(-2) - @unittest.expectedFailure + # @unittest.expectedFailure def test_calibrate(self): """Tests construct_object_points and CalibCV methods.""" path_input = pathbase / "cam0" / "0mm_cam0.tif" - with stdout_redirected(): - calib = CalibCV("fluidimage_test_calib_cv.h5") + calib = CalibCV("fluidimage_test_calib_cv.h5") result_cache = self.calib_cache.params @@ -65,7 +62,3 @@ def test_calibrate(self): assert_array_equal(mtx, result_cache.cam_mtx) assert_almost_equal(rvecs[0], result_cache.rotation[2]) assert_almost_equal(tvecs[0], result_cache.translate[2]) - - -if __name__ == "__main__": - unittest.main() diff --git a/src/fluidimage/gui/launcher/main.py b/src/fluidimage/gui/launcher/main.py index 656872eb..5823962c 100644 --- a/src/fluidimage/gui/launcher/main.py +++ b/src/fluidimage/gui/launcher/main.py @@ -8,19 +8,26 @@ import sys -from matplotlib.backends.qt_compat import QtWidgets, QtGui +try: + from matplotlib.backends.qt_compat import QtWidgets, QtGui +except ImportError: + base_classes = [] +else: + + from .mainwindow import Ui_MainWindow + from fluiddyn.util.paramcontainer_gui import QtParamContainer + + base_classes = [QtWidgets.QMainWindow, Ui_MainWindow] + from fluiddyn.util.paramcontainer import ParamContainer -from fluiddyn.util.paramcontainer_gui import QtParamContainer from fluidimage.topologies.launcher import ( TopologyPIVLauncher, TopologyPreprocLauncher, ) -from .mainwindow import Ui_MainWindow - -class Program(QtWidgets.QMainWindow, Ui_MainWindow): +class Program(*base_classes): def __init__(self): topologies = [TopologyPreprocLauncher, TopologyPIVLauncher] self.topologies = {cls.__name__: cls for cls in topologies} diff --git a/src/fluidimage/works/surface_tracking.py b/src/fluidimage/works/surface_tracking.py index 699fc5f4..ba06a6f1 100644 --- a/src/fluidimage/works/surface_tracking.py +++ b/src/fluidimage/works/surface_tracking.py @@ -419,7 +419,7 @@ def process_frame( reduction factor for the frame array to speed up the calc Returns - -------- + ------- a: array containing phase [radians] """