analysis
    
            analysis
    
            Analysis
    High-level orchestration of analysis tasks for a Project.
This class wires calculators and minimizers, exposes a compact interface for parameters, constraints and results, and coordinates computations across the project's sample models and experiments.
Typical usage:
- Display or filter parameters to fit.
 - Select a calculator/minimizer implementation.
 - Calculate patterns and run single or joint fits.
 
project: The parent Project object. aliases: A registry of human-friendly aliases for parameters. constraints: Symbolic constraints between parameters. calculator: Active calculator used for computations. fitter: Active fitter/minimizer driver.
Source code in src/easydiffraction/analysis/analysis.py
                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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580  |  | 
            __init__(project)
    Create a new Analysis instance bound to a project.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                project
             | 
            
               The project that owns models and experiments.  | 
            required | 
Source code in src/easydiffraction/analysis/analysis.py
              51 52 53 54 55 56 57 58 59 60 61 62 63 64  |  | 
            apply_constraints()
    Apply the currently defined constraints to the active project.
Source code in src/easydiffraction/analysis/analysis.py
              501 502 503 504 505 506 507 508 509 510 511  |  | 
            as_cif()
    Serialize the analysis section to a CIF string.
Returns:
| Type | Description | 
|---|---|
| 
               The analysis section represented as a CIF document string.  | 
          
Source code in src/easydiffraction/analysis/analysis.py
              563 564 565 566 567 568 569 570 571  |  | 
            calculate_pattern(expt_name)
    Calculate and store the diffraction pattern for an experiment.
The pattern is stored in the target experiment's datastore.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                expt_name
             | 
            
                  str
             | 
            
               The identifier of the experiment to compute.  | 
            required | 
Source code in src/easydiffraction/analysis/analysis.py
              460 461 462 463 464 465 466 467 468 469 470 471  |  | 
            current_calculator
  
      property
      writable
  
    The key/name of the active calculator backend.
            current_minimizer
  
      property
      writable
  
    The identifier of the active minimizer, if any.
            fit()
    Execute fitting using the selected mode, calculator and minimizer.
In 'single' mode, fits each experiment independently. In
'joint' mode, performs a simultaneous fit across experiments
with weights.
    Sets :attr:fit_results on success.
Source code in src/easydiffraction/analysis/analysis.py
              513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561  |  | 
            fit_mode
  
      property
      writable
  
    Current fitting strategy: either 'single' or 'joint'.
            how_to_access_parameters()
    Show Python access paths for all parameters.
The output explains how to reference specific parameters in code.
Source code in src/easydiffraction/analysis/analysis.py
              210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272  |  | 
            show_all_params()
    Print a table with all parameters for sample models and experiments.
Source code in src/easydiffraction/analysis/analysis.py
              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  |  | 
            show_as_cif()
    Render the analysis section as CIF in a formatted console view.
Source code in src/easydiffraction/analysis/analysis.py
              573 574 575 576 577 578 579 580  |  | 
            show_available_fit_modes()
    Print all supported fitting strategies and their descriptions.
Source code in src/easydiffraction/analysis/analysis.py
              424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453  |  | 
            show_available_minimizers()
  
      staticmethod
  
    Print a table of available minimizer drivers on this system.
Source code in src/easydiffraction/analysis/analysis.py
              370 371 372 373 374 375  |  | 
            show_constraints()
    Print a table of all user-defined symbolic constraints.
Source code in src/easydiffraction/analysis/analysis.py
              473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499  |  | 
            show_current_calculator()
    Print the name of the currently selected calculator engine.
Source code in src/easydiffraction/analysis/analysis.py
              331 332 333 334 335 336  |  | 
            show_current_fit_mode()
    Print the currently active fitting strategy.
Source code in src/easydiffraction/analysis/analysis.py
              455 456 457 458  |  | 
            show_current_minimizer()
    Print the name of the currently selected minimizer.
