-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(datasets): lazily load datasets in init files (#277)
* perf(datasets): lazily load datasets in init files (api) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (pandas) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * fix(datasets): fix no name in module in api/pandas Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (biosequence) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (dask) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (databricks) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (email) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (geopandas) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (holoviews) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (json) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * fix(datasets): resolve "too few public attributes" Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (matplotlib) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (networkx) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (pickle) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (pillow) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (plotly) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (polars) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (redis) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (snowflake) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (spark) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (svmlight) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (tensorflow) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (text) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (tracking) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (video) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * perf(datasets): lazily load datasets in init files (yaml) Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu> * Update RELEASE.md --------- Signed-off-by: Deepyaman Datta <deepyaman.datta@utexas.edu>
- Loading branch information
Showing
28 changed files
with
240 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``AbstractDataSet`` implementation to read/write from/to a sequence file.""" | ||
from typing import Any | ||
|
||
__all__ = ["BioSequenceDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
BioSequenceDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .biosequence_dataset import BioSequenceDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"biosequence_dataset": ["BioSequenceDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""Provides I/O modules using dask dataframe.""" | ||
from typing import Any | ||
|
||
__all__ = ["ParquetDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
ParquetDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .parquet_dataset import ParquetDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"parquet_dataset": ["ParquetDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""Provides interface to Unity Catalog Tables.""" | ||
from typing import Any | ||
|
||
__all__ = ["ManagedTableDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
ManagedTableDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .managed_table_dataset import ManagedTableDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"managed_table_dataset": ["ManagedTableDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``AbstractDataSet`` implementations for managing email messages.""" | ||
from typing import Any | ||
|
||
__all__ = ["EmailMessageDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
EmailMessageDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .message_dataset import EmailMessageDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"message_dataset": ["EmailMessageDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``GeoJSONDataSet`` is an ``AbstractVersionedDataSet`` to save and load GeoJSON files. | ||
""" | ||
__all__ = ["GeoJSONDataSet"] | ||
"""``GeoJSONDataSet`` is an ``AbstractVersionedDataSet`` to save and load GeoJSON files.""" | ||
from typing import Any | ||
|
||
from contextlib import suppress | ||
import lazy_loader as lazy | ||
|
||
with suppress(ImportError): | ||
from .geojson_dataset import GeoJSONDataSet | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
GeoJSONDataSet: Any | ||
|
||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"geojson_dataset": ["GeoJSONDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``AbstractDataSet`` implementation to save Holoviews objects as image files.""" | ||
from typing import Any | ||
|
||
__all__ = ["HoloviewsWriter"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
HoloviewsWriter: Any | ||
|
||
with suppress(ImportError): | ||
from .holoviews_writer import HoloviewsWriter | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"holoviews_writer": ["HoloviewsWriter"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``AbstractDataSet`` implementation to load/save data from/to a JSON file.""" | ||
from typing import Any | ||
|
||
__all__ = ["JSONDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
JSONDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .json_dataset import JSONDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"json_dataset": ["JSONDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
"""``AbstractDataSet`` implementation to save matplotlib objects as image files.""" | ||
from typing import Any | ||
|
||
__all__ = ["MatplotlibWriter"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
MatplotlibWriter: Any | ||
|
||
with suppress(ImportError): | ||
from .matplotlib_writer import MatplotlibWriter | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"matplotlib_writer": ["MatplotlibWriter"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
"""``AbstractDataSet`` implementation to save and load NetworkX graphs in JSON | ||
, GraphML and GML formats using ``NetworkX``.""" | ||
"""``AbstractDataSet`` implementation to save and load NetworkX graphs in JSON, | ||
GraphML and GML formats using ``NetworkX``.""" | ||
from typing import Any | ||
|
||
__all__ = ["GMLDataSet", "GraphMLDataSet", "JSONDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
GMLDataSet: Any | ||
GraphMLDataSet: Any | ||
JSONDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .gml_dataset import GMLDataSet | ||
|
||
with suppress(ImportError): | ||
from .graphml_dataset import GraphMLDataSet | ||
|
||
with suppress(ImportError): | ||
from .json_dataset import JSONDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, | ||
submod_attrs={ | ||
"gml_dataset": ["GMLDataSet"], | ||
"graphml_dataset": ["GraphMLDataSet"], | ||
"json_dataset": ["JSONDataSet"], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,36 @@ | ||
"""``AbstractDataSet`` implementations that produce pandas DataFrames.""" | ||
from typing import Any | ||
|
||
__all__ = [ | ||
"CSVDataSet", | ||
"DeltaTableDataSet", | ||
"ExcelDataSet", | ||
"FeatherDataSet", | ||
"GBQTableDataSet", | ||
"GBQQueryDataSet", | ||
"HDFDataSet", | ||
"JSONDataSet", | ||
"ParquetDataSet", | ||
"SQLQueryDataSet", | ||
"SQLTableDataSet", | ||
"XMLDataSet", | ||
"GenericDataSet", | ||
] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
CSVDataSet: Any | ||
DeltaTableDataSet: Any | ||
ExcelDataSet: Any | ||
FeatherDataSet: Any | ||
GBQQueryDataSet: Any | ||
GBQTableDataSet: Any | ||
GenericDataSet: Any | ||
HDFDataSet: Any | ||
JSONDataSet: Any | ||
ParquetDataSet: Any | ||
SQLQueryDataSet: Any | ||
SQLTableDataSet: Any | ||
XMLDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .csv_dataset import CSVDataSet | ||
with suppress(ImportError): | ||
from .deltatable_dataset import DeltaTableDataSet | ||
with suppress(ImportError): | ||
from .excel_dataset import ExcelDataSet | ||
with suppress(ImportError): | ||
from .feather_dataset import FeatherDataSet | ||
with suppress(ImportError): | ||
from .gbq_dataset import GBQQueryDataSet, GBQTableDataSet | ||
with suppress(ImportError): | ||
from .hdf_dataset import HDFDataSet | ||
with suppress(ImportError): | ||
from .json_dataset import JSONDataSet | ||
with suppress(ImportError): | ||
from .parquet_dataset import ParquetDataSet | ||
with suppress(ImportError): | ||
from .sql_dataset import SQLQueryDataSet, SQLTableDataSet | ||
with suppress(ImportError): | ||
from .xml_dataset import XMLDataSet | ||
with suppress(ImportError): | ||
from .generic_dataset import GenericDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, | ||
submod_attrs={ | ||
"csv_dataset": ["CSVDataSet"], | ||
"deltatable_dataset": ["DeltaTableDataSet"], | ||
"excel_dataset": ["ExcelDataSet"], | ||
"feather_dataset": ["FeatherDataSet"], | ||
"gbq_dataset": ["GBQQueryDataSet", "GBQTableDataSet"], | ||
"generic_dataset": ["GenericDataSet"], | ||
"hdf_dataset": ["HDFDataSet"], | ||
"json_dataset": ["JSONDataSet"], | ||
"parquet_dataset": ["ParquetDataSet"], | ||
"sql_dataset": ["SQLQueryDataSet", "SQLTableDataSet"], | ||
"xml_dataset": ["XMLDataSet"], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``AbstractDataSet`` implementation to load/save data from/to a Pickle file.""" | ||
from typing import Any | ||
|
||
__all__ = ["PickleDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
PickleDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .pickle_dataset import PickleDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"pickle_dataset": ["PickleDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``AbstractDataSet`` implementation to load/save image data.""" | ||
from typing import Any | ||
|
||
__all__ = ["ImageDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
ImageDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .image_dataset import ImageDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"image_dataset": ["ImageDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
"""``AbstractDataSet`` implementations to load/save a plotly figure from/to a JSON | ||
file.""" | ||
from typing import Any | ||
|
||
__all__ = ["PlotlyDataSet", "JSONDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
JSONDataSet: Any | ||
PlotlyDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .plotly_dataset import PlotlyDataSet | ||
with suppress(ImportError): | ||
from .json_dataset import JSONDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, | ||
submod_attrs={"json_dataset": ["JSONDataSet"], "plotly_dataset": ["PlotlyDataSet"]}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``AbstractDataSet`` implementations that produce pandas DataFrames.""" | ||
from typing import Any | ||
|
||
__all__ = ["CSVDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
CSVDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .csv_dataset import CSVDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"csv_dataset": ["CSVDataSet"]} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
"""``AbstractDataSet`` implementation to load/save data from/to a redis db.""" | ||
from typing import Any | ||
|
||
__all__ = ["PickleDataSet"] | ||
import lazy_loader as lazy | ||
|
||
from contextlib import suppress | ||
# https://github.com/pylint-dev/pylint/issues/4300#issuecomment-1043601901 | ||
PickleDataSet: Any | ||
|
||
with suppress(ImportError): | ||
from .redis_dataset import PickleDataSet | ||
__getattr__, __dir__, __all__ = lazy.attach( | ||
__name__, submod_attrs={"redis_dataset": ["PickleDataSet"]} | ||
) |
Oops, something went wrong.