Skip to content

Commit

Permalink
revert merged changes from #253
Browse files Browse the repository at this point in the history
  • Loading branch information
dorisjlee committed Feb 17, 2021
1 parent f745fb9 commit ceac264
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 298 deletions.
2 changes: 0 additions & 2 deletions lux/action/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def register_default_actions():
from lux.action.enhance import enhance
from lux.action.filter import add_filter
from lux.action.generalize import generalize
from lux.action.map import geomap

# display conditions for default actions
no_vis = lambda ldf: (ldf.current_vis is None) or (
Expand All @@ -20,7 +19,6 @@ def register_default_actions():
lux.config.register_action("distribution", univariate, no_vis, "quantitative")
lux.config.register_action("occurrence", univariate, no_vis, "nominal")
lux.config.register_action("temporal", univariate, no_vis, "temporal")
lux.config.register_action("geographical", geomap, no_vis, "geographical")

lux.config.register_action("Enhance", enhance, one_current_vis)
lux.config.register_action("Filter", add_filter, one_current_vis)
Expand Down
108 changes: 0 additions & 108 deletions lux/action/map.py

This file was deleted.

11 changes: 0 additions & 11 deletions lux/executor/PandasExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ def compute_data_type(self, ldf: LuxDataFrame):
ldf._data_type[attr] = "temporal"
elif self._is_datetime_number(ldf[attr]):
ldf._data_type[attr] = "temporal"
elif self._is_geographical_attribute(ldf[attr]):
ldf._data_type[attr] = "geoshape"
elif pd.api.types.is_float_dtype(ldf.dtypes[attr]):
# int columns gets coerced into floats if contain NaN
convertible2int = pd.api.types.is_integer_dtype(ldf[attr].convert_dtypes())
Expand Down Expand Up @@ -504,15 +502,6 @@ def _is_datetime_number(series):
return False
return False

@staticmethod
def _is_geographical_attribute(series):
# run detection algorithm
geographical_var_list = ["longitude", "latitude"]
name = str(series.name).lower()
if name in geographical_var_list:
return True
return False

def compute_stats(self, ldf: LuxDataFrame):
# precompute statistics
ldf.unique_values = {}
Expand Down
2 changes: 0 additions & 2 deletions lux/interestingness/interestingness.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ def interestingness(vis: Vis, ldf: LuxDataFrame) -> int:
if v_size < 10:
return -1
color_attr = vis.get_attr_by_channel("color")[0].attribute
if vis.mark == "geoshape":
return vis.data[dimension_lst[0].get_attr()].nunique()

C = ldf.cardinality[color_attr]
if C < 40:
Expand Down
2 changes: 0 additions & 2 deletions lux/processor/Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ def populate_data_type_model(ldf, vlist):
clause.data_type = ldf.data_type[clause.attribute]
if clause.data_type == "id":
clause.data_type = "nominal"
if clause.data_type == "geoshape":
clause.data_type = "quantitative"
if clause.data_model == "":
clause.data_model = data_model_lookup[clause.attribute]
if clause.value != "":
Expand Down
3 changes: 0 additions & 3 deletions lux/vislib/altair/AltairRenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from lux.vislib.altair.LineChart import LineChart
from lux.vislib.altair.Histogram import Histogram
from lux.vislib.altair.Heatmap import Heatmap
from lux.vislib.altair.SymbolMap import SymbolMap


class AltairRenderer:
Expand Down Expand Up @@ -83,8 +82,6 @@ def create_vis(self, vis, standalone=True):
chart = LineChart(vis)
elif vis.mark == "heatmap":
chart = Heatmap(vis)
elif vis.mark == "geoshape":
chart = SymbolMap(vis)
else:
chart = None

Expand Down
133 changes: 0 additions & 133 deletions lux/vislib/altair/SymbolMap.py

This file was deleted.

20 changes: 2 additions & 18 deletions tests/test_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def test_check_airbnb():
"host_name": "nominal",
"neighbourhood_group": "nominal",
"neighbourhood": "nominal",
"latitude": "geoshape",
"longitude": "geoshape",
"latitude": "quantitative",
"longitude": "quantitative",
"room_type": "nominal",
"price": "quantitative",
"minimum_nights": "quantitative",
Expand All @@ -100,22 +100,6 @@ def test_check_airbnb():
}


def test_check_airports():
from vega_datasets import data

df = data.airports()
df.maintain_metadata()
assert df.data_type == {
"iata": "id",
"name": "nominal",
"city": "nominal",
"state": "nominal",
"country": "nominal",
"latitude": "geoshape",
"longitude": "geoshape",
}


def test_check_datetime():
df = pd.DataFrame(
{
Expand Down
19 changes: 0 additions & 19 deletions tests/test_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,25 +432,6 @@ def test_vegalite_default_actions_registered(global_var):
assert len(df.recommendation["Correlation"]) > 0


def test_vegalite_default_actions_registered_2(global_var):
from vega_datasets import data

df = data.airports()
lux.config.plotting_backend = "vegalite"

# Symbol Map
assert "Geographic" in df.recommendation
assert len(df.recommendation["Geographic"]) > 0

# Occurrence Chart
assert "Occurrence" in df.recommendation
assert len(df.recommendation["Occurrence"]) > 0

# Scatter Chart
assert "Correlation" in df.recommendation
assert len(df.recommendation["Correlation"]) > 0


def test_matplotlib_default_actions_registered(global_var):
lux.config.plotting_backend = "matplotlib"
df = pytest.car_df
Expand Down

0 comments on commit ceac264

Please sign in to comment.