Source code in src/easydiffraction/analysis/analysis.py
              365 366 367 368  |  | 
            show_fittable_params()
    Print a table with parameters that can be included in fitting.
Source code in src/easydiffraction/analysis/analysis.py
              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 168 169 170 171 172 173 174  |  | 
            show_free_params()
    Print a table with only currently-free (varying) parameters.
Source code in src/easydiffraction/analysis/analysis.py
              176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208  |  | 
            show_parameter_cif_uids()
    Show CIF unique IDs for all parameters.
The output explains which unique identifiers are used when creating CIF-based constraints.
Source code in src/easydiffraction/analysis/analysis.py
              274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329  |  | 
            show_supported_calculators()
  
      staticmethod
  
    Print a table of available calculator backends on this system.
Source code in src/easydiffraction/analysis/analysis.py
              338 339 340 341 342 343  |  | 
            calculation
    
            Calculator
    Invokes calculation engines for pattern generation.
Source code in src/easydiffraction/analysis/calculation.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 61 62 63 64 65 66 67  |  | 
            __init__(engine='cryspy')
    Initialize the diffraction calculator with a specified backend engine.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                engine
             | 
            
                  str
             | 
            
               Type of the calculation engine to use. Supported types: 'crysfml', 'cryspy', 'pdffit'. Default is 'cryspy'.  | 
            
                  'cryspy'
             | 
          
Source code in src/easydiffraction/analysis/calculation.py
              17 18 19 20 21 22 23 24 25 26 27  |  | 
            calculate_pattern(sample_models, experiment)
    Calculate diffraction pattern based on sample models and experiment. The calculated pattern is stored within the experiment's datastore.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                sample_models
             | 
            
                  SampleModels
             | 
            
               Collection of sample models.  | 
            required | 
                experiment
             | 
            
                  ExperimentBase
             | 
            
               A single experiment object.  | 
            required | 
Source code in src/easydiffraction/analysis/calculation.py
              54 55 56 57 58 59 60 61 62 63 64 65 66 67  |  | 
            calculate_structure_factors(sample_models, experiments)
    Calculate HKL intensities (structure factors) for sample models and experiments.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                sample_models
             | 
            
                  SampleModels
             | 
            
               Collection of sample models.  | 
            required | 
                experiments
             | 
            
                  Experiments
             | 
            
               Collection of experiments.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  Optional[List[Any]]
             | 
            
               HKL intensities calculated by the backend calculator.  | 
          
Source code in src/easydiffraction/analysis/calculation.py
              37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52  |  | 
            set_calculator(engine)
    Switch to a different calculator engine at runtime.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                engine
             | 
            
                  str
             | 
            
               New calculation engine type to use.  | 
            required | 
Source code in src/easydiffraction/analysis/calculation.py
              29 30 31 32 33 34 35  |  | 
            calculators
    
            base
    
            CalculatorBase
    
              Bases: ABC
Base API for diffraction calculation engines.
Source code in src/easydiffraction/analysis/calculators/base.py
                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  |  | 
            calculate_pattern(sample_models, experiment, called_by_minimizer=False)
    Calculate the diffraction pattern for multiple sample models and a single experiment. The calculated pattern is stored within the experiment's datastore.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                sample_models
             | 
            
                  SampleModels
             | 
            
               Collection of sample models.  | 
            required | 
                experiment
             | 
            
                  ExperimentBase
             | 
            
               The experiment object.  | 
            required | 
                called_by_minimizer
             | 
            
                  bool
             | 
            
               Whether the calculation is called by a minimizer.  | 
            
                  False
             | 
          
Source code in src/easydiffraction/analysis/calculators/base.py
              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  |  | 
            calculate_structure_factors(sample_model, experiment)
  
      abstractmethod
  
    Calculate structure factors for a single sample model and experiment.
Source code in src/easydiffraction/analysis/calculators/base.py
              30 31 32 33 34 35 36 37 38 39  |  | 
            crysfml
    
            CrysfmlCalculator
    
              Bases: CalculatorBase
Wrapper for Crysfml library.
Source code in src/easydiffraction/analysis/calculators/crysfml.py
                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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212  |  | 
            calculate_structure_factors(sample_models, experiments)
    Call Crysfml to calculate structure factors.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                sample_models
             | 
            
                  SampleModels
             | 
            
               The sample models to calculate structure factors for.  | 
            required | 
                experiments
             | 
            
                  Experiments
             | 
            
               The experiments associated with the sample models.  | 
            required | 
Source code in src/easydiffraction/analysis/calculators/crysfml.py
              39 40 41 42 43 44 45 46 47 48 49 50 51 52  |  | 
            cryspy
    
            CryspyCalculator
    
              Bases: CalculatorBase
Cryspy-based diffraction calculator.
Converts EasyDiffraction models into Cryspy objects and computes patterns.
Source code in src/easydiffraction/analysis/calculators/cryspy.py
                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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415  |  | 
            calculate_structure_factors(sample_model, experiment)
    Raises a NotImplementedError as HKL calculation is not implemented.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                sample_model
             | 
            
                  SampleModelBase
             | 
            
               The sample model to calculate structure factors for.  | 
            required | 
                experiment
             | 
            
                  ExperimentBase
             | 
            
               The experiment associated with the sample models.  | 
            required | 
Source code in src/easydiffraction/analysis/calculators/cryspy.py
              50 51 52 53 54 55 56 57 58 59 60 61 62 63 64  |  | 
            factory
    
            CalculatorFactory
    Factory for creating calculation engine instances.
The factory exposes discovery helpers to list and show available
calculators in the current environment and a creator that returns an
instantiated calculator or None if the requested one is not
available.
Source code in src/easydiffraction/analysis/calculators/factory.py
                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  |  | 
            create_calculator(calculator_name)
  
      classmethod
  
    Create a calculator instance by name.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                calculator_name
             | 
            
                  str
             | 
            
               Identifier of the calculator to create.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  Optional[CalculatorBase]
             | 
            
               A calculator instance or   | 
          
Source code in src/easydiffraction/analysis/calculators/factory.py
              87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105  |  | 
            list_supported_calculators()
  
      classmethod
  
    List names of calculators available in the environment.
Returns:
| Type | Description | 
|---|---|
                  List[str]
             | 
            
               List of calculator identifiers, e.g.   | 
          
Source code in src/easydiffraction/analysis/calculators/factory.py
              61 62 63 64 65 66 67 68  |  | 
            show_supported_calculators()
  
      classmethod
  
    Pretty-print supported calculators and their descriptions.
Source code in src/easydiffraction/analysis/calculators/factory.py
              70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85  |  | 
            pdffit
    PDF calculation backend using diffpy.pdffit2 if available.
The class adapts the engine to EasyDiffraction calculator interface and silences stdio on import to avoid noisy output in notebooks and logs.
            PdffitCalculator
    
              Bases: CalculatorBase
Wrapper for Pdffit library.
Source code in src/easydiffraction/analysis/calculators/pdffit.py
                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  |  | 
            categories
    
            aliases
    Alias category for mapping friendly names to parameter UIDs.
Defines a small record type used by analysis configuration to refer to parameters via readable labels instead of raw unique identifiers.
            Alias
    
              Bases: CategoryItem
Single alias entry.
Maps a human-readable label to a concrete param_uid used by
the engine.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                label
             | 
            
                  str
             | 
            
               Alias label. Must match   | 
            required | 
                param_uid
             | 
            
                  str
             | 
            
               Target parameter uid. Same identifier pattern as
  | 
            required | 
Source code in src/easydiffraction/analysis/categories/aliases.py
                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  |  | 
            label
  
      property
      writable
  
    Alias label descriptor.
            param_uid
  
      property
      writable
  
    Parameter uid descriptor the alias points to.
            Aliases
    
              Bases: CategoryCollection
Collection of :class:Alias items.
Source code in src/easydiffraction/analysis/categories/aliases.py
                101 102 103 104 105 106  |  | 
            __init__()
    Create an empty collection of aliases.
Source code in src/easydiffraction/analysis/categories/aliases.py
              104 105 106  |  | 
            constraints
    Simple symbolic constraint between parameters.
Represents an equation of the form lhs_alias = rhs_expr where
rhs_expr is evaluated elsewhere by the analysis engine.
            Constraint
    
              Bases: CategoryItem
Single constraint item.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                lhs_alias
             | 
            
                  str
             | 
            
               Left-hand side alias name being constrained.  | 
            required | 
                rhs_expr
             | 
            
                  str
             | 
            
               Right-hand side expression as a string.  | 
            required | 
Source code in src/easydiffraction/analysis/categories/constraints.py
                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  |  | 
            lhs_alias
  
      property
      writable
  
    Alias name on the left-hand side of the equation.
            rhs_expr
  
      property
      writable
  
    Right-hand side expression string.
            Constraints
    
              Bases: CategoryCollection
Collection of :class:Constraint items.
Source code in src/easydiffraction/analysis/categories/constraints.py
                97 98 99 100 101 102  |  | 
            __init__()
    Create an empty constraints collection.
Source code in src/easydiffraction/analysis/categories/constraints.py
              100 101 102  |  | 
            joint_fit_experiments
    Joint-fit experiment weighting configuration.
Stores per-experiment weights to be used when multiple experiments are fitted simultaneously.
            JointFitExperiment
    
              Bases: CategoryItem
A single joint-fit entry.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                id
             | 
            
                  str
             | 
            
               Experiment identifier used in the fit session.  | 
            required | 
                weight
             | 
            
                  float
             | 
            
               Relative weight factor in the combined objective.  | 
            required | 
Source code in src/easydiffraction/analysis/categories/joint_fit_experiments.py
                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  |  | 
            id
  
      property
      writable
  
    Experiment identifier descriptor.
            weight
  
      property
      writable
  
    Weight factor descriptor.
            JointFitExperiments
    
              Bases: CategoryCollection
Collection of :class:JointFitExperiment items.
Source code in src/easydiffraction/analysis/categories/joint_fit_experiments.py
                99 100 101 102 103 104  |  | 
            __init__()
    Create an empty joint-fit experiments collection.
Source code in src/easydiffraction/analysis/categories/joint_fit_experiments.py
              102 103 104  |  | 
            fit_helpers
    
            metrics
    
            calculate_r_factor(y_obs, y_calc)
    Calculate the R-factor (reliability factor) between observed and calculated data.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                y_obs
             | 
            
                  ndarray
             | 
            
               Observed data points.  | 
            required | 
                y_calc
             | 
            
                  ndarray
             | 
            
               Calculated data points.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  float
             | 
            
               R-factor value.  | 
          
Source code in src/easydiffraction/analysis/fit_helpers/metrics.py
              14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32  |  | 
            calculate_r_factor_squared(y_obs, y_calc)
    Calculate the R-factor squared between observed and calculated data.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                y_obs
             | 
            
                  ndarray
             | 
            
               Observed data points.  | 
            required | 
                y_calc
             | 
            
                  ndarray
             | 
            
               Calculated data points.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  float
             | 
            
               R-factor squared value.  | 
          
Source code in src/easydiffraction/analysis/fit_helpers/metrics.py
              80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98  |  | 
            calculate_rb_factor(y_obs, y_calc)
    Calculate the Bragg R-factor between observed and calculated data.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                y_obs
             | 
            
                  ndarray
             | 
            
               Observed data points.  | 
            required | 
                y_calc
             | 
            
                  ndarray
             | 
            
               Calculated data points.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  float
             | 
            
               Bragg R-factor value.  | 
          
