pyemaps 1.1.7__tar.gz → 2.0.0__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 (120) hide show
  1. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/CifFile_module.py +1 -1
  2. {pyemaps-1.1.7 → pyemaps-2.0.0}/PKG-INFO +24 -21
  3. {pyemaps-1.1.7 → pyemaps-2.0.0}/README.md +9 -17
  4. {pyemaps-1.1.7 → pyemaps-2.0.0}/__main__.py +3 -3
  5. pyemaps-2.0.0/__version__.py +1 -0
  6. {pyemaps-1.1.7 → pyemaps-2.0.0}/diffract/powder_dec.py +3 -1
  7. {pyemaps-1.1.7 → pyemaps-2.0.0}/display.py +14 -10
  8. {pyemaps-1.1.7 → pyemaps-2.0.0}/fileutils.py +2 -2
  9. {pyemaps-1.1.7 → pyemaps-2.0.0}/pyemaps.egg-info/PKG-INFO +24 -21
  10. {pyemaps-1.1.7 → pyemaps-2.0.0}/pyemaps.egg-info/SOURCES.txt +22 -3
  11. pyemaps-2.0.0/pyemaps.egg-info/requires.txt +3 -0
  12. pyemaps-2.0.0/pyproject.toml +6 -0
  13. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/si_pyemaps.py +1 -1
  14. {pyemaps-1.1.7 → pyemaps-2.0.0}/setup.cfg +5 -4
  15. {pyemaps-1.1.7 → pyemaps-2.0.0}/setup.py +39 -45
  16. {pyemaps-1.1.7 → pyemaps-2.0.0}/stackimg.py +18 -4
  17. pyemaps-1.1.7/__version__.py +0 -1
  18. pyemaps-1.1.7/pyemaps.egg-info/requires.txt +0 -3
  19. pyemaps-1.1.7/pyproject.toml +0 -7
  20. {pyemaps-1.1.7 → pyemaps-2.0.0}/COPYING +0 -0
  21. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/StarFile.py +0 -0
  22. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/TypeContentsParser.py +0 -0
  23. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/YappsStarParser_1_0.py +0 -0
  24. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/YappsStarParser_1_1.py +0 -0
  25. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/YappsStarParser_2_0.py +0 -0
  26. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/YappsStarParser_STAR2.py +0 -0
  27. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/__init__.py +0 -0
  28. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/drel/__init__.py +0 -0
  29. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/drel/drel_ast_yacc.py +0 -0
  30. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/drel/drel_lex.py +0 -0
  31. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/drel/drel_runtime.py +0 -0
  32. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/drel/parsetab.py +0 -0
  33. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/drel/py_from_ast.py +0 -0
  34. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/parsetab.py +0 -0
  35. {pyemaps-1.1.7 → pyemaps-2.0.0}/CifFile/src/yapps3_compiled_rt.py +0 -0
  36. {pyemaps-1.1.7 → pyemaps-2.0.0}/MANIFEST.in +0 -0
  37. {pyemaps-1.1.7 → pyemaps-2.0.0}/__config__.py +0 -0
  38. {pyemaps-1.1.7 → pyemaps-2.0.0}/__init__.py +0 -0
  39. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Aluminium.xtl +0 -0
  40. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/AluminiumOxide.xtl +0 -0
  41. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Aluminium_FCC.xtl +0 -0
  42. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/BariumTitanate_180k.xtl +0 -0
  43. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/BariumTitanate_270k.xtl +0 -0
  44. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/BariumTitanate_Tetra.xtl +0 -0
  45. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/BiMnO3.xtl +0 -0
  46. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Boron_Tetra.xtl +0 -0
  47. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/CadmiumSelenide_Hex.xtl +0 -0
  48. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/CadmiumSulfide_Cubic.xtl +0 -0
  49. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/CadmiumSulfide_Hex.xtl +0 -0
  50. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Chromium_BCC.xtl +0 -0
  51. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/CoSb3_Skutterudite.xtl +0 -0
  52. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/CopperOxide.xtl +0 -0
  53. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Copper_FCC.xtl +0 -0
  54. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Cu2O_Cuprite.xtl +0 -0
  55. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Diamond.xtl +0 -0
  56. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/ErbiumPyrogermanate.xtl +0 -0
  57. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/FePd_Tetra.xtl +0 -0
  58. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/FeS2_Pyrite.xtl +0 -0
  59. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/GalliumAntimonide.xtl +0 -0
  60. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/GalliumArsenide.xtl +0 -0
  61. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/GalliumNitride.xtl +0 -0
  62. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Germanium.xtl +0 -0
  63. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Gold_FCC.xtl +0 -0
  64. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/IndiumArsenide.xtl +0 -0
  65. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/LaMnO3.xtl +0 -0
  66. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/LeadZirconateTitanate.xtl +0 -0
  67. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Li2MnO3.xtl +0 -0
  68. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/NaFeO2.xtl +0 -0
  69. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Nb3Sn.xtl +0 -0
  70. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Pentacene.xtl +0 -0
  71. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/SiAlONa.xtl +0 -0
  72. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Silicon.xtl +0 -0
  73. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/StrontiumTitanate.xtl +0 -0
  74. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/TelluriumDioxide.xtl +0 -0
  75. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/TinDioxide_RT.xtl +0 -0
  76. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/TitaniumDioxide_Anatase.xtl +0 -0
  77. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/TitaniumDioxide_Rutile.xtl +0 -0
  78. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/TungstenDiselenide.xtl +0 -0
  79. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/VanadiumDioxide_RT.xtl +0 -0
  80. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/ZincOxide.xtl +0 -0
  81. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/Zinc_HCP.xtl +0 -0
  82. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/ZirconiumNitride.xtl +0 -0
  83. {pyemaps-1.1.7 → pyemaps-2.0.0}/cdata/limno2.xtl +0 -0
  84. {pyemaps-1.1.7 → pyemaps-2.0.0}/crystals.py +0 -0
  85. {pyemaps-1.1.7 → pyemaps-2.0.0}/ddiffs.py +0 -0
  86. {pyemaps-1.1.7 → pyemaps-2.0.0}/diffract/__init__.py +0 -0
  87. {pyemaps-1.1.7 → pyemaps-2.0.0}/diffract/bloch_dec.py +0 -0
  88. {pyemaps-1.1.7 → pyemaps-2.0.0}/diffract/csf_dec.py +0 -0
  89. {pyemaps-1.1.7 → pyemaps-2.0.0}/diffract/dif_dec.py +0 -0
  90. {pyemaps-1.1.7 → pyemaps-2.0.0}/diffract/dpgen_dec.py +0 -0
  91. {pyemaps-1.1.7 → pyemaps-2.0.0}/diffract/mxtal_dec.py +0 -0
  92. {pyemaps-1.1.7 → pyemaps-2.0.0}/diffract/stereo_dec.py +0 -0
  93. {pyemaps-1.1.7 → pyemaps-2.0.0}/emcontrols.py +0 -0
  94. {pyemaps-1.1.7 → pyemaps-2.0.0}/errors.py +0 -0
  95. {pyemaps-1.1.7 → pyemaps-2.0.0}/kdiffs.py +0 -0
  96. {pyemaps-1.1.7 → pyemaps-2.0.0}/license.txt +0 -0
  97. {pyemaps-1.1.7 → pyemaps-2.0.0}/pyemaps.egg-info/dependency_links.txt +0 -0
  98. {pyemaps-1.1.7 → pyemaps-2.0.0}/pyemaps.egg-info/entry_points.txt +0 -0
  99. {pyemaps-1.1.7 → pyemaps-2.0.0}/pyemaps.egg-info/top_level.txt +0 -0
  100. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/adf.py +0 -0
  101. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/al.img +0 -0
  102. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/al_dpgen.py +0 -0
  103. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/al_ediom.py +0 -0
  104. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/convert_image.py +0 -0
  105. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/dm_diff.py +0 -0
  106. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/mask.im3 +0 -0
  107. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/powder.py +0 -0
  108. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/raw.img +0 -0
  109. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/si_bloch.py +0 -0
  110. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/si_constructor.py +0 -0
  111. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/si_csf.py +0 -0
  112. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/si_dif.py +0 -0
  113. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/si_lacbed.py +0 -0
  114. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/si_scm.py +0 -0
  115. {pyemaps-1.1.7 → pyemaps-2.0.0}/samples/si_stereo.py +0 -0
  116. {pyemaps-1.1.7 → pyemaps-2.0.0}/scattering/__init__.py +0 -0
  117. {pyemaps-1.1.7 → pyemaps-2.0.0}/scattering/sct_dec.py +0 -0
  118. {pyemaps-1.1.7 → pyemaps-2.0.0}/spg/__init__.py +0 -0
  119. {pyemaps-1.1.7 → pyemaps-2.0.0}/spg/spg_dec.py +0 -0
  120. {pyemaps-1.1.7 → pyemaps-2.0.0}/xtal.py +0 -0
