pyemaps 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. pyemaps/COPYING +798 -0
  2. pyemaps/CifFile/CifFile_module.py +3117 -0
  3. pyemaps/CifFile/StarFile.py +2496 -0
  4. pyemaps/CifFile/TypeContentsParser.py +82 -0
  5. pyemaps/CifFile/YappsStarParser_1_0.py +289 -0
  6. pyemaps/CifFile/YappsStarParser_1_1.py +288 -0
  7. pyemaps/CifFile/YappsStarParser_2_0.py +369 -0
  8. pyemaps/CifFile/YappsStarParser_STAR2.py +382 -0
  9. pyemaps/CifFile/__init__.py +7 -0
  10. pyemaps/CifFile/drel/__init__.py +1 -0
  11. pyemaps/CifFile/drel/drel_ast_yacc.py +582 -0
  12. pyemaps/CifFile/drel/drel_lex.py +228 -0
  13. pyemaps/CifFile/drel/drel_runtime.py +126 -0
  14. pyemaps/CifFile/drel/parsetab.py +185 -0
  15. pyemaps/CifFile/drel/py_from_ast.py +628 -0
  16. pyemaps/CifFile/parsetab.py +185 -0
  17. pyemaps/CifFile/yapps3_compiled_rt.py +390 -0
  18. pyemaps/README.md +201 -0
  19. pyemaps/__config__.py +91 -0
  20. pyemaps/__init__.py +233 -0
  21. pyemaps/__main__.py +219 -0
  22. pyemaps/__version__.py +1 -0
  23. pyemaps/cdata/Aluminium.xtl +4 -0
  24. pyemaps/cdata/AluminiumOxide.xtl +5 -0
  25. pyemaps/cdata/Aluminium_FCC.xtl +4 -0
  26. pyemaps/cdata/BariumTitanate_180k.xtl +6 -0
  27. pyemaps/cdata/BariumTitanate_270k.xtl +7 -0
  28. pyemaps/cdata/BariumTitanate_Tetra.xtl +7 -0
  29. pyemaps/cdata/BiMnO3.xtl +27 -0
  30. pyemaps/cdata/Boron_Tetra.xtl +8 -0
  31. pyemaps/cdata/CadmiumSelenide_Hex.xtl +5 -0
  32. pyemaps/cdata/CadmiumSulfide_Cubic.xtl +5 -0
  33. pyemaps/cdata/CadmiumSulfide_Hex.xtl +5 -0
  34. pyemaps/cdata/Chromium_BCC.xtl +4 -0
  35. pyemaps/cdata/CoSb3_Skutterudite.xtl +5 -0
  36. pyemaps/cdata/CopperOxide.xtl +5 -0
  37. pyemaps/cdata/Copper_FCC.xtl +4 -0
  38. pyemaps/cdata/Cu2O_Cuprite.xtl +5 -0
  39. pyemaps/cdata/Diamond.xtl +4 -0
  40. pyemaps/cdata/ErbiumPyrogermanate.xtl +9 -0
  41. pyemaps/cdata/FePd_Tetra.xtl +5 -0
  42. pyemaps/cdata/FeS2_Pyrite.xtl +15 -0
  43. pyemaps/cdata/GalliumAntimonide.xtl +5 -0
  44. pyemaps/cdata/GalliumArsenide.xtl +5 -0
  45. pyemaps/cdata/GalliumNitride.xtl +5 -0
  46. pyemaps/cdata/Germanium.xtl +4 -0
  47. pyemaps/cdata/Gold_FCC.xtl +4 -0
  48. pyemaps/cdata/IndiumArsenide.xtl +5 -0
  49. pyemaps/cdata/LaMnO3.xtl +7 -0
  50. pyemaps/cdata/LeadZirconateTitanate.xtl +8 -0
  51. pyemaps/cdata/Li2MnO3.xtl +13 -0
  52. pyemaps/cdata/NaFeO2.xtl +6 -0
  53. pyemaps/cdata/Nb3Sn.xtl +5 -0
  54. pyemaps/cdata/Pentacene.xtl +39 -0
  55. pyemaps/cdata/Silicon.xtl +4 -0
  56. pyemaps/cdata/StrontiumTitanate.xtl +6 -0
  57. pyemaps/cdata/TelluriumDioxide.xtl +5 -0
  58. pyemaps/cdata/TinDioxide_RT.xtl +5 -0
  59. pyemaps/cdata/TitaniumDioxide_Anatase.xtl +5 -0
  60. pyemaps/cdata/TitaniumDioxide_Rutile.xtl +5 -0
  61. pyemaps/cdata/TungstenDiselenide.xtl +5 -0
  62. pyemaps/cdata/VanadiumDioxide_RT.xtl +6 -0
  63. pyemaps/cdata/ZincOxide.xtl +5 -0
  64. pyemaps/cdata/Zinc_HCP.xtl +4 -0
  65. pyemaps/cdata/ZirconiumNitride.xtl +5 -0
  66. pyemaps/cdata/limno2.xtl +6 -0
  67. pyemaps/crystals.py +1415 -0
  68. pyemaps/ddiffs.py +147 -0
  69. pyemaps/diffract/__init__.py +70 -0
  70. pyemaps/diffract/bloch_dec.py +779 -0
  71. pyemaps/diffract/csf_dec.py +242 -0
  72. pyemaps/diffract/dif_dec.py +519 -0
  73. pyemaps/diffract/dpgen_dec.py +175 -0
  74. pyemaps/diffract/mxtal_dec.py +201 -0
  75. pyemaps/diffract/powder_dec.py +137 -0
  76. pyemaps/diffract/stereo_dec.py +111 -0
  77. pyemaps/display.py +791 -0
  78. pyemaps/emcontrols.py +1017 -0
  79. pyemaps/errors.py +266 -0
  80. pyemaps/fileutils.py +1001 -0
  81. pyemaps/kdiffs.py +1221 -0
  82. pyemaps/license.txt +42 -0
  83. pyemaps/samples/adf.py +137 -0
  84. pyemaps/samples/al.img +0 -0
  85. pyemaps/samples/al_dpgen.py +57 -0
  86. pyemaps/samples/al_ediom.py +94 -0
  87. pyemaps/samples/convert_image.py +88 -0
  88. pyemaps/samples/dm_diff.py +225 -0
  89. pyemaps/samples/mask.im3 +0 -0
  90. pyemaps/samples/powder.py +51 -0
  91. pyemaps/samples/raw.img +0 -0
  92. pyemaps/samples/si_bloch.py +120 -0
  93. pyemaps/samples/si_constructor.py +51 -0
  94. pyemaps/samples/si_csf.py +59 -0
  95. pyemaps/samples/si_dif.py +134 -0
  96. pyemaps/samples/si_lacbed.py +59 -0
  97. pyemaps/samples/si_pyemaps.py +80 -0
  98. pyemaps/samples/si_scm.py +156 -0
  99. pyemaps/samples/si_stereo.py +116 -0
  100. pyemaps/scattering/__init__.py +26 -0
  101. pyemaps/scattering/sct_dec.py +31 -0
  102. pyemaps/spg/__init__.py +25 -0
  103. pyemaps/spg/spg_dec.py +60 -0
  104. pyemaps/stackimg.py +1031 -0
  105. pyemaps/xtal.py +222 -0
  106. pyemaps-2.0.0.dist-info/METADATA +231 -0
  107. pyemaps-2.0.0.dist-info/RECORD +112 -0
  108. pyemaps-2.0.0.dist-info/WHEEL +5 -0
  109. pyemaps-2.0.0.dist-info/entry_points.txt +2 -0
  110. pyemaps-2.0.0.dist-info/licenses/COPYING +798 -0
  111. pyemaps-2.0.0.dist-info/licenses/license.txt +42 -0
  112. pyemaps-2.0.0.dist-info/top_level.txt +1 -0
pyemaps/errors.py ADDED
@@ -0,0 +1,266 @@
1
+
2
+
3
+ '''
4
+ .. This file is part of pEMAPS
5
+
6
+ Error module for handling various pyemaps data validation and calculation
7
+ failures.
8
+
9
+ .. note::
10
+
11
+ This module is still in active development and improvements.
12
+
13
+ .. ----
14
+
15
+ .. pyEMAPS is free software. You can redistribute it and/or modify
16
+ .. it under the terms of the GNU General Public License as published
17
+ .. by the Free Software Foundation, either version 3 of the License,
18
+ .. or (at your option) any later version..
19
+
20
+ .. pyEMAPS is distributed in the hope that it will be useful,
21
+ .. but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ .. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ .. GNU General Public License for more details.
24
+
25
+ .. You should have received a copy of the GNU General Public License
26
+ .. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
27
+
28
+ .. Contact supprort@emlabsoftware.com for any questions and comments.
29
+
30
+ .. ----
31
+
32
+ .. Author: EMLab Solutions, Inc.
33
+ .. Date Created: June 28, 2022
34
+
35
+ '''
36
+
37
+ class pyemapsError(Exception):
38
+ pass # reserved for later
39
+
40
+
41
+ class CrystalClassError(Exception):
42
+ '''
43
+ Crystal object creation, validation and loading errors.
44
+
45
+ '''
46
+ def __init__(self, message):
47
+ self.message = str(f'Error creating pyemaps crystal object with message:\n{message}')
48
+ super().__init__(self.message)
49
+
50
+ class XTLError(Exception):
51
+ '''
52
+ XTL crystal data import errors.
53
+
54
+ '''
55
+ def __init__(self, fn='', message=''):
56
+ self.message = str(f'Error importing XTL file {fn}: {message}')
57
+ super().__init__(self.message)
58
+
59
+ class CIFError(Exception):
60
+ '''
61
+ CIF crystal data import errors.
62
+
63
+ '''
64
+ def __init__(self, fn='', message=''):
65
+ self.message = str(f'Error importing CIF file {fn}: {message}')
66
+ super().__init__(self.message)
67
+
68
+ class CellError(Exception):
69
+ '''
70
+ Cell constant data validation errors.
71
+
72
+ '''
73
+ def __init__(self, message):
74
+ self.message = message
75
+ super().__init__(self.message)
76
+
77
+ class CellValueError(CellError):
78
+ '''
79
+ Details of cell constant data validation errors.
80
+
81
+ '''
82
+ def __init__(self, ty=0, cn=''):
83
+ self.message = str(f'Invalid cell length value for {cn}') if ty ==1 else \
84
+ str(f'Invalid cell angle value for {cn}')
85
+ super().__init__(self.message)
86
+
87
+ class CellDataError(CellError):
88
+ '''
89
+ Details of cell constant data validation errors.
90
+
91
+ '''
92
+ def __init__(self, message = 'invalid cell data'):
93
+ self.message = message
94
+ super().__init__(self.message)
95
+
96
+ class SPGError(Exception):
97
+ '''
98
+ Space group data validation errors.
99
+
100
+ '''
101
+ def __init__(self, message):
102
+ self.message = message
103
+ super().__init__(self.message)
104
+
105
+ class SPGITMumberNotInRangeError(SPGError):
106
+ '''
107
+ Space group IT number validation errors.
108
+
109
+ '''
110
+ def __init__(self, nummax):
111
+ self.message = str(f'Space Group IT number is not in (1, {nummax}) range')
112
+ super().__init__(self.message)
113
+
114
+ class SPGSettingNotInRangeError(SPGError):
115
+ '''
116
+ Space group setting validation errors.
117
+
118
+ '''
119
+ def __init__(self, setmax):
120
+ self.set_max = setmax
121
+ self.message = str(f'Space Group Setting is not in (1, {setmax}) range')
122
+ super().__init__(self.message)
123
+
124
+ class SPGInvalidDataInputError(SPGError):
125
+ '''
126
+ Space group setting validation errors. Duplicate of SPGError.
127
+
128
+ '''
129
+ def __init__(self, message = 'Invalid Space group data entered'):
130
+ self.message = message
131
+ super().__init__(self.message)
132
+
133
+ class UCError(Exception):
134
+ '''
135
+ Atomc data validation errors.
136
+
137
+ '''
138
+ def __init__(self, message=''):
139
+ self.message = str(f'Invalid unit cell data: {message}')
140
+ super().__init__(self.message)
141
+
142
+ # Diffraction pattern errors
143
+ class DPError(Exception):
144
+ '''
145
+ Kinematic diffraction pattren object creation errors.
146
+
147
+ '''
148
+ def __init__(self, message=''):
149
+ self.message = str(f'Invalid diffraction pattern: {message}')
150
+ super().__init__(self.message)
151
+
152
+ class PointError(DPError):
153
+ '''
154
+ Detailed kinematic diffraction pattren object creation errors on
155
+ Point object creation.
156
+
157
+ '''
158
+ def __init__(self, message=''):
159
+ self.message = str(f'Error creating Point object: {message}')
160
+ super().__init__(self.message)
161
+
162
+ class LineError(DPError):
163
+ '''
164
+ Detailed kinematic diffraction pattren object creation errors on
165
+ Line (Kikuchi or HOLZ) object creation.
166
+
167
+ '''
168
+ def __init__(self, message=''):
169
+ self.message = str(f'Error creating Line object: {message}')
170
+ super().__init__(self.message)
171
+
172
+ class PIndexError(DPError):
173
+ '''
174
+ Detailed kinematic diffraction pattren object creation errors on
175
+ Dfffracted beams Miller index object creation.
176
+
177
+ '''
178
+ def __init__(self, message=''):
179
+ self.message = str(f'Error creating Index object: {message}')
180
+ super().__init__(self.message)
181
+
182
+ class DiskError(DPError):
183
+ '''
184
+ Detailed kinematic diffraction pattren object creation errors on
185
+ Dfffracted beams object creation.
186
+
187
+ '''
188
+ def __init__(self, message=''):
189
+ self.message = str(f'Error creating Disk object: {message}')
190
+ super().__init__(self.message)
191
+
192
+ class DPListError(Exception):
193
+ '''
194
+ List of diffraction patterns create errors.
195
+
196
+ '''
197
+ def __init__(self, message=''):
198
+ self.message = str(f'Error creating DP list: {message}')
199
+ super().__init__(self.message)
200
+
201
+ class BlochError(Exception):
202
+ '''
203
+ Dynamic diffraction pattern generation, creation and validation errors.
204
+
205
+ '''
206
+ def __init__(self, message=''):
207
+ self.message = str(f'Error generating dynamic diffraction: {message}')
208
+ super().__init__(self.message)
209
+
210
+ # EM controls
211
+
212
+ class EMCError(Exception):
213
+ '''
214
+ Microscope controls objects creation and validation errors.
215
+
216
+ '''
217
+ def __init__(self, message=''):
218
+ self.message = str(f'Error creating EMC object: {message}')
219
+ super().__init__(self.message)
220
+
221
+ class BlochListError(Exception):
222
+ '''
223
+ List of yynamic diffraction patterns errors.
224
+
225
+ '''
226
+ def __init__(self, message=''):
227
+ self.message = str(f'Error creating blochList object: {message}')
228
+ super().__init__(self.message)
229
+
230
+ class StereodiagramError(Exception):
231
+ '''
232
+ Stereodiagram generation errors.
233
+
234
+ '''
235
+ def __init__(self, message=''):
236
+ self.message = str(f'Error generating stereodiagram: {message}')
237
+ super().__init__(self.message)
238
+
239
+ class MxtalError(Exception):
240
+ '''
241
+ Crystal construction simulation errors.
242
+
243
+ '''
244
+ def __init__(self, message=''):
245
+ self.message = str(f'Error generating mxtal: {message}')
246
+ super().__init__(self.message)
247
+
248
+
249
+ class CSFError(Exception):
250
+ '''
251
+ Crystal structure factor generation and validation errors.
252
+
253
+ '''
254
+ def __init__(self, message=''):
255
+ self.message = str(f'Error generating structure factors: {message}')
256
+ super().__init__(self.message)
257
+
258
+
259
+ class XDPImageError(Exception):
260
+ '''
261
+ Experimental diffraction pattern image object errors.
262
+
263
+ '''
264
+ def __init__(self, message=''):
265
+ self.message = str(f'{message}')
266
+ super().__init__(self.message)