Source code in src/easydiffraction/analysis/fit_helpers/metrics.py
              59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77  |  | 
            calculate_reduced_chi_square(residuals, num_parameters)
    Calculate the reduced chi-square statistic.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                residuals
             | 
            
                  ndarray
             | 
            
               Residuals between observed and calculated data.  | 
            required | 
                num_parameters
             | 
            
                  int
             | 
            
               Number of free parameters used in the model.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  float
             | 
            
               Reduced chi-square value.  | 
          
Source code in src/easydiffraction/analysis/fit_helpers/metrics.py
              101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121  |  | 
            calculate_weighted_r_factor(y_obs, y_calc, weights)
    Calculate the weighted R-factor between observed and calculated data.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                y_obs
             | 
            
                  ndarray
             | 
            
               Observed data points.  | 
            required | 
                y_calc
             | 
            
                  ndarray
             | 
            
               Calculated data points.  | 
            required | 
                weights
             | 
            
                  ndarray
             | 
            
               Weights for each data point.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  float
             | 
            
               Weighted R-factor value.  | 
          
Source code in src/easydiffraction/analysis/fit_helpers/metrics.py
              35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56  |  | 
            get_reliability_inputs(sample_models, experiments, calculator)
    Collect observed and calculated data points for reliability calculations.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                sample_models
             | 
            
                  SampleModels
             | 
            
               Collection of sample models.  | 
            required | 
                experiments
             | 
            
                  Experiments
             | 
            
               Collection of experiments.  | 
            required | 
                calculator
             | 
            
                  CalculatorBase
             | 
            
               The calculator to use for pattern generation.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  Tuple[ndarray, ndarray, Optional[ndarray]]
             | 
            
               Tuple containing arrays of (observed values, calculated values, error values)  | 
          
Source code in src/easydiffraction/analysis/fit_helpers/metrics.py
              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  |  | 
            reporting
    
            FitResults
    Container for results of a single optimization run.
Holds success flag, chi-square metrics, iteration counts, timing, and parameter objects. Provides a printer to summarize key indicators and a table of fitted parameters.
Source code in src/easydiffraction/analysis/fit_helpers/reporting.py
                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 168 169 170 171 172 173 174 175 176 177 178  |  | 
            __init__(success=False, parameters=None, chi_square=None, reduced_chi_square=None, message='', iterations=0, engine_result=None, starting_parameters=None, fitting_time=None, **kwargs)
    Initialize FitResults with the given parameters.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                success
             | 
            
                  bool
             | 
            
               Indicates if the fit was successful.  | 
            
                  False
             | 
          
                parameters
             | 
            
                  Optional[List[Any]]
             | 
            
               List of parameters used in the fit.  | 
            
                  None
             | 
          
                chi_square
             | 
            
                  Optional[float]
             | 
            
               Chi-square value of the fit.  | 
            
                  None
             | 
          
                reduced_chi_square
             | 
            
                  Optional[float]
             | 
            
               Reduced chi-square value of the fit.  | 
            
                  None
             | 
          
                message
             | 
            
                  str
             | 
            
               Message related to the fit.  | 
            
                  ''
             | 
          
                iterations
             | 
            
                  int
             | 
            
               Number of iterations performed.  | 
            
                  0
             | 
          
                engine_result
             | 
            
                  Optional[Any]
             | 
            
               Result from the fitting engine.  | 
            
                  None
             | 
          
                starting_parameters
             | 
            
                  Optional[List[Any]]
             | 
            
               Initial parameters for the fit.  | 
            
                  None
             | 
          
                fitting_time
             | 
            
                  Optional[float]
             | 
            
               Time taken for the fitting process.  | 
            
                  None
             | 
          
                **kwargs
             | 
            
                  Any
             | 
            
               Additional engine-specific fields. If   | 
            
                  {}
             | 
          