@@ -353,7 +353,7 @@ class CifDic(StarFile.StarFile):
353
353
  self.DDL2_normalise() #iron out some DDL2 tricky bits
354
354
  elif self.diclang == "DDLm":
355
355
  self.scoping = 'dictionary' #expose all save frames
356
- if do_imports is not 'No':
356
+ if do_imports != 'No':
357
357
  self.obtain_imports(import_mode=do_imports,heavy=heavy)#recursively calls this routine
358
358
  self.create_alias_table()
359
359
  self.create_cat_obj_table()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pyemaps
3
- Version: 1.1.7
3
+ Version: 2.0.0
4
4
  Summary: A Python Package for Transmission Electron Diffraction Simulations and Crystallographic Computing
5
5
  Home-page: https://www.emlabsolutions.com
6
6
  Author: EMLab Solutions, Inc.
@@ -8,14 +8,25 @@ Author-email: support@emlabsoftware.com
8
8
  License: Free for base features. License activation required for extended 4dstem features
9
9
  Keywords: Transmission,Electron,Diffraction,Simulation,Crystallography,Python
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Programming Language :: Python :: 3.15
12
15
  Classifier: Operating System :: Microsoft :: Windows
13
16
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
17
  Classifier: Intended Audience :: Science/Research
15
- Requires-Python: >=3.7
18
+ Requires-Python: >=3.12
16
19
  Description-Content-Type: text/markdown
