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.
Files changed (29) hide show
  1. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/.gitignore +2 -0
  2. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/PKG-INFO +1 -2
  3. pypowder-0.0.0a5/RunConversion.bat +3 -0
  4. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/pyproject.toml +4 -2
  5. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPOW/__init__.py +2 -0
  6. pypowder-0.0.0a4/src/PyPOW/run_XY_conversion.py → pypowder-0.0.0a5/src/PyPOW/__main__.py +16 -15
  7. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPOW/__version__.py +3 -3
  8. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/PKG-INFO +1 -2
  9. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/SOURCES.txt +3 -3
  10. pypowder-0.0.0a5/src/PyPowder.egg-info/entry_points.txt +2 -0
  11. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/requires.txt +0 -1
  12. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/scm_file_list.json +2 -3
  13. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/scm_version.json +2 -2
  14. pypowder-0.0.0a4/RunConversion.bat +0 -3
  15. pypowder-0.0.0a4/requirements.txt +0 -4
  16. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/.gitattributes +0 -0
  17. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/.github/workflows/python-publish.yml +0 -0
  18. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/LICENCE +0 -0
  19. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/README.md +0 -0
  20. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/setup.cfg +0 -0
  21. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPOW/import_module.py +0 -0
  22. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/dependency_links.txt +0 -0
  23. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/src/PyPowder.egg-info/top_level.txt +0 -0
  24. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/ASG1_1.XRDML +0 -0
  25. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/ASG1_1.csv +0 -0
  26. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/ASG1_1.gsas +0 -0
  27. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/ASG1_1.xy +0 -0
  28. {pypowder-0.0.0a4/src/PyPOW → pypowder-0.0.0a5/tests}/lab.py +0 -0
  29. {pypowder-0.0.0a4 → pypowder-0.0.0a5}/tests/working_example.py +0 -0
@@ -1,3 +1,5 @@
1
+ __version__.py
2
+
1
3
  # Byte-compiled / optimized / DLL files
2
4
  __pycache__/
3
5
  *.py[cod]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPowder
3
- Version: 0.0.0a4
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
@@ -0,0 +1,3 @@
1
+ call C:\Users\dafda1\Anaconda3\envs\scripting\Lib\venv\scripts\common\activate
2
+ @python3 -m PyPOW %*
3
+ @pause
@@ -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"
@@ -5,3 +5,5 @@ Created on Fri Oct 18 10:52:51 2024
5
5
  @author: dafda1
6
6
  """
7
7
 
8
+ from PyPOW.import_module import *
9
+ from PyPOW.__version__ import *
@@ -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
- for filename in files_to_convert:
50
- print(f">> Converting file {filename}.")
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.0a4'
22
- __version_tuple__ = version_tuple = (0, 0, 0, 'a4')
21
+ __version__ = version = '0.0.0a5'
22
+ __version_tuple__ = version_tuple = (0, 0, 0, 'a5')
23
23
 
24
- __commit_id__ = commit_id = 'g4bd43426a'
24
+ __commit_id__ = commit_id = 'g91f4eb88d'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPowder
3
- Version: 0.0.0a4
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
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ PyPOW = PyPOW.__main__:convert_files
@@ -1,4 +1,3 @@
1
1
  pandas
2
2
  numpy
3
3
  xmltodict
4
- matplotlib
@@ -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/run_XY_conversion.py",
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",
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "0.0.0a4",
2
+ "tag": "0.0.0a5",
3
3
  "distance": 0,
4
- "node": "g4bd43426a2eb12d47f5f4e556dd642297b50aea2",
4
+ "node": "g91f4eb88dcd1a11aaecadbb663b99166a1a0221c",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-07-14"
@@ -1,3 +0,0 @@
1
- call C:\Users\dafda1\Anaconda3\envs\scripting\Lib\venv\scripts\common\activate
2
- @C:\Users\dafda1\Anaconda3\envs\scripting\python.exe C:\Users\dafda1\MyPackages\PyPOW\run_XY_conversion.py %*
3
- @pause
@@ -1,4 +0,0 @@
1
- pandas
2
- numpy
3
- matplotlib
4
- xmltodict
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes