Skip to content

experiment

Modules:

Name Description
categories
collection

Collection of experiment data blocks.

item

Modules

categories

Modules:

Name Description
background
calculator

Experiment calculator category exports.

data
diffrn
excluded_regions
experiment_type
extinction
instrument
linked_crystal
linked_phases
peak
refln

Modules

background

Modules:

Name Description
base
chebyshev

Chebyshev polynomial background model.

enums

Enumerations for background model types.

factory

Background factory — delegates entirely to FactoryBase.

line_segment

Line-segment background model.

Classes
Modules
base

Classes:

Name Description
BackgroundBase

Abstract base for background subcategories in experiments.

Classes
BackgroundBase(item_type)

Abstract base for background subcategories in experiments.

Concrete implementations provide parameterized background models and compute background intensities on the experiment grid.

Methods:

Name Description
show

Print a human-readable view of background components.

show_supported

Print supported types and mark the active one.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
type str

Active factory tag for this category.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
type property writable

Active factory tag for this category.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
show() abstractmethod

Print a human-readable view of background components.

show_supported()

Print supported types and mark the active one.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
chebyshev

Chebyshev polynomial background model.

Provides a collection of polynomial terms and evaluation helpers.

Classes:

Name Description
PolynomialTerm

Chebyshev polynomial term.

ChebyshevPolynomialBackground

Chebyshev polynomial background model.

Classes
PolynomialTerm()

Chebyshev polynomial term.

New public attribute names: order and coef replacing the longer chebyshev_order / chebyshev_coef. Backward-compatible aliases are kept so existing serialized data / external code does not break immediately. Tests should migrate to the short names.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
id StringDescriptor

Identifier for this background polynomial term.

order NumericDescriptor

Order used in a Chebyshev polynomial background term.

coef Parameter

Coefficient used in a Chebyshev polynomial background term.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
id property writable

Identifier for this background polynomial term.

Reading this property returns the underlying StringDescriptor object. Assigning to it updates the parameter value.

order property writable

Order used in a Chebyshev polynomial background term.

Reading this property returns the underlying NumericDescriptor object. Assigning to it updates the parameter value.

coef property writable

Coefficient used in a Chebyshev polynomial background term.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

ChebyshevPolynomialBackground()

Chebyshev polynomial background model.

Methods:

Name Description
show

Print a table of polynomial orders and coefficients.

show_supported

Print supported types and mark the active one.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
type str

Active factory tag for this category.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
type property writable

Active factory tag for this category.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
show()

Print a table of polynomial orders and coefficients.

show_supported()

Print supported types and mark the active one.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
Functions
enums

Enumerations for background model types.

Classes:

Name Description
BackgroundTypeEnum

Supported background model types.

Classes
BackgroundTypeEnum

Supported background model types.

Methods:

Name Description
default

Return a default background type.

description

Human-friendly description for the enum value.

Functions
default() classmethod

Return a default background type.

description()

Human-friendly description for the enum value.

factory

Background factory — delegates entirely to FactoryBase.

Classes:

Name Description
BackgroundFactory

Create background collections by tag.

Classes
BackgroundFactory

Create background collections by tag.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
line_segment

Line-segment background model.

Interpolate user-specified points to form a background curve.

Classes:

Name Description
LineSegment

Single background control point for interpolation.

LineSegmentBackground

Linear-interpolation background between user-defined points.

Classes
LineSegment()

Single background control point for interpolation.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
id StringDescriptor

Identifier for this background line segment.

x NumericDescriptor

X-coordinates used to create many straight-line segments.

y Parameter

Intensity used to create many straight-line segments.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
id property writable

Identifier for this background line segment.

Reading this property returns the underlying StringDescriptor object. Assigning to it updates the parameter value.

x property writable

X-coordinates used to create many straight-line segments.

Reading this property returns the underlying NumericDescriptor object. Assigning to it updates the parameter value.

y property writable

Intensity used to create many straight-line segments.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

LineSegmentBackground()

Linear-interpolation background between user-defined points.

Methods:

Name Description
show

Print a table of control points (x, intensity).

show_supported

Print supported types and mark the active one.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
type str

Active factory tag for this category.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
type property writable

Active factory tag for this category.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
show()

Print a table of control points (x, intensity).

show_supported()

Print supported types and mark the active one.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
Functions
calculator

Experiment calculator category exports.

Modules:

Name Description
default

Experiment calculator category.

factory

Factory for experiment calculator categories.

Classes
Modules
default

Experiment calculator category.

Classes:

Name Description
Calculator

Calculator selection and access for an experiment.

Classes
Calculator(*, type)

Calculator selection and access for an experiment.

Methods:

Name Description
from_cif

Populate this calculator category from a CIF block.

show_supported

Print supported types and mark the active one.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

Attributes:

Name Type Description
calculator object | None

Live calculator backend instance.

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
calculator property

Live calculator backend instance.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
from_cif(block, idx=0)

Populate this calculator category from a CIF block.

show_supported()

Print supported types and mark the active one.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

Functions
factory

Factory for experiment calculator categories.

Classes:

Name Description
CalculatorCategoryFactory

Create experiment calculator category instances.

Classes
CalculatorCategoryFactory

Create experiment calculator category instances.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
data

Modules:

Name Description
bragg_pd
factory

Data collection factory — delegates to FactoryBase.

total_pd

Data categories for total scattering (PDF) experiments.

Classes
Modules
bragg_pd

Classes:

Name Description
PdDataPointBaseMixin

Single base data point mixin for powder diffraction data.

PdCwlDataPointMixin

Mixin for CWL powder diffraction data points.

PdTofDataPointMixin

Mixin for powder diffraction data points with time-of-flight.

PdCwlDataPoint

Powder diffraction data point for CWL experiments.

PdTofDataPoint

Powder diffraction data point for time-of-flight experiments.

PdDataBase

Base class for powder diffraction data collections.

PdCwlData

Bragg powder CWL data collection.

PdTofData

Bragg powder TOF data collection.

Classes
PdDataPointBaseMixin()

Single base data point mixin for powder diffraction data.

Attributes:

Name Type Description
point_id StringDescriptor

Identifier for this data point in the dataset.

d_spacing NumericDescriptor

d-spacing value corresponding to this data point.

intensity_meas NumericDescriptor

Intensity recorded at each measurement point (angle/time).

intensity_meas_su NumericDescriptor

Standard uncertainty of the measured intensity at this point.

intensity_calc NumericDescriptor

Intensity of a computed diffractogram at this point.

intensity_bkg NumericDescriptor

Intensity of a computed background at this point.

calc_status StringDescriptor

Status code of the data point in the calculation process.

Attributes
point_id property

Identifier for this data point in the dataset.

Reading this property returns the underlying StringDescriptor object.

d_spacing property

d-spacing value corresponding to this data point.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas property

Intensity recorded at each measurement point (angle/time).

Reading this property returns the underlying NumericDescriptor object.

intensity_meas_su property

Standard uncertainty of the measured intensity at this point.

Reading this property returns the underlying NumericDescriptor object.

intensity_calc property

Intensity of a computed diffractogram at this point.

Reading this property returns the underlying NumericDescriptor object.

intensity_bkg property

Intensity of a computed background at this point.

Reading this property returns the underlying NumericDescriptor object.

calc_status property

Status code of the data point in the calculation process.

Reading this property returns the underlying StringDescriptor object.

PdCwlDataPointMixin()

Mixin for CWL powder diffraction data points.

Attributes:

Name Type Description
two_theta NumericDescriptor

Measured 2θ diffraction angle (deg).

Attributes
two_theta property

Measured 2θ diffraction angle (deg).

Reading this property returns the underlying NumericDescriptor object.

PdTofDataPointMixin()

Mixin for powder diffraction data points with time-of-flight.

Attributes:

Name Type Description
time_of_flight NumericDescriptor

Measured time for time-of-flight neutron measurement (μs).

Attributes
time_of_flight property

Measured time for time-of-flight neutron measurement (μs).

Reading this property returns the underlying NumericDescriptor object.

PdCwlDataPoint()

Powder diffraction data point for CWL experiments.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

two_theta NumericDescriptor

Measured 2θ diffraction angle (deg).

point_id StringDescriptor

Identifier for this data point in the dataset.

d_spacing NumericDescriptor

d-spacing value corresponding to this data point.

intensity_meas NumericDescriptor

Intensity recorded at each measurement point (angle/time).

intensity_meas_su NumericDescriptor

Standard uncertainty of the measured intensity at this point.

intensity_calc NumericDescriptor

Intensity of a computed diffractogram at this point.

intensity_bkg NumericDescriptor

Intensity of a computed background at this point.

calc_status StringDescriptor

Status code of the data point in the calculation process.

Attributes
unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

two_theta property

Measured 2θ diffraction angle (deg).

Reading this property returns the underlying NumericDescriptor object.

point_id property

Identifier for this data point in the dataset.

Reading this property returns the underlying StringDescriptor object.

d_spacing property

d-spacing value corresponding to this data point.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas property

Intensity recorded at each measurement point (angle/time).

Reading this property returns the underlying NumericDescriptor object.

intensity_meas_su property

Standard uncertainty of the measured intensity at this point.

Reading this property returns the underlying NumericDescriptor object.

intensity_calc property

Intensity of a computed diffractogram at this point.

Reading this property returns the underlying NumericDescriptor object.

intensity_bkg property

Intensity of a computed background at this point.

Reading this property returns the underlying NumericDescriptor object.

calc_status property

Status code of the data point in the calculation process.

Reading this property returns the underlying StringDescriptor object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

PdTofDataPoint()

Powder diffraction data point for time-of-flight experiments.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

time_of_flight NumericDescriptor

Measured time for time-of-flight neutron measurement (μs).

point_id StringDescriptor

Identifier for this data point in the dataset.

d_spacing NumericDescriptor

d-spacing value corresponding to this data point.

intensity_meas NumericDescriptor

Intensity recorded at each measurement point (angle/time).

intensity_meas_su NumericDescriptor

Standard uncertainty of the measured intensity at this point.

intensity_calc NumericDescriptor

Intensity of a computed diffractogram at this point.

intensity_bkg NumericDescriptor

Intensity of a computed background at this point.

calc_status StringDescriptor

Status code of the data point in the calculation process.

Attributes
unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

time_of_flight property

Measured time for time-of-flight neutron measurement (μs).

Reading this property returns the underlying NumericDescriptor object.

point_id property

Identifier for this data point in the dataset.

Reading this property returns the underlying StringDescriptor object.

d_spacing property

d-spacing value corresponding to this data point.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas property

Intensity recorded at each measurement point (angle/time).

Reading this property returns the underlying NumericDescriptor object.

intensity_meas_su property

Standard uncertainty of the measured intensity at this point.

Reading this property returns the underlying NumericDescriptor object.

intensity_calc property

Intensity of a computed diffractogram at this point.

Reading this property returns the underlying NumericDescriptor object.

intensity_bkg property

Intensity of a computed background at this point.

Reading this property returns the underlying NumericDescriptor object.

calc_status property

Status code of the data point in the calculation process.

Reading this property returns the underlying StringDescriptor object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

PdDataBase(item_type)

Base class for powder diffraction data collections.

Methods:

Name Description
fit_data_arrays

Return arrays needed to draw the fit-data chart.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
calc_status np.ndarray

Refinement-status flags for each data point as an array.

d_spacing np.ndarray

D-spacing values for active (non-excluded) data points.

intensity_meas np.ndarray

Measured intensities for active data points.

intensity_meas_su np.ndarray

Standard uncertainties of the measured intensities.

intensity_calc np.ndarray

Calculated intensities for active data points.

intensity_bkg np.ndarray

Background intensities for active data points.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
calc_status property

Refinement-status flags for each data point as an array.

d_spacing property

D-spacing values for active (non-excluded) data points.

intensity_meas property

Measured intensities for active data points.

intensity_meas_su property

Standard uncertainties of the measured intensities.

Values smaller than 0.0001 are replaced with 1.0 to prevent fitting failures.

intensity_calc property

Calculated intensities for active data points.

intensity_bkg property

Background intensities for active data points.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
fit_data_arrays()

Return arrays needed to draw the fit-data chart.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
PdCwlData()

Bragg powder CWL data collection.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

fit_data_arrays

Return arrays needed to draw the fit-data chart.

Attributes:

Name Type Description
two_theta np.ndarray

Get 2θ values for data points included in calculations.

x_descriptor NumericDescriptor

Descriptor that owns the 2θ x-axis metadata.

x np.ndarray

Alias for two_theta.

unfiltered_x np.ndarray

Get the 2θ values for all data points in this collection.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

calc_status np.ndarray

Refinement-status flags for each data point as an array.

d_spacing np.ndarray

D-spacing values for active (non-excluded) data points.

intensity_meas np.ndarray

Measured intensities for active data points.

intensity_meas_su np.ndarray

Standard uncertainties of the measured intensities.

intensity_calc np.ndarray

