1111import numpy as np
1212from pydantic import (
1313 BaseModel ,
14+ ConfigDict ,
1415 Discriminator ,
1516 Field ,
1617 Tag ,
@@ -130,13 +131,21 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
130131 inputs required for a reflectivity calculation.
131132 """
132133
134+ model_config = ConfigDict (use_attribute_docstrings = True )
135+
133136 name : str = ""
137+ """The name of the project."""
134138 calculation : Calculations = Calculations .Normal
139+ """What calculation type should be used. Can be 'normal' or 'domains'."""
135140 model : LayerModels = LayerModels .StandardLayers
141+ """What layer model should be used. Can be 'standard layers', 'custom layers', or 'custom xy'."""
136142 geometry : Geometries = Geometries .AirSubstrate
143+ """What geometry should be used. Can be 'air/substrate' or 'substrate/liquid'"""
137144 absorption : bool = False
145+ """Whether imaginary (absorption) SLD should be accounted for."""
138146
139147 parameters : ClassList [RATapi .models .Parameter ] = ClassList ()
148+ """The list of parameters used in the layers of a model."""
140149
141150 bulk_in : ClassList [RATapi .models .Parameter ] = ClassList (
142151 RATapi .models .Parameter (
@@ -150,6 +159,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
150159 sigma = np .inf ,
151160 ),
152161 )
162+ """The parameters for SLD of the entry interfaces of a model."""
153163
154164 bulk_out : ClassList [RATapi .models .Parameter ] = ClassList (
155165 RATapi .models .Parameter (
@@ -163,6 +173,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
163173 sigma = np .inf ,
164174 ),
165175 )
176+ """The parameters for SLD of the exit interfaces of a model."""
166177
167178 scalefactors : ClassList [RATapi .models .Parameter ] = ClassList (
168179 RATapi .models .Parameter (
@@ -176,6 +187,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
176187 sigma = np .inf ,
177188 ),
178189 )
190+ """The parameters for scale factors to handle systematic error in model data."""
179191
180192 domain_ratios : ClassList [RATapi .models .Parameter ] = ClassList (
181193 RATapi .models .Parameter (
@@ -189,6 +201,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
189201 sigma = np .inf ,
190202 ),
191203 )
204+ """The parameters for weighting between domains of a domains model."""
192205
193206 background_parameters : ClassList [RATapi .models .Parameter ] = ClassList (
194207 RATapi .models .Parameter (
@@ -202,10 +215,12 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
202215 sigma = np .inf ,
203216 ),
204217 )
218+ """The parameters for models of backgrounds."""
205219
206220 backgrounds : ClassList [RATapi .models .Background ] = ClassList (
207221 RATapi .models .Background (name = "Background 1" , type = TypeOptions .Constant , source = "Background Param 1" ),
208222 )
223+ """The models for background noise in the project."""
209224
210225 resolution_parameters : ClassList [RATapi .models .Parameter ] = ClassList (
211226 RATapi .models .Parameter (
@@ -219,13 +234,17 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
219234 sigma = np .inf ,
220235 ),
221236 )
237+ """The parameters for models of resolutions."""
222238
223239 resolutions : ClassList [RATapi .models .Resolution ] = ClassList (
224240 RATapi .models .Resolution (name = "Resolution 1" , type = TypeOptions .Constant , source = "Resolution Param 1" ),
225241 )
242+ """The models for instrument resolution in the project."""
226243
227244 custom_files : ClassList [RATapi .models .CustomFile ] = ClassList ()
245+ """Handles for custom files used by the project."""
228246 data : ClassList [RATapi .models .Data ] = ClassList ()
247+ """Arrays of experimental data corresponding to a model."""
229248 layers : Union [
230249 Annotated [ClassList [RATapi .models .Layer ], Tag ("no_abs" )],
231250 Annotated [ClassList [RATapi .models .AbsorptionLayer ], Tag ("abs" )],
@@ -238,7 +257,9 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
238257 custom_error_context = {"discriminator" : "absorption_or_no" },
239258 ),
240259 )
260+ """The layers of a standard layer model."""
241261 domain_contrasts : ClassList [RATapi .models .DomainContrast ] = ClassList ()
262+ """The groups of layers required by each domain in a domains model."""
242263 contrasts : Union [
243264 Annotated [ClassList [RATapi .models .Contrast ], Tag ("no_ratio" )],
244265 Annotated [ClassList [RATapi .models .ContrastWithRatio ], Tag ("ratio" )],
@@ -251,6 +272,7 @@ class Project(BaseModel, validate_assignment=True, extra="forbid"):
251272 custom_error_context = {"discriminator" : "ratio_or_no_ratio" },
252273 ),
253274 )
275+ """All groups of components used to define each model in the project."""
254276
255277 _all_names : dict
256278 _contrast_model_field : str
0 commit comments