Skip to content

Commit

Permalink
update pyproject.toml and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
jinimukh committed Nov 28, 2020
1 parent a412ab4 commit 11dedf7
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 50 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
init:
pip install -r requirements.txt
test:
black --check .
python -m pytest tests/
.PHONY: init test
4 changes: 0 additions & 4 deletions lux/action/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ def get_complementary_ops(fltr_op):
unique_values = ldf.unique_values[cat]
for val in unique_values:
new_spec = column_spec.copy()
<<<<<<< HEAD
new_filter = lux.Clause(attribute=cat, filter_op="=", value=unique_values[i])
=======
new_filter = lux.Clause(attribute=cat, filter_op="=", value=val)
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784
new_spec.append(new_filter)
temp_vis = Vis(new_spec)
output.append(temp_vis)
Expand Down
4 changes: 0 additions & 4 deletions lux/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,11 +603,7 @@ def set_intent_on_click(self, change):
from lux.processor.Compiler import Compiler

intent_action = list(self._widget.selectedIntentIndex.keys())[0]
<<<<<<< HEAD
vis = self.recommendation[intent_action][self._widget.selectedIntentIndex[intent_action][0]]
=======
vis = self._recommendation[intent_action][self._widget.selectedIntentIndex[intent_action][0]]
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784
self.set_intent_as_vis(vis)

self.maintain_metadata()
Expand Down
17 changes: 0 additions & 17 deletions lux/processor/Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,11 @@ def compile_vis(ldf: LuxDataFrame, vis: Vis) -> Vis:
"""
if vis:
# autofill data type/model information
<<<<<<< HEAD
vis_collection = Compiler.populate_data_type_model(ldf, [vis])
# remove invalid visualizations from collection
vis_collection = Compiler.remove_all_invalid(vis_collection)
for vis in vis_collection:
# autofill viz related information
Compiler.determine_encoding(ldf, vis)
=======
Compiler.populate_data_type_model(ldf, [vis])
# remove invalid visualizations from collection
Compiler.remove_all_invalid([vis])
# autofill viz related information
Compiler.determine_encoding(ldf, vis)
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784
ldf._compiled = True
return vis

Expand All @@ -93,11 +84,7 @@ def compile_intent(ldf: LuxDataFrame, _inferred_intent: List[Clause]) -> VisList
if _inferred_intent:
vis_collection = Compiler.enumerate_collection(_inferred_intent, ldf)
# autofill data type/model information
<<<<<<< HEAD
vis_collection = Compiler.populate_data_type_model(ldf, vis_collection)
=======
Compiler.populate_data_type_model(ldf, vis_collection)
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784
# remove invalid visualizations from collection
if len(vis_collection) >= 1:
vis_collection = Compiler.remove_all_invalid(vis_collection)
Expand Down Expand Up @@ -192,10 +179,6 @@ def populate_data_type_model(ldf, vlist):
else:
chart_title = clause.value
vis.title = f"{clause.attribute} {clause.filter_op} {chart_title}"
<<<<<<< HEAD
return vlist
=======
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784

@staticmethod
def remove_all_invalid(vis_collection: VisList) -> VisList:
Expand Down
14 changes: 0 additions & 14 deletions lux/processor/Validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ def validate_clause(clause):
# we don't value check datetime since datetime can take filter values that don't exactly match the exact TimeStamp representation
if clause.attribute and not is_datetime_string(clause.attribute):
if not clause.attribute in list(ldf.columns):
<<<<<<< HEAD
warnings.warn(
f"The input attribute '{clause.attribute}' does not exist in the DataFrame."
)
=======
search_val = clause.attribute
match_attr = False
for attr, val_list in ldf.unique_values.items():
Expand All @@ -84,7 +79,6 @@ def validate_clause(clause):
warn_msg = f"\n- The input '{search_val}' looks like a value that belongs to the '{match_attr}' attribute. \n Please specify the value fully, as something like {match_attr}={search_val}."
else:
warn_msg = f"\n- The input attribute '{clause.attribute}' does not exist in the DataFrame. \n Please check your input intent for typos."
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784
if clause.value and clause.attribute and clause.filter_op == "=":
series = ldf[clause.attribute]
if not is_datetime_series(series):
Expand All @@ -93,17 +87,9 @@ def validate_clause(clause):
else:
vals = [clause.value]
for val in vals:
<<<<<<< HEAD
# (not series.str.contains(val).any()):
if val not in series.values:
warnings.warn(
f"The input value '{val}' does not exist for the attribute '{clause.attribute}' for the DataFrame."
)
=======
if val not in series.values:
warn_msg = f"\n- The input value '{val}' does not exist for the attribute '{clause.attribute}' for the DataFrame."
return warn_msg
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784

warn_msg = ""
for clause in intent:
Expand Down
6 changes: 0 additions & 6 deletions lux/vis/Vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,6 @@ def refresh_source(self, ldf): # -> Vis:
from lux.processor.Parser import Parser
from lux.processor.Validator import Validator
from lux.processor.Compiler import Compiler
<<<<<<< HEAD
from lux.executor.PandasExecutor import PandasExecutor

# TODO: temporary (generalize to executor)
=======
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784

self.check_not_vislist_intent()

Expand Down
5 changes: 0 additions & 5 deletions lux/vislib/altair/AltairRenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,10 @@ def create_vis(self, vis, standalone=True):
elif self.output_type == "Altair":
import inspect

<<<<<<< HEAD
if vis.plot_config:
chart.code += "\n".join(inspect.getsource(vis.plot_config).split("\n ")[1:-1])
=======
if lux.config.plot_config:
chart.code += "\n".join(
inspect.getsource(lux.config.plot_config).split("\n ")[1:-1]
)
>>>>>>> 8149e7222f218e100b79d114a81d27ccda129784
chart.code += "\nchart"
chart.code = chart.code.replace("\n\t\t", "\n")

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.black]
line-length = 105

0 comments on commit 11dedf7

Please sign in to comment.