Calculated intensities for active data points.

intensity_bkg np.ndarray

Background intensities for active data points.

Attributes
two_theta property

Get 2θ values for data points included in calculations.

x_descriptor property

Descriptor that owns the 2θ x-axis metadata.

x property

Alias for two_theta.

unfiltered_x property

Get the 2θ values for all data points in this collection.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

calc_status property

Refinement-status flags for each data point as an array.

d_spacing property

D-spacing values for active (non-excluded) data points.

intensity_meas property

Measured intensities for active data points.

intensity_meas_su property

Standard uncertainties of the measured intensities.

Values smaller than 0.0001 are replaced with 1.0 to prevent fitting failures.

intensity_calc property

Calculated intensities for active data points.

intensity_bkg property

Background intensities for active data points.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
fit_data_arrays()

Return arrays needed to draw the fit-data chart.

PdTofData()

Bragg powder TOF data collection.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

fit_data_arrays

Return arrays needed to draw the fit-data chart.

Attributes:

Name Type Description
time_of_flight np.ndarray

Get TOF values for data points included in calculations.

x_descriptor NumericDescriptor

Descriptor that owns the TOF x-axis metadata.

x np.ndarray

Alias for time_of_flight.

unfiltered_x np.ndarray

Get the TOF values for all data points in this collection.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

calc_status np.ndarray

Refinement-status flags for each data point as an array.

d_spacing np.ndarray

D-spacing values for active (non-excluded) data points.

intensity_meas np.ndarray

Measured intensities for active data points.

intensity_meas_su np.ndarray

Standard uncertainties of the measured intensities.

intensity_calc np.ndarray

Calculated intensities for active data points.

intensity_bkg np.ndarray

Background intensities for active data points.

Attributes
time_of_flight property

Get TOF values for data points included in calculations.

x_descriptor property

Descriptor that owns the TOF x-axis metadata.

x property

Alias for time_of_flight.

unfiltered_x property

Get the TOF values for all data points in this collection.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

calc_status property

Refinement-status flags for each data point as an array.

d_spacing property

D-spacing values for active (non-excluded) data points.

intensity_meas property

Measured intensities for active data points.

intensity_meas_su property

Standard uncertainties of the measured intensities.

Values smaller than 0.0001 are replaced with 1.0 to prevent fitting failures.

intensity_calc property

Calculated intensities for active data points.

intensity_bkg property

Background intensities for active data points.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
fit_data_arrays()

Return arrays needed to draw the fit-data chart.

Functions
factory

Data collection factory — delegates to FactoryBase.

Classes:

Name Description
DataFactory

Factory for creating diffraction data collections.

Classes
DataFactory

Factory for creating diffraction data collections.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
total_pd

Data categories for total scattering (PDF) experiments.

Classes:

Name Description
TotalDataPoint

Total scattering (PDF) data point in r-space (real space).

TotalDataBase

Base class for total scattering data collections.

TotalData

Total scattering (PDF) data collection in r-space.

Classes
TotalDataPoint()

Total scattering (PDF) data point in r-space (real space).

Note: PDF data is always in r-space regardless of whether the original measurement was CWL or TOF.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
point_id StringDescriptor

Identifier for this data point in the dataset.

r NumericDescriptor

Interatomic distance in real space (Å).

g_r_meas NumericDescriptor

Measured pair distribution function G(r).

g_r_meas_su NumericDescriptor

Standard uncertainty of measured G(r).

g_r_calc NumericDescriptor

Calculated pair distribution function G(r).

calc_status StringDescriptor

Status code of the data point in calculation.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
point_id property

Identifier for this data point in the dataset.

Reading this property returns the underlying StringDescriptor object.

r property

Interatomic distance in real space (Å).

Reading this property returns the underlying NumericDescriptor object.

g_r_meas property

Measured pair distribution function G(r).

Reading this property returns the underlying NumericDescriptor object.

g_r_meas_su property

Standard uncertainty of measured G(r).

Reading this property returns the underlying NumericDescriptor object.

g_r_calc property

Calculated pair distribution function G(r).

Reading this property returns the underlying NumericDescriptor object.

calc_status property

Status code of the data point in calculation.

Reading this property returns the underlying StringDescriptor object.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

TotalDataBase(item_type)

Base class for total scattering data collections.

Methods:

Name Description
fit_data_arrays

Return arrays needed to draw the fit-data chart.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
calc_status np.ndarray

Refinement-status flags for each data point as an array.

intensity_meas np.ndarray

Measured G(r) values for active data points.

intensity_meas_su np.ndarray

Standard uncertainties of the measured G(r) values.

intensity_calc np.ndarray

Calculated G(r) values for active data points.

intensity_bkg np.ndarray

Background is always zero for PDF data.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
calc_status property

Refinement-status flags for each data point as an array.

intensity_meas property

Measured G(r) values for active data points.

intensity_meas_su property

Standard uncertainties of the measured G(r) values.

intensity_calc property

Calculated G(r) values for active data points.

intensity_bkg property

Background is always zero for PDF data.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
fit_data_arrays()

Return arrays needed to draw the fit-data chart.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
TotalData()

Total scattering (PDF) data collection in r-space.

Note: Works for both CWL and TOF measurements as PDF data is always transformed to r-space.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

fit_data_arrays

Return arrays needed to draw the fit-data chart.

Attributes:

Name Type Description
x_descriptor NumericDescriptor

Descriptor that owns the r-space x-axis metadata.

x np.ndarray

Get the r values for data points included in calculations.

unfiltered_x np.ndarray

Get the r values for all data points.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

calc_status np.ndarray

Refinement-status flags for each data point as an array.

intensity_meas np.ndarray

Measured G(r) values for active data points.

intensity_meas_su np.ndarray

Standard uncertainties of the measured G(r) values.

intensity_calc np.ndarray

Calculated G(r) values for active data points.

intensity_bkg np.ndarray

Background is always zero for PDF data.

Attributes
x_descriptor property

Descriptor that owns the r-space x-axis metadata.

x property

Get the r values for data points included in calculations.

unfiltered_x property

Get the r values for all data points.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

calc_status property

Refinement-status flags for each data point as an array.

intensity_meas property

Measured G(r) values for active data points.

intensity_meas_su property

Standard uncertainties of the measured G(r) values.

intensity_calc property

Calculated G(r) values for active data points.

intensity_bkg property

Background is always zero for PDF data.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
fit_data_arrays()

Return arrays needed to draw the fit-data chart.

diffrn

Modules:

Name Description
default

Default diffraction ambient-conditions category.

factory

Factory for diffraction ambient-conditions categories.

Classes
Modules
default

Default diffraction ambient-conditions category.

Classes:

Name Description
DefaultDiffrn

Ambient conditions recorded during diffraction measurement.

Classes
DefaultDiffrn()

Ambient conditions recorded during diffraction measurement.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
ambient_temperature NumericDescriptor

Mean temperature during measurement (K).

ambient_pressure NumericDescriptor

Mean hydrostatic pressure during measurement (kPa).

ambient_magnetic_field NumericDescriptor

Mean magnetic field during measurement (T).

ambient_electric_field NumericDescriptor

Mean electric field during measurement (V/m).

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
ambient_temperature property writable

Mean temperature during measurement (K).

Reading this property returns the underlying NumericDescriptor object. Assigning to it updates the value.

ambient_pressure property writable

Mean hydrostatic pressure during measurement (kPa).

Reading this property returns the underlying NumericDescriptor object. Assigning to it updates the value.

ambient_magnetic_field property writable

Mean magnetic field during measurement (T).

Reading this property returns the underlying NumericDescriptor object. Assigning to it updates the value.

ambient_electric_field property writable

Mean electric field during measurement (V/m).

Reading this property returns the underlying NumericDescriptor object. Assigning to it updates the value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

factory

Factory for diffraction ambient-conditions categories.

Classes:

Name Description
DiffrnFactory

Create diffraction ambient-conditions category instances.

Classes
DiffrnFactory

Create diffraction ambient-conditions category instances.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
excluded_regions

Modules:

Name Description
default

Exclude ranges of x from fitting/plotting (masked regions).

factory

Excluded-regions factory — delegates entirely to FactoryBase.

Classes
Modules
default

Exclude ranges of x from fitting/plotting (masked regions).

Classes:

Name Description
ExcludedRegion

Closed interval [start, end] to be excluded.

ExcludedRegions

Collection of ExcludedRegion instances.

Classes
ExcludedRegion()

Closed interval [start, end] to be excluded.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
id StringDescriptor

Identifier for this excluded region.

start NumericDescriptor

Start of the excluded region.

end NumericDescriptor

End of the excluded region.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
id property writable

Identifier for this excluded region.

Reading this property returns the underlying StringDescriptor object. Assigning to it updates the parameter value.

start property writable

Start of the excluded region.

Reading this property returns the underlying NumericDescriptor object. Assigning to it updates the parameter value.

end property writable

End of the excluded region.

Reading this property returns the underlying NumericDescriptor object. Assigning to it updates the parameter value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

ExcludedRegions()

Collection of ExcludedRegion instances.

Excluded regions define closed intervals [start, end] on the x-axis that are to be excluded from calculations and, as a result, from fitting and plotting.

Methods:

Name Description
show

Print a table of excluded [start, end] intervals.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
show()

Print a table of excluded [start, end] intervals.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
Functions
factory

Excluded-regions factory — delegates entirely to FactoryBase.

Classes:

Name Description
ExcludedRegionsFactory

Create excluded-regions collections by tag.

Classes
ExcludedRegionsFactory

Create excluded-regions collections by tag.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
experiment_type

Modules:

Name Description
default

Experiment type descriptor (form, beam, probe, scattering).

factory

Experiment-type factory — delegates entirely to FactoryBase.

Classes
Modules
default

Experiment type descriptor (form, beam, probe, scattering).

This lightweight container stores the categorical attributes defining an experiment configuration and handles CIF serialization via CifHandler.

Classes:

Name Description
ExperimentType

Container of attributes defining the experiment type.

Classes
ExperimentType()

Container of attributes defining the experiment type.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
sample_form EnumDescriptor

Powder diffraction or single crystal diffraction.

beam_mode EnumDescriptor

Constant wavelength (CW) or time-of-flight (TOF) measurement.

radiation_probe EnumDescriptor

Neutron or X-ray diffraction measurement.

scattering_type EnumDescriptor

Conventional Bragg diffraction or total scattering (PDF).

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
sample_form property

Powder diffraction or single crystal diffraction.

Reading this property returns the underlying EnumDescriptor object.

beam_mode property

Constant wavelength (CW) or time-of-flight (TOF) measurement.

Reading this property returns the underlying EnumDescriptor object.

radiation_probe property

Neutron or X-ray diffraction measurement.

Reading this property returns the underlying EnumDescriptor object.

scattering_type property

Conventional Bragg diffraction or total scattering (PDF).

Reading this property returns the underlying EnumDescriptor object.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

factory

Experiment-type factory — delegates entirely to FactoryBase.

Classes:

Name Description
ExperimentTypeFactory

Create experiment-type descriptors by tag.

Classes
ExperimentTypeFactory

Create experiment-type descriptors by tag.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
extinction

Modules:

Name Description
base

Base class for extinction correction categories.

becker_coppens

Becker-Coppens isotropic extinction correction for single crystals.

factory

Extinction factory — delegates entirely to FactoryBase.

Classes
Modules
base

Base class for extinction correction categories.

Classes:

Name Description
ExtinctionBase

Base class for extinction correction categories.

Classes
ExtinctionBase()

Base class for extinction correction categories.

Methods:

Name Description
show_supported

Print supported types and mark the active one.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported types and mark the active one.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

becker_coppens

Becker-Coppens isotropic extinction correction for single crystals.

Classes:

Name Description
BeckerCoppensExtinction

Becker-Coppens spherical extinction correction for single crystals.

Classes
BeckerCoppensExtinction()

Becker-Coppens spherical extinction correction for single crystals.

Combines primary and secondary extinction into a single correction factor y = y_p * y_s, following the Becker-Coppens formalism. The mosaicity distribution for the secondary extinction can be either Gaussian ('gauss') or Lorentzian ('lorentz').

Parameters are the crystal radius (in μm) and the mosaicity (in arc-minutes, as expected by CrysPy).

Methods:

Name Description
show_supported

Print supported types and mark the active one.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
model EnumDescriptor

Mosaicity distribution model ('gauss' or 'lorentz').

mosaicity Parameter

Mosaicity of the crystal (arcmin).

radius Parameter

Mean radius of the crystal (μm).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
model property writable

Mosaicity distribution model ('gauss' or 'lorentz').

Reading this property returns the underlying EnumDescriptor object. Assigning to it updates the descriptor value.

mosaicity property writable

Mosaicity of the crystal (arcmin).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

radius property writable

Mean radius of the crystal (μm).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported types and mark the active one.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

factory

Extinction factory — delegates entirely to FactoryBase.

