From 578a972a3ada4206dcc92680cf9598ba7f6a4557 Mon Sep 17 00:00:00 2001 From: Rundong Hua <157993340+stevenhua0320@users.noreply.github.com> Date: Fri, 16 Aug 2024 21:27:09 +0800 Subject: [PATCH] fix import and counting to make it work (#74) --- src/diffpy/srmise/modelcluster.py | 4 ++-- src/diffpy/srmise/modelparts.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/diffpy/srmise/modelcluster.py b/src/diffpy/srmise/modelcluster.py index cc509c4..668612e 100644 --- a/src/diffpy/srmise/modelcluster.py +++ b/src/diffpy/srmise/modelcluster.py @@ -1408,8 +1408,8 @@ def prune(self): if __name__ == "__main__": from numpy.random import randn - from diffpy.srmise.modelevaluators import AICc - from diffpy.srmise.peaks import GaussianOverR + from diffpy.srmise.modelevaluators.aicc import AICc + from diffpy.srmise.peaks.gaussianoverr import GaussianOverR pf = GaussianOverR(0.7) res = 0.01 diff --git a/src/diffpy/srmise/modelparts.py b/src/diffpy/srmise/modelparts.py index 1c6f2cf..f8f0fbc 100644 --- a/src/diffpy/srmise/modelparts.py +++ b/src/diffpy/srmise/modelparts.py @@ -558,7 +558,7 @@ def npars(self, count_fixed=True): if count_fixed: return self._owner.npars else: - return (self.free is True).sum() + return np.sum(self.free) def __str__(self): """Return string representation of ModelPart parameters."""