From 984f059e71581f28c636e485d8045d9525e269bf Mon Sep 17 00:00:00 2001 From: akashdhruv Date: Wed, 21 Jun 2023 15:21:10 -0500 Subject: [PATCH 1/3] update some methods --- boxkit/api/_create.py | 9 +++++++++ boxkit/api/_regionprops.py | 10 +++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/boxkit/api/_create.py b/boxkit/api/_create.py index 3b2eec73..22e19f38 100644 --- a/boxkit/api/_create.py +++ b/boxkit/api/_create.py @@ -56,6 +56,15 @@ def create_dataset(storage=None, **attributes): (self.zmax - self.zmin) / (self.nblockz * self.nzb), ] + if self.dx == 0: + self.dx = 1 + + if self.dy == 0: + self.dy = 1 + + if self.dz == 0: + self.dz = 1 + blocklist = [] for lblock in range(self.nblockx * self.nblocky * self.nblockz): diff --git a/boxkit/api/_regionprops.py b/boxkit/api/_regionprops.py index 004c59c4..48d7d1b3 100644 --- a/boxkit/api/_regionprops.py +++ b/boxkit/api/_regionprops.py @@ -58,8 +58,12 @@ def skimage_props_blk(block, lsetkey, labelkey): listprops = skimage_measure.regionprops(block[labelkey].astype(int)) - listprops = [ - {"area": props["area"] * block.dx * block.dy * block.dz} for props in listprops - ] + proplist = ["area", "centroid", "equivalent_diameter_area"] + + # listprops = [ + # {"area": props["area"] * block.dx * block.dy * block.dz} for props in listprops + # ] + + listprops = [{key: props[key] for key in proplist} for props in listprops] return listprops From ce84157c3a1c42150a7d7b0251c1ce5c028df032 Mon Sep 17 00:00:00 2001 From: Akash Dhruv Date: Wed, 21 Jun 2023 15:24:22 -0500 Subject: [PATCH 2/3] fix a bug --- boxkit/api/_regionprops.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boxkit/api/_regionprops.py b/boxkit/api/_regionprops.py index 48d7d1b3..29eb392f 100644 --- a/boxkit/api/_regionprops.py +++ b/boxkit/api/_regionprops.py @@ -58,7 +58,8 @@ def skimage_props_blk(block, lsetkey, labelkey): listprops = skimage_measure.regionprops(block[labelkey].astype(int)) - proplist = ["area", "centroid", "equivalent_diameter_area"] + # proplist = ["area", "centroid", "equivalent_diameter_area"] + proplist = ["area"] # listprops = [ # {"area": props["area"] * block.dx * block.dy * block.dz} for props in listprops From 18f374cb4beb5b010d3c0f1922647545ac91a55d Mon Sep 17 00:00:00 2001 From: akashdhruv Date: Wed, 21 Jun 2023 17:13:58 -0500 Subject: [PATCH 3/3] update paper --- paper/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper/paper.md b/paper/paper.md index 16a6f6ab..5e60afa0 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -34,7 +34,7 @@ Non-Uniform Memory Access (NUMA) and distributed computing architectures. Simulation sofware instruments like Flash-X [@DUBEY2022] store output in the form of Hierarchical Data Format (HDF5) datasets. Each dataset is often gigabytes (GB) in size and requires cache efficient techniques to enable its -integration with Python packages. BoxKit datastructures act as a wrapper around +integration with Python packages. BoxKit data structures act as a wrapper around simulation output stored in HDF5 files and provide metadata for AMR blocks that describe the simulation domain. The wrapper objects are lightweight in nature and represent chunks of data stored on disk, acting as array like input for Python