Skip to content

Commit

Permalink
FEAT-lux-org#474: basic working example with mock recommendation and …
Browse files Browse the repository at this point in the history
…display

Signed-off-by: Doris Lee <[email protected]>
  • Loading branch information
dorisjlee committed Apr 2, 2022
1 parent 98ae5ac commit 8d34dd7
Show file tree
Hide file tree
Showing 5 changed files with 1,982 additions and 908 deletions.
28 changes: 14 additions & 14 deletions lux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
# limitations under the License.

# Register the commonly used modules (similar to how pandas does it: https://github.com/pandas-dev/pandas/blob/master/pandas/__init__.py)
from lux.vis.Clause import Clause
from lux.core.frame import LuxDataFrame
from lux.core.sqltable import LuxSQLTable
from lux.core.joinedsqltable import JoinedSQLTable
from lux.utils.tracing_utils import LuxTracer
from ._version import __version__, version_info
from lux._config import config
from lux._config.config import warning_format
from lux.utils.debug_utils import debug_info, check_luxwidget_enabled
# from lux.vis.Clause import Clause
# from lux.core.frame import LuxDataFrame
# from lux.core.sqltable import LuxSQLTable
# from lux.core.joinedsqltable import JoinedSQLTable
# from lux.utils.tracing_utils import LuxTracer
# from ._version import __version__, version_info
# from lux._config import config
# from lux._config.config import warning_format
# from lux.utils.debug_utils import debug_info, check_luxwidget_enabled

from lux._config import Config
# from lux._config import Config

config = Config()
# config = Config()

from lux.action.default import register_default_actions
# from lux.action.default import register_default_actions

register_default_actions()
check_luxwidget_enabled()
# register_default_actions()
# check_luxwidget_enabled()
108 changes: 54 additions & 54 deletions lux/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,62 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import pandas as pd
from .frame import LuxDataFrame
from .groupby import LuxDataFrameGroupBy, LuxSeriesGroupBy
from .series import LuxSeries
# import pandas as pd
# from .frame import LuxDataFrame
# from .groupby import LuxDataFrameGroupBy, LuxSeriesGroupBy
# from .series import LuxSeries

global originalDF
# Keep variable scope of original pandas df
originalDF = pd.core.frame.DataFrame
originalSeries = pd.core.series.Series
# global originalDF
# # Keep variable scope of original pandas df
# originalDF = pd.core.frame.DataFrame
# originalSeries = pd.core.series.Series


def setOption(overridePandas=True):
if overridePandas:
pd.DataFrame = (
pd.io.json._json.DataFrame
) = (
pd.io.sql.DataFrame
) = (
pd.io.excel.DataFrame
) = (
pd.io.formats.DataFrame
) = (
pd.io.sas.DataFrame
) = (
pd.io.clipboards.DataFrame
) = (
pd.io.common.DataFrame
) = (
pd.io.feather_format.DataFrame
) = (
pd.io.gbq.DataFrame
) = (
pd.io.html.DataFrame
) = (
pd.io.orc.DataFrame
) = (
pd.io.parquet.DataFrame
) = (
pd.io.pickle.DataFrame
) = (
pd.io.pytables.DataFrame
) = (
pd.io.spss.DataFrame
) = (
pd.io.stata.DataFrame
) = pd.io.api.DataFrame = pd.core.frame.DataFrame = pd._testing.DataFrame = LuxDataFrame
if pd.__version__ < "1.3.0":
pd.io.parsers.DataFrame = LuxDataFrame
else:
pd.io.parsers.readers.DataFrame = LuxDataFrame
pd.Series = pd.core.series.Series = pd.core.groupby.ops.Series = pd._testing.Series = LuxSeries
pd.core.groupby.generic.DataFrameGroupBy = LuxDataFrameGroupBy
pd.core.groupby.generic.SeriesGroupBy = LuxSeriesGroupBy
else:
pd.DataFrame = pd.io.parsers.DataFrame = pd.core.frame.DataFrame = originalDF
pd.Series = originalSeries
# def setOption(overridePandas=True):
# if overridePandas:
# pd.DataFrame = (
# pd.io.json._json.DataFrame
# ) = (
# pd.io.sql.DataFrame
# ) = (
# pd.io.excel.DataFrame
# ) = (
# pd.io.formats.DataFrame
# ) = (
# pd.io.sas.DataFrame
# ) = (
# pd.io.clipboards.DataFrame
# ) = (
# pd.io.common.DataFrame
# ) = (
# pd.io.feather_format.DataFrame
# ) = (
# pd.io.gbq.DataFrame
# ) = (
# pd.io.html.DataFrame
# ) = (
# pd.io.orc.DataFrame
# ) = (
# pd.io.parquet.DataFrame
# ) = (
# pd.io.pickle.DataFrame
# ) = (
# pd.io.pytables.DataFrame
# ) = (
# pd.io.spss.DataFrame
# ) = (
# pd.io.stata.DataFrame
# ) = pd.io.api.DataFrame = pd.core.frame.DataFrame = pd._testing.DataFrame = LuxDataFrame
# if pd.__version__ < "1.3.0":
# pd.io.parsers.DataFrame = LuxDataFrame
# else:
# pd.io.parsers.readers.DataFrame = LuxDataFrame
# pd.Series = pd.core.series.Series = pd.core.groupby.ops.Series = pd._testing.Series = LuxSeries
# pd.core.groupby.generic.DataFrameGroupBy = LuxDataFrameGroupBy
# pd.core.groupby.generic.SeriesGroupBy = LuxSeriesGroupBy
# else:
# pd.DataFrame = pd.io.parsers.DataFrame = pd.core.frame.DataFrame = originalDF
# pd.Series = originalSeries


setOption(overridePandas=True)
# setOption(overridePandas=True)
Loading

0 comments on commit 8d34dd7

Please sign in to comment.