guix_mirror_bot pushed a commit to branch master
in repository guix.

commit b6523e1a20034306ff1413f653923a954a3e8075
Author: Danny Milosavljevic <[email protected]>
AuthorDate: Mon Dec 22 15:28:58 2025 +0100

    gnu: Add python-pystog.
    
    * gnu/packages/python-science.scm (python-pystog): New variable.
    
    Change-Id: I75eb64488c6a190aebee221bb7387dde2c0797c7
---
 gnu/packages/python-science.scm | 49 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index b6858c4f2d..7e11f4b354 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -6638,6 +6638,55 @@ of crystal structures.  It automatically detects Bravais 
lattice types and
 generates k-point labels and band paths following crystallographic
 conventions.")
     (license license:expat)))
+
+(define-public python-pystog
+  (package
+    (name "python-pystog")
+    (version "0.6.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/neutrons/pystog";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1dwljmyp083v5a189xzdxxsdkazh5bmbm2f2k79jp7lds0y8h9lg"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-version
+            (lambda _
+              ;; versioningit needs git tags; patch pyproject.toml to use
+              ;; static version and create _version.py directly.
+              (substitute* "pyproject.toml"
+                (("dynamic = \\[\"version\"\\]")
+                 (string-append "version = \"" #$version "\""))
+                (("source = \"versioningit\"") "")
+                (("\\[tool\\.hatch\\.build\\.hooks\\.versioningit-onbuild\\]")
+                 "[tool.hatch.build.hooks.versioningit-onbuild]
+enable-by-default = false"))
+              (mkdir-p "src/pystog")
+              (call-with-output-file "src/pystog/_version.py"
+                (lambda (port)
+                  (format port "__version__ = \"~a\"~%" #$version))))))))
+    (propagated-inputs
+     (list python-h5py
+           python-numpy))
+    (native-inputs
+     (list python-hatchling
+           python-pytest))
+    (home-page "https://github.com/neutrons/pystog";)
+    (synopsis "Total scattering function manipulator")
+    (description
+     "PyStoG is a Python package for converting between different total
+scattering functions used in crystalline and amorphous materials research.
+It handles reciprocal-space structure factors and real-space pair distribution
+functions, performing Fourier transforms between them and applying filters to
+remove spurious artifacts in the data.")
+    (license license:gpl3+)))
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar

Reply via email to