summary refs log tree commit diff
path: root/gnu/packages/simulation.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-07-18 16:05:21 +0200
committerLudovic Courtès <ludo@gnu.org>2021-07-18 19:50:01 +0200
commit0e47fcced442d8e7c1b05184fdc1c14f10ed04ec (patch)
tree4ae844bc0ec3c670f8697bdc24362c122fa718ad /gnu/packages/simulation.scm
parente4b70bc55a538569465bcedee19d1f2607308e65 (diff)
parent8b1bde7bb3936a64244824500ffe60f123704437 (diff)
downloadguix-0e47fcced442d8e7c1b05184fdc1c14f10ed04ec.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/simulation.scm')
-rw-r--r--gnu/packages/simulation.scm109
1 files changed, 108 insertions, 1 deletions
diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index ed9a4b8f2e..26e26b351e 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
+;;; Copyright © 2017, 2018, 2019, 2020, 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -42,6 +42,7 @@
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages tls)
@@ -772,3 +773,109 @@ areas in the model.  A semi-implicit method is used to advance the
 solution in time.  The tool is typically applied to the modelling of
 river flooding.")
       (license license:cecill))))
+
+(define-public python-meshio
+  (package
+    (name "python-meshio")
+    (version "4.4.6")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "meshio" version))
+        (sha256
+          (base32
+           "0kv832s2vyff30zz8yqypw5jifwdanvh5x56d2bzkvy94h4jlddy"))
+        (snippet
+         '(begin
+            (let ((file (open-file "setup.py" "a")))
+              (display "from setuptools import setup\nsetup()" file)
+              (close-port file))
+            #t))))
+    (build-system python-build-system)
+    (inputs
+     `(("h5py" ,python-h5py)
+       ("netcdf4" ,python-netcdf4)))
+    (native-inputs
+     `(("pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("importlib-metadata" ,python-importlib-metadata)
+       ("numpy" ,python-numpy)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "python" "-m" "pytest" "-v" "tests")
+             #t)))))
+    (home-page "https://github.com/nschloe/meshio")
+    (synopsis "I/O for mesh files")
+    (description "There are various file formats available for
+representing unstructured meshes and mesh data.  The @code{meshio}
+package is able to read and write mesh files in many formats and to
+convert files from one format to another.  Formats such as cgns, h5m,
+gmsh, xdmf and vtk are supported.  The package provides command-line
+tools and a collection of Python modules for programmatic use.")
+    (license license:expat)))
+
+(define-public python-pygmsh
+  (package
+    (name "python-pygmsh")
+    (version "7.1.9")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "pygmsh" version))
+        (sha256
+          (base32
+           "1q7nr0cq581wlif537y6awj7vz9jywxg14c8znmsx5ip8x24754j"))
+        (modules '((guix build utils)))
+        (snippet
+         '(begin
+            (let ((file (open-file "setup.py" "a")))
+              (display "from setuptools import setup\nsetup()" file)
+              (close-port file))
+            ;; setuptools is supplied by the build system.  An extra
+            ;; reference in the original configuration file triggers
+            ;; an attempt to download the package again.  This fails.
+            ;; The extra reference is unnecessary and is removed.
+            (substitute* "setup.cfg"
+              (("^[[:blank:]]+setuptools>=42\n") ""))
+            ;; FIXME: gmsh version 4.7.0 introduces new field option
+            ;; names.  See gmsh commit 6eab8028.  pygmsh needs to use
+            ;; one of the old option names for compatibility with gmsh
+            ;; version 4.6.0.
+            (with-directory-excursion "pygmsh/common"
+              (substitute* "size_field.py"
+                (("NumPointsPerCurve") "NNodesByEdge")))
+            #t))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("pytest" ,python-pytest)
+       ("wheel" ,python-wheel)))
+    (propagated-inputs
+     `(("importlib-metadata" ,python-importlib-metadata)
+       ("gmsh" ,gmsh)
+       ("meshio" ,python-meshio)
+       ("numpy" ,python-numpy)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               ;; The readme test is skipped.  It requires the exdown
+               ;; module which is not available.
+               (invoke "python" "-m" "pytest" "-v" "test"
+                       "--ignore" "test/test_readme.py"))
+             #t)))))
+    (home-page "https://github.com/nschloe/pygmsh")
+    (synopsis "Python frontend for Gmsh")
+    (description "The goal of @code{pygmsh} is to combine the power of
+Gmsh with the versatility of Python.  The package generalises many of
+the methods and functions that comprise the Gmsh Python API.  In this
+way the meshing of complex geometries using high-level abstractions is
+made possible.  The package provides a Python library together with a
+command-line utility for mesh optimisation.")
+    (license license:lgpl3)))