Source code in src/easydiffraction/analysis/fit_helpers/reporting.py
              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  |  | 
            display_results(y_obs=None, y_calc=None, y_err=None, f_obs=None, f_calc=None)
    Render a human-readable summary of the fit.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                y_obs
             | 
            
                  Optional[List[float]]
             | 
            
               Observed intensities for pattern R-factor metrics.  | 
            
                  None
             | 
          
                y_calc
             | 
            
                  Optional[List[float]]
             | 
            
               Calculated intensities for pattern R-factor metrics.  | 
            
                  None
             | 
          
                y_err
             | 
            
                  Optional[List[float]]
             | 
            
               Standard deviations of observed intensities for wR.  | 
            
                  None
             | 
          
                f_obs
             | 
            
                  Optional[List[float]]
             | 
            
               Observed structure-factor magnitudes for Bragg R.  | 
            
                  None
             | 
          
                f_calc
             | 
            
                  Optional[List[float]]
             | 
            
               Calculated structure-factor magnitudes for Bragg R.  | 
            
                  None
             | 
          
Source code in src/easydiffraction/analysis/fit_helpers/reporting.py
              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 168 169 170 171 172 173 174 175 176 177 178  |  | 
            tracking
    
            FitProgressTracker
    Track and report reduced chi-square during optimization.
The tracker keeps iteration counters, remembers the best observed reduced chi-square and when it occurred, and can display progress as a table in notebooks or a text UI in terminals.
Source code in src/easydiffraction/analysis/fit_helpers/tracking.py
                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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259  |  | 
            add_tracking_info(row)
    Append a formatted row to the progress display.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                row
             | 
            
                  List[str]
             | 
            
               Columns corresponding to DEFAULT_HEADERS.  | 
            required | 
Source code in src/easydiffraction/analysis/fit_helpers/tracking.py
              223 224 225 226 227 228 229 230 231 232 233 234 235 236 237  |  | 
            best_chi2
  
      property
  
    Best recorded reduced chi-square value or None.
            best_iteration
  
      property
  
    Iteration index at which the best chi-square was observed.
            finish_tracking()
    Finalize progress display and print best result summary.
Source code in src/easydiffraction/analysis/fit_helpers/tracking.py
              239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259  |  | 
            fitting_time
  
      property
  
    Elapsed time of the last run in seconds, if available.
            iteration
  
      property
  
    Current iteration counter.
            reset()
    Reset internal state before a new optimization run.
Source code in src/easydiffraction/analysis/fit_helpers/tracking.py
              100 101 102 103 104 105 106 107 108  |  | 
            start_timer()
    Begin timing of a fit run.
Source code in src/easydiffraction/analysis/fit_helpers/tracking.py
              193 194 195  |  | 
            start_tracking(minimizer_name)
    Initialize display and headers and announce the minimizer.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                minimizer_name
             | 
            
                  str
             | 
            
               Name of the minimizer used for the run.  | 
            required | 
Source code in src/easydiffraction/analysis/fit_helpers/tracking.py
              202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221  |  | 
            stop_timer()
    Stop timing and store elapsed time for the run.
Source code in src/easydiffraction/analysis/fit_helpers/tracking.py
              197 198 199 200  |  | 
            track(residuals, parameters)
    Update progress with current residuals and parameters.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                residuals
             | 
            
                  ndarray
             | 
            
               Residuals between measured and calculated data.  | 
            required | 
                parameters
             | 
            
                  List[float]
             | 
            
               Current free parameters being fitted.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  ndarray
             | 
            
               Residuals unchanged, for optimizer consumption.  | 
          
Source code in src/easydiffraction/analysis/fit_helpers/tracking.py
              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 168 169 170 171  |  | 
            fitting
    
            Fitter
    Handles the fitting workflow using a pluggable minimizer.
