diff mbox series

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

Message ID 5c9b02bbd244c522334ac9524eb79010e426feb2.camel@posteo.net
State Accepted
Headers show
Series None | expand

Commit Message

Vinicius Monego May 26, 2021, 6 p.m. UTC
Hi Björn,

Sending a v2 with your suggestions.

> Or is there a reason to have it in python-xyz.scm? WDYT?

My personal preference is to have Python modules in python-* files,
similar to how python-crypto and python-web are separate from crypto
and web. But I'm not strong on this. Also, creating python-geo for this
set would seem more controversial.

As a side note, there's a problem in python-shapely that it can't find
libgeos and that will break cartopy at runtime :(

Vinicius

Comments

Björn Höfling June 23, 2021, 4:53 a.m. UTC | #1
On Wed, 26 May 2021 18:00:10 +0000
Vinicius Monego <monego@posteo.net> wrote:

> Hi Björn,
> 
> Sending a v2 with your suggestions.
> 
> > Or is there a reason to have it in python-xyz.scm? WDYT?  
> 
> My personal preference is to have Python modules in python-* files,
> similar to how python-crypto and python-web are separate from crypto
> and web. But I'm not strong on this. Also, creating python-geo for
> this set would seem more controversial.

Pushed as

5ab7fbad27c652bb2a7143995970e8b5886a0cb6


Thanks.
 
> As a side note, there's a problem in python-shapely that it can't find
> libgeos and that will break cartopy at runtime :(

I tried out some examples from the gallery, they worked very nicely. Do
you still have problems? If so, would you fill out a bug report?

Björn
Vinicius Monego June 23, 2021, 10:06 a.m. UTC | #2
>  
> > As a side note, there's a problem in python-shapely that it can't
> > find
> > libgeos and that will break cartopy at runtime :(
> 
> I tried out some examples from the gallery, they worked very nicely.
> Do
> you still have problems? If so, would you fill out a bug report?
> 
> Björn

The problem was that I had an environment variable that fooled shapely
into thinking it was running from conda. I solved it by running guix
environment with --pure.

I'll send a followup series with scitools-iris later this week.
diff mbox series

Patch

From f19c7e5644181549ff8129477c7ee5ecdb009666 Mon Sep 17 00:00:00 2001
From: Vinicius Monego <monego@posteo.net>
Date: Tue, 18 May 2021 20:54:14 -0300
Subject: [PATCH v2 3/3] gnu: Add python-cartopy.

* gnu/packages/geo.scm (python-cartopy): New variable.
---
 gnu/packages/geo.scm | 56 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index b0d0b64a2d..1fdaf911f0 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -913,6 +913,62 @@  utilities for data translation and processing.")
       "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
     (license license:expat)))
 
+(define-public python-cartopy
+  (package
+    (name "python-cartopy")
+    ;; This is a post-release fix that adds build_ext to setup.py.
+    (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 postgis
   (package
     (name "postgis")
-- 
2.31.1