forked from diffpy/diffpy.srmise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrmiseerrors.py
167 lines (111 loc) · 4.59 KB
/
srmiseerrors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/usr/bin/env python
##############################################################################
#
# SrMise by Luke Granlund
# (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
#
# See LICENSE.txt for license information.
#
##############################################################################
"""Defines all custom exceptions used by diffpy.srmise.
Classes
-------
SrMiseError: Subclass of Exception, and superclass of all diffpy.srmise exceptions.
SrMiseDataFormatError: Error in format of diffpy.srmise data.
SrMiseEstimationError: Parameter estimation error.
SrMiseFileError: Error while reading/writing files.
SrMiseFitError: Error while fitting.
SrMiseLogError: Error while logging.
SrMiseModelEvaluatorError: Error while computing or comparing model quality.
SrMisePDFKeyError: Error in key referencing component of PDF dataset.
SrMiseQmaxError: Error in value of Qmax.
SrMiseScalingError: Error while scaling a peak function.
SrMiseStaticOwnerError: Error when changing ModelPart instance owner.
"""
# Superclass class for diffpy.srmise.mise
class SrMiseError(Exception):
"""Superclass of all diffpy.srmise exceptions."""
def __init__(self, info):
"""initialize
info: description string"""
Exception.__init__(self)
self.info = info
def __str__(self):
return self.info
# SrMiseError subclasses ###
class SrMiseDataFormatError(SrMiseError):
"""diffpy.srmise exception class. Error in formatted data."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseEstimationError(SrMiseError):
"""diffpy.srmise.modelevaluator exception class. Parameter estimation error."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseFileError(SrMiseError):
"""diffpy.srmise exception class. Error while reading/writing files."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseFitError(SrMiseError):
"""diffpy.srmise exception class. Error occurred during fitting."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseLogError(SrMiseError):
"""diffpy.srmise exception class. Error while handling logging capabilities."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseModelEvaluatorError(SrMiseError):
"""diffpy.srmise.modelevaluator exception class. Error when comparing models."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseQmaxError(SrMiseError):
"""diffpy.srmise.modelevaluator exception class. Error when setting qmax."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseScalingError(SrMiseError):
"""diffpy.srmise.peaks exception class. Error when scaling a peak function."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseStaticOwnerError(SrMiseError):
"""diffpy.srmise exception class. Attempt to change owner of static model part."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseTransformationError(SrMiseError):
"""diffpy.srmise exception class. Error transforming model/covariance parameters."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMiseUndefinedCovarianceError(SrMiseError):
"""diffpy.srmise exception class. Attempted to perform on undefined covariance."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)
class SrMisePDFKeyError(SrMiseError):
"""diffpy.srmise exception class. Requested PDF key can't be found."""
def __init__(self, info):
"""initialize
info -- description string"""
SrMiseError.__init__(self, info)