Source code in src/easydiffraction/analysis/fitting.py
                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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186  |  | 
            fit(sample_models, experiments, calculator, weights=None)
    Run the fitting process.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                sample_models
             | 
            
                  SampleModels
             | 
            
               Collection of sample models.  | 
            required | 
                experiments
             | 
            
                  Experiments
             | 
            
               Collection of experiments.  | 
            required | 
                calculator
             | 
            
                  Any
             | 
            
               The calculator to use for pattern generation.  | 
            required | 
                weights
             | 
            
                  Optional[array]
             | 
            
               Optional weights for joint fitting.  | 
            
                  None
             | 
          
Source code in src/easydiffraction/analysis/fitting.py
              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  |  | 
            minimizers
    
            base
    
            MinimizerBase
    
              Bases: ABC
Abstract base for concrete minimizers.
Contract:
- Subclasses must implement _prepare_solver_args,
    _run_solver, _sync_result_to_parameters and
    _check_success.
- The fit method orchestrates the full workflow and returns
    :class:FitResults.
Source code in src/easydiffraction/analysis/minimizers/base.py
                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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185  |  | 
            fit(parameters, objective_function)
    Run the full minimization workflow.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                parameters
             | 
            
                  List[Any]
             | 
            
               Free parameters to optimize.  | 
            required | 
                objective_function
             | 
            
                  Callable[..., Any]
             | 
            
               Callable returning residuals for a given set of engine arguments.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  FitResults
             | 
            
               FitResults with success flag, best chi2 and timing.  | 
          
Source code in src/easydiffraction/analysis/minimizers/base.py
              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  |  | 
            dfols
    
            DfolsMinimizer
    
              Bases: MinimizerBase
Minimizer using the DFO-LS package (Derivative-Free Optimization for Least-Squares).
Source code in src/easydiffraction/analysis/minimizers/dfols.py
                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  |  | 
            factory
    
            MinimizerFactory
    Source code in src/easydiffraction/analysis/minimizers/factory.py
                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  |  | 
            create_minimizer(selection)
  
      classmethod
  
    Create a minimizer instance based on the selection.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                selection
             | 
            
                  str
             | 
            
               The name of the minimizer to create.  | 
            required | 
Returns:
| Type | Description | 
|---|---|
                  MinimizerBase
             | 
            
               An instance of the selected minimizer.  | 
          
Raises:
| Type | Description | 
|---|---|
                  ValueError
             | 
            
               If the selection is not a valid minimizer.  | 
          
Source code in src/easydiffraction/analysis/minimizers/factory.py
              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  |  | 
            list_available_minimizers()
  
      classmethod
  
    List all available minimizers.
Returns:
| Type | Description | 
|---|---|
                  List[str]
             | 
            
               A list of minimizer names.  | 
          
Source code in src/easydiffraction/analysis/minimizers/factory.py
              46 47 48 49 50 51 52 53  |  | 
            register_minimizer(name, minimizer_cls, method=None, description='No description provided.')
  
      classmethod
  
    Register a new minimizer.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                name
             | 
            
                  str
             | 
            
               The name of the minimizer.  | 
            required | 
                minimizer_cls
             | 
            
                  Type[MinimizerBase]
             | 
            
               The class of the minimizer.  | 
            required | 
                method
             | 
            
                  Optional[str]
             | 
            
               The method used by the minimizer (optional).  | 
            
                  None
             | 
          
                description
             | 
            
                  str
             | 
            
               A description of the minimizer.  | 
            
                  'No description provided.'
             | 
          
Source code in src/easydiffraction/analysis/minimizers/factory.py
              105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126  |  | 
            show_available_minimizers()
  
      classmethod
  
    Display a table of available minimizers and their descriptions.
Source code in src/easydiffraction/analysis/minimizers/factory.py
              55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75  |  | 
            lmfit
    
            LmfitMinimizer
    
              Bases: MinimizerBase
Minimizer using the lmfit package.
Source code in src/easydiffraction/analysis/minimizers/lmfit.py
                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  |  |