sample_models
collections
atom_sites
AtomSite
Bases: Component
Represents a single atom site within the crystal structure.
Source code in src/easydiffraction/sample_models/collections/atom_sites.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
AtomSites
Bases: Collection
Collection of AtomSite instances.
Source code in src/easydiffraction/sample_models/collections/atom_sites.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
components
cell
Cell
Bases: Component
Represents the unit cell parameters of a sample model.
Source code in src/easydiffraction/sample_models/components/cell.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
space_group
SpaceGroup
Bases: Component
Represents the space group of a sample model.
Source code in src/easydiffraction/sample_models/components/space_group.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
sample_model
SampleModel
Bases: Datablock
Represents an individual structural model of a sample. Wraps crystallographic information including space group, cell, and atomic sites.
Source code in src/easydiffraction/sample_models/sample_model.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
as_cif()
Export the sample model to CIF format. Returns: str: CIF string representation of the sample model.
Source code in src/easydiffraction/sample_models/sample_model.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
load_from_cif_file(cif_path)
Load model data from a CIF file.
Source code in src/easydiffraction/sample_models/sample_model.py
143 144 145 146 |
|
load_from_cif_string(cif_str)
Load model data from a CIF string.
Source code in src/easydiffraction/sample_models/sample_model.py
149 150 151 152 |
|
show_params()
Display structural parameters (space group, unit cell, atomic sites).
Source code in src/easydiffraction/sample_models/sample_model.py
194 195 196 197 198 199 200 |
|
show_structure(plane='xy', grid_size=20)
Show an ASCII projection of the structure on a 2D plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plane
|
str
|
'xy', 'xz', or 'yz' plane to project. |
'xy'
|
grid_size
|
int
|
Size of the ASCII grid (default is 20). |
20
|
Source code in src/easydiffraction/sample_models/sample_model.py
182 183 184 185 186 187 188 189 190 191 192 |
|
sample_models
SampleModels
Bases: Collection
Collection manager for multiple SampleModel instances.
Source code in src/easydiffraction/sample_models/sample_models.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
add(model=None, name=None, cif_path=None, cif_str=None)
Add a new sample model to the collection. Dispatches based on input type: pre-built model or parameters for new creation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Optional[SampleModel]
|
An existing SampleModel instance. |
None
|
name
|
Optional[str]
|
Name for a new model if created from scratch. |
None
|
cif_path
|
Optional[str]
|
Path to a CIF file to create a model from. |
None
|
cif_str
|
Optional[str]
|
CIF content as string to create a model from. |
None
|
Source code in src/easydiffraction/sample_models/sample_models.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
as_cif()
Export all sample models to CIF format.
Returns:
Type | Description |
---|---|
str
|
CIF string representation of all sample models. |
Source code in src/easydiffraction/sample_models/sample_models.py
82 83 84 85 86 87 88 89 |
|
get_ids()
Return a list of all model IDs in the collection.
Returns:
Type | Description |
---|---|
List[str]
|
List of model IDs. |
Source code in src/easydiffraction/sample_models/sample_models.py
58 59 60 61 62 63 64 65 |
|
ids
property
Property accessor for model IDs.
remove(name)
Remove a sample model by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
ID of the model to remove. |
required |
Source code in src/easydiffraction/sample_models/sample_models.py
48 49 50 51 52 53 54 55 56 |
|
show_names()
List all model IDs in the collection.
Source code in src/easydiffraction/sample_models/sample_models.py
72 73 74 75 |
|
show_params()
Show parameters of all sample models in the collection.
Source code in src/easydiffraction/sample_models/sample_models.py
77 78 79 80 |
|