summaryrefslogtreecommitdiff
path: root/gnu/packages/physics.scm
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@friendly-machines.com>2026-02-13 11:06:41 +0000
committerDanny Milosavljevic <dannym@friendly-machines.com>2026-02-21 21:52:39 +0100
commitd3e7490a5c54d342ac043be4e77b0c06073db741 (patch)
tree369bfb527af323cf854a8b0abd975e31863255a8 /gnu/packages/physics.scm
parent8154e1d07b61245f59edf101f7c25a8307e63c98 (diff)
gnu: python-pystog: Move to (gnu packages physics).
* gnu/packages/python-science.scm (python-pystog): Move from here… * gnu/packages/physics.scm (python-pystog): …to here. Change-Id: Ic2051954eb1c126bde11b2d4545d14065cd8b16b
Diffstat (limited to 'gnu/packages/physics.scm')
-rw-r--r--gnu/packages/physics.scm49
1 files changed, 49 insertions, 0 deletions
diff --git a/gnu/packages/physics.scm b/gnu/packages/physics.scm
index 8f5e7f7b3dd..911b8ba3f92 100644
--- a/gnu/packages/physics.scm
+++ b/gnu/packages/physics.scm
@@ -144,3 +144,52 @@ Information File) format files. CIF is the standard format for
crystallographic data exchange endorsed by the International Union of
Crystallography.")
(license license:psfl)))
+
+(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+)))