[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/09: gnu: Add python-vega-datasets.
From: |
guix-commits |
Subject: |
01/09: gnu: Add python-vega-datasets. |
Date: |
Sun, 25 Jun 2023 09:53:04 -0400 (EDT) |
monego pushed a commit to branch master
in repository guix.
commit 64e5e17d8c3e32a5735c6a616afc18bbcc2729fb
Author: Vinicius Monego <monego@posteo.net>
AuthorDate: Sat May 20 15:03:32 2023 -0300
gnu: Add python-vega-datasets.
* gnu/packages/statistics.scm (python-vega-datasets): New variable.
* gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 1 +
...python-vega-datasets-remove-la-riots-code.patch | 89 ++++++++++++++++++++++
gnu/packages/statistics.scm | 29 +++++++
3 files changed, 119 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 4f557fbe93..4566f1b4a4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1834,6 +1834,7 @@ dist_patch_DATA =
\
%D%/packages/patches/python-typing-inspect-fix.patch \
%D%/packages/patches/python-unittest2-python3-compat.patch \
%D%/packages/patches/python-unittest2-remove-argparse.patch \
+ %D%/packages/patches/python-vega-datasets-remove-la-riots-code.patch \
%D%/packages/patches/python-versioneer-guix-support.patch \
%D%/packages/patches/python-waitress-fix-tests.patch \
%D%/packages/patches/python-werkzeug-tests.patch \
diff --git
a/gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch
b/gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch
new file mode 100644
index 0000000000..ea3f68927a
--- /dev/null
+++ b/gnu/packages/patches/python-vega-datasets-remove-la-riots-code.patch
@@ -0,0 +1,89 @@
+# This patch was imported from Debian:
+#
https://sources.debian.org/src/python-vega-datasets/0.9%2Bdfsg-1/debian/patches/remove-la-riots-related-code.patch/
+# According to the Debian package, the license of this dataset is not clear
and it is not available from Los Angeles Times for European users.
+Index: vega_datasets/vega_datasets/tests/test_local_datasets.py
+===================================================================
+--- vega_datasets.orig/vega_datasets/tests/test_local_datasets.py
++++ vega_datasets/vega_datasets/tests/test_local_datasets.py
+@@ -75,7 +75,6 @@ def test_cars_column_names():
+ [
+ ("cars", "Year"),
+ ("stocks", "date"),
+- ("la-riots", "death_date"),
+ ("iowa-electricity", "year"),
+ ("seattle-weather", "date"),
+ ("seattle-temps", "date"),
+Index: vega_datasets/vega_datasets/core.py
+===================================================================
+--- vega_datasets.orig/vega_datasets/core.py
++++ vega_datasets/vega_datasets/core.py
+@@ -322,11 +322,6 @@ class IowaElectricity(Dataset):
+ _pd_read_kwds = {"parse_dates": ["year"]}
+
+
+-class LARiots(Dataset):
+- name = "la-riots"
+- _pd_read_kwds = {"parse_dates": ["death_date"]}
+-
+-
+ class Miserables(Dataset):
+ name = "miserables"
+ _return_type = tuple
+Index: vega_datasets/vega_datasets/datasets.json
+===================================================================
+--- vega_datasets.orig/vega_datasets/datasets.json
++++ vega_datasets/vega_datasets/datasets.json
+@@ -143,10 +143,6 @@
+ "filename": "jobs.json",
+ "format": "json"
+ },
+- "la-riots": {
+- "filename": "la-riots.csv",
+- "format": "csv"
+- },
+ "londonBoroughs": {
+ "filename": "londonBoroughs.json",
+ "format": "json"
+@@ -279,4 +275,4 @@
+ "filename": "zipcodes.csv",
+ "format": "csv"
+ }
+-}
+\ No newline at end of file
++}
+Index: vega_datasets/vega_datasets/local_datasets.json
+===================================================================
+--- vega_datasets.orig/vega_datasets/local_datasets.json
++++ vega_datasets/vega_datasets/local_datasets.json
+@@ -8,7 +8,6 @@
+ "driving": "_data/driving.json",
+ "iowa-electricity": "_data/iowa-electricity.csv",
+ "iris": "_data/iris.json",
+- "la-riots": "_data/la-riots.csv",
+ "ohlc": "_data/ohlc.json",
+ "seattle-temps": "_data/seattle-temps.csv",
+ "seattle-weather": "_data/seattle-weather.csv",
+@@ -16,4 +15,4 @@
+ "stocks": "_data/stocks.csv",
+ "us-employment": "_data/us-employment.csv",
+ "wheat": "_data/wheat.json"
+-}
+\ No newline at end of file
++}
+Index: vega_datasets/vega_datasets/dataset_info.json
+===================================================================
+--- vega_datasets.orig/vega_datasets/dataset_info.json
++++ vega_datasets/vega_datasets/dataset_info.json
+@@ -49,12 +49,6 @@
+ "R. A. Fisher (1936). 'The use of multiple measurements in taxonomic
problems'. Annals of Eugenics. 7 (2): 179-188."
+ ]
+ },
+- "la-riots" : {
+- "description" : "More than 60 people lost their lives amid the looting
and fires that ravaged Los Angeles for five days starting on April 29, 1992.
This dataset contains metadata about each person, including the geographic
coordinates of their death. It was compiled and published by the Los Angeles
Times Data Desk [1]_.",
+- "references" : [
+- "http://spreadsheets.latimes.com/la-riots-deaths/"
+- ]
+- },
+ "ohlc" : {
+ "description" : "This dataset contains the performance of the Chicago
Board Options Exchange `Volatility Index <https://en.wikipedia.org/wiki/VIX>`_
in the summer of 2009."
+ },
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index e025653338..449f1aaf66 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -2026,6 +2026,35 @@ and fast file reading.")
"This package provides tools to export R data as LaTeX and HTML tables.")
(license license:gpl2+)))
+(define-public python-vega-datasets
+ (package
+ (name "python-vega-datasets")
+ (version "0.9.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "vega_datasets" version))
+ (sha256
+ (base32 "1h1zv607mars2j73v8fdwihjh479blqxyw29nhmc73lf40s9iglx"))
+ (modules '((guix build utils)))
+ (patches
+ (search-patches "python-vega-datasets-remove-la-riots-code.patch"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'remove-la-riots-dataset
+ ;; Remove dataset with unclear license.
+ (lambda _
+ (delete-file "vega_datasets/_data/la-riots.csv"))))))
+ (native-inputs (list python-pytest))
+ (propagated-inputs (list python-pandas))
+ (home-page "https://github.com/altair-viz/vega_datasets")
+ (synopsis "Example datasets used by Vega-related projects")
+ (description "This package provides a collection of datasets used in Vega
+and Vega-Lite examples.")
+ (license license:expat)))
+
(define-public python-hdmedians
(package
(name "python-hdmedians")
- branch master updated (c210dbe43e -> c55611ff3f), guix-commits, 2023/06/25
- 02/09: gnu: Add python-altair., guix-commits, 2023/06/25
- 01/09: gnu: Add python-vega-datasets.,
guix-commits <=
- 05/09: gnu: Add python-xarray-einstats., guix-commits, 2023/06/25
- 03/09: gnu: Add python-einops., guix-commits, 2023/06/25
- 04/09: gnu: python-xarray: Update to 2023.6.0., guix-commits, 2023/06/25
- 06/09: gnu: Add python-arviz., guix-commits, 2023/06/25
- 08/09: gnu: Add python-pytensor., guix-commits, 2023/06/25
- 09/09: gnu: Add python-pymc., guix-commits, 2023/06/25
- 07/09: gnu: Add python-fastprogress., guix-commits, 2023/06/25