unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#48614] [PATCH 0/3] gnu: Add python-cartopy.
@ 2021-05-23 19:29 Vinicius Monego
  2021-05-23 19:31 ` [bug#48614] [PATCH 1/3] gnu: Add python-pyshp Vinicius Monego
  0 siblings, 1 reply; 8+ messages in thread
From: Vinicius Monego @ 2021-05-23 19:29 UTC (permalink / raw)
  To: 48614; +Cc: Vinicius Monego

Vinicius Monego (3):
  gnu: Add python-pyshp.
  gnu: Add python-pykdtree.
  gnu: Add python-cartopy.

 gnu/packages/python-science.scm | 56 +++++++++++++++++++++++++++++++++
 gnu/packages/python-xyz.scm     | 53 +++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)

-- 
2.31.1





^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#48614] [PATCH 1/3] gnu: Add python-pyshp.
  2021-05-23 19:29 [bug#48614] [PATCH 0/3] gnu: Add python-cartopy Vinicius Monego
@ 2021-05-23 19:31 ` Vinicius Monego
  2021-05-23 19:31   ` [bug#48614] [PATCH 2/3] gnu: Add python-pykdtree Vinicius Monego
  2021-05-23 19:31   ` [bug#48614] [PATCH 3/3] gnu: Add python-cartopy Vinicius Monego
  0 siblings, 2 replies; 8+ messages in thread
From: Vinicius Monego @ 2021-05-23 19:31 UTC (permalink / raw)
  To: 48614; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-pyshp): New variable.
---
 gnu/packages/python-xyz.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f79fc54e24..18410dac39 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5806,6 +5806,37 @@ operators such as union, intersection, and difference.")
 (define-public python2-pysnptools
   (package-with-python2 python-pysnptools))
 
