Data Model
About the Data Model
The Data Model API is a new feature in the v0.12.0 release of SpectraFit
with major focus on:
- Data Validation
- Settings Management
The Data Model API is a work in progress and is subject to change. It is realized by using the pydantic library.
Data Model API¶
Command Line Interface¶
Reference model for the API of the command line interface.
CMDModelAPI
¶
Bases: BaseModel
Model for the model command line argument.
Source code in spectrafit/api/cmd_model.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
DescriptionAPI
¶
Bases: BaseModel
Model for the description command line argument.
Source code in spectrafit/api/cmd_model.py
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 |
|
Models and Components¶
Reference model for the API of the models distributions.
AmplitudeAPI
¶
Bases: BaseModel
Definition of the amplitude of the models distributions.
Source code in spectrafit/api/models_model.py
15 16 17 18 19 20 21 22 |
|
AtanAPI
¶
Bases: BaseModel
Definition of the Step of the models distributions.
Source code in spectrafit/api/models_model.py
243 244 245 246 247 248 |
|
CGaussianAPI
¶
Bases: BaseModel
Definition of the cumulative Gaussian of the models distributions.
Source code in spectrafit/api/models_model.py
259 260 261 262 263 264 |
|
CLorentzianAPI
¶
Bases: BaseModel
Definition of the cumulative Lorentzian of the models distributions.
Source code in spectrafit/api/models_model.py
267 268 269 270 271 272 |
|
CVoigtAPI
¶
Bases: BaseModel
Definition of the cumulative Voigt of the models distributions.
Source code in spectrafit/api/models_model.py
275 276 277 278 279 280 |
|
CenterAPI
¶
Bases: BaseModel
Definition of the center of the models distributions.
Source code in spectrafit/api/models_model.py
25 26 27 28 29 30 31 32 |
|
ConfIntervalAPI
¶
Bases: BaseModel
Definition of Confidence Interval Function.
Source code in spectrafit/api/models_model.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
ConstantAPI
¶
Bases: BaseModel
Definition of the Constant of the models distributions.
Source code in spectrafit/api/models_model.py
221 222 223 224 |
|
DecayAPI
¶
Bases: BaseModel
Definition of the Decay of the Exponential of the models distributions.
Source code in spectrafit/api/models_model.py
113 114 115 116 117 118 119 120 121 122 |
|
DistributionModelAPI
¶
Bases: BaseModel
Definition of the models distributions.
Source code in spectrafit/api/models_model.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
|
ErfAPI
¶
Bases: BaseModel
Definition of the Step of the models distributions.
Source code in spectrafit/api/models_model.py
227 228 229 230 231 232 |
|
ExponentAPI
¶
Bases: BaseModel
Definition of the Exponent of the Linear of the models distributions.
Source code in spectrafit/api/models_model.py
135 136 137 138 139 140 141 142 |
|
ExponentialAPI
¶
Bases: BaseModel
Definition of the Exponential of the models distributions.
Source code in spectrafit/api/models_model.py
198 199 200 201 202 203 |
|
FwhmgAPI
¶
Bases: BaseModel
Definition of the FWHM Gaussian of the models distributions.
Source code in spectrafit/api/models_model.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
FwhmlAPI
¶
Bases: BaseModel
Definition of the FWHM Lorentzian of the models distributions.
Source code in spectrafit/api/models_model.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
FwhmvAPI
¶
Bases: BaseModel
Definition of the FWHM Voigt of the models distributions.
Source code in spectrafit/api/models_model.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
GammaAPI
¶
Bases: BaseModel
Definition of the Gamma of the Voigt of the models distributions.
Source code in spectrafit/api/models_model.py
103 104 105 106 107 108 109 110 |
|
GaussianAPI
¶
Bases: BaseModel
Definition of the Gaussian of the models distributions.
Source code in spectrafit/api/models_model.py
174 175 176 177 178 179 |
|
HeavisideAPI
¶
Bases: BaseModel
Definition of the Step of the models distributions.
Source code in spectrafit/api/models_model.py
235 236 237 238 239 240 |
|
InterceptAPI
¶
Bases: BaseModel
Definition of the Intercept of the Linear of the models distributions.
Source code in spectrafit/api/models_model.py
125 126 127 128 129 130 131 132 |
|
LinearAPI
¶
Bases: BaseModel
Definition of the Linear of the models distributions.
Source code in spectrafit/api/models_model.py
214 215 216 217 218 |
|
LogAPI
¶
Bases: BaseModel
Definition of the Step of the models distributions.
Source code in spectrafit/api/models_model.py
251 252 253 254 255 256 |
|
LorentzianAPI
¶
Bases: BaseModel
Definition of the Lorentzian of the models distributions.
Source code in spectrafit/api/models_model.py
182 183 184 185 186 187 |
|
PowerAPI
¶
Bases: BaseModel
Definition of the Power of the models distributions.
Source code in spectrafit/api/models_model.py
206 207 208 209 210 211 |
|
PseudovoigtAPI
¶
Bases: BaseModel
Definition of the Pseudovoigt of the models distributions.
Source code in spectrafit/api/models_model.py
165 166 167 168 169 170 171 |
|
SigmaAPI
¶
Bases: BaseModel
Definition of the Sigma of the models distributions.
Source code in spectrafit/api/models_model.py
155 156 157 158 159 160 161 162 |
|
SlopeAPI
¶
Bases: BaseModel
Definition of the Slope of the Linear of the models distributions.
Source code in spectrafit/api/models_model.py
145 146 147 148 149 150 151 152 |
|
VoigtAPI
¶
Bases: BaseModel
Definition of the Voigt of the models distributions.
Source code in spectrafit/api/models_model.py
190 191 192 193 194 195 |
|
Juptyer Notebook¶
Reference model for the API of the Jupyter Notebook interface.
ColorAPI
¶
Bases: BaseModel
Definition of the colors of the plotly figure.
Source code in spectrafit/api/notebook_model.py
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 |
|
transparent_rgb(v)
classmethod
¶
Convert string to transparent RGB color.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
v | str | One of the key-words of the validator decorator. | required |
Returns:
Name | Type | Description |
---|---|---|
str | str | Translate the word |
Source code in spectrafit/api/notebook_model.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
FnameAPI
¶
Bases: BaseModel
Definition of the file name.
Source code in spectrafit/api/notebook_model.py
180 181 182 183 184 185 186 187 188 |
|
FontAPI
¶
Bases: BaseModel
Definition of the used font of the plotly figure.
Source code in spectrafit/api/notebook_model.py
75 76 77 78 79 80 81 82 |
|
GridAPI
¶
Bases: BaseModel
Definition of the grid of the plotly figure.
Source code in spectrafit/api/notebook_model.py
95 96 97 98 99 100 |
|
LegendAPI
¶
Bases: BaseModel
Definition of the legend of the plotly figure.
Source code in spectrafit/api/notebook_model.py
85 86 87 88 89 90 91 92 |
|
MetricAPI
¶
Bases: BaseModel
Definition of the residual plot (Y-Axis) of the plotly figure.
Source code in spectrafit/api/notebook_model.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
PlotAPI
¶
Bases: BaseModel
Definition of the plotly figure.
Source code in spectrafit/api/notebook_model.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|
ResidualAPI
¶
Bases: BaseModel
Definition of the residual plot (Y-Axis) of the plotly figure.
Source code in spectrafit/api/notebook_model.py
38 39 40 41 42 43 44 45 46 |
|
RunAPI
¶
Bases: BaseModel
Definition of the residual plot (Y-Axis) of the plotly figure.
Source code in spectrafit/api/notebook_model.py
66 67 68 69 70 71 72 |
|
XAxisAPI
¶
Bases: BaseModel
Defintion of the X-Axis of the plotly figure.
Source code in spectrafit/api/notebook_model.py
18 19 20 21 22 23 24 |
|
YAxisAPI
¶
Bases: BaseModel
Defintion of the Y-Axis of the plotly figure.
Source code in spectrafit/api/notebook_model.py
27 28 29 30 31 32 33 34 35 |
|
Report Design¶
Reference model for the API of the Jupyter Notebook report.
CreditsAPI
¶
Bases: BaseModel
Credits API model.
Source code in spectrafit/api/report_model.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
FitMethodAPI
¶
Bases: BaseModel
Fit method API model.
Source code in spectrafit/api/report_model.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
InputAPI
¶
Bases: BaseModel
Input API for the report endpoint.
Source code in spectrafit/api/report_model.py
59 60 61 62 63 64 65 66 67 68 69 70 |
|
OutputAPI
¶
Bases: BaseModel
Output API for the report endpoint.
Source code in spectrafit/api/report_model.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
Config
¶
Config for the OutputAPI of arbitary types.
Source code in spectrafit/api/report_model.py
122 123 124 125 |
|
ReportAPI
¶
Bases: BaseModel
Definition of the report model.
Source code in spectrafit/api/report_model.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
SolverAPI
¶
Bases: BaseModel
Solver API for the report endpoint.
Source code in spectrafit/api/report_model.py
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 |
|
Tools and Utilities¶
Reference model for the API of the SpectraFit tools.
AutopeakAPI
¶
Bases: BaseModel
Definition of the auto detection of peak command line argument.
The auto detection of peaks is performed by the SpectraFit tools. Here is listed the set of parameters that are used to control the auto detection of peaks according to the following scipy.signal.find_peaks
-module; source: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html
Source code in spectrafit/api/tools_model.py
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 |
|
Config
¶
Activate the Validation Error Raise.
Source code in spectrafit/api/tools_model.py
36 37 38 39 40 |
|
ColumnNamesAPI
¶
Bases: BaseModel
Definition of the column names of the exported model.
Source code in spectrafit/api/tools_model.py
112 113 114 115 116 117 118 |
|
DataPreProcessingAPI
¶
Bases: BaseModel
Definition of the data preprocessing command line argument.
Source code in spectrafit/api/tools_model.py
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 |
|
GeneralSolverModelsAPI
¶
Bases: BaseModel
Definition of the general solver of SpectraFit.
GeneralSolver
The General Solver combines the settings for lmfit
by adding the global fitting settings.
Source code in spectrafit/api/tools_model.py
98 99 100 101 102 103 104 105 106 107 108 109 |
|
GlobalFittingAPI
¶
Bases: BaseModel
Definition of the global fitting routine.
Source code in spectrafit/api/tools_model.py
79 80 81 82 |
|
SolverModelsAPI
¶
Bases: BaseModel
Definition of the solver of SpectraFit.
Source code in spectrafit/api/tools_model.py
85 86 87 88 89 90 91 92 93 94 95 |
|
File Model API¶
Definition of the data file model.
DataFileAPI
¶
Bases: BaseModel
Definition of a data file.
Source code in spectrafit/api/file_model.py
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 |
|
check_comment(v)
classmethod
¶
Check if the comment marker is valid.
Source code in spectrafit/api/file_model.py
54 55 56 57 58 59 60 |
|
check_delimiter(v)
classmethod
¶
Check if the delimiter is valid.
Source code in spectrafit/api/file_model.py
46 47 48 49 50 51 52 |
|