From 1fcdacece51e502cfd27f0beeaacb296bd5bee9c Mon Sep 17 00:00:00 2001 From: Matthew Abruzzo Date: Thu, 5 Oct 2023 09:03:24 -0400 Subject: [PATCH 1/2] minor bugfix in cholla frontend Previously, the ``domain_right_edge`` attribute of ``ChollaDataset`` was initialized by assigning it the values of the ``"domain"`` attribute stored in the hdf5 file. This patch adjusts the logic so that the ``domain_right_edge`` attribute is now the sum of that array and the array stored in the ``domain_left_edge`` attribute. --- yt/frontends/cholla/data_structures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt/frontends/cholla/data_structures.py b/yt/frontends/cholla/data_structures.py index 70c7cdcc14e..c0b886c2d51 100644 --- a/yt/frontends/cholla/data_structures.py +++ b/yt/frontends/cholla/data_structures.py @@ -103,7 +103,7 @@ def _parse_parameter_file(self): attrs = h5f.attrs self.parameters = dict(attrs.items()) self.domain_left_edge = attrs["bounds"][:].astype("=f8") - self.domain_right_edge = attrs["domain"][:].astype("=f8") + self.domain_right_edge = self.domain_left_edge + attrs["domain"][:].astype("=f8") self.dimensionality = len(attrs["dims"][:]) self.domain_dimensions = attrs["dims"][:].astype("=f8") self.current_time = attrs["t"][:] From 8a905e6c85f72480f1b6c4dc883ed9ac1df307c0 Mon Sep 17 00:00:00 2001 From: Matthew Abruzzo Date: Thu, 5 Oct 2023 09:27:19 -0400 Subject: [PATCH 2/2] used black to adjust formatting. --- yt/frontends/cholla/data_structures.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yt/frontends/cholla/data_structures.py b/yt/frontends/cholla/data_structures.py index c0b886c2d51..f633683f91b 100644 --- a/yt/frontends/cholla/data_structures.py +++ b/yt/frontends/cholla/data_structures.py @@ -103,7 +103,9 @@ def _parse_parameter_file(self): attrs = h5f.attrs self.parameters = dict(attrs.items()) self.domain_left_edge = attrs["bounds"][:].astype("=f8") - self.domain_right_edge = self.domain_left_edge + attrs["domain"][:].astype("=f8") + self.domain_right_edge = self.domain_left_edge + attrs["domain"][:].astype( + "=f8" + ) self.dimensionality = len(attrs["dims"][:]) self.domain_dimensions = attrs["dims"][:].astype("=f8") self.current_time = attrs["t"][:]