+(define-public python-pyshp
+  (package
+    (name "python-pyshp")
+    (version "2.1.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/GeospatialPython/pyshp")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0jsraqzq82pw19wvx84x7w5cs8agr44a9b5y0jjw540wim4xa73r"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               ;; This is the only test file.
+               (invoke "python" "-m" "pytest" "test_shapefile.py")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-runner" ,python-pytest-runner)))
+    (home-page "https://github.com/GeospatialPython/pyshp")
+    (synopsis "Read/write support for ESRI Shapefile format")
+    (description
+      "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
+    (license license:expat)))
+
 (define-public python-wurlitzer
   (package
     (name "python-wurlitzer")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#48614] [PATCH 2/3] gnu: Add python-pykdtree.
  2021-05-23 19:31 ` [bug#48614] [PATCH 1/3] gnu: Add python-pyshp Vinicius Monego
@ 2021-05-23 19:31   ` Vinicius Monego
  2021-05-23 19:31   ` [bug#48614] [PATCH 3/3] gnu: Add python-cartopy Vinicius Monego
  1 sibling, 0 replies; 8+ messages in thread
From: Vinicius Monego @ 2021-05-23 19:31 UTC (permalink / raw)
  To: 48614; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-pykdtree): New variable.
---
 gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 18410dac39..4c8774cd60 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5837,6 +5837,28 @@ operators such as union, intersection, and difference.")
       "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
     (license license:expat)))
 
+(define-public python-pykdtree
+  (package
+    (name "python-pykdtree")
+    (version "1.3.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pykdtree" version))
+       (sha256
+        (base32 "0p8n2ljdacfixkiw092974dmhy4s1c0h032ii1z9kwi9h5h5rgmy"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-nose" ,python-nose)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)))
+    (home-page "https://github.com/storpipfugl/pykdtree")
+    (synopsis "Fast kd-tree implementation with OpenMP-enabled queries")
+    (description
+     "@code{pykdtree} is a kd-tree implementation for fast nearest neighbour
+search in Python.")
+    (license license:lgpl3+)))
+
 (define-public python-wurlitzer
   (package
     (name "python-wurlitzer")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#48614] [PATCH 3/3] gnu: Add python-cartopy.
  2021-05-23 19:31 ` [bug#48614] [PATCH 1/3] gnu: Add python-pyshp Vinicius Monego
  2021-05-23 19:31   ` [bug#48614] [PATCH 2/3] gnu: Add python-pykdtree Vinicius Monego
@ 2021-05-23 19:31   ` Vinicius Monego
  2021-05-24 23:11     ` Björn Höfling
  1 sibling, 1 reply; 8+ messages in thread
From: Vinicius Monego @ 2021-05-23 19:31 UTC (permalink / raw)
  To: 48614; +Cc: Vinicius Monego

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

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")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#48614] [PATCH 3/3] gnu: Add python-cartopy.
  2021-05-23 19:31   ` [bug#48614] [PATCH 3/3] gnu: Add python-cartopy Vinicius Monego
@ 2021-05-24 23:11     ` Björn Höfling
  2021-05-26 18:00       ` Vinicius Monego
  0 siblings, 1 reply; 8+ messages in thread
From: Björn Höfling @ 2021-05-24 23:11 UTC (permalink / raw)
  To: Vinicius Monego; +Cc: 48614

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#48614] [PATCH 3/3] gnu: Add python-cartopy.
  2021-05-24 23:11     ` Björn Höfling
@ 2021-05-26 18:00       ` Vinicius Monego
  2021-06-23  4:53         ` bug#48614: " Björn Höfling
  0 siblings, 1 reply; 8+ messages in thread
From: Vinicius Monego @ 2021-05-26 18:00 UTC (permalink / raw)
  To: Björn Höfling; +Cc: 48614

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

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

[-- Attachment #2: v2-0001-gnu-Add-python-pyshp.patch --]
[-- Type: text/x-patch, Size: 2184 bytes --]

From affdc0b3d8bca886b12c31934b75e35017f57315 Mon Sep 17 00:00:00 2001
From: Vinicius Monego <monego@posteo.net>
Date: Mon, 17 May 2021 23:55:58 -0300
Subject: [PATCH v2 1/3] gnu: Add python-pyshp.

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

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index c4bdb6aca0..b0d0b64a2d 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
 ;;; Copyright © 2020, 2021 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -881,6 +882,37 @@ utilities for data translation and processing.")
      `(("gdal" ,gdal)))
     (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
 
+(define-public python-pyshp
+  (package
+    (name "python-pyshp")
+    (version "2.1.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/GeospatialPython/pyshp")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0jsraqzq82pw19wvx84x7w5cs8agr44a9b5y0jjw540wim4xa73r"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               ;; This is the only test file.
+               (invoke "python" "-m" "pytest" "test_shapefile.py")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-runner" ,python-pytest-runner)))
+    (home-page "https://github.com/GeospatialPython/pyshp")
+    (synopsis "Read/write support for ESRI Shapefile format")
+    (description
+      "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
+    (license license:expat)))
+
 (define-public postgis
   (package
     (name "postgis")
-- 
2.31.1


[-- Attachment #3: v2-0002-gnu-Add-python-pykdtree.patch --]
[-- Type: text/x-patch, Size: 1521 bytes --]

From 01a07f91704e96c2b1614683cf6cfdef6f6ee31e Mon Sep 17 00:00:00 2001
From: Vinicius Monego <monego@posteo.net>
Date: Tue, 25 May 2021 14:28:20 -0300
Subject: [PATCH v2 2/3] gnu: Add python-pykdtree.

* gnu/packages/python-xyz.scm (python-pykdtree): New variable.
---
 gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 25f986e9b6..736ae40cc9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5809,6 +5809,28 @@ operators such as union, intersection, and difference.")
 (define-public python2-pysnptools
   (package-with-python2 python-pysnptools))
 
+(define-public python-pykdtree
+  (package
+    (name "python-pykdtree")
+    (version "1.3.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pykdtree" version))
+       (sha256
+        (base32 "0p8n2ljdacfixkiw092974dmhy4s1c0h032ii1z9kwi9h5h5rgmy"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-nose" ,python-nose)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)))
+    (home-page "https://github.com/storpipfugl/pykdtree")
+    (synopsis "Fast kd-tree implementation with OpenMP-enabled queries")
+    (description
+     "@code{pykdtree} is a kd-tree implementation for fast nearest neighbour
+search in Python.")
+    (license license:lgpl3+)))
+
 (define-public python-wurlitzer
   (package
     (name "python-wurlitzer")
-- 
2.31.1


[-- Attachment #4: v2-0003-gnu-Add-python-cartopy.patch --]
[-- Type: text/x-patch, Size: 2893 bytes --]

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#48614: [PATCH 3/3] gnu: Add python-cartopy.
  2021-05-26 18:00       ` Vinicius Monego
@ 2021-06-23  4:53         ` Björn Höfling
  2021-06-23 10:06           ` [bug#48614] " Vinicius Monego
  0 siblings, 1 reply; 8+ messages in thread
From: Björn Höfling @ 2021-06-23  4:53 UTC (permalink / raw)
  To: Vinicius Monego; +Cc: 48614-done

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#48614] [PATCH 3/3] gnu: Add python-cartopy.
  2021-06-23  4:53         ` bug#48614: " Björn Höfling
@ 2021-06-23 10:06           ` Vinicius Monego
  0 siblings, 0 replies; 8+ messages in thread
From: Vinicius Monego @ 2021-06-23 10:06 UTC (permalink / raw)
  To: Björn Höfling; +Cc: 48614-done

>  
> > 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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-23 10:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-23 19:29 [bug#48614] [PATCH 0/3] gnu: Add python-cartopy Vinicius Monego
2021-05-23 19:31 ` [bug#48614] [PATCH 1/3] gnu: Add python-pyshp Vinicius Monego
2021-05-23 19:31   ` [bug#48614] [PATCH 2/3] gnu: Add python-pykdtree Vinicius Monego
2021-05-23 19:31   ` [bug#48614] [PATCH 3/3] gnu: Add python-cartopy Vinicius Monego
2021-05-24 23:11     ` Björn Höfling
2021-05-26 18:00       ` Vinicius Monego
2021-06-23  4:53         ` bug#48614: " Björn Höfling
2021-06-23 10:06           ` [bug#48614] " Vinicius Monego

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).