Add Climate Data Operators package

DoneSubmitted by Roman Scherer.
Details
4 participants
  • Antero Mejr
  • Ludovic Courtès
  • Tobias Geerinckx-Rice
  • Roman Scherer
Owner
unassigned
Severity
normal
R
R
Roman Scherer wrote on 24 Jun 16:28 +0200
(address . guix-patches@gnu.org)
87a6a26sai.fsf@burningswell.com
Hello Guix,

I would like to contribute a patch to add the Climate Data Operators
package to Guix's geo module. Could you please review it?

Thanks, Roman.
From 2674303750a84b99d574212fe24c47e7e789f72e Mon Sep 17 00:00:00 2001
From: r0man <roman@burningswell.com>
Date: Fri, 24 Jun 2022 16:21:21 +0200
Subject: [PATCH] Add Climate Data Operators package

This PR adds CDO, a collection of command line Operators to manipulate and
analyse Climate and NWP model Data to Guix's geo module.
---
gnu/packages/geo.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 7b29c55088..64b5a91a23 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -119,6 +119,31 @@ (define-module (gnu packages geo)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
+(define-public cdo
+  (package
+    (name "cdo")
+    (version "2.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://code.mpimet.mpg.de/attachments/download/26823/cdo-"
+                     version ".tar.gz"))
+              (sha256
+               (base32
+                "1khdbd5cmnn7qm6hcqg4md5wbq14fs6brrns8b3g18diqgqvpvpd"))
+              (modules '((guix build utils)))))
+    (build-system gnu-build-system)
+    (inputs
+     (list netcdf))
+    (native-inputs
+     (list pkg-config))
+    (home-page "https://code.mpimet.mpg.de/projects/cdo")
+    (synopsis "Climate Data Operators")
+    (description "CDO is a collection of command line Operators to manipulate and analyse
+Climate and NWP model Data. Supported data formats are GRIB 1/2, netCDF 3/4,
+SERVICE, EXTRA and IEG. There are more than 600 operators available.")
+    (license (list license:bsd-3))))
+
 (define-public memphis
   (package
     (name "memphis")
-- 
2.36.1
-----BEGIN PGP SIGNATURE-----

iQFTBAEBCAA9FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmK1zEofHHJvbWFuLnNj
aGVyZXJAYnVybmluZ3N3ZWxsLmNvbQAKCRA92lJSfSrBmWGYCADDENUjKBX8CrBW
DTb/bvsH75rueuQdW4zPruq8GCzF2qS8PbOVsrDJJNjx93E3W9hmL+u9fH3DurWg
nbJB2RFwOrU2nME0LT8wufJIku07ezyC/x7mpP+nBj4NGmA0PAdTOESVoJhnpvae
ghjNdYjSajnNuetKcXZvDmVnrpzp2ZYEZOk32FTJs0KncyQCAbAdK+Nq+j/ki5s1
g/jmOBkCQlXNinDohQK2RVitJ8Pprn/stXIEVOEquY1oO+GLklKT6sTEPspeW6Dc
c02HRZFRiYU0QDaOf1x2KgbGmkoqNvJcwzNFdtP6gkpqAsa9JAMfEB6ufPLuvdOX
98zcR40h
=Q7mA
-----END PGP SIGNATURE-----

A
A
Antero Mejr wrote on 24 Jun 21:10 +0200
(no subject)
(address . 56193@debbugs.gnu.org)
871qvdamgi.fsf@mailbox.org
Hi Roman,

NetCDF support isn't working in your patch. The software says this:

"Unsupported file type (library support not compiled in)
To create a CDO application with NetCDF support use:
./configure --with-netcdf=<NetCDF root directory> ..."

So it looks like you will have to modify the configure phase a little.

I don't think you need the expression
`(modules '((guix build utils))`
as you are not using that module in your source expression.

`licenses` doesn't have to be a list unless cdo is dual-licensed.

Please run `guix style` and `guix lint` (using pre-inst-env), which will
help make sure the code style follows the Guix style guidelines.

Thanks,
Antero
R
R
Roman Scherer wrote on 25 Jun 12:18 +0200
[PATCH] Add Climate Data Operators package
(address . 56193@debbugs.gnu.org)
87mte1vy30.fsf@burningswell.com
Hi Antero,

thanks for your review! Here's an updated version of the patch. I added
--with-netcdf to the configure flags, removed the build utils, added
spaces between sentences and don't use a list for the licence field
anymore.

Could you have another look please?

I'm not sure if I addressed all lint issues, since this command is
failing on my machine recently. Any idea what this could be? Here's the
backtrace of the lint command:

```
[roman@thinkpad guix]$ ./pre-inst-env guix lint cdo
;;; note: source file /home/roman/workspace/guix/gnu/packages/geo.scm
;;; newer than compiled /home/roman/workspace/guix/gnu/packages/geo.go
;;; note: source file /home/roman/workspace/guix/gnu/packages/geo.scm
;;; newer than compiled /home/roman/.cache/guile/ccache/3.0-LE-8-4.5/home/roman/workspace/guix/gnu/packages/geo.scm.go
;;; Failed to autoload html->sxml in (htmlprag):
;;; no code for module (htmlprag)
Backtrace:
In ice-9/boot-9.scm:
1752:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
17 (apply-smob/0 #<thunk 7f3b46a28f60>)
In ice-9/boot-9.scm:
724:2 16 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 15 (_ #(#(#<directory (guile-user) 7f3b46a22c80>)))
In guix/ui.scm:
2238:7 14 (run-guix . _)
2201:10 13 (run-guix-command _ . _)
In ice-9/boot-9.scm:
1752:10 12 (with-exception-handler _ _ #:unwind? _ # _)
1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
659:37 10 (thunk)
In srfi/srfi-1.scm:
634:9 9 (for-each #<procedure 7f3b4531efa0 at guix/scripts/lin…> …)
In guix/scripts/lint.scm:
65:4 8 (run-checkers _ _ #:store _)
In srfi/srfi-1.scm:
634:9 7 (for-each #<procedure 7f3b31769de0 at guix/scripts/lin…> …)
In guix/scripts/lint.scm:
74:21 6 (_ _)
In guix/lint.scm:
1476:5 5 (check-for-updates #<package cdo@2.0.5 /home/roman/work…>)
811:2 4 (call-with-networking-fail-safe _ _ _)
In ice-9/boot-9.scm:
1752:10 3 (with-exception-handler _ _ #:unwind? _ # _)
1685:16 2 (raise-exception _ #:continuable? _)
1683:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: html->sxml: unbound variable
```

Thanks, Roman.
From d003fb5a519341a23973e8565ac7bc3195742808 Mon Sep 17 00:00:00 2001
From: r0man <roman@burningswell.com>
Date: Sat, 25 Jun 2022 12:10:00 +0200
Subject: [PATCH] Add Climate Data Operators package

This patch adds CDO, a collection of command line Operators to manipulate and
analyse Climate and NWP model Data to Guix's geo module.
---
gnu/packages/geo.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (40 lines)
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 7b29c55088..7ce1d2bda2 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -119,6 +119,33 @@ (define-module (gnu packages geo)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
+(define-public cdo
+  (package
+    (name "cdo")
+    (version "2.0.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://code.mpimet.mpg.de/attachments/download/26823/cdo-"
+                     version ".tar.gz"))
+              (sha256
+               (base32
+                "1khdbd5cmnn7qm6hcqg4md5wbq14fs6brrns8b3g18diqgqvpvpd"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list (string-append "--with-netcdf=" (assoc-ref %build-inputs "netcdf")))))
+    (inputs
+     (list netcdf))
+    (native-inputs
+     (list pkg-config))
+    (home-page "https://code.mpimet.mpg.de/projects/cdo")
+    (synopsis "Climate Data Operators")
+    (description "CDO is a collection of command line Operators to manipulate and analyse
+Climate and NWP model Data.  Supported data formats are GRIB 1/2, netCDF 3/4,
+SERVICE, EXTRA and IEG.  There are more than 600 operators available.")
+    (license license:bsd-3)))
+
 (define-public memphis
   (package
     (name "memphis")
-- 
2.36.1
-----BEGIN PGP SIGNATURE-----

iQFTBAEBCAA9FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmK24rgfHHJvbWFuLnNj
aGVyZXJAYnVybmluZ3N3ZWxsLmNvbQAKCRA92lJSfSrBmXkMB/9NQKAgmkRs0b58
ZlZvKsz6wCTUDgsigmcXEonU15pXRu+gmSmxNEkSAoVwpro2lzR8d5q7PDB8riuB
leNXXcJvfbjsL4+qw0aKoLNjuI6Rxi4Y6apCNLlMNCO/m70qEvxrkhoCVCutQeiO
CWCZRwvqbZ46ld71NNWceXcniwZwEZS4otehgqdEcnG9UdCBBHgZf/EKPGlTgzfY
WfVcTjJHTfTNPnJpiG85yWiEyM7qtvTxWLlQUQDek3Rvmsyz7DIAdbYwD+uXnoRl
5lo+MEG4bYpw0dUymt3PDDZDCuo5o6kHHoNVDzFdVG2yVGYV9WSF2FrhFpIclDj2
L96mj0Z6
=YFgF
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 25 Jun 13:09 +0200
(name . Roman Scherer)(address . roman.scherer@burningswell.com)
87letl56me@nckx
Roman!

Roman Scherer 写道:
Toggle quote (2 lines)
> [roman@thinkpad guix]$ ./pre-inst-env guix lint cdo

[…]

Toggle quote (2 lines)
> error: html->sxml: unbound variable

This is probably solved by running the command above in a guix
shell:

$ guix shell guix -- ./pre-inst-env guix lint cdo

‘pre-inst-env’ sets up some environment (variables) like
GUILE_LOAD_PATH to ensure that Guix can run from your local git
checkout, but nothing more.

Most importantly, it does not create a full Guix profile with the
numerous dependencies of the ‘guix’ package — including the
‘guile-lib’ package that provides HTML->SXML.

That's what the ‘guix shell’ is for. It's a clean alternative to
‘guix install’ing all these guile-* packages into your user
profile. Both work.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYrbwOQ0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15TWoBAJV9jNA3QHmju+BLupY94bGHJ/7cZSAvy41fWG5I
GK+iAP93jL5uQul6m8IRDdEQtJBiQeo9ziB1HLuv2nKMcW+fAQ==
=i2oN
-----END PGP SIGNATURE-----

R
R
Roman Scherer wrote on 25 Jun 13:43 +0200
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87ilopvuc6.fsf@burningswell.com
Hi Tobias,

thanks for the tip. Unfortunately the command you sent me is not
enough. I still get this error with `guix shell guix`:

```
[roman@thinkpad guix]$ guix shell guix -- ./pre-inst-env guix lint gdal
;;; note: source file /home/roman/workspace/guix/gnu/packages/geo.scm
;;; newer than compiled /home/roman/workspace/guix/gnu/packages/geo.go
;;; note: source file /home/roman/workspace/guix/gnu/packages/geo.scm
;;; newer than compiled /home/roman/.cache/guile/ccache/3.0-LE-8-4.5/home/roman/workspace/guix/gnu/packages/geo.scm.go
;;; Failed to autoload html->sxml in (htmlprag):
;;; no code for module (htmlprag)
Backtrace:
In ice-9/boot-9.scm:
1752:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
17 (apply-smob/0 #<thunk 7f09e3748f60>)
In ice-9/boot-9.scm:
724:2 16 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 15 (_ #(#(#<directory (guile-user) 7f09e3742c80>)))
In guix/ui.scm:
2238:7 14 (run-guix . _)
2201:10 13 (run-guix-command _ . _)
In ice-9/boot-9.scm:
1752:10 12 (with-exception-handler _ _ #:unwind? _ # _)
1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
659:37 10 (thunk)
In srfi/srfi-1.scm:
634:9 9 (for-each #<procedure 7f09e21bc9e0 at guix/scripts/lin…> …)
In guix/scripts/lint.scm:
65:4 8 (run-checkers _ _ #:store _)
In srfi/srfi-1.scm:
634:9 7 (for-each #<procedure 7f09d2d94c60 at guix/scripts/lin…> …)
In guix/scripts/lint.scm:
74:21 6 (_ _)
In guix/lint.scm:
1476:5 5 (check-for-updates #<package gdal@3.5.0 /home/roman/wor…>)
811:2 4 (call-with-networking-fail-safe _ _ _)
In ice-9/boot-9.scm:
1752:10 3 (with-exception-handler _ _ #:unwind? _ # _)
1685:16 2 (raise-exception _ #:continuable? _)
1683:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: html->sxml: unbound variable
```

However, after adding guile-lib to my home profile, it seems to work!

Thanks, Roman.

Tobias Geerinckx-Rice <me@tobias.gr> writes:

Toggle quote (31 lines)
> [[PGP Signed Part:Undecided]]
> Roman!
>
> Roman Scherer 写道:
>> [roman@thinkpad guix]$ ./pre-inst-env guix lint cdo
>
> […]
>
>> error: html->sxml: unbound variable
>
> This is probably solved by running the command above in a guix shell:
>
> $ guix shell guix -- ./pre-inst-env guix lint cdo
>
> ‘pre-inst-env’ sets up some environment (variables) like
> GUILE_LOAD_PATH to ensure that Guix can run from your local git
> checkout, but nothing more.
>
> Most importantly, it does not create a full Guix profile with the
> numerous dependencies of the ‘guix’ package — including the
> ‘guile-lib’ package that provides HTML->SXML.
>
> That's what the ‘guix shell’ is for. It's a clean alternative to
> ‘guix install’ing all these guile-* packages into your user profile.
> Both work.
>
> Kind regards,
>
> T G-R
>
> [[End of PGP Signed Part]]
-----BEGIN PGP SIGNATURE-----

iQFTBAEBCAA9FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmK29akfHHJvbWFuLnNj
aGVyZXJAYnVybmluZ3N3ZWxsLmNvbQAKCRA92lJSfSrBmd3tCADTJ6zhmSQSBnNN
JycqLWip78kqjxnDEXBzjLek8XnkhJUX0j5glJeQFpIUprNz+wQy1shNLjjT8Xdg
ZyTaSf1lZzbPKTmCzfNvt+FKQgktPL5p0uV/pP6VoODcImWGhFv6jxH2iGTc/qeE
7451qMp+QcLzepAz45y2A4PsPtdW7qGe5X4FWZZLmhViqyCztQAK5TgaGRdfHepv
77CQfPJ2tvAsR2UCnDeuAw3VNGMgf7CqcpkhnrEUc+MnOAJHzJ9Xhk7YPkjZSz0a
PE9HJWzYEeT5IYy5oatUfL+h2kULUNjtwZhlmrj6M5ZYtWItChBV+6QGq68df0kd
7Tom/TmM
=TZn1
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 25 Jun 14:05 +0200
(name . Roman Scherer)(address . roman.scherer@burningswell.com)
87h74954he@nckx
Roman,

Roman Scherer 写道:
Toggle quote (3 lines)
> thanks for the tip. Unfortunately the command you sent me is not
> enough. I still get this error with `guix shell guix`:

That's because I'm an old, who's still used to the (deprecated)
‘guix environment’, but wanted to sound hip by saying ‘guix shell’
instead. A recipe for failure.

The two are semantically equivalent but not identical, so I should
have said

$ guix shell -D guix -- ./pre-inst-env stuff

Note the -D, for --development (‘add P's inputs rather than P
itself’).

Nothing wrong with keeping guile-* packages in your user profile
but the above is a bit cleaner.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYrb7DQ0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15Dj4BAI5gvCnoyUWR0UwSXM7USmOl6chMDZmf8+QF2JPX
T7vGAQDYUhGSd1Eaq2ejzJoBG/QqluqffXSWG1A7FUfAqKSuCg==
=nG1B
-----END PGP SIGNATURE-----

R
R
Roman Scherer wrote on 25 Jun 14:18 +0200
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87edzdvsso.fsf@burningswell.com
Haha, ok. Thanks for the explanation Tobias. I think I leave it in my
home profile, I already have some other guile packages in it.

Tobias Geerinckx-Rice <me@tobias.gr> writes:

Toggle quote (27 lines)
> [[PGP Signed Part:Undecided]]
> Roman,
>
> Roman Scherer 写道:
>> thanks for the tip. Unfortunately the command you sent me is not
>> enough. I still get this error with `guix shell guix`:
>
> That's because I'm an old, who's still used to the (deprecated) ‘guix
> environment’, but wanted to sound hip by saying ‘guix shell’ instead.
> A recipe for failure.
>
> The two are semantically equivalent but not identical, so I should
> have said
>
> $ guix shell -D guix -- ./pre-inst-env stuff
>
> Note the -D, for --development (‘add P's inputs rather than P
> itself’).
>
> Nothing wrong with keeping guile-* packages in your user profile but
> the above is a bit cleaner.
>
> Kind regards,
>
> T G-R
>
> [[End of PGP Signed Part]]
-----BEGIN PGP SIGNATURE-----

iQFTBAEBCAA9FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmK2/XcfHHJvbWFuLnNj
aGVyZXJAYnVybmluZ3N3ZWxsLmNvbQAKCRA92lJSfSrBmTymB/wMdqfY22UQRI0b
sHqJKVJQiekA7lx4813w8CmuA/Gb8LC481F0kuP74uVzgbYm4IBy5nBRNE7QSJYu
2OycdwpBRZRDlP5NY32BUE5Gnaf6ZS4vncyAqBHaxDGAaW4dIN4m52oDRauPRG5V
W8b2BS2s+rwUnrFjT5BUoIa21wDHzZT0RyaTfOEckur3gCBrEYFCRpOV1PEXgUOA
ZNBLikyci7OQXpd+fiLjdLDKdAFTXTohPezk6m4XAHMTb3dOJmScI28WDdbwwdfh
qTlLufXTrLTIJalUhHc8p7zj1fkxsO9KdrGNcLsSSSO1B/J2svmSapTeXjDfHVD5
4qIsPCkz
=pkyn
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 3 Jul 16:07 +0200
Re: bug#56193: Add Climate Data Operators package
(name . Roman Scherer)(address . roman.scherer@burningswell.com)(address . 56193-done@debbugs.gnu.org)
87iloez3vq.fsf_-_@gnu.org
Hi,

Roman Scherer <roman.scherer@burningswell.com> skribis:

Toggle quote (8 lines)
> From d003fb5a519341a23973e8565ac7bc3195742808 Mon Sep 17 00:00:00 2001
> From: r0man <roman@burningswell.com>
> Date: Sat, 25 Jun 2022 12:10:00 +0200
> Subject: [PATCH] Add Climate Data Operators package
>
> This patch adds CDO, a collection of command line Operators to manipulate and
> analyse Climate and NWP model Data to Guix's geo module.

I tweaked the description and commit log, change #:configure-flags to
use the ‘this-package-input’ idiom, and committed.

Thanks!

Ludo’.
Closed
R
R
Roman Scherer wrote on 3 Jul 18:47 +0200
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 56193-done@debbugs.gnu.org)
87edz22ldx.fsf@burningswell.com
Cool, I didn't know about this-package-input.

Thank you!

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (18 lines)
> Hi,
>
> Roman Scherer <roman.scherer@burningswell.com> skribis:
>
>> From d003fb5a519341a23973e8565ac7bc3195742808 Mon Sep 17 00:00:00 2001
>> From: r0man <roman@burningswell.com>
>> Date: Sat, 25 Jun 2022 12:10:00 +0200
>> Subject: [PATCH] Add Climate Data Operators package
>>
>> This patch adds CDO, a collection of command line Operators to manipulate and
>> analyse Climate and NWP model Data to Guix's geo module.
>
> I tweaked the description and commit log, change #:configure-flags to
> use the ‘this-package-input’ idiom, and committed.
>
> Thanks!
>
> Ludo’.
-----BEGIN PGP SIGNATURE-----

iQFTBAEBCAA9FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmLByD0fHHJvbWFuLnNj
aGVyZXJAYnVybmluZ3N3ZWxsLmNvbQAKCRA92lJSfSrBmStLCACRDBe5PAMz3VQ/
/hQkKYLJHfENXtRDooodfb4h6868sj31RUmXXk1WxYnA39aCphXQsbFUT3+Xs/Mo
ZzIvT7KXuEfkUpyoCQYD7UOF+LfagUU6YQlcltdo3Plz9aXS1Lm5nGHMWtS2Y2lX
cVFZ7mhsvW7cA2wyFSIN/vWEGSUhgmw5daVj/5PzNJwtG8+nlKjHfsGkwHmD9pY0
9FGL+Y7dhs9Ns4rc7NsRo/CWnggWYCERb3iDSoOLpUE/CEJjdQ6BP6a6WyA6ET/g
4ibqq/AIAmhmxhY7TVpQ/5mPYN8i32t/tjJIiH6v3pbw+YH7QOCvV5JYz6NUlMyY
PWove2Yw
=fumP
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 56193@debbugs.gnu.org