unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add python-hdf4.
@ 2016-12-22 10:23 Thomas Danckaert
  2016-12-22 17:09 ` Marius Bakke
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Danckaert @ 2016-12-22 10:23 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 286 bytes --]

Hi Guix,

this patch adds python-hdf4.  I'm not sure if the line “Python-HDF4 
is a fork of pyhdf.” in the description is necessary.  The original 
and “official” pyhdf (http://hdfeos.org/software/pyhdf.php) is 
somewhat outdated (e.g. doesn't support python3).

Thomas

[-- Attachment #2: 0001-gnu-Add-python-hdf4.patch --]
[-- Type: Text/X-Patch, Size: 1741 bytes --]

From 7bb5a32da7b2b7bd2a31b6cfd4244e55fe0b850a Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Thu, 22 Dec 2016 11:17:44 +0100
Subject: [PATCH] gnu: Add python-hdf4.

* gnu/packages/python.scm (python-hdf4, python2-hdf4): New variables.
---
 gnu/packages/python.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index bfa7eae..1ed3b7d 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -715,6 +715,35 @@ certificate returned by the server to which a connection has been established,
 and verifies that it matches the intended target hostname.")
     (license license:psfl)))
 
+(define-public python-hdf4
+  (package
+   (name "python-hdf4")
+   (version "0.9")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (pypi-uri name version))
+     (sha256
+      (base32
+       "1hjiyrxvxk9817qyqky3nar4y3fs4z8wxz0n884zzb5wi6skrjks"))))
+   (build-system python-build-system)
+   (inputs
+    `(("hdf4" ,hdf4)
+      ("libjpeg" ,libjpeg)
+      ("zlib" ,zlib)
+      ("numpy" ,python-numpy)))
+   (home-page "https://github.com/fhs/python-hdf4")
+   (synopsis "Python interface to the NCSA HDF4 library")
+   (description
+    "Python-HDF4 is a python wrapper around the NCSA HDF version 4
+library, which implements the SD (Scientific Dataset), VS (Vdata) and
+V (Vgroup) API’s.  NetCDF files can also be read and modified.
+Python-HDF4 is a fork of pyhdf.")
+   (license license:expat)))
+
+(define-public python2-hdf4
+  (package-with-python2 python-hdf4))
+
 (define-public python-h5py
   (package
     (name "python-h5py")
-- 
2.7.4


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

* Re: [PATCH] gnu: Add python-hdf4.
  2016-12-22 10:23 [PATCH] gnu: Add python-hdf4 Thomas Danckaert
@ 2016-12-22 17:09 ` Marius Bakke
  2016-12-23  7:01   ` Thomas Danckaert
  0 siblings, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2016-12-22 17:09 UTC (permalink / raw)
  To: Thomas Danckaert, guix-devel

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

Thomas Danckaert <thomas.danckaert@gmail.com> writes:

> Hi Guix,
>
> this patch adds python-hdf4.  I'm not sure if the line “Python-HDF4 
> is a fork of pyhdf.” in the description is necessary.  The original 
> and “official” pyhdf (http://hdfeos.org/software/pyhdf.php) is 
> somewhat outdated (e.g. doesn't support python3).

The "official" pyhdf and this fork was released around the same time and
have the same version number. Confusing! But I'll take your word that
this one is better. I'd keep the fork comment in the description though,
in case someone is looking for pyhdf. Could you wrap pyhdf in '@url{}'?

Regarding the patch, I wonder if it should go in (gnu packages maths),
similar to how we put PDF libraries in pdf.scm and XML in xml.scm etc.
But no strong opinion here.

'python-numpy' should be a propagated-input since it is imported at
runtime, and not a dynamically linked C library like the other inputs.

The 'check' phase seems to run the build again, and prints at the end
"Ran 0 tests in 0.000s". Looking at the Github ".travis.yml", the CI
tool runs the command "nosetests" instead of 'python setup.py test' like
python-build-system does by default. Can you try replacing the 'check'
phase with that command? You'll need 'python-nose' as a native-input.

It seems you also forgot to add a copyright line. Can you send an
updated patch? Thank you! :-)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: [PATCH] gnu: Add python-hdf4.
  2016-12-22 17:09 ` Marius Bakke
@ 2016-12-23  7:01   ` Thomas Danckaert
  2016-12-23 14:21     ` Marius Bakke
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Danckaert @ 2016-12-23  7:01 UTC (permalink / raw)
  To: mbakke; +Cc: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 1834 bytes --]

From: Marius Bakke <mbakke@fastmail.com>
Subject: Re: [PATCH] gnu: Add python-hdf4.
Date: Thu, 22 Dec 2016 18:09:07 +0100

> Thomas Danckaert <thomas.danckaert@gmail.com> writes:
>
>> Hi Guix,
>>
>> this patch adds python-hdf4.  I'm not sure if the line “Python-HDF4
>> is a fork of pyhdf.” in the description is necessary.  The original
>> and “official” pyhdf (http://hdfeos.org/software/pyhdf.php) is
>> somewhat outdated (e.g. doesn't support python3).
>
> The "official" pyhdf and this fork was released around the same 
> time and
> have the same version number. Confusing! But I'll take your word 
> that
> this one is better.

Yes, it seems it mirrors updates in the “official” one, and keeps the 
same version numbers.

> Regarding the patch, I wonder if it should go in (gnu packages 
> maths),
> similar to how we put PDF libraries in pdf.scm and XML in xml.scm 
> etc.
> But no strong opinion here.

I've wondered the same.  Right now, h5py, which is a similar package 
for HDF5, is also in python.scm, so I decided to add this package 
next to it.  As an aside, I find many packages in maths.scm are not 
really “mathy” (“science” maybe), but anyway :-)

> The 'check' phase seems to run the build again, and prints at the 
> end
> "Ran 0 tests in 0.000s". Looking at the Github ".travis.yml", the CI
> tool runs the command "nosetests" instead of 'python setup.py test' 
> like
> python-build-system does by default. Can you try replacing the 
> 'check'
> phase with that command? You'll need 'python-nose' as a 
> native-input.

I hadn't noticed that. This patch adds nosetests, but that just 
prints “Ran 0 tests in .005s”, so it seems there are no tests.  Shall 
we just delete the 'check' phase?

Other changes applied!

thank you,

Thomas

[-- Attachment #2: 0001-gnu-Add-python-hdf4.patch --]
[-- Type: Text/X-Patch, Size: 2346 bytes --]

From 11a2988febff79775eb31bc8e5da09fdea7d2269 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Thu, 22 Dec 2016 11:17:44 +0100
Subject: [PATCH] gnu: Add python-hdf4.

* gnu/packages/python.scm (python-hdf4, python2-hdf4): New variables.
---
 gnu/packages/python.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index bfa7eae..cc53f76 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -715,6 +716,41 @@ certificate returned by the server to which a connection has been established,
 and verifies that it matches the intended target hostname.")
     (license license:psfl)))
 
+(define-public python-hdf4
+  (package
+   (name "python-hdf4")
+   (version "0.9")
+   (source
+    (origin
+      (method url-fetch)
+      (uri (pypi-uri name version))
+      (sha256
+       (base32
+        "1hjiyrxvxk9817qyqky3nar4y3fs4z8wxz0n884zzb5wi6skrjks"))))
+   (build-system python-build-system)
+   (native-inputs `(("nose" ,python-nose)))
+   (propagated-inputs `(("numpy" ,python-numpy)))
+   (inputs
+    `(("hdf4" ,hdf4)
+      ("libjpeg" ,libjpeg)
+      ("zlib" ,zlib)))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (replace 'check
+                 (lambda _ (zero? (system* "nosetests")))))))
+   (home-page "https://github.com/fhs/python-hdf4")
+   (synopsis "Python interface to the NCSA HDF4 library")
+   (description
+    "Python-HDF4 is a python wrapper around the NCSA HDF version 4 library,
+which implements the SD (Scientific Dataset), VS (Vdata) and V (Vgroup) API’s.
+NetCDF files can also be read and modified.  Python-HDF4 is a fork of
+@url{http://hdfeos.org/software/pyhdf.php,pyhdf}.")
+   (license license:expat)))
+
+(define-public python2-hdf4
+  (package-with-python2 python-hdf4))
+
 (define-public python-h5py
   (package
     (name "python-h5py")
-- 
2.7.4


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

* Re: [PATCH] gnu: Add python-hdf4.
  2016-12-23  7:01   ` Thomas Danckaert
@ 2016-12-23 14:21     ` Marius Bakke
  0 siblings, 0 replies; 4+ messages in thread
From: Marius Bakke @ 2016-12-23 14:21 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

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

Thomas Danckaert <post@thomasdanckaert.be> writes:

> From: Marius Bakke <mbakke@fastmail.com>
> Subject: Re: [PATCH] gnu: Add python-hdf4.
> Date: Thu, 22 Dec 2016 18:09:07 +0100
>
>> Thomas Danckaert <thomas.danckaert@gmail.com> writes:
>>
>>> Hi Guix,
>>>
>>> this patch adds python-hdf4.  I'm not sure if the line “Python-HDF4
>>> is a fork of pyhdf.” in the description is necessary.  The original
>>> and “official” pyhdf (http://hdfeos.org/software/pyhdf.php) is
>>> somewhat outdated (e.g. doesn't support python3).
>>
>> The "official" pyhdf and this fork was released around the same 
>> time and
>> have the same version number. Confusing! But I'll take your word 
>> that
>> this one is better.
>
> Yes, it seems it mirrors updates in the “official” one, and keeps the 
> same version numbers.

Thanks for clarifying.

>
>> Regarding the patch, I wonder if it should go in (gnu packages 
>> maths),
>> similar to how we put PDF libraries in pdf.scm and XML in xml.scm 
>> etc.
>> But no strong opinion here.
>
> I've wondered the same.  Right now, h5py, which is a similar package 
> for HDF5, is also in python.scm, so I decided to add this package 
> next to it.  As an aside, I find many packages in maths.scm are not 
> really “mathy” (“science” maybe), but anyway :-)

OK! :)

>> The 'check' phase seems to run the build again, and prints at the 
>> end
>> "Ran 0 tests in 0.000s". Looking at the Github ".travis.yml", the CI
>> tool runs the command "nosetests" instead of 'python setup.py test' 
>> like
>> python-build-system does by default. Can you try replacing the 
>> 'check'
>> phase with that command? You'll need 'python-nose' as a 
>> native-input.
>
> I hadn't noticed that. This patch adds nosetests, but that just 
> prints “Ran 0 tests in .005s”, so it seems there are no tests.  Shall 
> we just delete the 'check' phase?

Ha, it seems the one nosetest was added after the 0.9 release. But I
missed another script from the ".travis.yml" which runs through some
example scripts. I added that as well, and kept nose so that it "just
works" when this package is updated.

Applied!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

end of thread, other threads:[~2016-12-23 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-22 10:23 [PATCH] gnu: Add python-hdf4 Thomas Danckaert
2016-12-22 17:09 ` Marius Bakke
2016-12-23  7:01   ` Thomas Danckaert
2016-12-23 14:21     ` Marius Bakke

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