From 0cc843925d59093b70490ccbca5e18bc4174de9c Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 14 Jun 2023 19:49:27 +0300 Subject: gn: genecup: Use correct python-h5py. * gn/packages/python.scm (python-h5py-2): New variable. * gn/packages/machine-learning.scm (tensorflow-native): Remove comments. * gn/packages/ratspub.scm (use-corrected-inputs): New procedure. (genecup-with-tensorflow-native, genecup-latest-with-tensorflow-native): Use use-corrected-inputs. --- gn/packages/machine-learning.scm | 12 ------------ gn/packages/python.scm | 33 +++++++++++++++++++++++++++++++++ gn/packages/ratspub.scm | 12 ++++++++++-- 3 files changed, 43 insertions(+), 14 deletions(-) diff --git a/gn/packages/machine-learning.scm b/gn/packages/machine-learning.scm index fbaffb2..8f9f1f0 100644 --- a/gn/packages/machine-learning.scm +++ b/gn/packages/machine-learning.scm @@ -11,18 +11,6 @@ (arguments (substitute-keyword-arguments (package-arguments tensorflow) ((#:substitutable? _ #f) #f) - ;((#:phases phases) - ; `(modify-phases ,phases - ; (add-after 'unpack 'hardcode-multicore-usage - ; (lambda _ - ; (substitute* "tensorflow/core/protobuf/config.proto" - ; ;(("num_threads = 1") "num_threads = 28") ; 56/2 for penguin2 - ; ;(("intra_op_parallelism_threads = 2") - ; ; "intra_op_parallelism_threads = 0") - ; ;(("inter_op_parallelism_threads = 5") - ; ; "inter_op_parallelism_threads = 0") - ; ) - ; #t)))) ((#:configure-flags flags) `(cons "-Dtensorflow_OPTIMIZE_FOR_NATIVE_ARCH=ON" diff --git a/gn/packages/python.scm b/gn/packages/python.scm index 2c7ca86..510546d 100644 --- a/gn/packages/python.scm +++ b/gn/packages/python.scm @@ -9,8 +9,10 @@ #:use-module (gnu packages image) #:use-module (gnu packages libffi) #:use-module (gnu packages linux) + #:use-module (gnu packages maths) #:use-module (gnu packages monitoring) #:use-module (gnu packages pcre) + #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) #:use-module (gnu packages python-build) @@ -1845,3 +1847,34 @@ file format spec.") (synopsis "Shim for rdflib 5 and 6 incompatibilities") (description "Shim for rdflib 5 and 6 incompatibilities") (license license:cc0))) + +(define-public python-h5py-2 + (package + (name "python-h5py") + (version "2.10.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "h5py" version)) + (sha256 + (base32 + "0baipzv8n93m0dq0riyi8rfhzrjrfrfh8zqhszzp1j2xjac2fhc4")))) + (build-system python-build-system) + (arguments + `(#:tests? #f ;no test target + #:phases (modify-phases %standard-phases + (add-after 'unpack 'fix-hdf5-paths + (lambda* (#:key inputs #:allow-other-keys) + (setenv "HDF5_DIR" + (assoc-ref inputs "hdf5"))))))) + (propagated-inputs (list python-six python-numpy)) + (inputs (list hdf5-1.10)) + (native-inputs (list python-cython python-pkgconfig pkg-config)) + (home-page "https://www.h5py.org/") + (synopsis "Read and write HDF5 files from Python") + (description + "The h5py package provides both a high- and low-level interface to the +HDF5 library from Python. The low-level interface is intended to be a +complete wrapping of the HDF5 API, while the high-level component supports +access to HDF5 files, datasets and groups using established Python and NumPy +concepts.") + (license license:bsd-3))) diff --git a/gn/packages/ratspub.scm b/gn/packages/ratspub.scm index af64365..726bc0b 100644 --- a/gn/packages/ratspub.scm +++ b/gn/packages/ratspub.scm @@ -17,6 +17,7 @@ #:use-module (gnu packages python-xyz) #:use-module (gn packages javascript) #:use-module (gn packages machine-learning) + #:use-module (gn packages python) #:use-module (gn packages web)) (define-public ratspub @@ -148,6 +149,13 @@ Association Studies}} catalog are also included in the search. These gene-keyword relationships are presented as an interactive graph and a table.") (license license:expat))) +(define use-corrected-inputs + (package-input-rewriting/spec + ;; Tensorflow-native provides much improved speeds. python-h5py@2 provides + ;; compatibility with our version of tensorflow. + `(("tensorflow" . ,(const tensorflow-native)) + ("python-h5py" . ,(const python-h5py-2))))) + (define-public ratspub-with-tensorflow-native (package (inherit @@ -399,11 +407,11 @@ concepts and a list of keywords for each concept.") (define-public genecup-with-tensorflow-native (package (inherit - (tensowflow-native-instead-of-tensorflow genecup)) + (use-corrected-inputs genecup)) (name "genecup-with-tensorflow-native"))) (define-public genecup-latest-with-tensorflow-native (package (inherit - (tensowflow-native-instead-of-tensorflow genecup-master)) + (use-corrected-inputs genecup-master)) (name "genecup-latest-with-tensorflow-native"))) -- cgit v1.2.3