PyPowder 0.0.0a4__tar.gz → 0.0.0a5__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.
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/.gitignore +2 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/PKG-INFO +1 -2
- pypowder-0.0.0a5/RunConversion.bat +3 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/pyproject.toml +4 -2
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPOW/__init__.py +2 -0
- pypowder-0.0.0a4/src/PyPOW/run_XY_conversion.py → pypowder-0.0.0a5/src/PyPOW/__main__.py +16 -15
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPOW/__version__.py +3 -3
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/PKG-INFO +1 -2
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/SOURCES.txt +3 -3
- pypowder-0.0.0a5/src/PyPowder.egg-info/entry_points.txt +2 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/requires.txt +0 -1
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/scm_file_list.json +2 -3
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/scm_version.json +2 -2
- pypowder-0.0.0a4/RunConversion.bat +0 -3
- pypowder-0.0.0a4/requirements.txt +0 -4
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/.gitattributes +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/.github/workflows/python-publish.yml +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/LICENCE +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/README.md +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/setup.cfg +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPOW/import_module.py +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/dependency_links.txt +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/top_level.txt +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/ASG1_1.XRDML +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/ASG1_1.csv +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/ASG1_1.gsas +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/ASG1_1.xy +0 -0
- {pypowder-0.0.0a4/src/PyPOW → pypowder-0.0.0a5/tests}/lab.py +0 -0
- {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/working_example.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyPowder
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.0a5
|
|
4
4
|
Summary: Attempt at constructing a set of tools to convert XRDML files to a more usable format.
|
|
5
5
|
Author-email: Diogo Almeida <dafda1@st-andrews.ac.uk>, Max Pelly <mp250@st-andrews.ac.uk>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -14,7 +14,6 @@ License-File: LICENCE
|
|
|
14
14
|
Requires-Dist: pandas
|
|
15
15
|
Requires-Dist: numpy
|
|
16
16
|
Requires-Dist: xmltodict
|
|
17
|
-
Requires-Dist: matplotlib
|
|
18
17
|
Dynamic: license-file
|
|
19
18
|
|
|
20
19
|
# PyPOW
|
|
@@ -15,8 +15,7 @@ requires-python = ">=3.9"
|
|
|
15
15
|
dependencies = [
|
|
16
16
|
"pandas",
|
|
17
17
|
"numpy",
|
|
18
|
-
"xmltodict"
|
|
19
|
-
"matplotlib",
|
|
18
|
+
"xmltodict"
|
|
20
19
|
]
|
|
21
20
|
classifiers = [
|
|
22
21
|
"Programming Language :: Python :: 3",
|
|
@@ -29,5 +28,8 @@ license-files = ["LICEN[CS]E*"]
|
|
|
29
28
|
Homepage = "https://github.com/MaxPelly/PyPOW"
|
|
30
29
|
Issues = "https://github.com/MaxPelly/PyPOW/issues"
|
|
31
30
|
|
|
31
|
+
[project.scripts]
|
|
32
|
+
PyPOW = "PyPOW.__main__:convert_files"
|
|
33
|
+
|
|
32
34
|
[tool.setuptools_scm]
|
|
33
35
|
version_file = "src/PyPOW/__version__.py"
|
|
@@ -13,13 +13,6 @@ from PyPOW.import_module import extract_intended_wavelength as get_wvl
|
|
|
13
13
|
|
|
14
14
|
from sys import argv
|
|
15
15
|
|
|
16
|
-
#%% check input and get list of files
|
|
17
|
-
|
|
18
|
-
if len(argv) < 2:
|
|
19
|
-
raise ValueError("Must specify filenames to convert.")
|
|
20
|
-
else:
|
|
21
|
-
files_to_convert = argv[1:]
|
|
22
|
-
|
|
23
16
|
#%% define conversion functions
|
|
24
17
|
|
|
25
18
|
def change_file_extension (filename):
|
|
@@ -28,25 +21,33 @@ def change_file_extension (filename):
|
|
|
28
21
|
def convert_file (filename):
|
|
29
22
|
df, meta = import_xrdml_data(filename, include_metadata = True)
|
|
30
23
|
newfile = change_file_extension(filename)
|
|
31
|
-
|
|
24
|
+
|
|
32
25
|
#initialise data array and write 2 theta and intensity columns
|
|
33
26
|
data = np.empty((df.index.size, 2), dtype = float)
|
|
34
27
|
data[:, 0] = df["2Theta (deg)"]
|
|
35
28
|
data[:, 1] = df["Intensity (counts)"]
|
|
36
|
-
|
|
29
|
+
|
|
37
30
|
#save as text (xy) file
|
|
38
31
|
np.savetxt(newfile, data, fmt = ("%.3f", "%.1f"),
|
|
39
32
|
header = "wavelength = %.5f %s\n" % get_wvl(meta['usedWavelength']) +\
|
|
40
33
|
"2theta (deg), Intensity (counts)")
|
|
41
|
-
|
|
34
|
+
|
|
42
35
|
#save dataframe as csv
|
|
43
36
|
df.to_csv(filename[:-5] + "csv")
|
|
44
|
-
|
|
45
37
|
return newfile
|
|
46
38
|
|
|
47
39
|
#%% run conversions
|
|
40
|
+
def convert_files():
|
|
41
|
+
|
|
42
|
+
if len(argv) < 2:
|
|
43
|
+
raise ValueError("Must specify filenames to convert.")
|
|
44
|
+
else:
|
|
45
|
+
files_to_convert = argv[1:]
|
|
46
|
+
|
|
47
|
+
for filename in files_to_convert:
|
|
48
|
+
print(f">> Converting file {filename}.")
|
|
49
|
+
newfile = convert_file(filename)
|
|
50
|
+
print(f" >> Done. Created file {newfile}.")
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
newfile = convert_file(filename)
|
|
52
|
-
print(f" >> Done. Created file {newfile}.")
|
|
52
|
+
if __name__ == "__main__":
|
|
53
|
+
convert_files()
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 0, 0, '
|
|
21
|
+
__version__ = version = '0.0.0a5'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 0, 0, 'a5')
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g91f4eb88d'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyPowder
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.0a5
|
|
4
4
|
Summary: Attempt at constructing a set of tools to convert XRDML files to a more usable format.
|
|
5
5
|
Author-email: Diogo Almeida <dafda1@st-andrews.ac.uk>, Max Pelly <mp250@st-andrews.ac.uk>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -14,7 +14,6 @@ License-File: LICENCE
|
|
|
14
14
|
Requires-Dist: pandas
|
|
15
15
|
Requires-Dist: numpy
|
|
16
16
|
Requires-Dist: xmltodict
|
|
17
|
-
Requires-Dist: matplotlib
|
|
18
17
|
Dynamic: license-file
|
|
19
18
|
|
|
20
19
|
# PyPOW
|
|
@@ -4,16 +4,15 @@ LICENCE
|
|
|
4
4
|
README.md
|
|
5
5
|
RunConversion.bat
|
|
6
6
|
pyproject.toml
|
|
7
|
-
requirements.txt
|
|
8
7
|
.github/workflows/python-publish.yml
|
|
9
8
|
src/PyPOW/__init__.py
|
|
9
|
+
src/PyPOW/__main__.py
|
|
10
10
|
src/PyPOW/__version__.py
|
|
11
11
|
src/PyPOW/import_module.py
|
|
12
|
-
src/PyPOW/lab.py
|
|
13
|
-
src/PyPOW/run_XY_conversion.py
|
|
14
12
|
src/PyPowder.egg-info/PKG-INFO
|
|
15
13
|
src/PyPowder.egg-info/SOURCES.txt
|
|
16
14
|
src/PyPowder.egg-info/dependency_links.txt
|
|
15
|
+
src/PyPowder.egg-info/entry_points.txt
|
|
17
16
|
src/PyPowder.egg-info/requires.txt
|
|
18
17
|
src/PyPowder.egg-info/scm_file_list.json
|
|
19
18
|
src/PyPowder.egg-info/scm_version.json
|
|
@@ -22,4 +21,5 @@ tests/ASG1_1.XRDML
|
|
|
22
21
|
tests/ASG1_1.csv
|
|
23
22
|
tests/ASG1_1.gsas
|
|
24
23
|
tests/ASG1_1.xy
|
|
24
|
+
tests/lab.py
|
|
25
25
|
tests/working_example.py
|
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
"LICENCE",
|
|
5
5
|
"pyproject.toml",
|
|
6
6
|
"RunConversion.bat",
|
|
7
|
-
"requirements.txt",
|
|
8
7
|
".gitattributes",
|
|
9
8
|
".gitignore",
|
|
10
|
-
"src/PyPOW/lab.py",
|
|
11
9
|
"src/PyPOW/__init__.py",
|
|
12
10
|
"src/PyPOW/import_module.py",
|
|
13
|
-
"src/PyPOW/
|
|
11
|
+
"src/PyPOW/__main__.py",
|
|
12
|
+
"tests/lab.py",
|
|
14
13
|
"tests/ASG1_1.csv",
|
|
15
14
|
"tests/ASG1_1.XRDML",
|
|
16
15
|
"tests/ASG1_1.gsas",
|
|
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
|