From f91dceafcc1732f8196af4e580f33f4c6aec86e9 Mon Sep 17 00:00:00 2001 From: jthetzel Date: Sat, 28 Nov 2020 11:01:45 -0330 Subject: [PATCH 1/5] fix: Configure conda to use local .conda directory `conda create` creates the $HOME/.conda directory but does not prepend it conda config. Closes #377 --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 2b939ee0..c4aeca92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,8 @@ USER pims # Set up the initial conda environment COPY --chown=pims:pims environment.yml /src/environment.yml WORKDIR /src +RUN conda config --prepend envs_dirs $HOME/.conda/envs +RUN conda config --prepend pkgs_dirs $HOME/.conda/pkgs RUN conda env create -f environment.yml \ && conda clean -tipsy From fa3835803009d3e165977f4236a2d6cc56f58937 Mon Sep 17 00:00:00 2001 From: jthetzel Date: Sat, 28 Nov 2020 11:31:29 -0330 Subject: [PATCH 2/5] fix: Rename loci.formats in to in_ Attribute name automatically mangled due to conflict. https://github.com/soft-matter/pims/issues/373#issuecomment-735013243 --- pims/bioformats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pims/bioformats.py b/pims/bioformats.py index 95d21dc1..4e1807dd 100644 --- a/pims/bioformats.py +++ b/pims/bioformats.py @@ -361,7 +361,7 @@ def __init__(self, filename, meta=True, java_memory='512m', # patch for issue with ND2 files and the Chunkmap implemented in 5.4.0 # See https://github.com/openmicroscopy/bioformats/issues/2955 # circumventing the reserved keyword 'in' - mo = getattr(loci.formats, 'in').DynamicMetadataOptions() + mo = getattr(loci.formats, 'in_').DynamicMetadataOptions() mo.set('nativend2.chunkmap', 'False') # Format Bool as String self.rdr.setMetadataOptions(mo) From e77ea9c79aa8085ec51421c1617c9842e49e3bd8 Mon Sep 17 00:00:00 2001 From: jthetzel Date: Sat, 28 Nov 2020 12:55:26 -0330 Subject: [PATCH 3/5] fix: Call `imageio_get_ffmpeg_exe` to determine if ffmpeg available Importing `imageio_ffmpeg` succeeds even if ffmpeg executable is not available. This additional check is required when checking if ffmpeg related tests should be skipped. Closes #379. --- pims/imageio_reader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pims/imageio_reader.py b/pims/imageio_reader.py index 4d58f0fa..f4322210 100644 --- a/pims/imageio_reader.py +++ b/pims/imageio_reader.py @@ -15,6 +15,10 @@ import imageio_ffmpeg except ImportError: imageio_ffmpeg = None +try: + imageio_ffmpeg.get_ffmpeg_exe() +except RuntimeError: + imageio_ffmpeg = None def available(): From 65b20f48d65cb222e6928e8042c0a77b0d0f435b Mon Sep 17 00:00:00 2001 From: jthetzel Date: Sat, 28 Nov 2020 13:52:50 -0330 Subject: [PATCH 4/5] fix: Try/except AttributeName logic for `loci.formats.in` mangling --- pims/bioformats.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pims/bioformats.py b/pims/bioformats.py index 4e1807dd..05553b1c 100644 --- a/pims/bioformats.py +++ b/pims/bioformats.py @@ -361,7 +361,11 @@ def __init__(self, filename, meta=True, java_memory='512m', # patch for issue with ND2 files and the Chunkmap implemented in 5.4.0 # See https://github.com/openmicroscopy/bioformats/issues/2955 # circumventing the reserved keyword 'in' - mo = getattr(loci.formats, 'in_').DynamicMetadataOptions() + try: + mo = getattr(loci.formats, 'in').DynamicMetadataOptions() + except AttributeError: + # Attribute name conflict causes mangling of `in` to `in_` + mo = getattr(loci.formats, 'in_').DynamicMetadataOptions() mo.set('nativend2.chunkmap', 'False') # Format Bool as String self.rdr.setMetadataOptions(mo) From 37bf9183b28934e28a8720c7689d1ceb3163d7ce Mon Sep 17 00:00:00 2001 From: jthetzel Date: Sat, 28 Nov 2020 13:56:56 -0330 Subject: [PATCH 5/5] fix: Move get_ffmpeg_exe call within imageio_ffmpeg import block --- pims/imageio_reader.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pims/imageio_reader.py b/pims/imageio_reader.py index f4322210..15bdfd88 100644 --- a/pims/imageio_reader.py +++ b/pims/imageio_reader.py @@ -13,12 +13,12 @@ imageio = None try: import imageio_ffmpeg + try: + imageio_ffmpeg.get_ffmpeg_exe() + except RuntimeError: + imageio_ffmpeg = None except ImportError: imageio_ffmpeg = None -try: - imageio_ffmpeg.get_ffmpeg_exe() -except RuntimeError: - imageio_ffmpeg = None def available():