From 622d70101f028fa37af4cb5d59933db03a3b6028 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 3 Sep 2020 17:18:01 -0500 Subject: [PATCH 1/3] Fix documentation errors after CL cost model merge --- doc/conf.py | 2 +- pytential/qbx/cost.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 33ad35cf..62a9d725 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -280,4 +280,4 @@ intersphinx_mapping = { 'https://documen.tician.de/loopy/': None, 'https://documen.tician.de/sumpy/': None, } -autoclass_content = "both" +autoclass_content = "class" diff --git a/pytential/qbx/cost.py b/pytential/qbx/cost.py index 6071dea5..547185e5 100644 --- a/pytential/qbx/cost.py +++ b/pytential/qbx/cost.py @@ -40,7 +40,8 @@ from functools import partial import sys from boxtree.cost import ( - FMMTranslationCostModel, AbstractFMMCostModel, FMMCostModel, _PythonFMMCostModel + FMMTranslationCostModel, AbstractFMMCostModel as BaseAbstractFMMCostModel, + FMMCostModel, _PythonFMMCostModel ) from abc import abstractmethod @@ -193,7 +194,7 @@ def make_taylor_translation_cost_model(dim, nlevels): # {{{ abstract cost model -class AbstractQBXCostModel(AbstractFMMCostModel): +class AbstractQBXCostModel(BaseAbstractFMMCostModel): """An interface to obtain both QBX operation counts and calibrated (e.g. in seconds) cost estimates. @@ -503,7 +504,7 @@ class AbstractQBXCostModel(AbstractFMMCostModel): @staticmethod def get_unit_calibration_params(): - calibration_params = AbstractFMMCostModel.get_unit_calibration_params() + calibration_params = super().get_unit_calibration_params() calibration_params.update(dict( c_p2qbxl=1.0, @@ -529,7 +530,7 @@ class AbstractQBXCostModel(AbstractFMMCostModel): stage_to_param_names = self._QBX_STAGE_TO_CALIBRATION_PARAMETER.copy() stage_to_param_names.update(additional_stage_to_param_names) - return AbstractFMMCostModel.estimate_calibration_params( + return super().estimate_calibration_params( self, model_results, timing_results, time_field_name=time_field_name, additional_stage_to_param_names=stage_to_param_names ) -- GitLab From 10aee521754d06adb19d8df6685679e2452ce4b4 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 3 Sep 2020 20:03:23 -0500 Subject: [PATCH 2/3] CL cost model: don't use super() in a static method --- pytential/qbx/cost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytential/qbx/cost.py b/pytential/qbx/cost.py index 547185e5..7867e540 100644 --- a/pytential/qbx/cost.py +++ b/pytential/qbx/cost.py @@ -504,7 +504,7 @@ class AbstractQBXCostModel(BaseAbstractFMMCostModel): @staticmethod def get_unit_calibration_params(): - calibration_params = super().get_unit_calibration_params() + calibration_params = BaseAbstractFMMCostModel.get_unit_calibration_params() calibration_params.update(dict( c_p2qbxl=1.0, -- GitLab From 5515e303a0afcb8fa5598a249f9fe49f62a6ced5 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 3 Sep 2020 22:09:31 -0500 Subject: [PATCH 3/3] Cost model fix: Don't pass self when using super() --- pytential/qbx/cost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytential/qbx/cost.py b/pytential/qbx/cost.py index 7867e540..88cef8e4 100644 --- a/pytential/qbx/cost.py +++ b/pytential/qbx/cost.py @@ -531,7 +531,7 @@ class AbstractQBXCostModel(BaseAbstractFMMCostModel): stage_to_param_names.update(additional_stage_to_param_names) return super().estimate_calibration_params( - self, model_results, timing_results, time_field_name=time_field_name, + model_results, timing_results, time_field_name=time_field_name, additional_stage_to_param_names=stage_to_param_names ) -- GitLab