From b2b8cc24e2588a775ac93457b8f7e81a62712bb1 Mon Sep 17 00:00:00 2001 From: Ko Sugawara Date: Fri, 22 Mar 2024 02:03:49 +0900 Subject: [PATCH 1/6] Update version to 0.5.5-dev --- Dockerfile-test | 2 +- Makefile | 2 +- elephant-core/elephant/version.py | 2 +- elephant_server.ipynb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile-test b/Dockerfile-test index ff53780..ac8792a 100644 --- a/Dockerfile-test +++ b/Dockerfile-test @@ -1,4 +1,4 @@ -FROM elephant-server:0.5.4 +FROM elephant-server:0.5.5-dev LABEL maintainer="Ko Sugawara " diff --git a/Makefile b/Makefile index e11fbde..318ee10 100755 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ help: ELEPHANT_GPU?=all ELEPHANT_WORKSPACE?=${PWD}/workspace -ELEPHANT_IMAGE_NAME?=elephant-server:0.5.4 +ELEPHANT_IMAGE_NAME?=elephant-server:0.5.5-dev ELEPHANT_NVIDIA_GID?=$$(ls -n /dev/nvidia0 2>/dev/null | awk '{print $$4}') ELEPHANT_DOCKER?=docker ELEPHANT_RABBITMQ_NODENAME?=rabbit@localhost diff --git a/elephant-core/elephant/version.py b/elephant-core/elephant/version.py index f3915f2..69948ec 100644 --- a/elephant-core/elephant/version.py +++ b/elephant-core/elephant/version.py @@ -24,4 +24,4 @@ # ============================================================================== """Version definition.""" -__version__ = "0.5.4" +__version__ = "0.5.5-dev" diff --git a/elephant_server.ipynb b/elephant_server.ipynb index 0d6ad48..7d2dc8f 100644 --- a/elephant_server.ipynb +++ b/elephant_server.ipynb @@ -39,7 +39,7 @@ }, "outputs": [], "source": [ - "%env ELEPHANT_SERVER_VERSION = v0.5.4" + "%env ELEPHANT_SERVER_VERSION = v0.5.5-dev" ] }, { From 8a22ee646b44a9a1e616eb5f9646e5b1d3280974 Mon Sep 17 00:00:00 2001 From: Ko Sugawara Date: Fri, 22 Mar 2024 02:05:01 +0900 Subject: [PATCH 2/6] Fix installation of RabbitMQ Previous installation steps did not work. See: https://www.rabbitmq.com/docs/install-debian#apt-cloudsmith --- docker/install-rabbitmq.sh | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/docker/install-rabbitmq.sh b/docker/install-rabbitmq.sh index 0edb51d..dba52c2 100644 --- a/docker/install-rabbitmq.sh +++ b/docker/install-rabbitmq.sh @@ -8,23 +8,31 @@ apt-get install curl gnupg debian-keyring debian-archive-keyring apt-transport-h ## Ignore warnings export APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 ## Team RabbitMQ's main signing key -apt-key adv --keyserver "hkps://keys.openpgp.org" --recv-keys "0x0A9AF2115F4687BD29803A206B73A36E6026DFCA" -## Cloudsmith: modern Erlang repository -curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key | apt-key add - -## Cloudsmith: RabbitMQ repository -curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key | apt-key add - +curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | sudo gpg --dearmor | sudo tee /usr/share/keyrings/com.rabbitmq.team.gpg > /dev/null +## Community mirror of Cloudsmith: modern Erlang repository +curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.E495BB49CC4BBE5B.gpg > /dev/null +## Community mirror of Cloudsmith: RabbitMQ repository +curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-server.9F4587F226208342.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/rabbitmq.9F4587F226208342.gpg > /dev/null ## Add apt repositories maintained by Team RabbitMQ -tee /etc/apt/sources.list.d/rabbitmq.list < Date: Fri, 22 Mar 2024 20:04:41 +0900 Subject: [PATCH 3/6] Update version to 0.5.5 --- Dockerfile-test | 2 +- Makefile | 2 +- elephant-core/elephant/version.py | 2 +- elephant_server.ipynb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile-test b/Dockerfile-test index ac8792a..3cb85c4 100644 --- a/Dockerfile-test +++ b/Dockerfile-test @@ -1,4 +1,4 @@ -FROM elephant-server:0.5.5-dev +FROM elephant-server:0.5.5 LABEL maintainer="Ko Sugawara " diff --git a/Makefile b/Makefile index 318ee10..3dd0c9b 100755 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ help: ELEPHANT_GPU?=all ELEPHANT_WORKSPACE?=${PWD}/workspace -ELEPHANT_IMAGE_NAME?=elephant-server:0.5.5-dev +ELEPHANT_IMAGE_NAME?=elephant-server:0.5.5 ELEPHANT_NVIDIA_GID?=$$(ls -n /dev/nvidia0 2>/dev/null | awk '{print $$4}') ELEPHANT_DOCKER?=docker ELEPHANT_RABBITMQ_NODENAME?=rabbit@localhost diff --git a/elephant-core/elephant/version.py b/elephant-core/elephant/version.py index 69948ec..f1b0432 100644 --- a/elephant-core/elephant/version.py +++ b/elephant-core/elephant/version.py @@ -24,4 +24,4 @@ # ============================================================================== """Version definition.""" -__version__ = "0.5.5-dev" +__version__ = "0.5.5" diff --git a/elephant_server.ipynb b/elephant_server.ipynb index 7d2dc8f..d90fcef 100644 --- a/elephant_server.ipynb +++ b/elephant_server.ipynb @@ -39,7 +39,7 @@ }, "outputs": [], "source": [ - "%env ELEPHANT_SERVER_VERSION = v0.5.5-dev" + "%env ELEPHANT_SERVER_VERSION = v0.5.5" ] }, { From 9df6134eef15b9214c897a5d42ead2a2b5e6100e Mon Sep 17 00:00:00 2001 From: Ko Sugawara Date: Wed, 27 Mar 2024 22:35:47 +0900 Subject: [PATCH 4/6] Update version to 0.5.6-dev --- Dockerfile-test | 2 +- Makefile | 2 +- elephant-core/elephant/version.py | 2 +- elephant_server.ipynb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile-test b/Dockerfile-test index 3cb85c4..f4dcaa0 100644 --- a/Dockerfile-test +++ b/Dockerfile-test @@ -1,4 +1,4 @@ -FROM elephant-server:0.5.5 +FROM elephant-server:0.5.6-dev LABEL maintainer="Ko Sugawara " diff --git a/Makefile b/Makefile index 3dd0c9b..22eea6e 100755 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ help: ELEPHANT_GPU?=all ELEPHANT_WORKSPACE?=${PWD}/workspace -ELEPHANT_IMAGE_NAME?=elephant-server:0.5.5 +ELEPHANT_IMAGE_NAME?=elephant-server:0.5.6-dev ELEPHANT_NVIDIA_GID?=$$(ls -n /dev/nvidia0 2>/dev/null | awk '{print $$4}') ELEPHANT_DOCKER?=docker ELEPHANT_RABBITMQ_NODENAME?=rabbit@localhost diff --git a/elephant-core/elephant/version.py b/elephant-core/elephant/version.py index f1b0432..ce75e66 100644 --- a/elephant-core/elephant/version.py +++ b/elephant-core/elephant/version.py @@ -24,4 +24,4 @@ # ============================================================================== """Version definition.""" -__version__ = "0.5.5" +__version__ = "0.5.6-dev" diff --git a/elephant_server.ipynb b/elephant_server.ipynb index d90fcef..ff0517f 100644 --- a/elephant_server.ipynb +++ b/elephant_server.ipynb @@ -39,7 +39,7 @@ }, "outputs": [], "source": [ - "%env ELEPHANT_SERVER_VERSION = v0.5.5" + "%env ELEPHANT_SERVER_VERSION = v0.5.6-dev" ] }, { From aea2f16ea26b214c37a50fca99c6744d405e449c Mon Sep 17 00:00:00 2001 From: Ko Sugawara Date: Wed, 27 Mar 2024 22:37:43 +0900 Subject: [PATCH 5/6] Fix issue in data loading scale information was not handled properly. --- elephant-core/elephant/datasets.py | 65 ++++++++++++++---------------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/elephant-core/elephant/datasets.py b/elephant-core/elephant/datasets.py index 40b90fa..e1a30ef 100644 --- a/elephant-core/elephant/datasets.py +++ b/elephant-core/elephant/datasets.py @@ -57,8 +57,7 @@ def profile(func): return func -def _load_image(za_input, timepoint, use_median=False, img_size=None): - img = za_input[timepoint].astype('float32') +def _load_image(img, use_median=False, img_size=None): if use_median and img.ndim == 3: global_median = np.median(img) for z in range(img.shape[0]): @@ -86,9 +85,9 @@ def _get_memmap_or_load(za, timepoint, memmap_dir=None, use_median=False, fpath = Path(memmap_dir) / f'{key}.dat' lock = FileLock(str(fpath) + '.lock') with lock: - if not fpath.exists(): - logger().info(f'creating {fpath}') - fpath.parent.mkdir(parents=True, exist_ok=True) + if not fpath_org.exists(): + logger().info(f'creating {fpath_org}') + fpath_org.parent.mkdir(parents=True, exist_ok=True) img_org = np.memmap( fpath_org, dtype='float32', @@ -96,28 +95,27 @@ def _get_memmap_or_load(za, timepoint, memmap_dir=None, use_median=False, shape=za.shape[1:] ) img_org[:] = za[timepoint].astype('float32') - if img_size is None: - img = img_org - else: - img = np.memmap( - fpath, - dtype='float32', - mode='w+', - shape=img_size - ) - img[:] = F.interpolate( - torch.from_numpy(img_org)[None, None], - size=img_size, - mode='trilinear' if img.ndim == 3 else 'bilinear', - align_corners=True, - )[0, 0].numpy() - if use_median and img.ndim == 3: - global_median = np.median(img) - for z in range(img.shape[0]): - slice_median = np.median(img[z]) - if 0 < slice_median: - img[z] -= slice_median - global_median - img = normalize_zero_one(img) + else: + img_org = np.memmap( + fpath_org, + dtype='float32', + mode='c', + shape=za.shape[1:] + ) + if not fpath.exists(): + logger().info(f'creating {fpath}') + fpath.parent.mkdir(parents=True, exist_ok=True) + img = np.memmap( + fpath, + dtype='float32', + mode='w+', + shape=img_size + ) + img[:] = _load_image( + img_org, + use_median=use_median, + img_size=img_size, + ) logger().info(f'loading from {fpath}') return np.memmap( fpath, @@ -126,14 +124,11 @@ def _get_memmap_or_load(za, timepoint, memmap_dir=None, use_median=False, shape=za.shape[1:] if img_size is None else img_size ) else: - img = za[timepoint].astype('float32') - if use_median and img.ndim == 3: - global_median = np.median(img) - for z in range(img.shape[0]): - slice_median = np.median(img[z]) - if 0 < slice_median: - img[z] -= slice_median - global_median - img = normalize_zero_one(img) + img = _load_image( + za[timepoint].astype('float32'), + use_median=use_median, + img_size=img_size, + ) return img From ea1b79b2f16a2bdf1005e35e1b12545eaac7368a Mon Sep 17 00:00:00 2001 From: Ko Sugawara Date: Wed, 27 Mar 2024 23:48:19 +0900 Subject: [PATCH 6/6] Update version to 0.5.6 --- Dockerfile-test | 2 +- Makefile | 2 +- elephant-core/elephant/version.py | 2 +- elephant_server.ipynb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile-test b/Dockerfile-test index f4dcaa0..a266ee2 100644 --- a/Dockerfile-test +++ b/Dockerfile-test @@ -1,4 +1,4 @@ -FROM elephant-server:0.5.6-dev +FROM elephant-server:0.5.6 LABEL maintainer="Ko Sugawara " diff --git a/Makefile b/Makefile index 22eea6e..615b36d 100755 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ help: ELEPHANT_GPU?=all ELEPHANT_WORKSPACE?=${PWD}/workspace -ELEPHANT_IMAGE_NAME?=elephant-server:0.5.6-dev +ELEPHANT_IMAGE_NAME?=elephant-server:0.5.6 ELEPHANT_NVIDIA_GID?=$$(ls -n /dev/nvidia0 2>/dev/null | awk '{print $$4}') ELEPHANT_DOCKER?=docker ELEPHANT_RABBITMQ_NODENAME?=rabbit@localhost diff --git a/elephant-core/elephant/version.py b/elephant-core/elephant/version.py index ce75e66..aee4e40 100644 --- a/elephant-core/elephant/version.py +++ b/elephant-core/elephant/version.py @@ -24,4 +24,4 @@ # ============================================================================== """Version definition.""" -__version__ = "0.5.6-dev" +__version__ = "0.5.6" diff --git a/elephant_server.ipynb b/elephant_server.ipynb index ff0517f..f90ad63 100644 --- a/elephant_server.ipynb +++ b/elephant_server.ipynb @@ -39,7 +39,7 @@ }, "outputs": [], "source": [ - "%env ELEPHANT_SERVER_VERSION = v0.5.6-dev" + "%env ELEPHANT_SERVER_VERSION = v0.5.6" ] }, {