- class easyreflectometry.sample.collections.sample.Sample[source]#
Bases:
BaseCollection
A sample is a collection of assemblies that represent the structure for which experimental measurements exist.
- __init__(*assemblies, name='EasySample', interface=None, unique_name=None, populate_if_none=True, **kwargs)[source]#
Constructor.
- Parameters:
args – The assemblies in the sample.
name (
str
) – Name of the sample, defaults to ‘EasySample’.interface – Calculator interface, defaults to None.
- add_assembly(assembly=None)[source]#
Add an assembly to the sample.
- Parameters:
assembly (
Optional
[BaseAssembly
]) – Assembly to add.
- duplicate_assembly(index)[source]#
Add an assembly to the sample.
- Parameters:
assembly – Assembly to add.
- move_up(index)[source]#
Move the assembly at the given index up in the sample.
- Parameters:
index (
int
) – Index of the assembly to move up.
- move_down(index)[source]#
Move the assembly at the given index down in the sample.
- Parameters:
index (
int
) – Index of the assembly to move down.
- remove_assembly(index)[source]#
Remove the assembly at the given index from the sample.
- Parameters:
index (
int
) – Index of the assembly to remove.
- as_dict(skip=None)[source]#
Produces a cleaned dict using a custom as_dict method to skip necessary things. The resulting dict matches the parameters in __init__
- Parameters:
skip (
Optional
[List
[str
]]) – List of keys to skip, defaults to None.- Return type:
dict
-
user_data:
dict
#