pyemaps 2.1.0__tar.gz → 2.2.1__tar.gz

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 (151) hide show
  1. {pyemaps-2.1.0 → pyemaps-2.2.1}/MANIFEST.in +3 -2
  2. pyemaps-2.2.1/PKG-INFO +177 -0
  3. pyemaps-2.2.1/README.md +141 -0
  4. {pyemaps-2.1.0 → pyemaps-2.2.1}/__init__.py +8 -22
  5. {pyemaps-2.1.0 → pyemaps-2.2.1}/__main__.py +84 -60
  6. pyemaps-2.2.1/__version__.py +1 -0
  7. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Germanium.xtl +1 -1
  8. {pyemaps-2.1.0 → pyemaps-2.2.1}/crystals.py +9 -22
  9. {pyemaps-2.1.0 → pyemaps-2.2.1}/ddiffs.py +9 -23
  10. pyemaps-2.2.1/diffract/__init__.py +54 -0
  11. {pyemaps-2.1.0 → pyemaps-2.2.1}/diffract/bloch_dec.py +9 -22
  12. {pyemaps-2.1.0 → pyemaps-2.2.1}/diffract/csf_dec.py +16 -26
  13. {pyemaps-2.1.0 → pyemaps-2.2.1}/diffract/dif_dec.py +42 -27
  14. {pyemaps-2.1.0 → pyemaps-2.2.1}/diffract/dpgen_dec.py +9 -22
  15. {pyemaps-2.1.0 → pyemaps-2.2.1}/diffract/mxtal_dec.py +9 -23
  16. {pyemaps-2.1.0 → pyemaps-2.2.1}/diffract/powder_dec.py +13 -25
  17. {pyemaps-2.1.0 → pyemaps-2.2.1}/diffract/stereo_dec.py +9 -22
  18. {pyemaps-2.1.0 → pyemaps-2.2.1}/display.py +267 -103
  19. {pyemaps-2.1.0 → pyemaps-2.2.1}/emcontrols.py +94 -82
  20. {pyemaps-2.1.0 → pyemaps-2.2.1}/errors.py +8 -22
  21. {pyemaps-2.1.0 → pyemaps-2.2.1}/fileutils.py +8 -22
  22. {pyemaps-2.1.0 → pyemaps-2.2.1}/kdiffs.py +9 -22
  23. pyemaps-2.2.1/license-exception.txt +32 -0
  24. pyemaps-2.2.1/license.txt +59 -0
  25. pyemaps-2.2.1/notebooks/adf.ipynb +762 -0
  26. pyemaps-2.2.1/notebooks/al_ediom.ipynb +683 -0
  27. pyemaps-2.2.1/notebooks/powder.ipynb +526 -0
  28. pyemaps-2.2.1/notebooks/si_bloch.ipynb +844 -0
  29. pyemaps-2.2.1/notebooks/si_constructor.ipynb +493 -0
  30. pyemaps-2.2.1/notebooks/si_csf.ipynb +835 -0
  31. pyemaps-2.2.1/notebooks/si_dif.ipynb +931 -0
  32. pyemaps-2.2.1/notebooks/si_lacbed.ipynb +789 -0
  33. pyemaps-2.2.1/notebooks/si_scm.ipynb +888 -0
  34. pyemaps-2.2.1/notebooks/si_stereo.ipynb +501 -0
  35. pyemaps-2.2.1/pyemaps.egg-info/PKG-INFO +177 -0
  36. {pyemaps-2.1.0 → pyemaps-2.2.1}/pyemaps.egg-info/SOURCES.txt +11 -0
  37. {pyemaps-2.1.0 → pyemaps-2.2.1}/pyemaps.egg-info/requires.txt +1 -1
  38. pyemaps-2.2.1/samples/adf.py +85 -0
  39. pyemaps-2.2.1/samples/al_dpgen.py +54 -0
  40. pyemaps-2.2.1/samples/al_ediom.py +72 -0
  41. pyemaps-2.2.1/samples/convert_image.py +47 -0
  42. pyemaps-2.2.1/samples/dm_diff.py +171 -0
  43. pyemaps-2.2.1/samples/powder.py +51 -0
  44. pyemaps-2.2.1/samples/si_bloch.py +107 -0
  45. pyemaps-2.2.1/samples/si_constructor.py +55 -0
  46. pyemaps-2.2.1/samples/si_csf.py +65 -0
  47. pyemaps-2.2.1/samples/si_dif.py +112 -0
  48. pyemaps-2.2.1/samples/si_lacbed.py +55 -0
  49. pyemaps-2.2.1/samples/si_pyemaps.py +57 -0
  50. pyemaps-2.2.1/samples/si_scm.py +114 -0
  51. pyemaps-2.2.1/samples/si_stereo.py +81 -0
  52. pyemaps-2.2.1/scattering/__init__.py +10 -0
  53. pyemaps-2.2.1/scattering/sct_dec.py +18 -0
  54. {pyemaps-2.1.0 → pyemaps-2.2.1}/setup.cfg +2 -2
  55. {pyemaps-2.1.0 → pyemaps-2.2.1}/setup.py +48 -23
  56. pyemaps-2.2.1/spg/__init__.py +10 -0
  57. {pyemaps-2.1.0 → pyemaps-2.2.1}/spg/spg_dec.py +9 -22
  58. {pyemaps-2.1.0 → pyemaps-2.2.1}/stackimg.py +8 -22
  59. {pyemaps-2.1.0 → pyemaps-2.2.1}/xtal.py +9 -23
  60. pyemaps-2.1.0/PKG-INFO +0 -231
  61. pyemaps-2.1.0/README.md +0 -201
  62. pyemaps-2.1.0/__version__.py +0 -1
  63. pyemaps-2.1.0/diffract/__init__.py +0 -70
  64. pyemaps-2.1.0/license.txt +0 -42
  65. pyemaps-2.1.0/pyemaps.egg-info/PKG-INFO +0 -231
  66. pyemaps-2.1.0/samples/adf.py +0 -137
  67. pyemaps-2.1.0/samples/al_dpgen.py +0 -57
  68. pyemaps-2.1.0/samples/al_ediom.py +0 -94
  69. pyemaps-2.1.0/samples/convert_image.py +0 -88
  70. pyemaps-2.1.0/samples/dm_diff.py +0 -225
  71. pyemaps-2.1.0/samples/powder.py +0 -52
  72. pyemaps-2.1.0/samples/si_bloch.py +0 -120
  73. pyemaps-2.1.0/samples/si_constructor.py +0 -51
  74. pyemaps-2.1.0/samples/si_csf.py +0 -59
  75. pyemaps-2.1.0/samples/si_dif.py +0 -134
  76. pyemaps-2.1.0/samples/si_lacbed.py +0 -59
  77. pyemaps-2.1.0/samples/si_pyemaps.py +0 -80
  78. pyemaps-2.1.0/samples/si_scm.py +0 -156
  79. pyemaps-2.1.0/samples/si_stereo.py +0 -116
  80. pyemaps-2.1.0/scattering/__init__.py +0 -26
  81. pyemaps-2.1.0/scattering/sct_dec.py +0 -31
  82. pyemaps-2.1.0/spg/__init__.py +0 -25
  83. {pyemaps-2.1.0 → pyemaps-2.2.1}/COPYING +0 -0
  84. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/CifFile_module.py +0 -0
  85. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/StarFile.py +0 -0
  86. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/TypeContentsParser.py +0 -0
  87. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/YappsStarParser_1_0.py +0 -0
  88. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/YappsStarParser_1_1.py +0 -0
  89. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/YappsStarParser_2_0.py +0 -0
  90. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/YappsStarParser_STAR2.py +0 -0
  91. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/__init__.py +0 -0
  92. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/drel/__init__.py +0 -0
  93. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/drel/drel_ast_yacc.py +0 -0
  94. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/drel/drel_lex.py +0 -0
  95. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/drel/drel_runtime.py +0 -0
  96. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/drel/parsetab.py +0 -0
  97. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/drel/py_from_ast.py +0 -0
  98. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/parsetab.py +0 -0
  99. {pyemaps-2.1.0 → pyemaps-2.2.1}/CifFile/src/yapps3_compiled_rt.py +0 -0
  100. {pyemaps-2.1.0 → pyemaps-2.2.1}/__config__.py +0 -0
  101. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Aluminium.xtl +0 -0
  102. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/AluminiumOxide.xtl +0 -0
  103. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Aluminium_FCC.xtl +0 -0
  104. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/BariumTitanate_180k.xtl +0 -0
  105. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/BariumTitanate_270k.xtl +0 -0
  106. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/BariumTitanate_Tetra.xtl +0 -0
  107. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/BiMnO3.xtl +0 -0
  108. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Boron_Tetra.xtl +0 -0
  109. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/CadmiumSelenide_Hex.xtl +0 -0
  110. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/CadmiumSulfide_Cubic.xtl +0 -0
  111. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/CadmiumSulfide_Hex.xtl +0 -0
  112. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Chromium_BCC.xtl +0 -0
  113. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/CoSb3_Skutterudite.xtl +0 -0
  114. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/CopperOxide.xtl +0 -0
  115. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Copper_FCC.xtl +0 -0
  116. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Cu2O_Cuprite.xtl +0 -0
  117. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Diamond.xtl +0 -0
  118. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/ErbiumPyrogermanate.xtl +0 -0
  119. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/FePd_Tetra.xtl +0 -0
  120. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/FeS2_Pyrite.xtl +0 -0
  121. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/GalliumAntimonide.xtl +0 -0
  122. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/GalliumArsenide.xtl +0 -0
  123. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/GalliumNitride.xtl +0 -0
  124. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Gold_FCC.xtl +0 -0
  125. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/IndiumArsenide.xtl +0 -0
  126. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/LaMnO3.xtl +0 -0
  127. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/LeadZirconateTitanate.xtl +0 -0
  128. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Li2MnO3.xtl +0 -0
  129. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/NaFeO2.xtl +0 -0
  130. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Nb3Sn.xtl +0 -0
  131. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Pentacene.xtl +0 -0
  132. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/SiAlONa.xtl +0 -0
  133. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Silicon.xtl +0 -0
  134. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/StrontiumTitanate.xtl +0 -0
  135. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/TelluriumDioxide.xtl +0 -0
  136. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/TinDioxide_RT.xtl +0 -0
  137. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/TitaniumDioxide_Anatase.xtl +0 -0
  138. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/TitaniumDioxide_Rutile.xtl +0 -0
  139. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/TungstenDiselenide.xtl +0 -0
  140. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/VanadiumDioxide_RT.xtl +0 -0
  141. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/ZincOxide.xtl +0 -0
  142. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/Zinc_HCP.xtl +0 -0
  143. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/ZirconiumNitride.xtl +0 -0
  144. {pyemaps-2.1.0 → pyemaps-2.2.1}/cdata/limno2.xtl +0 -0
  145. {pyemaps-2.1.0 → pyemaps-2.2.1}/pyemaps.egg-info/dependency_links.txt +0 -0
  146. {pyemaps-2.1.0 → pyemaps-2.2.1}/pyemaps.egg-info/entry_points.txt +0 -0
  147. {pyemaps-2.1.0 → pyemaps-2.2.1}/pyemaps.egg-info/top_level.txt +0 -0
  148. {pyemaps-2.1.0 → pyemaps-2.2.1}/pyproject.toml +0 -0
  149. {pyemaps-2.1.0 → pyemaps-2.2.1}/samples/al.img +0 -0
  150. {pyemaps-2.1.0 → pyemaps-2.2.1}/samples/mask.im3 +0 -0
  151. {pyemaps-2.1.0 → pyemaps-2.2.1}/samples/raw.img +0 -0
@@ -1,5 +1,4 @@
1
1
  exclude */emaps/*.f90
2
- exclude */samples/deprecated/*.py
3
2
  prune __pycache__
4
3
  prune emaps/__pycache__
5
4
 
@@ -9,6 +8,8 @@ include __config__.py
9
8
  include README.md
10
9
  include COPYING
11
10
  include license.txt
11
+ include license-exception.txt
12
12
 
13
13
  include cdata/*.xtl
14
- include samples/*.py
14
+ include samples/*.py
15
+ include notebooks/*.ipynb
pyemaps-2.2.1/PKG-INFO ADDED
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyemaps
3
+ Version: 2.2.1
4
+ Summary: A Python Package for Transmission Electron Diffraction Simulations and Crystallographic Computing
5
+ Home-page: https://github.com/emlab-solutions/pyemaps
6
+ Author: EMLab Solutions, Inc.
7
+ Author-email: support@emlabsoftware.com
8
+ License: GPL-3.0-or-later, with the linking exception for emaps in license-exception.txt. emaps' 4D-STEM features need a license.
9
+ Project-URL: Documentation, https://emlab-solutions.github.io/pyemaps/
10
+ Project-URL: Source, https://github.com/emlab-solutions/pyemaps
11
+ Project-URL: Issues, https://github.com/emlab-solutions/pyemaps/issues
12
+ Project-URL: Changelog, https://emlab-solutions.github.io/pyemaps/rn.html
13
+ Keywords: Transmission,Electron,Diffraction,Simulation,Crystallography,Python
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Intended Audience :: Science/Research
22
+ Requires-Python: >=3.12
23
+ Description-Content-Type: text/markdown
24
+ License-File: license-exception.txt
25
+ License-File: license.txt
26
+ License-File: COPYING
27
+ Requires-Dist: emaps>=2.0.1
28
+ Requires-Dist: numpy>=2.0
29
+ Requires-Dist: matplotlib>=3.8.4
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: license-file
33
+ Dynamic: project-url
34
+ Dynamic: requires-dist
35
+ Dynamic: summary
36
+
37
+ # pyEMAPS
38
+
39
+ **pyEMAPS** is a Python package for transmission electron diffraction simulations and
40
+ crystallographic computing, for all crystal systems. Its simulations are based on the theories of
41
+ kinematical and dynamical electron diffraction described by J. C. H. Spence and J. M. Zuo in
42
+ *Electron Microdiffraction* (Plenum Press, New York, 1992).
43
+
44
+ [Documentation](https://emlab-solutions.github.io/pyemaps/) ·
45
+ [Get started](https://emlab-solutions.github.io/pyemaps/getting_started.html) ·
46
+ [Examples](https://emlab-solutions.github.io/pyemaps/examples.html) ·
47
+ [Release notes](https://emlab-solutions.github.io/pyemaps/rn.html) ·
48
+ [Issues](https://github.com/emlab-solutions/pyemaps/issues)
49
+
50
+ ## Features
51
+
52
+ The base features are free, under the GNU General Public License v3.0:
53
+
54
+ - **Crystallography**
55
+ - Crystal construction, from your own data or the built-in crystal library
56
+ - CIF import
57
+ - Crystallographic transformations
58
+ - Real and reciprocal space vector calculations
59
+ - Stereodiagrams
60
+ - Crystal structure factors
61
+ - **Kinematical electron diffraction**
62
+ - Selected area diffraction
63
+ - Kikuchi and higher order Laue zone (HOLZ) line geometry
64
+ - Convergent beam electron diffraction (CBED)
65
+ - Electron powder diffraction
66
+ - **Dynamical electron diffraction** (Bloch wave)
67
+ - Convergent beam electron diffraction, including large-angle CBED
68
+ - The electron scattering matrix
69
+ - Electron dispersion (the eigenvalues of the Bloch wave solution)
70
+
71
+ The extended 4D-STEM features need a license:
72
+
73
+ - Building and searching diffraction pattern databases
74
+ - Indexing experimental diffraction patterns
75
+ - Annular bright and dark field images
76
+ - Masked images
77
+
78
+ ## Requirements
79
+
80
+ - 64-bit Windows
81
+ - Python 3.12, 3.13, 3.14 or 3.15
82
+ - 8 GB of RAM or more is recommended
83
+
84
+ pip also installs NumPy (2.0 or later), matplotlib (3.8.4 or later) and **emaps**, the compiled
85
+ simulation backend for your Python version. On Python 3.7, pip installs pyEMAPS 1.1.x.
86
+
87
+ ## Installation
88
+
89
+ Install pyEMAPS in its own virtual environment, so its dependencies don't clash with your other
90
+ packages:
91
+
92
+ ```
93
+ python -m venv .venv
94
+ .venv\Scripts\activate
95
+ pip install pyemaps
96
+ ```
97
+
98
+ Check the installation:
99
+
100
+ ```
101
+ pyemaps --version
102
+ pyemaps --sample
103
+ ```
104
+
105
+ `--version` prints the pyEMAPS version, and `--sample` runs a short kinematical simulation and
106
+ shows the pattern. If the installation fails, see the
107
+ [FAQ](https://emlab-solutions.github.io/pyemaps/faq.html).
108
+
109
+ ## Quick start
110
+
111
+ Load Silicon from the built-in crystal library, generate its kinematical diffraction pattern with
112
+ the default settings, and show it:
113
+
114
+ ```python
115
+ from pyemaps import Crystal, DPList, showDif
116
+
117
+ if __name__ == '__main__':
118
+ si = Crystal.from_builtin('Silicon')
119
+ emc, si_dp = si.generateDP()
120
+
121
+ dpl = DPList('Silicon')
122
+ dpl.add(emc, si_dp)
123
+ showDif(dpl)
124
+ ```
125
+
126
+ Keep the `if __name__ == '__main__':` line in scripts. The `show` functions draw in a separate
127
+ process, which on Windows runs your script again. Jupyter notebooks don't need it.
128
+
129
+ `pyemaps -cp` copies the sample scripts into a `pyemaps_samples` folder and the Jupyter
130
+ notebooks into `pyemaps_notebooks`; `pyemaps -cp samples` or `pyemaps -cp notebooks` copies just
131
+ one set.
132
+
133
+ The [documentation](https://emlab-solutions.github.io/pyemaps/) has a user guide, an examples
134
+ gallery and the full API reference.
135
+
136
+ ## Licensing
137
+
138
+ pyEMAPS is free software under the
139
+ [GNU General Public License v3.0 or later](https://emlab-solutions.github.io/pyemaps/license.html),
140
+ for personal and commercial use, with a linking exception
141
+ ([license-exception.txt](https://github.com/emlab-solutions/pyemaps/blob/main/license-exception.txt))
142
+ that allows its use with emaps, the proprietary simulation engine it runs on. emaps' 4D-STEM
143
+ features need a license:
144
+
145
+ - `pyemaps --license trial` activates a 7-day trial license. It needs an internet connection.
146
+ - `pyemaps --license <token>` activates a trial or production license with a license activation
147
+ token, online or offline. Write to support@emlabsoftware.com for a token.
148
+ - `pyemaps --license info` shows the current license.
149
+
150
+ After activation, all license checks are offline. See
151
+ [License Activation](https://emlab-solutions.github.io/pyemaps/user_guide/configuration.html#license-activation)
152
+ for details.
153
+
154
+ ## Support
155
+
156
+ Report bugs and request features on [GitHub](https://github.com/emlab-solutions/pyemaps/issues),
157
+ and send other questions to support@emlabsoftware.com.
158
+
159
+ If pyEMAPS helps your microscopy and crystallography research or teaching, please consider a
160
+ [donation](https://www.paypal.com/paypalme/pyemaps22). Donations keep us providing software
161
+ tools to the education and research communities.
162
+
163
+ ## Contributing
164
+
165
+ We're looking for experts in electron microscopy and crystallography, and Python enthusiasts, to
166
+ join the project. Contact us at support@emlabsoftware.com if you're interested.
167
+
168
+ - [DEVELOPMENT.md](https://github.com/emlab-solutions/pyemaps/blob/main/DEVELOPMENT.md)
169
+ explains how to build pyEMAPS, run its tests and build the documentation, and how we work.
170
+ - Please read and agree to our
171
+ [Contributor License Agreement](https://github.com/emlab-solutions/pyemaps/blob/main/CONTRIBUTING.md)
172
+ before contributing.
173
+ - We follow the
174
+ [Contributor Covenant](https://www.contributor-covenant.org/version/2/0/code_of_conduct/) as our
175
+ code of conduct. Report unacceptable behavior to support@emlabsoftware.com.
176
+
177
+ pyEMAPS is developed by EMLab Solutions, Inc.
@@ -0,0 +1,141 @@
1
+ # pyEMAPS
2
+
3
+ **pyEMAPS** is a Python package for transmission electron diffraction simulations and
4
+ crystallographic computing, for all crystal systems. Its simulations are based on the theories of
5
+ kinematical and dynamical electron diffraction described by J. C. H. Spence and J. M. Zuo in
6
+ *Electron Microdiffraction* (Plenum Press, New York, 1992).
7
+
8
+ [Documentation](https://emlab-solutions.github.io/pyemaps/) ·
9
+ [Get started](https://emlab-solutions.github.io/pyemaps/getting_started.html) ·
10
+ [Examples](https://emlab-solutions.github.io/pyemaps/examples.html) ·
11
+ [Release notes](https://emlab-solutions.github.io/pyemaps/rn.html) ·
12
+ [Issues](https://github.com/emlab-solutions/pyemaps/issues)
13
+
14
+ ## Features
15
+
16
+ The base features are free, under the GNU General Public License v3.0:
17
+
18
+ - **Crystallography**
19
+ - Crystal construction, from your own data or the built-in crystal library
20
+ - CIF import
21
+ - Crystallographic transformations
22
+ - Real and reciprocal space vector calculations
23
+ - Stereodiagrams
24
+ - Crystal structure factors
25
+ - **Kinematical electron diffraction**
26
+ - Selected area diffraction
27
+ - Kikuchi and higher order Laue zone (HOLZ) line geometry
28
+ - Convergent beam electron diffraction (CBED)
29
+ - Electron powder diffraction
30
+ - **Dynamical electron diffraction** (Bloch wave)
31
+ - Convergent beam electron diffraction, including large-angle CBED
32
+ - The electron scattering matrix
33
+ - Electron dispersion (the eigenvalues of the Bloch wave solution)
34
+
35
+ The extended 4D-STEM features need a license:
36
+
37
+ - Building and searching diffraction pattern databases
38
+ - Indexing experimental diffraction patterns
39
+ - Annular bright and dark field images
40
+ - Masked images
41
+
42
+ ## Requirements
43
+
44
+ - 64-bit Windows
45
+ - Python 3.12, 3.13, 3.14 or 3.15
46
+ - 8 GB of RAM or more is recommended
47
+
48
+ pip also installs NumPy (2.0 or later), matplotlib (3.8.4 or later) and **emaps**, the compiled
49
+ simulation backend for your Python version. On Python 3.7, pip installs pyEMAPS 1.1.x.
50
+
51
+ ## Installation
52
+
53
+ Install pyEMAPS in its own virtual environment, so its dependencies don't clash with your other
54
+ packages:
55
+
56
+ ```
57
+ python -m venv .venv
58
+ .venv\Scripts\activate
59
+ pip install pyemaps
60
+ ```
61
+
62
+ Check the installation:
63
+
64
+ ```
65
+ pyemaps --version
66
+ pyemaps --sample
67
+ ```
68
+
69
+ `--version` prints the pyEMAPS version, and `--sample` runs a short kinematical simulation and
70
+ shows the pattern. If the installation fails, see the
71
+ [FAQ](https://emlab-solutions.github.io/pyemaps/faq.html).
72
+
73
+ ## Quick start
74
+
75
+ Load Silicon from the built-in crystal library, generate its kinematical diffraction pattern with
76
+ the default settings, and show it:
77
+
78
+ ```python
79
+ from pyemaps import Crystal, DPList, showDif
80
+
81
+ if __name__ == '__main__':
82
+ si = Crystal.from_builtin('Silicon')
83
+ emc, si_dp = si.generateDP()
84
+
85
+ dpl = DPList('Silicon')
86
+ dpl.add(emc, si_dp)
87
+ showDif(dpl)
88
+ ```
89
+
90
+ Keep the `if __name__ == '__main__':` line in scripts. The `show` functions draw in a separate
91
+ process, which on Windows runs your script again. Jupyter notebooks don't need it.
92
+
93
+ `pyemaps -cp` copies the sample scripts into a `pyemaps_samples` folder and the Jupyter
94
+ notebooks into `pyemaps_notebooks`; `pyemaps -cp samples` or `pyemaps -cp notebooks` copies just
95
+ one set.
96
+
97
+ The [documentation](https://emlab-solutions.github.io/pyemaps/) has a user guide, an examples
98
+ gallery and the full API reference.
99
+
100
+ ## Licensing
101
+
102
+ pyEMAPS is free software under the
103
+ [GNU General Public License v3.0 or later](https://emlab-solutions.github.io/pyemaps/license.html),
104
+ for personal and commercial use, with a linking exception
105
+ ([license-exception.txt](https://github.com/emlab-solutions/pyemaps/blob/main/license-exception.txt))
106
+ that allows its use with emaps, the proprietary simulation engine it runs on. emaps' 4D-STEM
107
+ features need a license:
108
+
109
+ - `pyemaps --license trial` activates a 7-day trial license. It needs an internet connection.
110
+ - `pyemaps --license <token>` activates a trial or production license with a license activation
111
+ token, online or offline. Write to support@emlabsoftware.com for a token.
112
+ - `pyemaps --license info` shows the current license.
113
+
114
+ After activation, all license checks are offline. See
115
+ [License Activation](https://emlab-solutions.github.io/pyemaps/user_guide/configuration.html#license-activation)
116
+ for details.
117
+
118
+ ## Support
119
+
120
+ Report bugs and request features on [GitHub](https://github.com/emlab-solutions/pyemaps/issues),
121
+ and send other questions to support@emlabsoftware.com.
122
+
123
+ If pyEMAPS helps your microscopy and crystallography research or teaching, please consider a
124
+ [donation](https://www.paypal.com/paypalme/pyemaps22). Donations keep us providing software
125
+ tools to the education and research communities.
126
+
127
+ ## Contributing
128
+
129
+ We're looking for experts in electron microscopy and crystallography, and Python enthusiasts, to
130
+ join the project. Contact us at support@emlabsoftware.com if you're interested.
131
+
132
+ - [DEVELOPMENT.md](https://github.com/emlab-solutions/pyemaps/blob/main/DEVELOPMENT.md)
133
+ explains how to build pyEMAPS, run its tests and build the documentation, and how we work.
134
+ - Please read and agree to our
135
+ [Contributor License Agreement](https://github.com/emlab-solutions/pyemaps/blob/main/CONTRIBUTING.md)
136
+ before contributing.
137
+ - We follow the
138
+ [Contributor Covenant](https://www.contributor-covenant.org/version/2/0/code_of_conduct/) as our
139
+ code of conduct. Report unacceptable behavior to support@emlabsoftware.com.
140
+
141
+ pyEMAPS is developed by EMLab Solutions, Inc.
@@ -1,29 +1,15 @@
1
+ # This file is part of pyEMAPS.
2
+ # Copyright (C) 2021-2026 EMLab Solutions, Inc.
3
+ #
4
+ # SPDX-License-Identifier: GPL-3.0-or-later
5
+ #
6
+ # Additional permission under GPLv3 Section 7:
7
+ # See license-exception.txt for the exception permitting
8
+ # combination with the separately licensed backend, emaps.
1
9
 
2
10
  """
3
- .. This file is part of pyEMAPS
4
-
5
- .. ----
6
-
7
- .. pyEMAPS is free software. You can redistribute it and/or modify
8
- .. it under the terms of the GNU General Public License as published
9
- .. by the Free Software Foundation, either version 3 of the License,
10
- .. or (at your option) any later version..
11
-
12
- .. pyEMAPS is distributed in the hope that it will be useful,
13
- .. but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- .. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- .. GNU General Public License for more details.
16
-
17
- .. You should have received a copy of the GNU General Public License
18
- .. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
19
-
20
- .. Contact supprort@emlabsoftware.com for any questions and comments.
21
-
22
- .. ----
23
-
24
11
  .. Author: EMLab Solutions, Inc.
25
12
  .. Date: May 07, 2022
26
-
27
13
  """
28
14
 
29
15
 
@@ -1,71 +1,87 @@
1
- '''
2
- .. This file is part of pyEMAPS
3
-
4
- .. ----
5
-
6
- .. pyEMAPS is free software. You can redistribute it and/or modify
7
- .. it under the terms of the GNU General Public License as published
8
- .. by the Free Software Foundation, either version 3 of the License,
9
- .. or (at your option) any later version..
10
-
11
- .. pyEMAPS is distributed in the hope that it will be useful,
12
- .. but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- .. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- .. GNU General Public License for more details.
15
-
16
- .. You should have received a copy of the GNU General Public License
17
- .. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
18
-
19
- .. Contact supprort@emlabsoftware.com for any questions and comments.
20
-
21
- .. ----
1
+ # This file is part of pyEMAPS.
2
+ # Copyright (C) 2021-2026 EMLab Solutions, Inc.
3
+ #
4
+ # SPDX-License-Identifier: GPL-3.0-or-later
5
+ #
6
+ # Additional permission under GPLv3 Section 7:
7
+ # See license-exception.txt for the exception permitting
8
+ # combination with the separately licensed backend, emaps.
22
9
 
10
+ '''
23
11
  .. Author: EMLab Solutions, Inc.
24
12
  .. Date: May 07, 2022
25
-
26
13
  '''
27
14
 
28
15
  rel_stage = 'Stable'
29
- pyemaps_samples_dir = 'pyemaps_samples'
30
16
 
31
- def copy_samples():
17
+ # What pyemaps -cp copies: (description, folder in the package, folder it copies into).
18
+ COPY_SETS = {
19
+ 'samples': ('sample scripts', 'samples', 'pyemaps_samples'),
20
+ 'notebooks': ('notebooks', 'notebooks', 'pyemaps_notebooks'),
21
+ }
22
+
23
+ # The sample that pyemaps -s runs; it isn't copied.
24
+ COPY_SKIP = {'si_pyemaps.py'}
25
+
26
+
27
+ def copy_examples(what):
32
28
  '''
33
- Copies sample code from package directory to current diretory
34
- for easy access.
29
+ Copy the sample scripts, the notebooks, or both into folders in the current directory,
30
+ after asking to confirm. *what* is 'samples', 'notebooks' or 'all'. Files that already exist
31
+ there are left alone, so copying again doesn't overwrite your changes.
35
32
  '''
36
- import os, sys
33
+ import os
37
34
  import shutil
35
+ import sys
38
36
 
37
+ names = list(COPY_SETS) if what == 'all' else [what]
38
+ pkg_dir = os.path.dirname(os.path.abspath(__file__))
39
39
  curr_dir = os.getcwd()
40
-
41
- q = str(f"Copy pyemaps samples into {pyemaps_samples_dir} in current directory?\n ")
42
-
43
- inp = input(q +"[Y/n] ")
44
40
 
45
- if inp and not inp.lower().strip()[:1] == "y":
46
- print("No sample code is copied!")
41
+ plan = ' and '.join(f'the {COPY_SETS[n][0]} into {COPY_SETS[n][2]}' for n in names)
42
+ inp = input(f'Copy {plan}, in the current directory? [Y/n] ')
43
+ if inp and not inp.lower().strip()[:1] == 'y':
44
+ print('Nothing copied.')
47
45
  sys.exit(1)
48
46
 
49
- curr_samples_dir = os.path.join(curr_dir, pyemaps_samples_dir)
50
-
51
- if not os.path.exists(curr_samples_dir):
52
- os.makedirs(curr_samples_dir)
53
-
54
- pyemaps_pkgdir = os.path.dirname(os.path.abspath(__file__))
55
- pkg_samples_dir = os.path.join(pyemaps_pkgdir, "samples")
56
-
57
- for file_name in os.listdir(pkg_samples_dir):
58
-
59
- if file_name == 'si_pyemaps.py':
47
+ for n in names:
48
+ desc, pkg_sub, dest_sub = COPY_SETS[n]
49
+ source_dir = os.path.join(pkg_dir, pkg_sub)
50
+ if not os.path.isdir(source_dir):
51
+ print(f'This pyEMAPS installation has no {desc}.')
60
52
  continue
61
- source = os.path.join(pkg_samples_dir, file_name)
62
- destination = os.path.join(curr_samples_dir, file_name)
63
-
64
- if os.path.isfile(source):
53
+
54
+ dest_dir = os.path.join(curr_dir, dest_sub)
55
+ os.makedirs(dest_dir, exist_ok=True)
56
+
57
+ copied, skipped = 0, []
58
+ for file_name in sorted(os.listdir(source_dir)):
59
+ source = os.path.join(source_dir, file_name)
60
+ if not os.path.isfile(source) or file_name in COPY_SKIP:
61
+ continue
62
+ destination = os.path.join(dest_dir, file_name)
63
+ if os.path.exists(destination):
64
+ skipped.append(file_name)
65
+ continue
65
66
  shutil.copy(source, destination)
66
- print(f'Copied sample code: {file_name} in pyemaps package to {destination}')
67
+ copied += 1
68
+ print(f'Copied {file_name} to {destination}')
69
+
70
+ print(f'Copied {copied} file{"" if copied == 1 else "s"} into {dest_dir}.')
71
+ if len(skipped) == 1:
72
+ print(f'Skipped {skipped[0]}, which already exists there. To get a fresh copy, '
73
+ 'rename or delete it and copy again.')
74
+ elif skipped:
75
+ print(f'Skipped {len(skipped)} files that already exist there: '
76
+ f'{", ".join(skipped)}. To get fresh copies, rename or delete them and copy '
77
+ 'again.')
78
+
79
+ if n == 'samples':
80
+ print(f'Run a sample with: python {os.path.join(dest_sub, "<sample>.py")}')
81
+ else:
82
+ print(f'Open the notebooks with Jupyter (pip install jupyter): '
83
+ f'jupyter notebook {dest_sub}')
67
84
 
68
- print(f'Run sample code by typing: \"python pyemaps_samples\\<sample>\"')
69
85
 
70
86
  def is_alphanumeric_with_dash(s, slen):
71
87
  """
@@ -85,7 +101,7 @@ def main():
85
101
  Usage:
86
102
  pyemaps -s (--sample)
87
103
  pyemaps -c (--copyright)
88
- pyemaps -cp (--copysamples)
104
+ pyemaps -cp (--copy) [samples|notebooks]
89
105
  pyemaps -v (--version)
90
106
  pyemaps -l (--license) <trial|info|license token>
91
107
 
@@ -94,7 +110,7 @@ def main():
94
110
  """
95
111
 
96
112
  try:
97
- from .samples.si_pyemaps import run_si_sample
113
+ from .samples.si_pyemaps import run_sample
98
114
 
99
115
  from emaps import PKG_TYPE, TYPE_FREE, TYPE_FULL, TYPE_UIUC
100
116
 
@@ -114,11 +130,16 @@ def main():
114
130
  action='store_true',
115
131
  help="display pyEMAPS copyrights.",
116
132
  required=False)
117
- parser.add_argument("-cp",
118
- "--copysamples",
119
- default=False,
120
- action='store_true',
121
- help="copy sample code into current working directory.",
133
+ parser.add_argument("-cp",
134
+ "--copy",
135
+ "--copysamples",
136
+ nargs='?',
137
+ const='all',
138
+ default=None,
139
+ metavar='samples|notebooks',
140
+ help="copy the sample scripts into pyemaps_samples, the Jupyter\n"
141
+ "notebooks into pyemaps_notebooks, or, with neither, both.\n"
142
+ "Files that already exist there aren't overwritten.",
122
143
  required=False)
123
144
 
124
145
  if PKG_TYPE != TYPE_FREE:
@@ -155,6 +176,9 @@ The token is obtained from EMLab Solutions, Inc. by writing to support@emlabsoft
155
176
  parser.print_help()
156
177
  exit(1)
157
178
 
179
+ if args.copy not in (None, 'all', *COPY_SETS):
180
+ parser.error(f"argument -cp/--copy: expected 'samples' or 'notebooks', not '{args.copy}'")
181
+
158
182
  ver = dist_version("pyemaps") + str(f" {rel_stage}").lower()
159
183
 
160
184
  copyrit = ['PyEMAPS - Transmission Electron Diffraction Simulations In Python']
@@ -181,12 +205,12 @@ The token is obtained from EMLab Solutions, Inc. by writing to support@emlabsoft
181
205
  copyrit.append('--------------------------------')
182
206
  print('\n'.join(copyrit))
183
207
 
184
- if args.copysamples:
185
- copy_samples()
208
+ if args.copy:
209
+ copy_examples(args.copy)
186
210
  exit(0)
187
211
 
188
212
  if args.sample:
189
- run_si_sample()
213
+ run_sample()
190
214
  exit(0)
191
215
 
192
216
  if args.license is not None and PKG_TYPE != TYPE_FREE:
@@ -0,0 +1 @@
1
+ __version__ = "2.2.1"
@@ -1,4 +1,4 @@
1
1
  crystal Germanium: dw = iso
2
2
  cell 5.6576 5.6576 5.6576 90.0000 90.0000 90.0000
3
3
  atom ge 0.125 0.125 0.125 0.60 1.000000
4
- spg 227 1
4
+ spg 227 2
@@ -1,28 +1,15 @@
1
- '''
2
- .. This file is part of pyEMAPS
3
-
4
- .. ----
5
-
6
- .. pyEMAPS is free software. You can redistribute it and/or modify
7
- .. it under the terms of the GNU General Public License as published
8
- .. by the Free Software Foundation, either version 3 of the License,
9
- .. or (at your option) any later version..
10
-
11
- .. pyEMAPS is distributed in the hope that it will be useful,
12
- .. but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- .. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- .. GNU General Public License for more details.
15
-
16
- .. You should have received a copy of the GNU General Public License
17
- .. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
18
-
19
- .. Contact supprort@emlabsoftware.com for any questions and comments.
20
-
21
- .. ----
1
+ # This file is part of pyEMAPS.
2
+ # Copyright (C) 2021-2026 EMLab Solutions, Inc.
3
+ #
4
+ # SPDX-License-Identifier: GPL-3.0-or-later
5
+ #
6
+ # Additional permission under GPLv3 Section 7:
7
+ # See license-exception.txt for the exception permitting
8
+ # combination with the separately licensed backend, emaps.
22
9
 
10
+ '''
23
11
  .. Author: EMLab Solutions, Inc.
24
12
  .. Date Created: May 07, 2022
25
-
26
13
  '''
27
14
 
28
15
  from enum import Enum
@@ -1,29 +1,15 @@
1
- '''
2
-
3
- .. This file is part of pyEMAPS
4
-
5
- .. ----
6
-
7
- .. pyEMAPS is free software. You can redistribute it and/or modify
8
- .. it under the terms of the GNU General Public License as published
9
- .. by the Free Software Foundation, either version 3 of the License,
10
- .. or (at your option) any later version..
11
-
12
- .. pyEMAPS is distributed in the hope that it will be useful,
13
- .. but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- .. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- .. GNU General Public License for more details.
16
-
17
- .. You should have received a copy of the GNU General Public License
18
- .. along with pyEMAPS. If not, see `<https://www.gnu.org/licenses/>`_.
19
-
20
- .. Contact supprort@emlabsoftware.com for any questions and comments.
21
-
22
- .. ----
1
+ # This file is part of pyEMAPS.
2
+ # Copyright (C) 2021-2026 EMLab Solutions, Inc.
3
+ #
4
+ # SPDX-License-Identifier: GPL-3.0-or-later
5
+ #
6
+ # Additional permission under GPLv3 Section 7:
7
+ # See license-exception.txt for the exception permitting
8
+ # combination with the separately licensed backend, emaps.
23
9
 
10
+ '''
24
11
  .. Author: EMLab Solutions, Inc.
25
12
  .. Date: July 17, 2022
26
-
27
13
  '''
28
14
 
29
15
  from . import EMC