summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2023-10-30 13:00:56 +0100
committerRicardo Wurmus <rekado@elephly.net>2023-10-30 13:00:56 +0100
commit7e9783b2ab8c747ef340daa749bdeba9e924ec57 (patch)
treea0407777d1d5906be610d5f2625caf9c6d53980a /gnu
parentf330920a14f2a9be1b6b545570c78c1dea74935a (diff)
downloadguix-7e9783b2ab8c747ef340daa749bdeba9e924ec57.tar.gz
gnu: Add python-ml-collections.
* gnu/packages/machine-learning.scm (python-ml-collections): New variable.

Change-Id: I9299fe4221f13d979266fccc7b9cdd96a8d6e678
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/machine-learning.scm36
1 files changed, 36 insertions, 0 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 26a8c97a4a..460e77cf0b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -296,6 +296,42 @@ classification.")
      (list python))
     (synopsis "Python bindings of libSVM")))
 
+(define-public python-ml-collections
+  (package
+    (name "python-ml-collections")
+    (version "0.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ml_collections" version))
+       (sha256
+        (base32 "1k38psfzqsqnl99fl578bd07zdmvfkja61r3sgjs2fj3xircrvrz"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                ;; TODO: we can't seem to run the config_flags tests, because
+                ;; the installed Python files conflict with those from the
+                ;; source directory, resulting in constants to be defined more
+                ;; than once.
+                (invoke "pytest" "ml_collections/config_dict/tests"
+                        ;; This one fails because we're testing the __main__
+                        ;; class, not config_dict_test.
+                        "-k" "not testJSONConversionBestEffort")))))))
+    (propagated-inputs
+     (list python-absl-py python-contextlib2 python-pyyaml python-six))
+    (native-inputs (list python-mock python-pytest))
+    (home-page "https://github.com/google/ml_collections")
+    (synopsis "Python collections designed for Machine Learning usecases")
+    (description
+     "ML Collections is a library of Python collections designed for Machine
+Learning usecases.")
+    (license license:asl2.0)))
+
 (define-public ghmm
   ;; The latest release candidate is several years and a couple of fixes have
   ;; been published since.  This is why we download the sources from the SVN