17
20
  License-File: license.txt
18
21
  License-File: COPYING
22
+ Requires-Dist: emaps>=2.0.0
23
+ Requires-Dist: numpy>=2.0
24
+ Requires-Dist: matplotlib>=3.8.4
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: summary
19
30
 
20
31
  <!-- # Open Source __pyEMAPS__ Development Guidelines -->
21
32
 
@@ -74,22 +85,18 @@ See instructions below for contributor:
74
85
  ## Build pyEMAPS [`↩`](#content) <a id="build"></a>
75
86
 
76
87
  Requirements and recommendations:
77
- * __Python__: Version == 3.7
88
+ * __Python__: Version 3.12, 3.13, 3.14 or 3.15
78
89
  * __Operating Systems__: Windows
79
90
  * __VSCode__: code editing (recommended, for contributors only)
80
- * __MSVC Community 2019__: with build tools (for contributors only)
81
91
 
82
- Current __pyEMAPS__ only support Windows and python 3.7. We are also looking for contributors to extend it to other platforms and python versions.
92
+ Building __pyEMAPS__ itself needs no compiler, because it is pure Python. Its compiled backend, __emaps__, supports Windows with Python 3.12 to 3.15, so __pyEMAPS__ does too. pyEMAPS 1.1.x remains available for Python 3.7. We are also looking for contributors to extend it to other platforms.
83
93
 
84
94
  Like many python development, a virtual python environment is recommended to isolate your pyEMAPS development environment from your other python development projects.
85
95
 
86
- Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as an example:
96
+ Below are steps to establish __pyEMAPS__ build environment with python 3.12 as an example:
87
97
 
