PyPowder 0.0.0a3__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.0a3 → pypowder-0.0.0a5}/.gitignore +2 -0
  2. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/PKG-INFO +4 -5
  3. pypowder-0.0.0a5/RunConversion.bat +3 -0
  4. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/pyproject.toml +10 -4
  5. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPOW/__init__.py +2 -0
  6. pypowder-0.0.0a3/src/PyPOW/run_XY_conversion.py → pypowder-0.0.0a5/src/PyPOW/__main__.py +16 -15
  7. pypowder-0.0.0a5/src/PyPOW/__version__.py +24 -0
  8. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPowder.egg-info/PKG-INFO +4 -5
  9. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPowder.egg-info/SOURCES.txt +4 -3
  10. pypowder-0.0.0a5/src/PyPowder.egg-info/entry_points.txt +2 -0
  11. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPowder.egg-info/requires.txt +0 -1
  12. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPowder.egg-info/scm_file_list.json +2 -3
  13. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPowder.egg-info/scm_version.json +2 -2
  14. pypowder-0.0.0a3/RunConversion.bat +0 -3
  15. pypowder-0.0.0a3/requirements.txt +0 -4
  16. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/.gitattributes +0 -0
  17. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/.github/workflows/python-publish.yml +0 -0
  18. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/LICENCE +0 -0
  19. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/README.md +0 -0
  20. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/setup.cfg +0 -0
  21. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPOW/import_module.py +0 -0
  22. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPowder.egg-info/dependency_links.txt +0 -0
  23. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/src/PyPowder.egg-info/top_level.txt +0 -0
  24. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/tests/ASG1_1.XRDML +0 -0
  25. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/tests/ASG1_1.csv +0 -0
  26. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/tests/ASG1_1.gsas +0 -0
  27. {pypowder-0.0.0a3 → pypowder-0.0.0a5}/tests/ASG1_1.xy +0 -0
  28. {pypowder-0.0.0a3/src/PyPOW → pypowder-0.0.0a5/tests}/lab.py +0 -0
  29. {pypowder-0.0.0a3 → 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,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPowder
3
- Version: 0.0.0a3
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
- Author-email: Diogo Almeida <dafda1@st-andrews.ac.uk>
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
7
- Project-URL: Homepage, https://github.com/dafda1/PyPOW
8
- Project-URL: Issues, https://github.com/dafda1/PyPOW/issues
7
+ Project-URL: Homepage, https://github.com/MaxPelly/PyPOW
8
+ Project-URL: Issues, https://github.com/MaxPelly/PyPOW/issues
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.9
@@ -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
@@ -7,6 +7,7 @@ name = "PyPowder"
7
7
  dynamic = ["version"]
8
8
  authors = [
9
9
  { name="Diogo Almeida", email="dafda1@st-andrews.ac.uk" },
10
+ { name="Max Pelly", email="mp250@st-andrews.ac.uk" },
10
11
  ]
11
12
  description = "Attempt at constructing a set of tools to convert XRDML files to a more usable format."
12
13
  readme = "README.md"
@@ -14,8 +15,7 @@ requires-python = ">=3.9"
14
15
  dependencies = [
15
16
  "pandas",
16
17
  "numpy",
17
- "xmltodict",
18
- "matplotlib",
18
+ "xmltodict"
19
19
  ]
20
20
  classifiers = [
21
21
  "Programming Language :: Python :: 3",
@@ -25,5 +25,11 @@ license = "GPL-3.0-or-later"
25
25
  license-files = ["LICEN[CS]E*"]
26
26
 
27
27
  [project.urls]
28
- Homepage = "https://github.com/dafda1/PyPOW"
29
- Issues = "https://github.com/dafda1/PyPOW/issues"
28
+ Homepage = "https://github.com/MaxPelly/PyPOW"
29
+ Issues = "https://github.com/MaxPelly/PyPOW/issues"
30
+
31
+ [project.scripts]
32
+ PyPOW = "PyPOW.__main__:convert_files"
33
+
34
+ [tool.setuptools_scm]
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()
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.0.0a5'
22
+ __version_tuple__ = version_tuple = (0, 0, 0, 'a5')
23
+
24
+ __commit_id__ = commit_id = 'g91f4eb88d'
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPowder
3
- Version: 0.0.0a3
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
- Author-email: Diogo Almeida <dafda1@st-andrews.ac.uk>
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
7
- Project-URL: Homepage, https://github.com/dafda1/PyPOW
8
- Project-URL: Issues, https://github.com/dafda1/PyPOW/issues
7
+ Project-URL: Homepage, https://github.com/MaxPelly/PyPOW
8
+ Project-URL: Issues, https://github.com/MaxPelly/PyPOW/issues
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.9
@@ -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,15 +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
+ src/PyPOW/__version__.py
10
11
  src/PyPOW/import_module.py
11
- src/PyPOW/lab.py
12
- src/PyPOW/run_XY_conversion.py
13
12
  src/PyPowder.egg-info/PKG-INFO
14
13
  src/PyPowder.egg-info/SOURCES.txt
15
14
  src/PyPowder.egg-info/dependency_links.txt
15
+ src/PyPowder.egg-info/entry_points.txt
16
16
  src/PyPowder.egg-info/requires.txt
17
17
  src/PyPowder.egg-info/scm_file_list.json
18
18
  src/PyPowder.egg-info/scm_version.json
@@ -21,4 +21,5 @@ tests/ASG1_1.XRDML
21
21
  tests/ASG1_1.csv
22
22
  tests/ASG1_1.gsas
23
23
  tests/ASG1_1.xy
24
+ tests/lab.py
24
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.0a3",
2
+ "tag": "0.0.0a5",
3
3
  "distance": 0,
4
- "node": "g3ea66b9c74f885be3c156f18d5498f5afb89f090",
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