From f51e3ab030c6b1d80cc3890efee719fc7ad6c521 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sun, 4 Dec 2016 11:00:24 -0600 Subject: [PATCH 1/2] VolumeTaylorExpansionBase: Add back get_storage_index (closes #1). --- sumpy/expansion/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sumpy/expansion/__init__.py b/sumpy/expansion/__init__.py index c1281f96..5430da3c 100644 --- a/sumpy/expansion/__init__.py +++ b/sumpy/expansion/__init__.py @@ -122,6 +122,14 @@ class VolumeTaylorExpansionBase(object): """ raise NotImplementedError + @memoize_method + def _storage_loc_dict(self): + return dict((i, idx) for idx, i in + enumerate(self.get_coefficient_identifiers())) + + def get_storage_index(self, i): + return self._storage_loc_dict[i] + @memoize_method def get_full_coefficient_identifiers(self): """ -- GitLab From 31154585bcd3c486645a1ca7260f7f5b4b00b7e8 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Sun, 4 Dec 2016 11:01:31 -0600 Subject: [PATCH 2/2] Add property decorator. --- sumpy/expansion/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sumpy/expansion/__init__.py b/sumpy/expansion/__init__.py index 5430da3c..280eb8b7 100644 --- a/sumpy/expansion/__init__.py +++ b/sumpy/expansion/__init__.py @@ -122,6 +122,7 @@ class VolumeTaylorExpansionBase(object): """ raise NotImplementedError + @property @memoize_method def _storage_loc_dict(self): return dict((i, idx) for idx, i in -- GitLab