88
- * Install python 3.7.9 with Windows PowerShell command line in Administrator mode in c:\python37 directory:
89
- ```
90
- Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe" -OutFile "python-3.7.9-amd64.exe"
91
- ```
92
- * Run the "python-3.7.9-amd64.exe", choose the following in installer GUI:
98
+ * Download the Python 3.12 Windows installer (64-bit) from [python.org](https://www.python.org/downloads/windows/).
99
+ * Run the installer, choose the following in installer GUI:
93
100
 
94
101
  * Select Customize Installation
95
102
  * Check and select pip
@@ -102,7 +109,7 @@ Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as
102
109
  (or choose your own directory name)
103
110
  * Create pyemaps_build virtual environemnt:
104
111
  ```
105
- c:\python37\python.exe -m venv pyemaps_build
112
+ py -3.12 -m venv pyemaps_build
106
113
  ```
107
114
  * Activate pyemaps_build vitual environment:
108
115
  ```
@@ -110,16 +117,12 @@ Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as
110
117
  ```
111
118
  * Update pip:
112
119
  ```
113
- C:\Python37\python.exe -m pip install pip --upgrade
120
+ python -m pip install pip --upgrade
114
121
  ```
115
122
  * Install other python packages required for building pyemaps, using pip:
116
123
  ```
117
- pip install setuptool wheel numpy build
124
+ pip install setuptools wheel build
118
125
  ```
119
- * Install Microsoft Visual Studio 2019 Community with build tools
120
- https://visualstudio.microsoft.com/vs/older-downloads/
121
- by selecting "Desktop development with C++" in the installer.
122
- (You may need a microsoft account to be able to download)
123
126
  * Build directory structure:
124
127
 
125
128
  <pre>
@@ -160,7 +163,7 @@ where _docs_ for creation of documents requires Sphinx python package:
160
163
 
161
164
  * Install the new pyEMAPS package:
162
165
  ```
163
- pip .\dist\pyemaps-1.0.0-cp37-cp37m-win_amd64.whl
166
+ pip install .\dist\pyemaps-1.0.0-py3-none-any.whl
164
167
  ```
165
168
  This will install new pyEMAPS just built in current python virtual environment
166
169
  along with all of its dependent packages.
@@ -55,22 +55,18 @@ See instructions below for contributor:
55
55
  ## Build pyEMAPS [`↩`](#content) <a id="build"></a>
56
56
 
57
57
  Requirements and recommendations:
58
- * __Python__: Version == 3.7
58
+ * __Python__: Version 3.12, 3.13, 3.14 or 3.15
59
59
  * __Operating Systems__: Windows
60
60
  * __VSCode__: code editing (recommended, for contributors only)
61
- * __MSVC Community 2019__: with build tools (for contributors only)
62
61
 
63
- Current __pyEMAPS__ only support Windows and python 3.7. We are also looking for contributors to extend it to other platforms and python versions.
62
+ Building __pyEMAPS__ itself needs no compiler, because it is pure Python. Its compiled backend, __emaps__, supports Windows with Python 3.12 to 3.15, so __pyEMAPS__ does too. pyEMAPS 1.1.x remains available for Python 3.7. We are also looking for contributors to extend it to other platforms.
64
63
 
65
64
  Like many python development, a virtual python environment is recommended to isolate your pyEMAPS development environment from your other python development projects.
66
65
 
67
- Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as an example:
66
+ Below are steps to establish __pyEMAPS__ build environment with python 3.12 as an example:
68
67
 
69
- * Install python 3.7.9 with Windows PowerShell command line in Administrator mode in c:\python37 directory:
70
- ```
71
- Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe" -OutFile "python-3.7.9-amd64.exe"
72
- ```
73
- * Run the "python-3.7.9-amd64.exe", choose the following in installer GUI:
68
+ * Download the Python 3.12 Windows installer (64-bit) from [python.org](https://www.python.org/downloads/windows/).
69
+ * Run the installer, choose the following in installer GUI:
74
70
 
75
71
  * Select Customize Installation
76
72
  * Check and select pip
@@ -83,7 +79,7 @@ Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as
83
79
  (or choose your own directory name)
84
80
  * Create pyemaps_build virtual environemnt:
85
81
  ```
86
- c:\python37\python.exe -m venv pyemaps_build
82
+ py -3.12 -m venv pyemaps_build
87
83
  ```
88
84
  * Activate pyemaps_build vitual environment:
89
85
  ```
@@ -91,16 +87,12 @@ Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as
91
87
  ```
92
88
  * Update pip:
93
89
  ```
94
- C:\Python37\python.exe -m pip install pip --upgrade
90
+ python -m pip install pip --upgrade
95
91
  ```
96
92
  * Install other python packages required for building pyemaps, using pip:
97
93
  ```
98
- pip install setuptool wheel numpy build
94
+ pip install setuptools wheel build
99
95
  ```
100
- * Install Microsoft Visual Studio 2019 Community with build tools
101
- https://visualstudio.microsoft.com/vs/older-downloads/
102
- by selecting "Desktop development with C++" in the installer.
103
- (You may need a microsoft account to be able to download)
104
96
  * Build directory structure:
105
97
 
106
98
  <pre>
@@ -141,7 +133,7 @@ where _docs_ for creation of documents requires Sphinx python package:
141
133
 
142
134
  * Install the new pyEMAPS package:
143
135
  ```
144
- pip .\dist\pyemaps-1.0.0-cp37-cp37m-win_amd64.whl
136
+ pip install .\dist\pyemaps-1.0.0-py3-none-any.whl
145
137
  ```
146
138
  This will install new pyEMAPS just built in current python virtual environment
147
139
  along with all of its dependent packages.
@@ -65,7 +65,7 @@ def copy_samples():
65
65
  shutil.copy(source, destination)
66
66
  print(f'Copied sample code: {file_name} in pyemaps package to {destination}')
67
67
 
68
- print(f'Run sample code by typing: \"python pyemaps_samples\<sample>\"')
68
+ print(f'Run sample code by typing: \"python pyemaps_samples\\<sample>\"')
69
69
 
70
70
  def is_alphanumeric_with_dash(s, slen):
71
71
  """
@@ -103,7 +103,7 @@ def main():
103
103
 
104
104
  import argparse
105
105
  import datetime
106
- import pkg_resources
106
+ from importlib.metadata import version as dist_version
107
107
 
108
108
  parser = argparse.ArgumentParser(description="pyEMAPS command line tool.",
109
109
  formatter_class=argparse.RawTextHelpFormatter)
@@ -155,7 +155,7 @@ The token is obtained from EMLab Solutions, Inc. by writing to support@emlabsoft
155
155
  parser.print_help()
156
156
  exit(1)
157
157
 
158
- ver = pkg_resources.require("pyemaps")[0].version + str(f" {rel_stage}").lower()
158
+ ver = dist_version("pyemaps") + str(f" {rel_stage}").lower()
159
159
 
160
160
  copyrit = ['PyEMAPS - Transmission Electron Diffraction Simulations In Python']
161
161
  copy1 = '© 2021-' + datetime.date.today().strftime('%Y') + ' EMLab Solutions, Inc. All rights reserved.'
@@ -0,0 +1 @@
1
+ __version__ = "2.0.0"
@@ -50,7 +50,9 @@ def add_powder(target):
50
50
  raise ValueError("Failed to plot: data error")
51
51
 
52
52
  fig, ax = plt.subplots()
53
- fig.canvas.set_window_title('PYEMAPS')
53
+ # canvas.set_window_title was removed in matplotlib 3.6
54
+ if fig.canvas.manager is not None:
55
+ fig.canvas.manager.set_window_title('PYEMAPS')
54
56
  fig.suptitle("Electron Powder Diffraction", fontsize=14, fontweight='bold')
55
57
 
56
58
  ax.set_title(self.name)
@@ -81,7 +81,6 @@ def _find_dpi():
81
81
  import ctypes
82
82
  except ImportError as e:
83
83
  print(f'failed to find display resolution')
84
- print(f'supported python version: == 3.7')
85
84
  print(f'Use default dpi of 96 for display')
86
85
 
87
86
  return dpi
@@ -102,6 +101,9 @@ def _isWin():
102
101
  import sys
103
102
  return (sys.platform == 'win32')
104
103
 
104
+ # seconds a window with bClose=True stays up after its last image
105
+ CLOSE_DELAY = 3
106
+
105
107
  class DifPlotter:
106
108
  # '''
107
109
  # diffraction data plotter that receives data from the pipe and
@@ -125,6 +127,8 @@ class DifPlotter:
125
127
 
126
128
  def terminate(self):
127
129
  if self.bClose:
130
+ # keep the last image up for CLOSE_DELAY seconds, then close the window
131
+ plt.pause(CLOSE_DELAY)
128
132
  plt.close(self.fig) #just close the current figure
129
133
  # Otherwise:
130
134
  # users must close this window after done
@@ -409,10 +413,9 @@ class DifPlotter:
409
413
 
410
414
  self.type = type
411
415
  if hasDisplay:
416
+ # canvas.set_window_title was removed in matplotlib 3.6
412
417
  if self.fig.canvas.manager is not None:
413
418
  self.fig.canvas.manager.set_window_title(pyemaps_title)
414
- else:
415
- self.fig.canvas.set_window_title(pyemaps_title)
416
419
 
417
420
  self.fig.suptitle(self.name, va='top', fontsize=24)
418
421
 
@@ -487,7 +490,7 @@ def showDif(dpl=None,
487
490
  :param bSave: Whether to save the diplay into a .png image file.
488
491
  :type bSave: bool
489
492
 
490
- :param bClose: Whether to close plotting window when finished. Default: False - users must close it.
493
+ :param bClose: Whether to close the plotting window by itself, 3 seconds after the last image. Default: False - users must close it.
491
494
  :type bClose: bool, optional
492
495
 
493
496
  """
@@ -537,7 +540,7 @@ def showBloch(bimgs,
537
540
  :param bSave: Optional. Whether to save the image into a .im3 image file.
538
541
  :type bSave: bool
539
542
 
540
- :param bClose: Whether to close plotting window when finished. Default: False - users must close it.
543
+ :param bClose: Whether to close the plotting window by itself, 3 seconds after the last image. Default: False - users must close it.
541
544
  :type bClose: bool, optional
542
545
 
543
546
  """
@@ -595,7 +598,7 @@ def showStereo(slist, name,
595
598
  :param bSave: Whether to save the image into a .png image file.
596
599
  :type bSave: bool, optional
597
600
 
598
- :param bClose: Whether to close plotting window when finished. Default: False - users must close it.
601
+ :param bClose: Whether to close the plotting window by itself, 3 seconds after the last image. Default: False - users must close it.
599
602
  :type bClose: bool, optional
600
603
 
601
604
 
@@ -705,8 +708,10 @@ def displayXImage(img,
705
708
  bsize = (1.0, 1.0*int(nr/nc))
706
709
 
707
710
  fig, ax = plt.subplots(figsize=bsize, dpi=qedDPI)
708
-
709
- fig.canvas.set_window_title(STEM4D_TITLE)
711
+
712
+ # canvas.set_window_title was removed in matplotlib 3.6
713
+ if fig.canvas.manager is not None:
714
+ fig.canvas.manager.set_window_title(STEM4D_TITLE)
710
715
  # ax.set_xlabel(suptitle, fontsize=1.5)
711
716
  fig.suptitle(suptitle, va='top', fontsize=1.5)
712
717
 
@@ -764,10 +769,9 @@ def plot2Powder(pw1, pw2, bClose=True):
764
769
  fig, (ax1, ax2) = plt.subplots(nrows = 2)
765
770
 
766
771
  title = 'pyEMAPS - Powder Diffraction'
772
+ # canvas.set_window_title was removed in matplotlib 3.6
767
773
  if fig.canvas.manager is not None:
768
774
  fig.canvas.manager.set_window_title(title)
769
- else:
770
- fig.canvas.set_window_title(title)
771
775
 
772
776
  ax1.plot(pw1[0], pw1[1], 'r')
773
777
  ax1.set_title('Silicon')
@@ -193,10 +193,10 @@ negative_infinity = float(-np.inf)
193
193
 
194
194
  required_keys = ['cell', 'dw', 'atoms', 'spg']
195
195
 
196
- NUMERIC_PATTERN = '[-+]? (?: (?: \d* \. \d+ ) | (?: \d+ \.? ) )(?: [Ee] [+-]? \d+ ) ?'
196
+ NUMERIC_PATTERN = r'[-+]? (?: (?: \d* \. \d+ ) | (?: \d+ \.? ) )(?: [Ee] [+-]? \d+ ) ?'
197
197
  RX = re.compile(NUMERIC_PATTERN, re.VERBOSE)
198
198
 
199
- HM_CORE_PATTERN = '[A-Za-z0-9 /\-+]+'
199
+ HM_CORE_PATTERN = r'[A-Za-z0-9 /\-+]+'
200
200
  HM_RX = re.compile(HM_CORE_PATTERN, re.VERBOSE)
201
201
 
202
202
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pyemaps
3
- Version: 1.1.7
3
+ Version: 2.0.0
4
4
  Summary: A Python Package for Transmission Electron Diffraction Simulations and Crystallographic Computing
5
5
  Home-page: https://www.emlabsolutions.com
6
6
  Author: EMLab Solutions, Inc.
@@ -8,14 +8,25 @@ Author-email: support@emlabsoftware.com
8
8
  License: Free for base features. License activation required for extended 4dstem features
9
9
  Keywords: Transmission,Electron,Diffraction,Simulation,Crystallography,Python
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Programming Language :: Python :: 3.7
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Programming Language :: Python :: 3.15
12
15
  Classifier: Operating System :: Microsoft :: Windows
13
16
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
17
  Classifier: Intended Audience :: Science/Research
15
- Requires-Python: >=3.7
18
+ Requires-Python: >=3.12
16
19
  Description-Content-Type: text/markdown
17
20
  License-File: license.txt
18
21
  License-File: COPYING
22
+ Requires-Dist: emaps>=2.0.0
23
+ Requires-Dist: numpy>=2.0
24
+ Requires-Dist: matplotlib>=3.8.4
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: summary
19
30
 
20
31
  <!-- # Open Source __pyEMAPS__ Development Guidelines -->
21
32
 
@@ -74,22 +85,18 @@ See instructions below for contributor:
74
85
  ## Build pyEMAPS [`↩`](#content) <a id="build"></a>
75
86
 
76
87
  Requirements and recommendations:
77
- * __Python__: Version == 3.7
88
+ * __Python__: Version 3.12, 3.13, 3.14 or 3.15
78
89
  * __Operating Systems__: Windows
79
90
  * __VSCode__: code editing (recommended, for contributors only)
80
- * __MSVC Community 2019__: with build tools (for contributors only)
81
91
 
82
- Current __pyEMAPS__ only support Windows and python 3.7. We are also looking for contributors to extend it to other platforms and python versions.
92
+ Building __pyEMAPS__ itself needs no compiler, because it is pure Python. Its compiled backend, __emaps__, supports Windows with Python 3.12 to 3.15, so __pyEMAPS__ does too. pyEMAPS 1.1.x remains available for Python 3.7. We are also looking for contributors to extend it to other platforms.
83
93
 
84
94
  Like many python development, a virtual python environment is recommended to isolate your pyEMAPS development environment from your other python development projects.
85
95
 
86
- Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as an example:
96
+ Below are steps to establish __pyEMAPS__ build environment with python 3.12 as an example:
87
97
 
88
- * Install python 3.7.9 with Windows PowerShell command line in Administrator mode in c:\python37 directory:
89
- ```
90
- Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe" -OutFile "python-3.7.9-amd64.exe"
91
- ```
92
- * Run the "python-3.7.9-amd64.exe", choose the following in installer GUI:
98
+ * Download the Python 3.12 Windows installer (64-bit) from [python.org](https://www.python.org/downloads/windows/).
99
+ * Run the installer, choose the following in installer GUI:
93
100
 
94
101
  * Select Customize Installation
95
102
  * Check and select pip
@@ -102,7 +109,7 @@ Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as
102
109
  (or choose your own directory name)
103
110
  * Create pyemaps_build virtual environemnt:
104
111
  ```
105
- c:\python37\python.exe -m venv pyemaps_build
112
+ py -3.12 -m venv pyemaps_build
106
113
  ```
107
114
  * Activate pyemaps_build vitual environment:
108
115
  ```
@@ -110,16 +117,12 @@ Below are steps to establish __pyEMAPS__ build environment with python 3.7.9 as
110
117
  ```
111
118
  * Update pip:
112
119
  ```
113
- C:\Python37\python.exe -m pip install pip --upgrade
120
+ python -m pip install pip --upgrade
114
121
  ```
115
122
  * Install other python packages required for building pyemaps, using pip:
116
123
  ```
117
- pip install setuptool wheel numpy build
124
+ pip install setuptools wheel build
118
125
  ```
119
- * Install Microsoft Visual Studio 2019 Community with build tools
120
- https://visualstudio.microsoft.com/vs/older-downloads/
121
- by selecting "Desktop development with C++" in the installer.
122
- (You may need a microsoft account to be able to download)
123
126
  * Build directory structure:
124
127
 
125
128
  <pre>
@@ -160,7 +163,7 @@ where _docs_ for creation of documents requires Sphinx python package:
160
163
 
161
164
  * Install the new pyEMAPS package:
162
165
  ```
163
- pip .\dist\pyemaps-1.0.0-cp37-cp37m-win_amd64.whl
166
+ pip install .\dist\pyemaps-1.0.0-py3-none-any.whl
164
167
  ```
165
168
  This will install new pyEMAPS just built in current python virtual environment
166
169
  along with all of its dependent packages.
@@ -18,9 +18,28 @@ setup.cfg
18
18
  setup.py
19
19
  stackimg.py
20
20
  xtal.py
21
- C:/Users/sharon/dev_space/pyemaps_release_builds/20260921-203032/pyemaps/CifFile/src/lib/lex.yy.c
22
- C:/Users/sharon/dev_space/pyemaps_release_builds/20260921-203032/pyemaps/CifFile/src/lib/py_star_scan.c
23
- C:/Users/sharon/dev_space/pyemaps_release_builds/20260921-203032/pyemaps/CifFile/src/lib/star_scanner.h
21
+ ./__init__.py
22
+ ./crystals.py
23
+ ./ddiffs.py
24
+ ./display.py
25
+ ./emcontrols.py
26
+ ./errors.py
27
+ ./fileutils.py
28
+ ./kdiffs.py
29
+ ./stackimg.py
30
+ ./xtal.py
31
+ ./diffract/__init__.py
32
+ ./diffract/bloch_dec.py
33
+ ./diffract/csf_dec.py
34
+ ./diffract/dif_dec.py
35
+ ./diffract/dpgen_dec.py
36
+ ./diffract/mxtal_dec.py
37
+ ./diffract/powder_dec.py
38
+ ./diffract/stereo_dec.py
39
+ ./scattering/__init__.py
40
+ ./scattering/sct_dec.py
41
+ ./spg/__init__.py
42
+ ./spg/spg_dec.py
24
43
  CifFile/src/CifFile_module.py
25
44
  CifFile/src/StarFile.py
26
45
  CifFile/src/TypeContentsParser.py
@@ -0,0 +1,3 @@
1
+ emaps>=2.0.0
2
+ numpy>=2.0
3
+ matplotlib>=3.8.4
@@ -0,0 +1,6 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools",
4
+ "wheel"
5
+ ]
6
+ build-backend = "setuptools.build_meta"
@@ -50,7 +50,7 @@ def run_si_sample():
50
50
  dpl.add(emc, si_dp)
51
51
 
52
52
  #plot and show the diffraction pattern using pyemaps built-in plot function
53
- showDif(dpl)
53
+ showDif(dpl, bClose=True)
54
54
 
55
55
  #hide Kikuchi lines
56
56
  showDif(dpl, kShow=False, bClose=True)
@@ -2,7 +2,10 @@
2
2
  author = EMLab Solutions, Inc.
3
3
  author_email = support@emlabsoftware.com
4
4
  classifiers = Development Status :: 5 - Production/Stable
5
- Programming Language :: Python :: 3.7
5
+ Programming Language :: Python :: 3.12
6
+ Programming Language :: Python :: 3.13
7
+ Programming Language :: Python :: 3.14
8
+ Programming Language :: Python :: 3.15
6
9
  Operating System :: Microsoft :: Windows
7
10
  Topic :: Software Development :: Libraries :: Python Modules
8
11
  Intended Audience :: Science/Research
@@ -16,11 +19,9 @@ keywords = Transmission
16
19
  url = https://www.emlabsolutions.com
17
20
 
18
21
  [options]
19
- python_requires = >= 3.7
22
+ python_requires = >= 3.12
20
23
  quiet = 1
21
24
 
22
- [build_ext]
23
-
24
25
  [egg_info]
25
26
  tag_build =
26
27
  tag_date = 0
@@ -23,39 +23,48 @@ Author: EMLab Solutions, Inc.
23
23
  Date Created: May 07, 2022
24
24
 
25
25
  '''
26
- from ast import keyword
27
- from ensurepip import version
28
- from multiprocessing import AuthenticationError
29
- from nturl2path import url2pathname
30
- from random import sample
31
- from ssl import Options
32
-
33
- import setuptools
34
- from numpy.distutils.core import Extension, setup
35
-
36
- from numpy.distutils.command.build_ext import build_ext as numpy_build_ext
37
-
38
26
  import os
39
-
40
- os.environ["DISTUTILS_USE_SDK"] = "1"
41
- os.environ["MSSdk"] = "1"
42
27
  from pathlib import Path
43
28
 
44
- install_requires = [
45
- 'emaps >= 1.1.1',
46
- 'numpy >= 1.21.2',
47
- 'matplotlib >= 3.2.1'
48
- ]
29
+ # pyemaps is pure Python. The bundled PyCifRW's optional C scanner
30
+ # (pyemaps.CifFile.StarScan, sources in CifFile/src/lib) is not built:
31
+ # pyemaps reads CIF files with ReadCif's default pure-Python scanner, and
32
+ # PyCifRW falls back to it when StarScan is absent. That makes the wheel
33
+ # py3-none-any, one wheel for every Python version.
34
+ from setuptools import setup
35
+ try:
36
+ from setuptools.command.install_data import install_data as _install_data
37
+ except ImportError:
38
+ # setuptools has no install_data command of its own (checked up to
39
+ # 84.2.1), so this branch is the one that normally runs. Python 3.12+
40
+ # has no stdlib distutils, but importing setuptools first makes
41
+ # setuptools' bundled copy answer this import.
42
+ from distutils.command.install_data import install_data as _install_data
43
+
44
+
45
+ class install_data_in_package(_install_data):
46
+ '''
47
+ Install data_files inside the installed package, as numpy.distutils did.
49
48
 
50
- def get_cifreader_source():
51
- current_path = Path(os.path.abspath(__file__))
52
- pyemaps_parent_path = current_path.parent.absolute()
53
- cifreader_path = os.path.join(pyemaps_parent_path, 'CifFile')
49
+ Plain setuptools installs relative data_files under sys.prefix. The
50
+ wheel then puts them in its .data/ section, so __main__.py,
51
+ __version__.py, __config__.py, cdata/ and samples/ would end up outside
52
+ site-packages/pyemaps. Point install_data at install_lib instead, which
53
+ keeps the same wheel layout as earlier pyemaps releases.
54
+ '''
55
+ def finalize_options(self):
56
+ self.set_undefined_options('install',
57
+ ('install_lib', 'install_dir'),
58
+ ('root', 'root'),
59
+ ('force', 'force'),
60
+ )
54
61
 
55
- # print(f'-----------CifReader Source path: {cifreader_path}')
56
62
 
57
- src_files = ["src/lib/lex.yy.c","src/lib/py_star_scan.c"]
58
- return [os.path.join(cifreader_path, s) for s in src_files]
63
+ install_requires = [
64
+ 'emaps >= 2.0.0',
65
+ 'numpy >= 2.0',
66
+ 'matplotlib >= 3.8.4'
67
+ ]
59
68
 
60
69
  def get_samples(sdn = 'samples'):
61
70
  '''
@@ -107,20 +116,6 @@ def get_install_requires():
107
116
  return install_reqs
108
117
 
109
118
 
110
- pyemaps_cifreader = Extension("pyemaps.CifFile.StarScan",
111
- sources = get_cifreader_source(), # Replace with your source files
112
- extra_compile_args=[
113
- "/Wall", # Enable all warnings
114
- # "/Zi", # Generate debug info
115
- "/nologo", # Suppress the MSVC logo
116
- "/D _CRT_SECURE_NO_WARNINGS", # Disable CRT warnings (optional)
117
- "/EHsc", # Enable exception handling (for C++)
118
- ],
119
- extra_link_args=[
120
- # "/DEBUG", # Generate debug symbols for linking
121
- ]
122
- )
123
-
124
119
  def get_version(f):
125
120
  version = {}
126
121
  with open(f + ".py") as fp:
@@ -163,9 +158,7 @@ setup(name ="pyemaps",
163
158
  'pyemaps.CifFile.StarFile',
164
159
  'pyemaps.CifFile.TypeContentsParser'],
165
160
 
166
- ext_modules = [pyemaps_cifreader,],
167
-
168
- packages = ['pyemaps.diffract',
161
+ packages = ['pyemaps.diffract',
169
162
  'pyemaps.scattering',
170
163
  'pyemaps.spg',
171
164
  'pyemaps.CifFile',
@@ -181,7 +174,8 @@ setup(name ="pyemaps",
181
174
  ],
182
175
  },
183
176
  install_requires = get_install_requires(),
184
-
177
+ cmdclass = {'install_data': install_data_in_package},
178
+
185
179
  data_files = [('pyemaps',
186
180
  ['__config__.py',
187
181
  '__main__.py',
@@ -106,7 +106,9 @@ class StackImage():
106
106
  MIN_IMAGESIZE,
107
107
  MIN_IMAGESTACK),
108
108
  noffset = 8):
109
-
109
+
110
+ self._data = None # current image data
111
+ self._npdata = None # numpy input image (E_NPY)
110
112
  setattr(self, 'nformat', nformat) # image file type
111
113
  setattr(self, 'fname', imgfn) # image file name
112
114
  setattr(self, 'noffset', noffset) # image header offset to image data
@@ -176,6 +178,10 @@ class StackImage():
176
178
  Otherwise, the data will be generated from Stem4d when the input image
177
179
  file is loaded.
178
180
 
181
+ With `nformat` set to E_NPY, set this to a 2-D numpy array of any
182
+ boolean, integer or floating-point type, 100 to 512 pixels per side,
183
+ before calling `loadImage`. It is converted to float32 when loaded.
184
+
179
185
  """
180
186
  return self._data
181
187
 
@@ -229,9 +235,12 @@ class StackImage():
229
235
 
230
236
  @data.setter
231
237
  def data(self, idata):
232
- if not isinstance(idata, np.ndarray()):
233
- raise XDPImageError('Raw image data must be an numpy array')
238
+ if not isinstance(idata, np.ndarray):
239
+ raise XDPImageError('Raw image data must be a numpy array')
234
240
 
241
+ # loadImage reads the input from _npdata; _data is replaced by
242
+ # whichever image is loaded or generated later
243
+ self._npdata = idata
235
244
  self._data = idata
236
245
 
237
246
  def __del__(self):
@@ -250,7 +259,12 @@ class StackImage():
250
259
  ximage = stem4d.cvar.ximg
251
260
  ret = -1
252
261
  if img_format == E_NPY:
253
- ret = ximage.setImage_from_numpy(self.data)
262
+ if self._npdata is None:
263
+ raise XDPImageError("No image data: set the data property to a 2-D numpy array before loading")
264
+ try:
265
+ ret = ximage.setImage_from_numpy(self._npdata)
266
+ except (TypeError, ValueError, MemoryError) as e:
267
+ raise XDPImageError(f"Invalid numpy image: {e}") from e
254
268
 
255
269
  # load proprietory small header formatted image file
256
270
  if img_format == E_SH:
@@ -1 +0,0 @@
1
- __version__ = "1.1.7"
@@ -1,3 +0,0 @@
1
- emaps>=1.1.1
2
- numpy>=1.21.2
3
- matplotlib>=3.2.1
@@ -1,7 +0,0 @@
1
- [build-system]
2
- requires = [
3
- "setuptools",
4
- "wheel",
5
- "numpy"
6
- ]
7
- build-backend = "setuptools.build_meta"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes