From bb0afa1e5cfa086f193166943b9a76ac31cd694d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Keck <jean-baptiste.keck@univ-grenoble-alpes.fr> Date: Sat, 24 Sep 2022 20:19:18 +0200 Subject: [PATCH] Fix BufferParameter init [ci skip] --- hysop/parameters/buffer_parameter.py | 8 ++++++++ hysop/problem.py | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hysop/parameters/buffer_parameter.py b/hysop/parameters/buffer_parameter.py index 9f10aa186..d45470f92 100644 --- a/hysop/parameters/buffer_parameter.py +++ b/hysop/parameters/buffer_parameter.py @@ -37,6 +37,14 @@ class BufferParameter(Parameter): obj._update_symbol(symbol) return obj + def __init__(selff, shape=None, dtype=HYSOP_REAL, initial_value=None, symbol=None, + **kwds): + parameter_types = (np.ndarray,) + initial_value = TensorParameter._compute_initial_value(shape=shape, + dtype=dtype, initial_value=initial_value) + obj = super().__init__( + parameter_types=parameter_types, initial_value=initial_value, **kwds) + def reallocate_buffer(self, shape, dtype, initial_value=None, symbol=None): self._value = TensorParameter._compute_initial_value(shape, dtype, initial_value) self._update_symbol(symbol) diff --git a/hysop/problem.py b/hysop/problem.py index f4101d41d..dff635d06 100644 --- a/hysop/problem.py +++ b/hysop/problem.py @@ -101,19 +101,19 @@ class Problem(ComputationalGraph): if (args is not None) and args.stop_at_discretization: return 'discretization' - vprint('\nDiscretizing problem...'+str(self.name)) + vprint('\nDiscretizing problem... '+str(self.name)) for node in [_ for _ in self.nodes if isinstance(_, Problem)]: node.discretize() self.discretize() if (args is not None) and args.stop_at_work_properties: return 'work properties retrieval' - vprint('\nGetting work properties...'+str(self.name)) + vprint('\nGetting work properties... '+str(self.name)) work = self.get_work_properties() if (args is not None) and args.stop_at_work_allocation: return 'work allocation' - vprint('\nAllocating work...'+str(self.name)) + vprint('\nAllocating work... '+str(self.name)) work.allocate(allow_subbuffers=allow_subbuffers) if (args is not None) and args.stop_at_setup: -- GitLab