Classes:

Name Description
ExtinctionFactory

Create extinction correction models by tag.

Classes
ExtinctionFactory

Create extinction correction models by tag.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
instrument

Modules:

Name Description
base

Instrument category base definitions for CWL/TOF instruments.

cwl
factory

Instrument factory — delegates to FactoryBase.

tof
Classes
Modules
base

Instrument category base definitions for CWL/TOF instruments.

This module provides the shared parent used by concrete instrument implementations under the instrument category.

Classes:

Name Description
InstrumentBase

Base class for instrument category items.

Classes
InstrumentBase()

Base class for instrument category items.

This class sets the common category_code and is used as a base for concrete CWL/TOF instrument definitions.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

cwl

Classes:

Name Description
CwlInstrumentBase

Base class for constant-wavelength instruments.

CwlScInstrument

CW single-crystal diffractometer.

CwlPdInstrument

CW powder diffractometer.

Classes
CwlInstrumentBase()

Base class for constant-wavelength instruments.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
setup_wavelength Parameter

Incident neutron or X-ray wavelength (Å).

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
setup_wavelength property writable

Incident neutron or X-ray wavelength (Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

CwlScInstrument()

CW single-crystal diffractometer.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

setup_wavelength Parameter

Incident neutron or X-ray wavelength (Å).

Attributes
unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

setup_wavelength property writable

Incident neutron or X-ray wavelength (Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

CwlPdInstrument()

CW powder diffractometer.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
calib_twotheta_offset Parameter

Instrument misalignment offset (deg).

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

setup_wavelength Parameter

Incident neutron or X-ray wavelength (Å).

Attributes
calib_twotheta_offset property writable

Instrument misalignment offset (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

setup_wavelength property writable

Incident neutron or X-ray wavelength (Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

factory

Instrument factory — delegates to FactoryBase.

Classes:

Name Description
InstrumentFactory

Create instrument instances for supported modes.

Classes
InstrumentFactory

Create instrument instances for supported modes.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
tof

Classes:

Name Description
TofScInstrument

TOF single-crystal diffractometer.

TofPdInstrument

TOF powder diffractometer.

Classes
TofScInstrument()

TOF single-crystal diffractometer.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

TofPdInstrument()

TOF powder diffractometer.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
setup_twotheta_bank Parameter

Detector bank position (deg).

calib_d_to_tof_offset Parameter

TOF offset (μs).

calib_d_to_tof_linear Parameter

TOF linear conversion (μs/Å).

calib_d_to_tof_quad Parameter

TOF quadratic correction (μs/Ų).

calib_d_to_tof_recip Parameter

TOF reciprocal velocity correction (μs·Å).

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
setup_twotheta_bank property writable

Detector bank position (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

calib_d_to_tof_offset property writable

TOF offset (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

calib_d_to_tof_linear property writable

TOF linear conversion (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

calib_d_to_tof_quad property writable

TOF quadratic correction (μs/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

calib_d_to_tof_recip property writable

TOF reciprocal velocity correction (μs·Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

linked_crystal

Modules:

Name Description
default

Default linked-crystal reference (id + scale).

factory

Linked-crystal factory — delegates entirely to FactoryBase.

Classes
Modules
default

Default linked-crystal reference (id + scale).

Classes:

Name Description
LinkedCrystal

Linked crystal reference for single-crystal diffraction.

Classes
LinkedCrystal()

Linked crystal reference for single-crystal diffraction.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
id StringDescriptor

Identifier of the linked crystal.

scale Parameter

Scale factor of the linked crystal.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
id property writable

Identifier of the linked crystal.

Reading this property returns the underlying StringDescriptor object. Assigning to it updates the parameter value.

scale property writable

Scale factor of the linked crystal.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

factory

Linked-crystal factory — delegates entirely to FactoryBase.

Classes:

Name Description
LinkedCrystalFactory

Create linked-crystal references by tag.

Classes
LinkedCrystalFactory

Create linked-crystal references by tag.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
linked_phases

Modules:

Name Description
default

Linked phases allow combining phases with scale factors.

factory

Linked-phases factory — delegates entirely to FactoryBase.

Classes
Modules
default

Linked phases allow combining phases with scale factors.

Classes:

Name Description
LinkedPhase

Link to a phase by id with a scale factor.

LinkedPhases

Collection of LinkedPhase instances.

Classes
LinkedPhase()

Link to a phase by id with a scale factor.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
id StringDescriptor

Identifier of the linked phase.

scale Parameter

Scale factor of the linked phase.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
id property writable

Identifier of the linked phase.

Reading this property returns the underlying StringDescriptor object. Assigning to it updates the parameter value.

scale property writable

Scale factor of the linked phase.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

LinkedPhases()

Collection of LinkedPhase instances.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
factory

Linked-phases factory — delegates entirely to FactoryBase.

Classes:

Name Description
LinkedPhasesFactory

Create linked-phases collections by tag.

Classes
LinkedPhasesFactory

Create linked-phases collections by tag.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
peak

Modules:

Name Description
base

Base class for peak profile categories.

cwl

Constant-wavelength peak profile classes.

cwl_mixins

Constant-wavelength (CWL) peak-profile component classes.

factory

Peak profile factory — delegates to FactoryBase.

tof

Time-of-flight peak profile classes.

tof_mixins

Time-of-flight (TOF) peak-profile mixin classes.

total

Total-scattering (PDF) peak profile classes.

total_mixins

Total scattering / PDF peak-profile component classes.

Classes
Modules
base

Base class for peak profile categories.

Classes:

Name Description
PeakBase

Base class for peak profile categories.

Classes
PeakBase()

Base class for peak profile categories.

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

Functions
cwl

Constant-wavelength peak profile classes.

Classes:

Name Description
CwlPseudoVoigt

Constant-wavelength pseudo-Voigt peak shape.

CwlPseudoVoigtEmpiricalAsymmetry

Pseudo-Voigt with empirical asymmetry correction for CWL mode.

CwlThompsonCoxHastings

Thompson-Cox-Hastings with FCJ asymmetry for CWL mode.

Classes
CwlPseudoVoigt()

Constant-wavelength pseudo-Voigt peak shape.

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
broad_gauss_u Parameter

Gaussian broadening from sample size and resolution (deg²).

broad_gauss_v Parameter

Gaussian broadening instrumental contribution (deg²).

broad_gauss_w Parameter

Gaussian broadening instrumental contribution (deg²).

broad_lorentz_x Parameter

Lorentzian broadening (sample strain effects) (deg).

broad_lorentz_y Parameter

Lorentzian broadening from microstructural defects (deg).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
broad_gauss_u property writable

Gaussian broadening from sample size and resolution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_v property writable

Gaussian broadening instrumental contribution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_w property writable

Gaussian broadening instrumental contribution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_x property writable

Lorentzian broadening (sample strain effects) (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_y property writable

Lorentzian broadening from microstructural defects (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

CwlPseudoVoigtEmpiricalAsymmetry()

Pseudo-Voigt with empirical asymmetry correction for CWL mode.

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
asym_empir_1 Parameter

Empirical asymmetry coefficient p1.

asym_empir_2 Parameter

Empirical asymmetry coefficient p2.

asym_empir_3 Parameter

Empirical asymmetry coefficient p3.

asym_empir_4 Parameter

Empirical asymmetry coefficient p4.

broad_gauss_u Parameter

Gaussian broadening from sample size and resolution (deg²).

broad_gauss_v Parameter

Gaussian broadening instrumental contribution (deg²).

broad_gauss_w Parameter

Gaussian broadening instrumental contribution (deg²).

broad_lorentz_x Parameter

Lorentzian broadening (sample strain effects) (deg).

broad_lorentz_y Parameter

Lorentzian broadening from microstructural defects (deg).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
asym_empir_1 property writable

Empirical asymmetry coefficient p1.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

asym_empir_2 property writable

Empirical asymmetry coefficient p2.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

asym_empir_3 property writable

Empirical asymmetry coefficient p3.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

asym_empir_4 property writable

Empirical asymmetry coefficient p4.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_u property writable

Gaussian broadening from sample size and resolution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_v property writable

Gaussian broadening instrumental contribution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_w property writable

Gaussian broadening instrumental contribution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_x property writable

Lorentzian broadening (sample strain effects) (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_y property writable

Lorentzian broadening from microstructural defects (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

CwlThompsonCoxHastings()

Thompson-Cox-Hastings with FCJ asymmetry for CWL mode.

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
asym_fcj_1 Parameter

Finger-Cox-Jephcoat asymmetry parameter 1.

asym_fcj_2 Parameter

Finger-Cox-Jephcoat asymmetry parameter 2.

broad_gauss_u Parameter

Gaussian broadening from sample size and resolution (deg²).

broad_gauss_v Parameter

Gaussian broadening instrumental contribution (deg²).

broad_gauss_w Parameter

Gaussian broadening instrumental contribution (deg²).

broad_lorentz_x Parameter

Lorentzian broadening (sample strain effects) (deg).

broad_lorentz_y Parameter

Lorentzian broadening from microstructural defects (deg).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
asym_fcj_1 property writable

Finger-Cox-Jephcoat asymmetry parameter 1.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

asym_fcj_2 property writable

Finger-Cox-Jephcoat asymmetry parameter 2.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_u property writable

Gaussian broadening from sample size and resolution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_v property writable

Gaussian broadening instrumental contribution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_w property writable

Gaussian broadening instrumental contribution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_x property writable

Lorentzian broadening (sample strain effects) (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_y property writable

Lorentzian broadening from microstructural defects (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

cwl_mixins

Constant-wavelength (CWL) peak-profile component classes.

This module provides classes that add broadening and asymmetry parameters. They are composed into concrete peak classes elsewhere via multiple inheritance.

Classes:

Name Description
CwlBroadeningMixin

CWL Gaussian and Lorentz broadening parameters.

EmpiricalAsymmetryMixin

Empirical CWL peak asymmetry parameters.

FcjAsymmetryMixin

Finger-Cox-Jephcoat (FCJ) asymmetry parameters.

Classes
CwlBroadeningMixin()

CWL Gaussian and Lorentz broadening parameters.

Attributes:

Name Type Description
broad_gauss_u Parameter

Gaussian broadening from sample size and resolution (deg²).

broad_gauss_v Parameter

Gaussian broadening instrumental contribution (deg²).

broad_gauss_w Parameter

Gaussian broadening instrumental contribution (deg²).

broad_lorentz_x Parameter

Lorentzian broadening (sample strain effects) (deg).

broad_lorentz_y Parameter

Lorentzian broadening from microstructural defects (deg).

Attributes
broad_gauss_u property writable

Gaussian broadening from sample size and resolution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_v property writable

Gaussian broadening instrumental contribution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_w property writable

Gaussian broadening instrumental contribution (deg²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_x property writable

Lorentzian broadening (sample strain effects) (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_y property writable

Lorentzian broadening from microstructural defects (deg).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

EmpiricalAsymmetryMixin()

Empirical CWL peak asymmetry parameters.

Attributes:

Name Type Description
asym_empir_1 Parameter

Empirical asymmetry coefficient p1.

asym_empir_2 Parameter

Empirical asymmetry coefficient p2.

asym_empir_3 Parameter

Empirical asymmetry coefficient p3.

asym_empir_4 Parameter

Empirical asymmetry coefficient p4.

Attributes
asym_empir_1 property writable

Empirical asymmetry coefficient p1.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

asym_empir_2 property writable

Empirical asymmetry coefficient p2.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

asym_empir_3 property writable

Empirical asymmetry coefficient p3.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

asym_empir_4 property writable

Empirical asymmetry coefficient p4.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

FcjAsymmetryMixin()

Finger-Cox-Jephcoat (FCJ) asymmetry parameters.

Attributes:

Name Type Description
asym_fcj_1 Parameter

Finger-Cox-Jephcoat asymmetry parameter 1.

asym_fcj_2 Parameter

Finger-Cox-Jephcoat asymmetry parameter 2.

Attributes
asym_fcj_1 property writable

Finger-Cox-Jephcoat asymmetry parameter 1.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

asym_fcj_2 property writable

Finger-Cox-Jephcoat asymmetry parameter 2.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

factory

Peak profile factory — delegates to FactoryBase.

Classes:

Name Description
PeakFactory

Factory for creating peak profile objects.

Classes
PeakFactory

Factory for creating peak profile objects.

Methods:

Name Description
show_supported

Pretty-print supported peak profiles with context-local aliases.

__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

Functions
show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print supported peak profiles with context-local aliases.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

Functions
tof

Time-of-flight peak profile classes.

Jorgensen: back-to-back exponentials ⊗ Gaussian (CrysPy peak_shape="Gauss"). Jorgensen-Von Dreele: back-to-back exponentials ⊗ pseudo-Voigt (CrysPy peak_shape="pseudo-Voigt"). Double-Jorgensen-Von Dreele: double back-to-back exponentials ⊗ pseudo-Voigt (CrysPy peak_shape="type0m", Z-Rietveld).

Classes:

Name Description
TofPseudoVoigt

Simple non-convoluted pseudo-Voigt TOF profile.

TofJorgensen

Jorgensen TOF profile: back-to-back exponentials ⊗ Gaussian.

TofJorgensenVonDreele

Back-to-back exponentials ⊗ pseudo-Voigt TOF profile.

TofDoubleJorgensenVonDreele

Double back-to-back exponentials ⊗ pseudo-Voigt TOF profile.

Classes
TofPseudoVoigt()

Simple non-convoluted pseudo-Voigt TOF profile.

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
broad_lorentz_gamma_0 Parameter

Lorentzian broadening (microstrain effects) (μs).

broad_lorentz_gamma_1 Parameter

Lorentzian broadening (dependent on d-spacing) (μs/Å).

broad_lorentz_gamma_2 Parameter

Lorentzian broadening (instrument-dependent term) (μs²/Ų).

broad_gauss_sigma_0 Parameter

Gaussian broadening (instrumental resolution) (μs²).

broad_gauss_sigma_1 Parameter

Gaussian broadening (dependent on d-spacing) (μs/Å).

broad_gauss_sigma_2 Parameter

Gaussian broadening (instrument-dependent term) (μs²/Ų).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
broad_lorentz_gamma_0 property writable

Lorentzian broadening (microstrain effects) (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_1 property writable

Lorentzian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_2 property writable

Lorentzian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_0 property writable

Gaussian broadening (instrumental resolution) (μs²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_1 property writable

Gaussian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_2 property writable

Gaussian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

TofJorgensen()

Jorgensen TOF profile: back-to-back exponentials ⊗ Gaussian.

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
exp_rise_alpha_0 Parameter

Back-to-back exponential rise α₀ (μs).

exp_rise_alpha_1 Parameter

Back-to-back exponential rise α₁ (μs/Å).

exp_decay_beta_0 Parameter

Back-to-back exponential decay β₀ (μs).

exp_decay_beta_1 Parameter

Back-to-back exponential decay β₁ (μs/Å).

broad_gauss_sigma_0 Parameter

Gaussian broadening (instrumental resolution) (μs²).

broad_gauss_sigma_1 Parameter

Gaussian broadening (dependent on d-spacing) (μs/Å).

broad_gauss_sigma_2 Parameter

Gaussian broadening (instrument-dependent term) (μs²/Ų).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
exp_rise_alpha_0 property writable

Back-to-back exponential rise α₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_rise_alpha_1 property writable

Back-to-back exponential rise α₁ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_decay_beta_0 property writable

Back-to-back exponential decay β₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_decay_beta_1 property writable

Back-to-back exponential decay β₁ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_0 property writable

Gaussian broadening (instrumental resolution) (μs²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_1 property writable

Gaussian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_2 property writable

Gaussian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

TofJorgensenVonDreele()

Back-to-back exponentials ⊗ pseudo-Voigt TOF profile.

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
exp_rise_alpha_0 Parameter

Back-to-back exponential rise α₀ (μs).

exp_rise_alpha_1 Parameter

Back-to-back exponential rise α₁ (μs/Å).

exp_decay_beta_0 Parameter

Back-to-back exponential decay β₀ (μs).

exp_decay_beta_1 Parameter

Back-to-back exponential decay β₁ (μs/Å).

broad_lorentz_gamma_0 Parameter

Lorentzian broadening (microstrain effects) (μs).

broad_lorentz_gamma_1 Parameter

Lorentzian broadening (dependent on d-spacing) (μs/Å).

broad_lorentz_gamma_2 Parameter

Lorentzian broadening (instrument-dependent term) (μs²/Ų).

broad_gauss_sigma_0 Parameter

Gaussian broadening (instrumental resolution) (μs²).

broad_gauss_sigma_1 Parameter

Gaussian broadening (dependent on d-spacing) (μs/Å).

broad_gauss_sigma_2 Parameter

Gaussian broadening (instrument-dependent term) (μs²/Ų).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
exp_rise_alpha_0 property writable

Back-to-back exponential rise α₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_rise_alpha_1 property writable

Back-to-back exponential rise α₁ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_decay_beta_0 property writable

Back-to-back exponential decay β₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_decay_beta_1 property writable

Back-to-back exponential decay β₁ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_0 property writable

Lorentzian broadening (microstrain effects) (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_1 property writable

Lorentzian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_2 property writable

Lorentzian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_0 property writable

Gaussian broadening (instrumental resolution) (μs²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_1 property writable

Gaussian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_2 property writable

Gaussian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

TofDoubleJorgensenVonDreele()

Double back-to-back exponentials ⊗ pseudo-Voigt TOF profile.

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
dexp_rise_alpha_1 Parameter

Double-exp rise parameter α₁ (μs).

dexp_rise_alpha_2 Parameter

Double-exp rise parameter α₂ (μs/Å).

dexp_decay_beta_00 Parameter

Double-exp first-regime decay β₀₀ (μs).

dexp_decay_beta_01 Parameter

Double-exp first-regime decay β₀₁ (μs/Å).

dexp_decay_beta_10 Parameter

Double-exp second-regime decay β₁₀ (μs).

dexp_switch_r_01 Parameter

Double-exp switching function r₀₁.

dexp_switch_r_02 Parameter

Double-exp switching function r₀₂.

dexp_switch_r_03 Parameter

Double-exp switching function r₀₃.

broad_lorentz_gamma_0 Parameter

Lorentzian broadening (microstrain effects) (μs).

broad_lorentz_gamma_1 Parameter

Lorentzian broadening (dependent on d-spacing) (μs/Å).

broad_lorentz_gamma_2 Parameter

Lorentzian broadening (instrument-dependent term) (μs²/Ų).

broad_gauss_sigma_0 Parameter

Gaussian broadening (instrumental resolution) (μs²).

broad_gauss_sigma_1 Parameter

Gaussian broadening (dependent on d-spacing) (μs/Å).

broad_gauss_sigma_2 Parameter

Gaussian broadening (instrument-dependent term) (μs²/Ų).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
dexp_rise_alpha_1 property writable

Double-exp rise parameter α₁ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_rise_alpha_2 property writable

Double-exp rise parameter α₂ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_decay_beta_00 property writable

Double-exp first-regime decay β₀₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_decay_beta_01 property writable

Double-exp first-regime decay β₀₁ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_decay_beta_10 property writable

Double-exp second-regime decay β₁₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_switch_r_01 property writable

Double-exp switching function r₀₁.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_switch_r_02 property writable

Double-exp switching function r₀₂.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_switch_r_03 property writable

Double-exp switching function r₀₃.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_0 property writable

Lorentzian broadening (microstrain effects) (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_1 property writable

Lorentzian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_2 property writable

Lorentzian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_0 property writable

Gaussian broadening (instrumental resolution) (μs²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_1 property writable

Gaussian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_2 property writable

Gaussian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

tof_mixins

Time-of-flight (TOF) peak-profile mixin classes.

Defines parameter mixins for TOF peak shapes based on the Jorgensen back-to-back exponential (BBE) formalism:

  • TofGaussianBroadeningMixin — σ₀, σ₁, σ₂
  • TofLorentzianBroadeningMixin — γ₀, γ₁, γ₂
  • TofBackToBackExponentialMixin — α₀, α₁ (rise), β₀, β₁ (decay)
  • TofDoubleExponentialMixin — α₁, α₂ (rise), β₀₀, β₀₁, β₁₀ (decay), r₀₁, r₀₂, r₀₃ (switching function) for double-BBE (Z-Rietveld type0m)

These are composed into concrete peak classes in tof.py.

Classes:

Name Description
TofGaussianBroadeningMixin

TOF Gaussian broadening parameters σ₀, σ₁, σ₂.

TofLorentzianBroadeningMixin

TOF Lorentzian broadening parameters γ₀, γ₁, γ₂.

TofBackToBackExponentialMixin

Back-to-back exponential (BBE) rise and decay parameters.

TofDoubleExponentialMixin

Double back-to-back exponential parameters for Z-Rietveld type0m.

Classes
TofGaussianBroadeningMixin()

TOF Gaussian broadening parameters σ₀, σ₁, σ₂.

The constant term σ₀ defaults nonzero so every TOF profile has a finite peak width out of the box; σ₁ and σ₂ default to 0.

Attributes:

Name Type Description
broad_gauss_sigma_0 Parameter

Gaussian broadening (instrumental resolution) (μs²).

broad_gauss_sigma_1 Parameter

Gaussian broadening (dependent on d-spacing) (μs/Å).

broad_gauss_sigma_2 Parameter

Gaussian broadening (instrument-dependent term) (μs²/Ų).

Attributes
broad_gauss_sigma_0 property writable

Gaussian broadening (instrumental resolution) (μs²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_1 property writable

Gaussian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_gauss_sigma_2 property writable

Gaussian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

TofLorentzianBroadeningMixin()

TOF Lorentzian broadening parameters γ₀, γ₁, γ₂.

Attributes:

Name Type Description
broad_lorentz_gamma_0 Parameter

Lorentzian broadening (microstrain effects) (μs).

broad_lorentz_gamma_1 Parameter

Lorentzian broadening (dependent on d-spacing) (μs/Å).

broad_lorentz_gamma_2 Parameter

Lorentzian broadening (instrument-dependent term) (μs²/Ų).

Attributes
broad_lorentz_gamma_0 property writable

Lorentzian broadening (microstrain effects) (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_1 property writable

Lorentzian broadening (dependent on d-spacing) (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_lorentz_gamma_2 property writable

Lorentzian broadening (instrument-dependent term) (μs²/Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

TofBackToBackExponentialMixin()

Back-to-back exponential (BBE) rise and decay parameters.

Rise parameters α₀, α₁ and decay parameters β₀, β₁ follow Von Dreele, Jorgensen & Windsor, J. Appl. Cryst. 15, 581 (1982).

The rise α₁ and decay β₀ default nonzero so the profile is normalisable and the peak is visible; refine per instrument.

Attributes:

Name Type Description
exp_rise_alpha_0 Parameter

Back-to-back exponential rise α₀ (μs).

exp_rise_alpha_1 Parameter

Back-to-back exponential rise α₁ (μs/Å).

exp_decay_beta_0 Parameter

Back-to-back exponential decay β₀ (μs).

exp_decay_beta_1 Parameter

Back-to-back exponential decay β₁ (μs/Å).

Attributes
exp_rise_alpha_0 property writable

Back-to-back exponential rise α₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_rise_alpha_1 property writable

Back-to-back exponential rise α₁ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_decay_beta_0 property writable

Back-to-back exponential decay β₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

exp_decay_beta_1 property writable

Back-to-back exponential decay β₁ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

TofDoubleExponentialMixin()

Double back-to-back exponential parameters for Z-Rietveld type0m.

Rise parameters α₁, α₂, decay parameters β₀₀, β₀₁, β₁₀ for two exponential regimes, and switching-function parameters r₀₁, r₀₂, r₀₃.

α₁, β₀₀, β₁₀ and r₀₁ default nonzero so both regimes stay finite and blended; an all-zero set produces NaN. Refine per instrument.

Attributes:

Name Type Description
dexp_rise_alpha_1 Parameter

Double-exp rise parameter α₁ (μs).

dexp_rise_alpha_2 Parameter

Double-exp rise parameter α₂ (μs/Å).

dexp_decay_beta_00 Parameter

Double-exp first-regime decay β₀₀ (μs).

dexp_decay_beta_01 Parameter

Double-exp first-regime decay β₀₁ (μs/Å).

dexp_decay_beta_10 Parameter

Double-exp second-regime decay β₁₀ (μs).

dexp_switch_r_01 Parameter

Double-exp switching function r₀₁.

dexp_switch_r_02 Parameter

Double-exp switching function r₀₂.

dexp_switch_r_03 Parameter

Double-exp switching function r₀₃.

Attributes
dexp_rise_alpha_1 property writable

Double-exp rise parameter α₁ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_rise_alpha_2 property writable

Double-exp rise parameter α₂ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_decay_beta_00 property writable

Double-exp first-regime decay β₀₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_decay_beta_01 property writable

Double-exp first-regime decay β₀₁ (μs/Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_decay_beta_10 property writable

Double-exp second-regime decay β₁₀ (μs).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_switch_r_01 property writable

Double-exp switching function r₀₁.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_switch_r_02 property writable

Double-exp switching function r₀₂.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

dexp_switch_r_03 property writable

Double-exp switching function r₀₃.

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

total

Total-scattering (PDF) peak profile classes.

Classes:

Name Description
TotalGaussianDampedSinc

Gaussian-damped sinc peak for total scattering (PDF).

Classes
TotalGaussianDampedSinc()

Gaussian-damped sinc peak for total scattering (PDF).

Methods:

Name Description
show_supported

Print supported peak profiles with context-local aliases.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
damp_q Parameter

Q-resolution damping for high-r PDF peak amplitude (Å⁻¹).

broad_q Parameter

Quadratic peak broadening from thermal uncertainty (Å⁻²).

cutoff_q Parameter

Q-value cutoff for Fourier transform (Å⁻¹).

sharp_delta_1 Parameter

PDF peak sharpening coefficient (1/r dependence) (Å).

sharp_delta_2 Parameter

PDF peak sharpening coefficient (1/r² dependence) (Ų).

damp_particle_diameter Parameter

Particle diameter for spherical envelope damping correction (Å).

type str

Active factory tag for this category.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
damp_q property writable

Q-resolution damping for high-r PDF peak amplitude (Å⁻¹).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_q property writable

Quadratic peak broadening from thermal uncertainty (Å⁻²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

cutoff_q property writable

Q-value cutoff for Fourier transform (Å⁻¹).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

sharp_delta_1 property writable

PDF peak sharpening coefficient (1/r dependence) (Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

sharp_delta_2 property writable

PDF peak sharpening coefficient (1/r² dependence) (Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

damp_particle_diameter property writable

Particle diameter for spherical envelope damping correction (Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

type property writable

Active factory tag for this category.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
show_supported()

Print supported peak profiles with context-local aliases.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

total_mixins

Total scattering / PDF peak-profile component classes.

This module provides classes that add broadening and asymmetry parameters. They are composed into concrete peak classes elsewhere via multiple inheritance.

Classes:

Name Description
TotalBroadeningMixin

PDF broadening/damping/sharpening parameters.

Classes
TotalBroadeningMixin()

PDF broadening/damping/sharpening parameters.

Attributes:

Name Type Description
damp_q Parameter

Q-resolution damping for high-r PDF peak amplitude (Å⁻¹).

broad_q Parameter

Quadratic peak broadening from thermal uncertainty (Å⁻²).

cutoff_q Parameter

Q-value cutoff for Fourier transform (Å⁻¹).

sharp_delta_1 Parameter

PDF peak sharpening coefficient (1/r dependence) (Å).

sharp_delta_2 Parameter

PDF peak sharpening coefficient (1/r² dependence) (Ų).

damp_particle_diameter Parameter

Particle diameter for spherical envelope damping correction (Å).

Attributes
damp_q property writable

Q-resolution damping for high-r PDF peak amplitude (Å⁻¹).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

broad_q property writable

Quadratic peak broadening from thermal uncertainty (Å⁻²).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

cutoff_q property writable

Q-value cutoff for Fourier transform (Å⁻¹).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

sharp_delta_1 property writable

PDF peak sharpening coefficient (1/r dependence) (Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

sharp_delta_2 property writable

PDF peak sharpening coefficient (1/r² dependence) (Ų).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

damp_particle_diameter property writable

Particle diameter for spherical envelope damping correction (Å).

Reading this property returns the underlying Parameter object. Assigning to it updates the parameter value.

refln

Modules:

Name Description
bragg_pd
bragg_sc
factory

Reflection collection factory — delegates to FactoryBase.

Classes
Modules
bragg_pd

Classes:

Name Description
PowderReflnBase

Single calculated powder reflection row.

PowderCwlRefln

Single calculated powder reflection row for CWL experiments.

PowderTofRefln

Single calculated powder reflection row for TOF experiments.

PowderReflnDataBase

Base collection for calculated powder reflection rows.

PowderCwlReflnData

Calculated powder reflection collection for CWL experiments.

PowderTofReflnData

Calculated powder reflection collection for TOF experiments.

Classes
PowderReflnBase()

Single calculated powder reflection row.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
phase_id StringDescriptor

Linked-phase identifier for this reflection.

f_calc NumericDescriptor

Calculated structure-factor amplitude for this reflection.

f_squared_calc NumericDescriptor

Calculated structure-factor amplitude squared.

parameters list

Powder reflection descriptors serialized in CIF loops.

unique_name str

Fully qualified name: datablock, category, entry.

as_cif str

Return CIF representation of this object.

id StringDescriptor

Identifier of the reflection.

d_spacing NumericDescriptor

Distance between lattice planes for this reflection (Å).

sin_theta_over_lambda NumericDescriptor

The sin(θ)/λ value for this reflection (Å⁻¹).

index_h NumericDescriptor

Miller index h of a measured reflection.

index_k NumericDescriptor

Miller index k of a measured reflection.

index_l NumericDescriptor

Miller index l of a measured reflection.

intensity_meas NumericDescriptor

The intensity of the reflection derived from the measurements.

intensity_meas_su NumericDescriptor

Standard uncertainty of the measured intensity.

intensity_calc NumericDescriptor

Intensity of the reflection calculated from atom site data.

Attributes
phase_id property

Linked-phase identifier for this reflection.

f_calc property

Calculated structure-factor amplitude for this reflection.

f_squared_calc property

Calculated structure-factor amplitude squared.

parameters property

Powder reflection descriptors serialized in CIF loops.

unique_name property

Fully qualified name: datablock, category, entry.

as_cif property

Return CIF representation of this object.

id property

Identifier of the reflection.

Reading this property returns the underlying StringDescriptor object.

d_spacing property

Distance between lattice planes for this reflection (Å).

Reading this property returns the underlying NumericDescriptor object.

sin_theta_over_lambda property

The sin(θ)/λ value for this reflection (Å⁻¹).

Reading this property returns the underlying NumericDescriptor object.

index_h property

Miller index h of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_k property

Miller index k of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_l property

Miller index l of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas property

The intensity of the reflection derived from the measurements.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas_su property

Standard uncertainty of the measured intensity.

Reading this property returns the underlying NumericDescriptor object.

intensity_calc property

Intensity of the reflection calculated from atom site data.

Reading this property returns the underlying NumericDescriptor object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

PowderCwlRefln()

Single calculated powder reflection row for CWL experiments.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
two_theta NumericDescriptor

Calculated 2theta position for this reflection.

parameters list

Powder CWL reflection descriptors serialized in CIF loops.

unique_name str

Fully qualified name: datablock, category, entry.

as_cif str

Return CIF representation of this object.

id StringDescriptor

Identifier of the reflection.

d_spacing NumericDescriptor

Distance between lattice planes for this reflection (Å).

sin_theta_over_lambda NumericDescriptor

The sin(θ)/λ value for this reflection (Å⁻¹).

index_h NumericDescriptor

Miller index h of a measured reflection.

index_k NumericDescriptor

Miller index k of a measured reflection.

index_l NumericDescriptor

Miller index l of a measured reflection.

intensity_meas NumericDescriptor

The intensity of the reflection derived from the measurements.

intensity_meas_su NumericDescriptor

Standard uncertainty of the measured intensity.

intensity_calc NumericDescriptor

Intensity of the reflection calculated from atom site data.

phase_id StringDescriptor

Linked-phase identifier for this reflection.

f_calc NumericDescriptor

Calculated structure-factor amplitude for this reflection.

f_squared_calc NumericDescriptor

Calculated structure-factor amplitude squared.

Attributes
two_theta property

Calculated 2theta position for this reflection.

parameters property

Powder CWL reflection descriptors serialized in CIF loops.

unique_name property

Fully qualified name: datablock, category, entry.

as_cif property

Return CIF representation of this object.

id property

Identifier of the reflection.

Reading this property returns the underlying StringDescriptor object.

d_spacing property

Distance between lattice planes for this reflection (Å).

Reading this property returns the underlying NumericDescriptor object.

sin_theta_over_lambda property

The sin(θ)/λ value for this reflection (Å⁻¹).

Reading this property returns the underlying NumericDescriptor object.

index_h property

Miller index h of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_k property

Miller index k of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_l property

Miller index l of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas property

The intensity of the reflection derived from the measurements.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas_su property

Standard uncertainty of the measured intensity.

Reading this property returns the underlying NumericDescriptor object.

intensity_calc property

Intensity of the reflection calculated from atom site data.

Reading this property returns the underlying NumericDescriptor object.

phase_id property

Linked-phase identifier for this reflection.

f_calc property

Calculated structure-factor amplitude for this reflection.

f_squared_calc property

Calculated structure-factor amplitude squared.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

PowderTofRefln()

Single calculated powder reflection row for TOF experiments.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
time_of_flight NumericDescriptor

Calculated time-of-flight position for this reflection.

parameters list

Powder TOF reflection descriptors serialized in CIF loops.

unique_name str

Fully qualified name: datablock, category, entry.

as_cif str

Return CIF representation of this object.

id StringDescriptor

Identifier of the reflection.

d_spacing NumericDescriptor

Distance between lattice planes for this reflection (Å).

sin_theta_over_lambda NumericDescriptor

The sin(θ)/λ value for this reflection (Å⁻¹).

index_h NumericDescriptor

Miller index h of a measured reflection.

index_k NumericDescriptor

Miller index k of a measured reflection.

index_l NumericDescriptor

Miller index l of a measured reflection.

intensity_meas NumericDescriptor

The intensity of the reflection derived from the measurements.

intensity_meas_su NumericDescriptor

Standard uncertainty of the measured intensity.

intensity_calc NumericDescriptor

Intensity of the reflection calculated from atom site data.

phase_id StringDescriptor

Linked-phase identifier for this reflection.

f_calc NumericDescriptor

Calculated structure-factor amplitude for this reflection.

f_squared_calc NumericDescriptor

Calculated structure-factor amplitude squared.

Attributes
time_of_flight property

Calculated time-of-flight position for this reflection.

parameters property

Powder TOF reflection descriptors serialized in CIF loops.

unique_name property

Fully qualified name: datablock, category, entry.

as_cif property

Return CIF representation of this object.

id property

Identifier of the reflection.

Reading this property returns the underlying StringDescriptor object.

d_spacing property

Distance between lattice planes for this reflection (Å).

Reading this property returns the underlying NumericDescriptor object.

sin_theta_over_lambda property

The sin(θ)/λ value for this reflection (Å⁻¹).

Reading this property returns the underlying NumericDescriptor object.

index_h property

Miller index h of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_k property

Miller index k of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_l property

Miller index l of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas property

The intensity of the reflection derived from the measurements.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas_su property

Standard uncertainty of the measured intensity.

Reading this property returns the underlying NumericDescriptor object.

intensity_calc property

Intensity of the reflection calculated from atom site data.

Reading this property returns the underlying NumericDescriptor object.

phase_id property

Linked-phase identifier for this reflection.

f_calc property

Calculated structure-factor amplitude for this reflection.

f_squared_calc property

Calculated structure-factor amplitude squared.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

PowderReflnDataBase(item_type)

Base collection for calculated powder reflection rows.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
id np.ndarray

Reflection identifiers for all rows.

phase_id np.ndarray

Linked-phase identifiers for all rows.

d_spacing np.ndarray

D-spacing values for all rows.

sin_theta_over_lambda np.ndarray

sin(theta)/lambda values for all rows.

index_h np.ndarray

Miller h indices for all rows.

index_k np.ndarray

Miller k indices for all rows.

index_l np.ndarray

Miller l indices for all rows.

f_calc np.ndarray

Calculated structure-factor amplitudes for all rows.

f_squared_calc np.ndarray

Calculated structure-factor amplitudes squared for all rows.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
id property

Reflection identifiers for all rows.

phase_id property

Linked-phase identifiers for all rows.

d_spacing property

D-spacing values for all rows.

sin_theta_over_lambda property

sin(theta)/lambda values for all rows.

index_h property

Miller h indices for all rows.

index_k property

Miller k indices for all rows.

index_l property

Miller l indices for all rows.

f_calc property

Calculated structure-factor amplitudes for all rows.

f_squared_calc property

Calculated structure-factor amplitudes squared for all rows.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
PowderCwlReflnData()

Calculated powder reflection collection for CWL experiments.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
two_theta np.ndarray

Calculated 2theta positions for all rows.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

id np.ndarray

Reflection identifiers for all rows.

phase_id np.ndarray

Linked-phase identifiers for all rows.

d_spacing np.ndarray

D-spacing values for all rows.

sin_theta_over_lambda np.ndarray

sin(theta)/lambda values for all rows.

index_h np.ndarray

Miller h indices for all rows.

index_k np.ndarray

Miller k indices for all rows.

index_l np.ndarray

Miller l indices for all rows.

f_calc np.ndarray

Calculated structure-factor amplitudes for all rows.

f_squared_calc np.ndarray

Calculated structure-factor amplitudes squared for all rows.

Attributes
two_theta property

Calculated 2theta positions for all rows.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

id property

Reflection identifiers for all rows.

phase_id property

Linked-phase identifiers for all rows.

d_spacing property

D-spacing values for all rows.

sin_theta_over_lambda property

sin(theta)/lambda values for all rows.

index_h property

Miller h indices for all rows.

index_k property

Miller k indices for all rows.

index_l property

Miller l indices for all rows.

f_calc property

Calculated structure-factor amplitudes for all rows.

f_squared_calc property

Calculated structure-factor amplitudes squared for all rows.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
PowderTofReflnData()

Calculated powder reflection collection for TOF experiments.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
time_of_flight np.ndarray

Calculated time-of-flight positions for all rows.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

id np.ndarray

Reflection identifiers for all rows.

phase_id np.ndarray

Linked-phase identifiers for all rows.

d_spacing np.ndarray

D-spacing values for all rows.

sin_theta_over_lambda np.ndarray

sin(theta)/lambda values for all rows.

index_h np.ndarray

Miller h indices for all rows.

index_k np.ndarray

Miller k indices for all rows.

index_l np.ndarray

Miller l indices for all rows.

f_calc np.ndarray

Calculated structure-factor amplitudes for all rows.

f_squared_calc np.ndarray

Calculated structure-factor amplitudes squared for all rows.

Attributes
time_of_flight property

Calculated time-of-flight positions for all rows.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

id property

Reflection identifiers for all rows.

phase_id property

Linked-phase identifiers for all rows.

d_spacing property

D-spacing values for all rows.

sin_theta_over_lambda property

sin(theta)/lambda values for all rows.

index_h property

Miller h indices for all rows.

index_k property

Miller k indices for all rows.

index_l property

Miller l indices for all rows.

f_calc property

Calculated structure-factor amplitudes for all rows.

f_squared_calc property

Calculated structure-factor amplitudes squared for all rows.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
bragg_sc

Classes:

Name Description
Refln

Single reflection for single-crystal diffraction data.

TofRefln

TOF single-crystal reflection with a per-reflection wavelength.

ReflnDataBase

Base collection of reflections for single-crystal diffraction data.

CwlReflnData

Collection of reflections for CWL single-crystal diffraction data.

TofReflnData

Collection of reflections for TOF single-crystal diffraction data.

Classes
Refln()

Single reflection for single-crystal diffraction data.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
id StringDescriptor

Identifier of the reflection.

d_spacing NumericDescriptor

Distance between lattice planes for this reflection (Å).

sin_theta_over_lambda NumericDescriptor

The sin(θ)/λ value for this reflection (Å⁻¹).

index_h NumericDescriptor

Miller index h of a measured reflection.

index_k NumericDescriptor

Miller index k of a measured reflection.

index_l NumericDescriptor

Miller index l of a measured reflection.

intensity_meas NumericDescriptor

The intensity of the reflection derived from the measurements.

intensity_meas_su NumericDescriptor

Standard uncertainty of the measured intensity.

intensity_calc NumericDescriptor

Intensity of the reflection calculated from atom site data.

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

Attributes
id property

Identifier of the reflection.

Reading this property returns the underlying StringDescriptor object.

d_spacing property

Distance between lattice planes for this reflection (Å).

Reading this property returns the underlying NumericDescriptor object.

sin_theta_over_lambda property

The sin(θ)/λ value for this reflection (Å⁻¹).

Reading this property returns the underlying NumericDescriptor object.

index_h property

Miller index h of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_k property

Miller index k of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_l property

Miller index l of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas property

The intensity of the reflection derived from the measurements.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas_su property

Standard uncertainty of the measured intensity.

Reading this property returns the underlying NumericDescriptor object.

intensity_calc property

Intensity of the reflection calculated from atom site data.

Reading this property returns the underlying NumericDescriptor object.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

TofRefln()

TOF single-crystal reflection with a per-reflection wavelength.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print parameters, other properties, and methods.

from_cif

Populate this item from a CIF block.

Attributes:

Name Type Description
wavelength NumericDescriptor

Mean wavelength of radiation for this reflection (Å).

unique_name str

Fully qualified name: datablock, category, entry.

parameters list

All GenericDescriptorBase instances on this item.

as_cif str

Return CIF representation of this object.

id StringDescriptor

Identifier of the reflection.

d_spacing NumericDescriptor

Distance between lattice planes for this reflection (Å).

sin_theta_over_lambda NumericDescriptor

The sin(θ)/λ value for this reflection (Å⁻¹).

index_h NumericDescriptor

Miller index h of a measured reflection.

index_k NumericDescriptor

Miller index k of a measured reflection.

index_l NumericDescriptor

Miller index l of a measured reflection.

intensity_meas NumericDescriptor

The intensity of the reflection derived from the measurements.

intensity_meas_su NumericDescriptor

Standard uncertainty of the measured intensity.

intensity_calc NumericDescriptor

Intensity of the reflection calculated from atom site data.

Attributes
wavelength property

Mean wavelength of radiation for this reflection (Å).

Reading this property returns the underlying NumericDescriptor object.

unique_name property

Fully qualified name: datablock, category, entry.

parameters property

All GenericDescriptorBase instances on this item.

as_cif property

Return CIF representation of this object.

id property

Identifier of the reflection.

Reading this property returns the underlying StringDescriptor object.

d_spacing property

Distance between lattice planes for this reflection (Å).

Reading this property returns the underlying NumericDescriptor object.

sin_theta_over_lambda property

The sin(θ)/λ value for this reflection (Å⁻¹).

Reading this property returns the underlying NumericDescriptor object.

index_h property

Miller index h of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_k property

Miller index k of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

index_l property

Miller index l of a measured reflection.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas property

The intensity of the reflection derived from the measurements.

Reading this property returns the underlying NumericDescriptor object.

intensity_meas_su property

Standard uncertainty of the measured intensity.

Reading this property returns the underlying NumericDescriptor object.

intensity_calc property

Intensity of the reflection calculated from atom site data.

Reading this property returns the underlying NumericDescriptor object.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print parameters, other properties, and methods.

from_cif(block, idx=0)

Populate this item from a CIF block.

ReflnDataBase(item_type)

Base collection of reflections for single-crystal diffraction data.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
d_spacing np.ndarray

D-spacing values for all reflection data points.

sin_theta_over_lambda np.ndarray

sinθ/λ values for all reflection data points.

index_h np.ndarray

Miller h indices for all reflection data points.

index_k np.ndarray

Miller k indices for all reflection data points.

index_l np.ndarray

Miller l indices for all reflection data points.

intensity_meas np.ndarray

Measured structure-factor intensities for all reflections.

intensity_meas_su np.ndarray

Standard uncertainties of the measured intensities.

intensity_calc np.ndarray

Calculated intensities for all reflections.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

Attributes
d_spacing property

D-spacing values for all reflection data points.

sin_theta_over_lambda property

sinθ/λ values for all reflection data points.

index_h property

Miller h indices for all reflection data points.

index_k property

Miller k indices for all reflection data points.

index_l property

Miller l indices for all reflection data points.

intensity_meas property

Measured structure-factor intensities for all reflections.

intensity_meas_su property

Standard uncertainties of the measured intensities.

intensity_calc property

Calculated intensities for all reflections.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
CwlReflnData()

Collection of reflections for CWL single-crystal diffraction data.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

d_spacing np.ndarray

D-spacing values for all reflection data points.

sin_theta_over_lambda np.ndarray

sinθ/λ values for all reflection data points.

index_h np.ndarray

Miller h indices for all reflection data points.

index_k np.ndarray

Miller k indices for all reflection data points.

index_l np.ndarray

Miller l indices for all reflection data points.

intensity_meas np.ndarray

Measured structure-factor intensities for all reflections.

intensity_meas_su np.ndarray

Standard uncertainties of the measured intensities.

intensity_calc np.ndarray

Calculated intensities for all reflections.

Attributes
unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

d_spacing property

D-spacing values for all reflection data points.

sin_theta_over_lambda property

sinθ/λ values for all reflection data points.

index_h property

Miller h indices for all reflection data points.

index_k property

Miller k indices for all reflection data points.

index_l property

Miller l indices for all reflection data points.

intensity_meas property

Measured structure-factor intensities for all reflections.

intensity_meas_su property

Standard uncertainties of the measured intensities.

intensity_calc property

Calculated intensities for all reflections.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
TofReflnData()

Collection of reflections for TOF single-crystal diffraction data.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

from_cif

Populate this collection from a CIF block.

add

Insert or replace a pre-built item into the collection.

create

Create a new item with the given attributes and add it.

Attributes:

Name Type Description
wavelength np.ndarray

Wavelengths associated with each reflection.

unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all items in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

scalar_descriptors list

Collection-level descriptors serialized outside the loop.

d_spacing np.ndarray

D-spacing values for all reflection data points.

sin_theta_over_lambda np.ndarray

sinθ/λ values for all reflection data points.

index_h np.ndarray

Miller h indices for all reflection data points.

index_k np.ndarray

Miller k indices for all reflection data points.

index_l np.ndarray

Miller l indices for all reflection data points.

intensity_meas np.ndarray

Measured structure-factor intensities for all reflections.

intensity_meas_su np.ndarray

Standard uncertainties of the measured intensities.

intensity_calc np.ndarray

Calculated intensities for all reflections.

Attributes
wavelength property

Wavelengths associated with each reflection.

unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all items in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

scalar_descriptors property

Collection-level descriptors serialized outside the loop.

d_spacing property

D-spacing values for all reflection data points.

sin_theta_over_lambda property

sinθ/λ values for all reflection data points.

index_h property

Miller h indices for all reflection data points.

index_k property

Miller k indices for all reflection data points.

index_l property

Miller l indices for all reflection data points.

intensity_meas property

Measured structure-factor intensities for all reflections.

intensity_meas_su property

Standard uncertainties of the measured intensities.

intensity_calc property

Calculated intensities for all reflections.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

from_cif(block)

Populate this collection from a CIF block.

add(item)

Insert or replace a pre-built item into the collection.

Parameters:

Name Type Description Default
item object

A CategoryItem instance to add.

required
create(**kwargs)

Create a new item with the given attributes and add it.

A default instance of the collection's item type is created, then each keyword argument is applied via setattr.

Parameters:

Name Type Description Default
**kwargs object

Attribute names and values for the new item.

{}
Functions
factory

Reflection collection factory — delegates to FactoryBase.

Classes:

Name Description
ReflnFactory

Factory for creating reflection collections.

Classes
ReflnFactory

Factory for creating reflection collections.

Methods:

Name Description
__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None

collection

Collection of experiment data blocks.

Classes:

Name Description
Experiments

Collection of Experiment data blocks.

Classes

Experiments()

Collection of Experiment data blocks.

Provides convenience constructors for common creation patterns and helper methods for simple presentation of collection contents.

Methods:

Name Description
create

Add an experiment without associating a data file.

add_from_cif_str

Add an experiment from a CIF string.

add_from_cif_path

Add an experiment from a CIF file path.

add_from_data_path

Add an experiment from a data file path.

show_names

List all experiment names in the collection.

show_params

Show parameters of all experiments in the collection.

__str__

Human-readable representation of this component.

__repr__

Return the developer representation of this object.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and contained items.

__getitem__

Return an item by name or positional index.

__setitem__

Insert or replace an item under the given identity key.

__delitem__

Delete an item by key or raise KeyError if missing.

__contains__

Check whether an item with the given key exists.

__iter__

Iterate over items in insertion order.

__len__

Return the number of items in the collection.

remove

Remove an item by its key.

keys

Yield keys for all items in insertion order.

values

Yield items in insertion order.

items

Yield (key, item) pairs in insertion order.

add

Add a pre-built item to the collection.

Attributes:

Name Type Description
unique_name str | None

Return None; collections have no unique name.

parameters list

All parameters from all datablocks in this collection.

as_cif str

Return CIF representation of this object.

names list[str | None]

List of all item keys in the collection.

fittable_parameters list

All Parameters not blocked by constraints or symmetry.

free_parameters list

All fittable parameters that are currently marked as free.

Attributes
unique_name property

Return None; collections have no unique name.

parameters property

All parameters from all datablocks in this collection.

as_cif property

Return CIF representation of this object.

names property

List of all item keys in the collection.

fittable_parameters property

All Parameters not blocked by constraints or symmetry.

free_parameters property

All fittable parameters that are currently marked as free.

Functions
create(*, name, sample_form=None, beam_mode=None, radiation_probe=None, scattering_type=None)

Add an experiment without associating a data file.

Parameters:

Name Type Description Default
name str

Experiment identifier.

required
sample_form str | None

Sample form (e.g. 'powder').

None
beam_mode str | None

Beam mode (e.g. 'constant wavelength').

None
radiation_probe str | None

Radiation probe (e.g. 'neutron').

None
scattering_type str | None

Scattering type (e.g. 'bragg').

None
add_from_cif_str(cif_str)

Add an experiment from a CIF string.

Parameters:

Name Type Description Default
cif_str str

Full CIF document as a string.

required
add_from_cif_path(cif_path)

Add an experiment from a CIF file path.

Parameters:

Name Type Description Default
cif_path str

Path to a CIF document.

required
add_from_data_path(*, name, data_path, sample_form=None, beam_mode=None, radiation_probe=None, scattering_type=None)

Add an experiment from a data file path.

Parameters:

Name Type Description Default
name str

Experiment identifier.

required
data_path str

Path to the measured data file.

required
sample_form str | None

Sample form (e.g. 'powder').

None
beam_mode str | None

Beam mode (e.g. 'constant wavelength').

None
radiation_probe str | None

Radiation probe (e.g. 'neutron').

None
scattering_type str | None

Scattering type (e.g. 'bragg').

None
show_names()

List all experiment names in the collection.

show_params()

Show parameters of all experiments in the collection.

__str__()

Human-readable representation of this component.

__repr__()

Return the developer representation of this object.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and contained items.

__getitem__(key)

Return an item by name or positional index.

Parameters:

Name Type Description Default
key str | int

Identity key (str) or zero-based positional index (int).

required

Returns:

Type Description
GuardedBase

The item matching the given key or index.

Raises:

Type Description
TypeError

If key is neither str nor int.

__setitem__(name, item)

Insert or replace an item under the given identity key.

__delitem__(name)

Delete an item by key or raise KeyError if missing.

__contains__(name)

Check whether an item with the given key exists.

__iter__()

Iterate over items in insertion order.

__len__()

Return the number of items in the collection.

remove(name)

Remove an item by its key.

Parameters:

Name Type Description Default
name str

Identity key of the item to remove.

required
keys()

Yield keys for all items in insertion order.

values()

Yield items in insertion order.

items()

Yield (key, item) pairs in insertion order.

add(item)

Add a pre-built item to the collection.

Parameters:

Name Type Description Default
item object

A DatablockItem instance (e.g. a Structure or ExperimentBase subclass).

required

item

Modules:

Name Description
base

Base classes for experiment datablock items.

bragg_pd
bragg_sc
enums

Enumerations for experiment configuration (forms, modes, types).

factory

Factory for creating experiment instances from various inputs.

total_pd

Classes

Modules

base

Base classes for experiment datablock items.

Classes:

Name Description
ExperimentBase

Base class for all experiment datablock items.

ScExperimentBase

Base class for all single crystal experiments.

PdExperimentBase

Base class for all powder experiments.

Functions:

Name Description
intensity_category_for

Return the category exposing measured and calculated values.

Classes
ExperimentBase(*, name, type)

Base class for all experiment datablock items.

Methods:

Name Description
show_as_cif

Pretty-print the experiment as CIF text.

__str__

Human-readable representation of this component.

__repr__

Developer-oriented representation of this component.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and categories.

Attributes:

Name Type Description
name str

Human-readable name of the experiment.

type object

Experiment type: sample form, probe, beam mode.

measured_range MeasuredRange | None

Measured x-axis range as (min, max, inc).

diffrn object

Ambient conditions recorded during measurement.

as_cif str

Serialize this experiment to a CIF fragment.

calculator object

The active calculator category for this experiment.

unique_name str | None

Unique name of this datablock item (from identity).

parameters list

All parameters from all owned categories.

categories list

All category objects owned by this object, sorted by priority.

Attributes
name property writable

Human-readable name of the experiment.

type property

Experiment type: sample form, probe, beam mode.

measured_range property

Measured x-axis range as (min, max, inc).

diffrn property

Ambient conditions recorded during measurement.

as_cif property

Serialize this experiment to a CIF fragment.

calculator property

The active calculator category for this experiment.

Holds the selected calculator type and provides access to the live calculator backend instance.

unique_name property

Unique name of this datablock item (from identity).

parameters property

All parameters from all owned categories.

categories property

All category objects owned by this object, sorted by priority.

Functions
show_as_cif()

Pretty-print the experiment as CIF text.

__str__()

Human-readable representation of this component.

__repr__()

Developer-oriented representation of this component.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and categories.

ScExperimentBase(*, name, type)

Base class for all single crystal experiments.

Methods:

Name Description
fit_data_arrays

Return no 1-D fit arrays for single-crystal experiments.

__str__

Human-readable representation of this component.

__repr__

Developer-oriented representation of this component.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and categories.

show_as_cif

Pretty-print the experiment as CIF text.

Attributes:

Name Type Description
extinction object

Active extinction correction model.

linked_crystal object

Linked crystal model for this experiment.

instrument object

Active instrument model for this experiment.

refln object

Reflection collection for this experiment.

x_descriptor NumericDescriptor | None

Return None because single-crystal data has no 1-D x axis.

unique_name str | None

Unique name of this datablock item (from identity).

parameters list

All parameters from all owned categories.

as_cif str

Serialize this experiment to a CIF fragment.

categories list

All category objects owned by this object, sorted by priority.

name str

Human-readable name of the experiment.

type object

Experiment type: sample form, probe, beam mode.

measured_range MeasuredRange | None

Measured x-axis range as (min, max, inc).

diffrn object

Ambient conditions recorded during measurement.

calculator object

The active calculator category for this experiment.

Attributes
extinction property

Active extinction correction model.

linked_crystal property

Linked crystal model for this experiment.

instrument property

Active instrument model for this experiment.

refln property

Reflection collection for this experiment.

x_descriptor property

Return None because single-crystal data has no 1-D x axis.

unique_name property

Unique name of this datablock item (from identity).

parameters property

All parameters from all owned categories.

as_cif property

Serialize this experiment to a CIF fragment.

categories property

All category objects owned by this object, sorted by priority.

name property writable

Human-readable name of the experiment.

type property

Experiment type: sample form, probe, beam mode.

measured_range property

Measured x-axis range as (min, max, inc).

diffrn property

Ambient conditions recorded during measurement.

calculator property

The active calculator category for this experiment.

Holds the selected calculator type and provides access to the live calculator backend instance.

Functions
fit_data_arrays() staticmethod

Return no 1-D fit arrays for single-crystal experiments.

__str__()

Human-readable representation of this component.

__repr__()

Developer-oriented representation of this component.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and categories.

show_as_cif()

Pretty-print the experiment as CIF text.

PdExperimentBase(*, name, type)

Base class for all powder experiments.

Methods:

Name Description
fit_data_arrays

Return arrays needed to draw the powder fit-data chart.

__str__

Human-readable representation of this component.

__repr__

Developer-oriented representation of this component.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and categories.

show_as_cif

Pretty-print the experiment as CIF text.

Attributes:

Name Type Description
linked_phases object

Collection of phases linked to this experiment.

excluded_regions object

Collection of excluded regions for the x-grid.

data object

Data collection for this experiment.

x_descriptor NumericDescriptor

Descriptor that owns the powder experiment's x-axis metadata.

peak object

Peak category object with profile parameters and mixins.

unique_name str | None

Unique name of this datablock item (from identity).

parameters list

All parameters from all owned categories.

as_cif str

Serialize this experiment to a CIF fragment.

categories list

All category objects owned by this object, sorted by priority.

name str

Human-readable name of the experiment.

type object

Experiment type: sample form, probe, beam mode.

measured_range MeasuredRange | None

Measured x-axis range as (min, max, inc).

diffrn object

Ambient conditions recorded during measurement.

calculator object

The active calculator category for this experiment.

Attributes
linked_phases property

Collection of phases linked to this experiment.

excluded_regions property

Collection of excluded regions for the x-grid.

data property

Data collection for this experiment.

x_descriptor property

Descriptor that owns the powder experiment's x-axis metadata.

peak property

Peak category object with profile parameters and mixins.

unique_name property

Unique name of this datablock item (from identity).

parameters property

All parameters from all owned categories.

as_cif property

Serialize this experiment to a CIF fragment.

categories property

All category objects owned by this object, sorted by priority.

name property writable

Human-readable name of the experiment.

type property

Experiment type: sample form, probe, beam mode.

measured_range property

Measured x-axis range as (min, max, inc).

diffrn property

Ambient conditions recorded during measurement.

calculator property

The active calculator category for this experiment.

Holds the selected calculator type and provides access to the live calculator backend instance.

Functions
fit_data_arrays()

Return arrays needed to draw the powder fit-data chart.

__str__()

Human-readable representation of this component.

__repr__()

Developer-oriented representation of this component.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and categories.

show_as_cif()

Pretty-print the experiment as CIF text.

Functions
intensity_category_for(experiment)

Return the category exposing measured and calculated values.

bragg_pd

Classes:

Name Description
BraggPdExperiment

Standard Bragg powder diffraction experiment.

Classes
BraggPdExperiment(*, name, type)

Standard Bragg powder diffraction experiment.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Developer-oriented representation of this component.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and categories.

show_as_cif

Pretty-print the experiment as CIF text.

fit_data_arrays

Return arrays needed to draw the powder fit-data chart.

Attributes:

Name Type Description
instrument object

Active instrument model for this experiment.

refln object | None

Calculated reflection metadata when supported.

background object

Active background model for this experiment.

unique_name str | None

Unique name of this datablock item (from identity).

parameters list

All parameters from all owned categories.

as_cif str

Serialize this experiment to a CIF fragment.

categories list

All category objects owned by this object, sorted by priority.

name str

Human-readable name of the experiment.

type object

Experiment type: sample form, probe, beam mode.

measured_range MeasuredRange | None

Measured x-axis range as (min, max, inc).

diffrn object

Ambient conditions recorded during measurement.

calculator object

The active calculator category for this experiment.

linked_phases object

Collection of phases linked to this experiment.

excluded_regions object

Collection of excluded regions for the x-grid.

data object

Data collection for this experiment.

x_descriptor NumericDescriptor

Descriptor that owns the powder experiment's x-axis metadata.

peak object

Peak category object with profile parameters and mixins.

Attributes
instrument property

Active instrument model for this experiment.

refln property

Calculated reflection metadata when supported.

background property

Active background model for this experiment.

unique_name property

Unique name of this datablock item (from identity).

parameters property

All parameters from all owned categories.

as_cif property

Serialize this experiment to a CIF fragment.

categories property

All category objects owned by this object, sorted by priority.

name property writable

Human-readable name of the experiment.

type property

Experiment type: sample form, probe, beam mode.

measured_range property

Measured x-axis range as (min, max, inc).

diffrn property

Ambient conditions recorded during measurement.

calculator property

The active calculator category for this experiment.

Holds the selected calculator type and provides access to the live calculator backend instance.

linked_phases property

Collection of phases linked to this experiment.

excluded_regions property

Collection of excluded regions for the x-grid.

data property

Data collection for this experiment.

x_descriptor property

Descriptor that owns the powder experiment's x-axis metadata.

peak property

Peak category object with profile parameters and mixins.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Developer-oriented representation of this component.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and categories.

show_as_cif()

Pretty-print the experiment as CIF text.

fit_data_arrays()

Return arrays needed to draw the powder fit-data chart.

Functions
bragg_sc

Classes:

Name Description
CwlScExperiment

Bragg constant-wavelength single-crystal experiment.

TofScExperiment

Bragg time-of-flight single-crystal experiment.

Classes
CwlScExperiment(*, name, type)

Bragg constant-wavelength single-crystal experiment.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Developer-oriented representation of this component.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and categories.

show_as_cif

Pretty-print the experiment as CIF text.

fit_data_arrays

Return no 1-D fit arrays for single-crystal experiments.

Attributes:

Name Type Description
unique_name str | None

Unique name of this datablock item (from identity).

parameters list

All parameters from all owned categories.

as_cif str

Serialize this experiment to a CIF fragment.

categories list

All category objects owned by this object, sorted by priority.

name str

Human-readable name of the experiment.

type object

Experiment type: sample form, probe, beam mode.

measured_range MeasuredRange | None

Measured x-axis range as (min, max, inc).

diffrn object

Ambient conditions recorded during measurement.

calculator object

The active calculator category for this experiment.

extinction object

Active extinction correction model.

linked_crystal object

Linked crystal model for this experiment.

instrument object

Active instrument model for this experiment.

refln object

Reflection collection for this experiment.

x_descriptor NumericDescriptor | None

Return None because single-crystal data has no 1-D x axis.

Attributes
unique_name property

Unique name of this datablock item (from identity).

parameters property

All parameters from all owned categories.

as_cif property

Serialize this experiment to a CIF fragment.

categories property

All category objects owned by this object, sorted by priority.

name property writable

Human-readable name of the experiment.

type property

Experiment type: sample form, probe, beam mode.

measured_range property

Measured x-axis range as (min, max, inc).

diffrn property

Ambient conditions recorded during measurement.

calculator property

The active calculator category for this experiment.

Holds the selected calculator type and provides access to the live calculator backend instance.

extinction property

Active extinction correction model.

linked_crystal property

Linked crystal model for this experiment.

instrument property

Active instrument model for this experiment.

refln property

Reflection collection for this experiment.

x_descriptor property

Return None because single-crystal data has no 1-D x axis.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Developer-oriented representation of this component.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and categories.

show_as_cif()

Pretty-print the experiment as CIF text.

fit_data_arrays() staticmethod

Return no 1-D fit arrays for single-crystal experiments.

TofScExperiment(*, name, type)

Bragg time-of-flight single-crystal experiment.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Developer-oriented representation of this component.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and categories.

show_as_cif

Pretty-print the experiment as CIF text.

fit_data_arrays

Return no 1-D fit arrays for single-crystal experiments.

Attributes:

Name Type Description
unique_name str | None

Unique name of this datablock item (from identity).

parameters list

All parameters from all owned categories.

as_cif str

Serialize this experiment to a CIF fragment.

categories list

All category objects owned by this object, sorted by priority.

name str

Human-readable name of the experiment.

type object

Experiment type: sample form, probe, beam mode.

measured_range MeasuredRange | None

Measured x-axis range as (min, max, inc).

diffrn object

Ambient conditions recorded during measurement.

calculator object

The active calculator category for this experiment.

extinction object

Active extinction correction model.

linked_crystal object

Linked crystal model for this experiment.

instrument object

Active instrument model for this experiment.

refln object

Reflection collection for this experiment.

x_descriptor NumericDescriptor | None

Return None because single-crystal data has no 1-D x axis.

Attributes
unique_name property

Unique name of this datablock item (from identity).

parameters property

All parameters from all owned categories.

as_cif property

Serialize this experiment to a CIF fragment.

categories property

All category objects owned by this object, sorted by priority.

name property writable

Human-readable name of the experiment.

type property

Experiment type: sample form, probe, beam mode.

measured_range property

Measured x-axis range as (min, max, inc).

diffrn property

Ambient conditions recorded during measurement.

calculator property

The active calculator category for this experiment.

Holds the selected calculator type and provides access to the live calculator backend instance.

extinction property

Active extinction correction model.

linked_crystal property

Linked crystal model for this experiment.

instrument property

Active instrument model for this experiment.

refln property

Reflection collection for this experiment.

x_descriptor property

Return None because single-crystal data has no 1-D x axis.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Developer-oriented representation of this component.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and categories.

show_as_cif()

Pretty-print the experiment as CIF text.

fit_data_arrays() staticmethod

Return no 1-D fit arrays for single-crystal experiments.

Functions
enums

Enumerations for experiment configuration (forms, modes, types).

Classes:

Name Description
SampleFormEnum

Physical sample form supported by experiments.

ScatteringTypeEnum

Type of scattering modeled in an experiment.

RadiationProbeEnum

Incident radiation probe used in the experiment.

BeamModeEnum

Beam delivery mode for the instrument.

CalculatorEnum

Known calculation engine identifiers.

PeakProfileTypeEnum

Available peak profile types per scattering and beam mode.

ExtinctionModelEnum

Mosaicity distribution model for Becker-Coppens extinction.

Classes
SampleFormEnum

Physical sample form supported by experiments.

Methods:

Name Description
default

Return the default sample form (POWDER).

description

Return a human-readable description of this sample form.

Functions
default() classmethod

Return the default sample form (POWDER).

Returns:

Type Description
SampleFormEnum

The default enum member.

description()

Return a human-readable description of this sample form.

Returns:

Type Description
str

Description string for the current enum member.

ScatteringTypeEnum

Type of scattering modeled in an experiment.

Methods:

Name Description
default

Return the default scattering type (BRAGG).

description

Return a human-readable description of this scattering type.

Functions
default() classmethod

Return the default scattering type (BRAGG).

Returns:

Type Description
ScatteringTypeEnum

The default enum member.

description()

Return a human-readable description of this scattering type.

Returns:

Type Description
str

Description string for the current enum member.

RadiationProbeEnum

Incident radiation probe used in the experiment.

Methods:

Name Description
default

Return the default radiation probe (NEUTRON).

description

Return a human-readable description of this radiation probe.

Functions
default() classmethod

Return the default radiation probe (NEUTRON).

Returns:

Type Description
RadiationProbeEnum

The default enum member.

description()

Return a human-readable description of this radiation probe.

Returns:

Type Description
str

Description string for the current enum member.

BeamModeEnum

Beam delivery mode for the instrument.

Methods:

Name Description
default

Return the default beam mode (CONSTANT_WAVELENGTH).

description

Return a human-readable description of this beam mode.

Functions
default() classmethod

Return the default beam mode (CONSTANT_WAVELENGTH).

Returns:

Type Description
BeamModeEnum

The default enum member.

description()

Return a human-readable description of this beam mode.

Returns:

Type Description
str

Description string for the current enum member.

CalculatorEnum

Known calculation engine identifiers.

PeakProfileTypeEnum

Available peak profile types per scattering and beam mode.

Methods:

Name Description
default

Return the default peak profile type for a given mode.

description

Return a human-readable description of this peak profile type.

Functions
default(scattering_type=None, beam_mode=None) classmethod

Return the default peak profile type for a given mode.

Parameters:

Name Type Description Default
scattering_type ScatteringTypeEnum | None

Scattering type; defaults to ScatteringTypeEnum.default() when None.

None
beam_mode BeamModeEnum | None

Beam mode; defaults to BeamModeEnum.default() when None.

None

Returns:

Type Description
PeakProfileTypeEnum

The default profile type for the given combination.

description()

Return a human-readable description of this peak profile type.

Returns:

Type Description
str

Description string for the current enum member.

ExtinctionModelEnum

Mosaicity distribution model for Becker-Coppens extinction.

Methods:

Name Description
default

Return the default extinction model (GAUSS).

description

Return a human-readable description of this extinction model.

Functions
default() classmethod

Return the default extinction model (GAUSS).

Returns:

Type Description
ExtinctionModelEnum

The default enum member.

description()

Return a human-readable description of this extinction model.

Returns:

Type Description
str

Description string for the current enum member.

factory

Factory for creating experiment instances from various inputs.

Provides individual class methods for each creation pathway: from_cif_path, from_cif_str, from_data_path, and from_scratch.

Classes:

Name Description
ExperimentFactory

Creates Experiment instances with only relevant attributes.

Classes
ExperimentFactory()

Creates Experiment instances with only relevant attributes.

Methods:

Name Description
from_scratch

Create an experiment without measured data.

from_cif_str

Create an experiment from a CIF string.

from_cif_path

Create an experiment from a CIF file path.

from_data_path

Create an experiment from a raw data ASCII file.

__init_subclass__

Give each subclass its own independent registry and rules.

register

Class decorator to register a concrete class.

supported_tags

Return list of all supported tags.

default_tag

Resolve the default tag for a given experimental context.

create

Instantiate a registered class by tag.

create_default_for

Instantiate the default class for a given context.

supported_for

Return classes matching conditions and/or calculator.

show_supported

Pretty-print a table of supported types.

Functions
from_scratch(*, name, sample_form=None, beam_mode=None, radiation_probe=None, scattering_type=None) classmethod

Create an experiment without measured data.

Parameters:

Name Type Description Default
name str

Experiment identifier.

required
sample_form str | None

Sample form (e.g. 'powder').

None
beam_mode str | None

Beam mode (e.g. 'constant wavelength').

None
radiation_probe str | None

Radiation probe (e.g. 'neutron').

None
scattering_type str | None

Scattering type (e.g. 'bragg').

None

Returns:

Type Description
ExperimentBase

An experiment instance with only metadata.

from_cif_str(cif_str) classmethod

Create an experiment from a CIF string.

Parameters:

Name Type Description Default
cif_str str

Full CIF document as a string.

required

Returns:

Type Description
ExperimentBase

A populated experiment instance.

from_cif_path(cif_path) classmethod

Create an experiment from a CIF file path.

Parameters:

Name Type Description Default
cif_path str

Path to a CIF file.

required

Returns:

Type Description
ExperimentBase

A populated experiment instance.

from_data_path(*, name, data_path, sample_form=None, beam_mode=None, radiation_probe=None, scattering_type=None) classmethod

Create an experiment from a raw data ASCII file.

Parameters:

Name Type Description Default
name str

Experiment identifier.

required
data_path str

Path to the measured data file.

required
sample_form str | None

Sample form (e.g. 'powder').

None
beam_mode str | None

Beam mode (e.g. 'constant wavelength').

None
radiation_probe str | None

Radiation probe (e.g. 'neutron').

None
scattering_type str | None

Scattering type (e.g. 'bragg').

None

Returns:

Type Description
ExperimentBase

An experiment instance with measured data attached.

__init_subclass__(**kwargs)

Give each subclass its own independent registry and rules.

register(klass) classmethod

Class decorator to register a concrete class.

Usage::

@SomeFactory.register class MyClass(SomeBase): type_info = TypeInfo(...)

Returns the class unmodified.

supported_tags() classmethod

Return list of all supported tags.

default_tag(**conditions) classmethod

Resolve the default tag for a given experimental context.

Uses largest-subset matching: the rule whose key is the biggest subset of the given conditions wins. A rule with an empty key (frozenset()) acts as a universal fallback.

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values, e.g. scattering_type=ScatteringTypeEnum.BRAGG.

{}

Returns:

Type Description
str

The resolved default tag string.

Raises:

Type Description
ValueError

If no rule matches the given conditions.

create(tag, **kwargs) classmethod

Instantiate a registered class by tag.

Parameters:

Name Type Description Default
tag str

type_info.tag value.

required
**kwargs object

Forwarded to the class constructor.

{}

Returns:

Type Description
object

A new instance of the registered class.

Raises:

Type Description
ValueError

If tag is not in the registry.

create_default_for(**conditions) classmethod

Instantiate the default class for a given context.

Combines default_tag(**conditions) with create(tag).

Parameters:

Name Type Description Default
**conditions object

Experimental-axis values.

{}

Returns:

Type Description
object

A new instance of the default class.

supported_for(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Return classes matching conditions and/or calculator.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum value.

None
sample_form object

Optional SampleFormEnum value.

None
scattering_type object

Optional ScatteringTypeEnum value.

None
beam_mode object

Optional BeamModeEnum value.

None
radiation_probe object

Optional RadiationProbeEnum value.

None

Returns:

Type Description
list[type]

Classes matching the given conditions.

show_supported(*, calculator=None, sample_form=None, scattering_type=None, beam_mode=None, radiation_probe=None) classmethod

Pretty-print a table of supported types.

Parameters:

Name Type Description Default
calculator object

Optional CalculatorEnum filter.

None
sample_form object

Optional SampleFormEnum filter.

None
scattering_type object

Optional ScatteringTypeEnum filter.

None
beam_mode object

Optional BeamModeEnum filter.

None
radiation_probe object

Optional RadiationProbeEnum filter.

None
Functions
total_pd

Classes:

Name Description
TotalPdExperiment

PDF experiment class with specific attributes.

Classes
TotalPdExperiment(name, type)

PDF experiment class with specific attributes.

Methods:

Name Description
__str__

Human-readable representation of this component.

__repr__

Developer-oriented representation of this component.

__getattr__

Raise a descriptive error for unknown attribute access.

__setattr__

Set an attribute with access-control diagnostics.

help

Print a summary of public attributes and categories.

show_as_cif

Pretty-print the experiment as CIF text.

fit_data_arrays

Return arrays needed to draw the powder fit-data chart.

Attributes:

Name Type Description
unique_name str | None

Unique name of this datablock item (from identity).

parameters list

All parameters from all owned categories.

as_cif str

Serialize this experiment to a CIF fragment.

categories list

All category objects owned by this object, sorted by priority.

name str

Human-readable name of the experiment.

type object

Experiment type: sample form, probe, beam mode.

measured_range MeasuredRange | None

Measured x-axis range as (min, max, inc).

diffrn object

Ambient conditions recorded during measurement.

calculator object

The active calculator category for this experiment.

linked_phases object

Collection of phases linked to this experiment.

excluded_regions object

Collection of excluded regions for the x-grid.

data object

Data collection for this experiment.

x_descriptor NumericDescriptor

Descriptor that owns the powder experiment's x-axis metadata.

peak object

Peak category object with profile parameters and mixins.

Attributes
unique_name property

Unique name of this datablock item (from identity).

parameters property

All parameters from all owned categories.

as_cif property

Serialize this experiment to a CIF fragment.

categories property

All category objects owned by this object, sorted by priority.

name property writable

Human-readable name of the experiment.

type property

Experiment type: sample form, probe, beam mode.

measured_range property

Measured x-axis range as (min, max, inc).

diffrn property

Ambient conditions recorded during measurement.

calculator property

The active calculator category for this experiment.

Holds the selected calculator type and provides access to the live calculator backend instance.

linked_phases property

Collection of phases linked to this experiment.

excluded_regions property

Collection of excluded regions for the x-grid.

data property

Data collection for this experiment.

x_descriptor property

Descriptor that owns the powder experiment's x-axis metadata.

peak property

Peak category object with profile parameters and mixins.

Functions
__str__()

Human-readable representation of this component.

__repr__()

Developer-oriented representation of this component.

__getattr__(key)

Raise a descriptive error for unknown attribute access.

__setattr__(key, value)

Set an attribute with access-control diagnostics.

help()

Print a summary of public attributes and categories.

show_as_cif()

Pretty-print the experiment as CIF text.

fit_data_arrays()

Return arrays needed to draw the powder fit-data chart.