aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2024-01-09 12:04:23 +0100
committerRicardo Wurmus <rekado@elephly.net>2024-01-16 12:44:35 +0100
commitefd98a9c450c7783c45214d03e65ac409ae9864c (patch)
tree549d8adf32227d888df55eb00783f2d1f1b78293
parent2c94760dcb5a01e2e810788ab4a269555e86cf2a (diff)
downloadguix-efd98a9c450c7783c45214d03e65ac409ae9864c.tar.gz
guix-efd98a9c450c7783c45214d03e65ac409ae9864c.zip
gnu: python-poliastro: Make compatible with latest matplotlib.
* gnu/packages/astronomy.scm (python-poliastro)[arguments]: Add phase 'matplotlib-compatibility; disable test_porkchop_plotting. Change-Id: Ie70673c69d4bdfa424e324d2848e9567360b03ef
-rw-r--r--gnu/packages/astronomy.scm18
1 files changed, 17 insertions, 1 deletions
diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 9b842621ee..4f019cb765 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2023 Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
;;; Copyright © 2023 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2024 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -2140,9 +2141,24 @@ of astronomical sources.")
" and not test_czml_custom_packet"
" and not test_czml_ground_station"
" and not test_czml_groundtrack"
- " and not test_czml_preamble"))
+ " and not test_czml_preamble"
+ ;; This fails with "ufunc 'isfinite' not
+ ;; supported for the input types"
+ " and not test_porkchop_plotting"))
#:phases
#~(modify-phases %standard-phases
+ (add-after 'unpack 'matplotlib-compatibility
+ (lambda _
+ (substitute* "src/poliastro/plotting/static.py"
+ (("import numpy as np.*" m)
+ (string-append m "\
+import itertools\n"))
+ (("( +)self._ax = ax.*" m indent)
+ (string-append m indent
+ "\
+self.colors = itertools.cycle(plt.rcParams[\"axes.prop_cycle\"].by_key()[\"color\"])\n"))
+ (("color = next\\(self._ax._get_lines.prop_cycler\\)\\[\"color\"\\]")
+ "color = next(self.colors)"))))
;; NOTE: Tests take about 7-10 minutes to pass.
(add-before 'check 'prepare-test-environment
(lambda _