1111import numpy as np
1212from pydantic import (
1313 BaseModel ,
14+ ConfigDict ,
1415 Discriminator ,
1516 Field ,
1617 Tag ,
@@ -129,14 +130,21 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
129130 This class combines the data defined in each of the pydantic models included in "models.py" into the full set of
130131 inputs required for a reflectivity calculation.
131132 """
133+ model_config = ConfigDict (use_attribute_docstrings = True )
132134
133135 name : str = ""
136+ """The name of the project."""
134137 calculation : Calculations = Calculations .Normal
138+ """What calculation type should be used. Can be 'normal' or 'domains'."""
135139 model : LayerModels = LayerModels .StandardLayers
140+ """What layer model should be used. Can be 'standard layers', 'custom layers', or 'custom xy'."""
136141 geometry : Geometries = Geometries .AirSubstrate
142+ """What geometry should be used. Can be 'air/substrate' or 'substrate/liquid'"""
137143 absorption : bool = False
144+ """Whether imaginary (absorption) SLD should be accounted for."""
138145
139146 parameters : ClassList [RATapi .models .Parameter ] = ClassList ()
147+ """The list of parameters used in the layers of a model."""
140148
141149 bulk_in : ClassList [RATapi .models .Parameter ] = ClassList (
142150 RATapi .models .Parameter (
@@ -150,6 +158,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
150158 sigma = np .inf ,
151159 ),
152160 )
161+ """The parameters for SLD of the entry interfaces of a model."""
153162
154163 bulk_out : ClassList [RATapi .models .Parameter ] = ClassList (
155164 RATapi .models .Parameter (
@@ -163,6 +172,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
163172 sigma = np .inf ,
164173 ),
165174 )
175+ """The parameters for SLD of the exit interfaces of a model."""
166176
167177 scalefactors : ClassList [RATapi .models .Parameter ] = ClassList (
168178 RATapi .models .Parameter (
@@ -176,6 +186,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
176186 sigma = np .inf ,
177187 ),
178188 )
189+ """The parameters for scale factors to handle systematic error in model data."""
179190
180191 domain_ratios : ClassList [RATapi .models .Parameter ] = ClassList (
181192 RATapi .models .Parameter (
@@ -189,6 +200,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
189200 sigma = np .inf ,
190201 ),
191202 )
203+ """The parameters for weighting between domains of a domains model."""
192204
193205 background_parameters : ClassList [RATapi .models .Parameter ] = ClassList (
194206 RATapi .models .Parameter (
@@ -202,10 +214,12 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
202214 sigma = np .inf ,
203215 ),
204216 )
217+ """The parameters for models of backgrounds."""
205218
206219 backgrounds : ClassList [RATapi .models .Background ] = ClassList (
207220 RATapi .models .Background (name = "Background 1" , type = TypeOptions .Constant , source = "Background Param 1" ),
208221 )
222+ """The models for background noise in the project."""
209223
210224 resolution_parameters : ClassList [RATapi .models .Parameter ] = ClassList (
211225 RATapi .models .Parameter (
@@ -219,13 +233,17 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
219233 sigma = np .inf ,
220234 ),
221235 )
236+ """The parameters for models of resolutions."""
222237
223238 resolutions : ClassList [RATapi .models .Resolution ] = ClassList (
224239 RATapi .models .Resolution (name = "Resolution 1" , type = TypeOptions .Constant , source = "Resolution Param 1" ),
225240 )
241+ """The models for instrument resolution in the project."""
226242
227243 custom_files : ClassList [RATapi .models .CustomFile ] = ClassList ()
244+ """Handles for custom files used by the project."""
228245 data : ClassList [RATapi .models .Data ] = ClassList ()
246+ """Arrays of experimental data corresponding to a model."""
229247 layers : Union [
230248 Annotated [ClassList [RATapi .models .Layer ], Tag ("no_abs" )],
231249 Annotated [ClassList [RATapi .models .AbsorptionLayer ], Tag ("abs" )],
@@ -238,7 +256,9 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
238256 custom_error_context = {"discriminator" : "absorption_or_no" },
239257 ),
240258 )
259+ """The layers of a standard layer model."""
241260 domain_contrasts : ClassList [RATapi .models .DomainContrast ] = ClassList ()
261+ """The groups of layers required by each domain in a domains model."""
242262 contrasts : Union [
243263 Annotated [ClassList [RATapi .models .Contrast ], Tag ("no_ratio" )],
244264 Annotated [ClassList [RATapi .models .ContrastWithRatio ], Tag ("ratio" )],
@@ -251,6 +271,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
251271 custom_error_context = {"discriminator" : "ratio_or_no_ratio" },
252272 ),
253273 )
274+ """All groups of components used to define each model in the project."""
254275
255276 _all_names : dict
256277 _contrast_model_field : str
0 commit comments