From 273fb35d6dd60296ff17a76e22f060e41a00c33b Mon Sep 17 00:00:00 2001 From: Lenz Fiedler Date: Thu, 14 Nov 2024 18:18:00 +0100 Subject: [PATCH] Made a density read from a cube file a 4D array as well --- mala/targets/density.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mala/targets/density.py b/mala/targets/density.py index 5782611fa..d5fdfe27c 100644 --- a/mala/targets/density.py +++ b/mala/targets/density.py @@ -417,6 +417,7 @@ def read_from_cube(self, path, units="1/Bohr^3", **kwargs): "We recommend to check and change the requested units" ) data, meta = read_cube(path) + data = np.expand_dims(data, -1) data *= self.convert_units(1, in_units=units) self.density = data self.grid_dimensions = list(np.shape(data)[0:3])