From 12c13da9c231fa5fbf31fda46746a923b6aabc74 Mon Sep 17 00:00:00 2001 From: David Pruitt Date: Thu, 14 Nov 2024 12:44:02 -0800 Subject: [PATCH] Add constant scaling to coupled hpx dataset --- modulus/datapipes/healpix/coupledtimeseries_dataset.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modulus/datapipes/healpix/coupledtimeseries_dataset.py b/modulus/datapipes/healpix/coupledtimeseries_dataset.py index 99d0343adc..732d947e04 100644 --- a/modulus/datapipes/healpix/coupledtimeseries_dataset.py +++ b/modulus/datapipes/healpix/coupledtimeseries_dataset.py @@ -305,11 +305,10 @@ def __getitem__(self, item): np.transpose(x, axes=(0, 3, 1, 2, 4, 5)) for x in inputs_result ] - if "constants" in self.ds.data_vars: + + if self.constants is not None: # Add the constants as [F, C, H, W] - inputs_result.append(np.swapaxes(self.ds.constants.values, 0, 1)) - # inputs_result.append(self.ds.constants.values) - logger.log(5, "computed batch in %0.2f s", time.time() - compute_time) + inputs_result.append(self.constants) # append integrated couplings inputs_result.append(integrated_couplings)