Skip to content

Commit

Permalink
Merge branch 'Cookie' of github.com:diffpy/diffpy.srmise into Cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
sbillinge committed Jul 30, 2024
2 parents 166e726 + 30d0909 commit 5249bf2
Show file tree
Hide file tree
Showing 29 changed files with 95 additions and 91 deletions.
26 changes: 2 additions & 24 deletions diffpy/srmise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand All @@ -13,28 +14,5 @@

"""Tools for peak extraction from PDF."""

__all__ = [
"basefunction",
"srmiseerrors",
"srmiselog",
"dataclusters",
"modelcluster",
"modelparts",
"pdfdataset",
"pdfpeakextraction",
"peakextraction",
"peakstability",
"multimodelselection",
]

from basefunction import BaseFunction
from dataclusters import DataClusters
from modelcluster import ModelCluster, ModelCovariance
from modelparts import ModelPart, ModelParts
from multimodelselection import MultimodelSelection
from pdfdataset import PDFDataSet
from pdfpeakextraction import PDFPeakExtraction
from peakextraction import PeakExtraction
from peakstability import PeakStability

from diffpy.srmise.version import __version__
3 changes: 2 additions & 1 deletion diffpy/srmise/applications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/applications/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
4 changes: 3 additions & 1 deletion diffpy/srmise/basefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/baselines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/baselines/arbitrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/baselines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/baselines/fromsequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/baselines/nanospherical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/baselines/polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/dataclusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/modelcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/modelevaluators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/modelevaluators/aic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/modelevaluators/aicc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
26 changes: 12 additions & 14 deletions diffpy/srmise/modelevaluators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down Expand Up @@ -43,9 +44,6 @@

import numpy as np

import diffpy.srmise.srmiselog
from diffpy.srmise.srmiseerrors import SrMiseModelEvaluatorError

logger = logging.getLogger("diffpy.srmise")


Expand All @@ -68,9 +66,9 @@ def __lt__(self, other):
""" """

assert self.method == other.method # Comparison between same types required
assert self.stat != None and other.stat != None # The statistic must already be calculated
assert self.stat is not None and other.stat is not None # The statistic must already be calculated

if self.higher_is_better:
if self.higher_is_better is not None:
return self.stat < other.stat
else:
return other.stat < self.stat
Expand All @@ -79,9 +77,9 @@ def __le__(self, other):
""" """

assert self.method == other.method # Comparison between same types required
assert self.stat != None and other.stat != None # The statistic must already be calculated
assert self.stat is not None and other.stat is not None # The statistic must already be calculated

if self.higher_is_better:
if self.higher_is_better is not None:
return self.stat <= other.stat
else:
return other.stat <= self.stat
Expand All @@ -90,25 +88,25 @@ def __eq__(self, other):
""" """

assert self.method == other.method # Comparison between same types required
assert self.stat != None and other.stat != None # The statistic must already be calculated
assert self.stat is not None and other.stat is not None # The statistic must already be calculated

return self.stat == other.stat

def __ne__(self, other):
""" """

assert self.method == other.method # Comparison between same types required
assert self.stat != None and other.stat != None # The statistic must already be calculated
assert self.stat is not None and other.stat is not None # The statistic must already be calculated

return self.stat != other.stat

def __gt__(self, other):
""" """

assert self.method == other.method # Comparison between same types required
assert self.stat != None and other.stat != None # The statistic must already be calculated
assert self.stat is not None and other.stat is not None # The statistic must already be calculated

if self.higher_is_better:
if self.higher_is_better is not None:
return self.stat > other.stat
else:
return other.stat > self.stat
Expand All @@ -117,9 +115,9 @@ def __ge__(self, other):
""" """

assert self.method == other.method # Comparison between same types required
assert self.stat != None and other.stat != None # The statistic must already be calculated
assert self.stat is not None and other.stat is not None # The statistic must already be calculated

if self.higher_is_better:
if self.higher_is_better is not None:
return self.stat >= other.stat
else:
return other.stat >= self.stat
Expand Down
5 changes: 3 additions & 2 deletions diffpy/srmise/modelparts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down Expand Up @@ -207,7 +208,7 @@ def fit(

return

#### Notes on the fit f
# # Notes on the fit f
# f[0] = solution
# f[1] = Uses the fjac and ipvt optional outputs to construct an estimate of the jacobian around the solution.
# None if a singular matrix encountered (indicates very flat curvature in some direction).
Expand Down
5 changes: 3 additions & 2 deletions diffpy/srmise/multimodelselection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down Expand Up @@ -527,7 +528,7 @@ def plot3dclassprobs(self, **kwds):
verts.append(np.concatenate([[p0], zip(xs, ys), [p1], [p0]]))
zlabels.append(i)

### Define face colors
# Define face colors
fc = np.array([len(self.classes[z]) for z in zlabels])
if class_size is "fraction":
fc = fc / float(len(self.results))
Expand Down
3 changes: 2 additions & 1 deletion diffpy/srmise/pdfpeakextraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
##############################################################################
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University.
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
Loading

0 comments on commit 5249bf2

Please sign in to comment.