Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix formatting issue and typo in copyright #35

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions diffpy/srmise/basefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#
# SrMise by Luke Granlund
# (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
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
14 changes: 7 additions & 7 deletions diffpy/srmise/baselines/arbitrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down Expand Up @@ -89,11 +89,12 @@ def __init__(self, npars, valuef, jacobianf=None, estimatef=None, Cache=None):

# TODO: figure out how the metadict can be used to save the functions
# and use them again when a file is loaded...
metadict = {}
metadict["npars"] = (npars, repr)
metadict["valuef"] = (valuef, repr)
metadict["jacobianf"] = (jacobianf, repr)
metadict["estimatef"] = (estimatef, repr)
metadict = {
"npars": (npars, repr),
"valuef": (valuef, repr),
"jacobianf": (jacobianf, repr),
"estimatef": (estimatef, repr),
}
BaselineFunction.__init__(self, parameterdict, formats, default_formats, metadict, None, Cache)

# Methods required by BaselineFunction ####
Expand Down Expand Up @@ -182,7 +183,6 @@ def _transform_parametersraw(self, pars, in_format, out_format):
def _valueraw(self, pars, r):
"""Return value of polynomial for the given parameters and r values.

Parameters
Parameters
pars: Sequence of parameters
pars[0] = a_0
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/baselines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/baselines/fromsequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
4 changes: 2 additions & 2 deletions diffpy/srmise/baselines/nanospherical.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down Expand Up @@ -35,7 +35,7 @@ class NanoSpherical(BaselineFunction):
scale factor is 4*pi*rho_0, where rho_r is the nanoparticle density.

gamma_0(r) Reference:
Guinier et. al. (1955). Small-angle Scattering from X-rays. New York: John Wiley & Sons, Inc.
Guinier et al. (1955). Small-angle Scattering from X-rays. New York: John Wiley & Sons, Inc.
"""

def __init__(self, Cache=None):
Expand Down
10 changes: 4 additions & 6 deletions diffpy/srmise/baselines/polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down Expand Up @@ -49,8 +49,7 @@ def __init__(self, degree, Cache=None):
parameterdict["a_" + str(d)] = self.degree - d
formats = ["internal"]
default_formats = {"default_input": "internal", "default_output": "internal"}
metadict = {}
metadict["degree"] = (degree, repr)
metadict = {"degree": (degree, repr)}
BaselineFunction.__init__(self, parameterdict, formats, default_formats, metadict, None, Cache)

# Methods required by BaselineFunction ####
Expand Down Expand Up @@ -95,12 +94,11 @@ def estimate_parameters(self, r, y):

import numpy.linalg as la

A = np.array([r[cut_idx]]).T
slope = la.lstsq(A, y[cut_idx])[0][0]
a = np.array([r[cut_idx]]).T
slope = la.lstsq(a, y[cut_idx])[0][0]
return np.array([slope, 0.0])
except Exception as e:
emsg = "Error during estimation -- " + str(e)
raise
raise SrMiseEstimationError(emsg)

def _jacobianraw(self, pars, r, free):
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/dataclusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/modelcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/modelevaluators/aic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/modelevaluators/aicc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/modelevaluators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/peaks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/peaks/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/peaks/gaussianoverr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
2 changes: 1 addition & 1 deletion diffpy/srmise/peaks/terminationripples.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# SrMise by Luke Granlund
# (c) 2014 trustees of the Michigan State University
# (c) 2024 trustees of Columia University in the City of New York
# (c) 2024 trustees of Columbia University in the City of New York
# All rights reserved.
#
# File coded by: Luke Granlund
Expand Down
Loading