keeganskeate
commited on
Commit
β’
5c9e80e
1
Parent(s):
c0464cb
cannabis-licenses-2023-09-30 (#6)
Browse files- Fixed data dir and included NY licenses (96e289006d6b39fb681ae10c5aaed5efb113b73e)
- README.md +2 -2
- cannabis_licenses.py +7 -11
README.md
CHANGED
@@ -66,7 +66,7 @@ The dataset is partitioned into 18 subsets for each state and the aggregate.
|
|
66 |
| [Delaware](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/de) | `md` | β
|
|
67 |
| [Illinois](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/il) | `il` | β
|
|
68 |
| [Maine](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/me) | `me` | β
|
|
69 |
-
| [Maryland](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/md) | `md` |
|
70 |
| [Massachusetts](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ma) | `ma` | β
|
|
71 |
| [Michigan](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/mi) | `mi` | β
|
|
72 |
| [Missouri](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/mo) | `mo` | β
|
|
@@ -74,7 +74,7 @@ The dataset is partitioned into 18 subsets for each state and the aggregate.
|
|
74 |
| [Nevada](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nv) | `nv` | β
|
|
75 |
| [New Jersey](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nj) | `nj` | β
|
|
76 |
| [New Mexico](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nm) | `nm` | β
|
|
77 |
-
| [New York](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ny) | `ny` |
|
78 |
| [Oregon](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/or) | `or` | β
|
|
79 |
| [Rhode Island](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ri) | `ri` | β
|
|
80 |
| [Vermont](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/vt) | `vt` | β
|
|
|
|
66 |
| [Delaware](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/de) | `md` | β
|
|
67 |
| [Illinois](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/il) | `il` | β
|
|
68 |
| [Maine](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/me) | `me` | β
|
|
69 |
+
| [Maryland](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/md) | `md` | β
|
|
70 |
| [Massachusetts](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ma) | `ma` | β
|
|
71 |
| [Michigan](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/mi) | `mi` | β
|
|
72 |
| [Missouri](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/mo) | `mo` | β
|
|
|
|
74 |
| [Nevada](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nv) | `nv` | β
|
|
75 |
| [New Jersey](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nj) | `nj` | β
|
|
76 |
| [New Mexico](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/nm) | `nm` | β
|
|
77 |
+
| [New York](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ny) | `ny` | β
|
|
78 |
| [Oregon](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/or) | `or` | β
|
|
79 |
| [Rhode Island](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/ri) | `ri` | β
|
|
80 |
| [Vermont](https://huggingface.co/datasets/cannlytics/cannabis_licenses/tree/main/data/vt) | `vt` | β
|
|
cannabis_licenses.py
CHANGED
@@ -6,17 +6,17 @@ Authors:
|
|
6 |
Keegan Skeate <https://github.com/keeganskeate>
|
7 |
Candace O'Sullivan-Sutherland <https://github.com/candy-o>
|
8 |
Created: 9/29/2022
|
9 |
-
Updated: 9/
|
10 |
License: <https://huggingface.co/datasets/cannlytics/cannabis_licenses/blob/main/LICENSE>
|
11 |
"""
|
12 |
-
# External imports
|
13 |
import datasets
|
14 |
import pandas as pd
|
15 |
|
16 |
|
17 |
# Constants.
|
18 |
_SCRIPT = 'cannabis_licenses.py'
|
19 |
-
_VERSION = '1.0.
|
20 |
_HOMEPAGE = 'https://huggingface.co/datasets/cannlytics/cannabis_licenses'
|
21 |
_LICENSE = "https://opendatacommons.org/licenses/by/4-0/"
|
22 |
_DESCRIPTION = """\
|
@@ -35,7 +35,7 @@ _CITATION = """\
|
|
35 |
"""
|
36 |
|
37 |
|
38 |
-
#
|
39 |
SUBSETS = [
|
40 |
'all',
|
41 |
'ak',
|
@@ -52,7 +52,7 @@ SUBSETS = [
|
|
52 |
'mt',
|
53 |
'nj',
|
54 |
'nm',
|
55 |
-
|
56 |
'nv',
|
57 |
'or',
|
58 |
'ri',
|
@@ -107,7 +107,7 @@ class CannabisLicensesConfig(datasets.BuilderConfig):
|
|
107 |
description = _DESCRIPTION
|
108 |
description += f'This configuration is for the `{name}` subset.'
|
109 |
super().__init__(
|
110 |
-
data_dir='
|
111 |
description=description,
|
112 |
name=name,
|
113 |
**kwargs,
|
@@ -137,11 +137,7 @@ class CannabisLicenses(datasets.GeneratorBasedBuilder):
|
|
137 |
def _split_generators(self, dl_manager):
|
138 |
"""Returns SplitGenerators."""
|
139 |
subset = self.config.name
|
140 |
-
|
141 |
-
# https://huggingface.co/datasets/cannlytics/cannabis_licenses/raw/main/
|
142 |
-
# data_url = SUBSETS[config_name]['data_url']
|
143 |
-
# TEST: Use local data.
|
144 |
-
data_url = f'./data/{subset}/licenses-{subset}-latest.csv'
|
145 |
urls = {subset: data_url}
|
146 |
downloaded_files = dl_manager.download_and_extract(urls)
|
147 |
params = {'filepath': downloaded_files[subset]}
|
|
|
6 |
Keegan Skeate <https://github.com/keeganskeate>
|
7 |
Candace O'Sullivan-Sutherland <https://github.com/candy-o>
|
8 |
Created: 9/29/2022
|
9 |
+
Updated: 9/30/2023
|
10 |
License: <https://huggingface.co/datasets/cannlytics/cannabis_licenses/blob/main/LICENSE>
|
11 |
"""
|
12 |
+
# External imports:
|
13 |
import datasets
|
14 |
import pandas as pd
|
15 |
|
16 |
|
17 |
# Constants.
|
18 |
_SCRIPT = 'cannabis_licenses.py'
|
19 |
+
_VERSION = '1.0.2'
|
20 |
_HOMEPAGE = 'https://huggingface.co/datasets/cannlytics/cannabis_licenses'
|
21 |
_LICENSE = "https://opendatacommons.org/licenses/by/4-0/"
|
22 |
_DESCRIPTION = """\
|
|
|
35 |
"""
|
36 |
|
37 |
|
38 |
+
# Define subsets.
|
39 |
SUBSETS = [
|
40 |
'all',
|
41 |
'ak',
|
|
|
52 |
'mt',
|
53 |
'nj',
|
54 |
'nm',
|
55 |
+
'ny',
|
56 |
'nv',
|
57 |
'or',
|
58 |
'ri',
|
|
|
107 |
description = _DESCRIPTION
|
108 |
description += f'This configuration is for the `{name}` subset.'
|
109 |
super().__init__(
|
110 |
+
data_dir='data',
|
111 |
description=description,
|
112 |
name=name,
|
113 |
**kwargs,
|
|
|
137 |
def _split_generators(self, dl_manager):
|
138 |
"""Returns SplitGenerators."""
|
139 |
subset = self.config.name
|
140 |
+
data_url = f'data/{subset}/licenses-{subset}-latest.csv'
|
|
|
|
|
|
|
|
|
141 |
urls = {subset: data_url}
|
142 |
downloaded_files = dl_manager.download_and_extract(urls)
|
143 |
params = {'filepath': downloaded_files[subset]}
|