diff mbox series

[bug#48614,3/3] gnu: Add python-cartopy.

Message ID 20210523193134.425937-3-monego@posteo.net
State Accepted
Headers show
Series gnu: Add python-cartopy. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Vinicius Monego May 23, 2021, 7:31 p.m. UTC
* gnu/packages/python-science.scm (python-cartopy): New variable.
---
 gnu/packages/python-science.scm | 56 +++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

Comments

Björn Höfling May 24, 2021, 11:11 p.m. UTC | #1
Hi Vinicius,

thanks for your contribution. this patch series looks good, except of
some little requarks:

- I would prefer to add python-cartopy and python-pyshp to geo.scm, as
to have all Geo/Cartographic packages there. Or is there a reason to
have it in python-xyz.scm? WDYT?

- If you move it, add a copyright line for you.

On Sun, 23 May 2021 19:31:33 +0000
Vinicius Monego <monego@posteo.net> wrote:

> * gnu/packages/python-science.scm (python-cartopy): New variable.

> +(define-public python-cartopy
> +  (package
> +    (name "python-cartopy")
> +    (version "0.19.0.post1")

Is this a pre-release/beta? Ah, no: It's a POST-release fix. Maybe add
a comment to explain?

Thanks,

Björn
diff mbox series

Patch

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 79ee7c8bb2..9d4edaa4df 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -33,6 +33,7 @@ 
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages geo)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages python)
@@ -208,6 +209,61 @@  depends on @code{scipy.weave}.  For new code, users are recommended to use
 Cython.")
     (license license:bsd-3)))
 
+(define-public python-cartopy
+  (package
+    (name "python-cartopy")
+    (version "0.19.0.post1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "Cartopy" version))
+       (sha256
+        (base32 "0xnm8z3as3hriivdfd26s6vn5b63gb46x6vxw6gh1mwfm5rlg2sb"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest" "--pyargs" "cartopy"
+                       ;; These tests require online data.
+                       "-m" "not natural_earth and not network"
+                       ;; This one too but it's not marked as such.
+                       "-k" "not test_gridliner_labels_bbox_style")))))))
+    (propagated-inputs
+     `(("python-matplotlib" ,python-matplotlib)
+       ("python-numpy" ,python-numpy)
+       ("python-pykdtree" ,python-pykdtree)
+       ("python-pyshp" ,python-pyshp)
+       ("python-scipy" ,python-scipy)
+       ("python-shapely" ,python-shapely)))
+    (inputs
+     `(("geos" ,geos)
+       ("proj" ,proj)))
+    (native-inputs
+     `(("python-cython" ,python-cython)
+       ("python-flufl-lock" ,python-flufl-lock)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://scitools.org.uk/cartopy/docs/latest/")
+    (synopsis "Cartographic library for visualisation")
+    (description
+     "Cartopy is a Python package designed to make drawing maps for data
+analysis and visualisation easy.
+
+It features:
+
+@itemize
+@item object oriented projection definitions
+@item point, line, polygon and image transformations between projections
+@item integration to expose advanced mapping in Matplotlib with a simple and
+intuitive interface
+@item powerful vector data handling by integrating shapefile reading with
+Shapely capabilities
+@end itemize")
+    (license license:lgpl3+)))
+
 (define-public python-scikit-fuzzy
   (package
     (name "python-scikit-fuzzy")