Skip to content

Commit

Permalink
fixup! import council RUC classification
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Apr 9, 2024
1 parent 558e141 commit a22d272
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
11 changes: 3 additions & 8 deletions hub/management/commands/import_council_rural_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@

from .base_importers import BaseImportFromDataFrameCommand, MultipleAreaTypesMixin

shades = [
{"title": "Sparse and rural", "shader": ""},
{"title": "Rural", "shader": ""},
{"title": "Urban", "shader": ""},
{"title": "Urban with rural areas", "shader": ""},
]


class Command(MultipleAreaTypesMixin, BaseImportFromDataFrameCommand):
help = "Import Council RUC data"

cons_row = "gss_code"
message = "Importing council rural/urban classification"
uses_gss = True
Expand Down Expand Up @@ -47,7 +42,7 @@ class Command(MultipleAreaTypesMixin, BaseImportFromDataFrameCommand):
}

data_sets = {
"council_ruc": {
"constituency_ruc": {
"defaults": defaults,
"col": "ruc-cluster-label",
},
Expand Down
14 changes: 3 additions & 11 deletions hub/management/commands/import_ruc_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ class Command(BaseImportFromDataFrameCommand):

cons_row = "gss-code"
message = "Importing constituency rural urban classification data"
do_not_convert = True
data_sets = {
"constituency_ruc": {
"defaults": {
"label": "Urban Rural Classification",
"label": "Rural Urban Classification",
"description": "A composite measure of 'ruralness' (based population density, settlement size, and drive times) standardised across the countries of the UK.",
"data_type": "text",
"category": "place",
Expand All @@ -39,7 +40,7 @@ class Command(BaseImportFromDataFrameCommand):
package = {
"repo_name": "uk_ruc",
"package_name": "uk_ruc",
"version_name": "2.0.0",
"version_name": "latest",
"file_name": "pcon_ruc.csv",
}

Expand All @@ -58,12 +59,3 @@ def __init__(self):

def get_dataframe(self):
return pd.read_csv(self.data_sets["constituency_ruc"]["defaults"]["data_url"])

def update_averages(self):
pass

def update_max_min(self):
pass

def convert_to_new_con(self):
pass

0 comments on commit a22d272

Please sign in to comment.