diff --git a/src/dx/__init__.py b/src/dx/__init__.py index 03d45c61..33651869 100644 --- a/src/dx/__init__.py +++ b/src/dx/__init__.py @@ -1,9 +1,4 @@ -from dx.comms import handle_resample_comm -from dx.datatypes import * -from dx.dx import display, show_docs -from dx.formatters import * from dx.loggers import configure_logging -from dx.settings import * __version__ = "1.4.0" diff --git a/src/dx/comms/__init__.py b/src/dx/comms/__init__.py index bd87ad2a..e69de29b 100644 --- a/src/dx/comms/__init__.py +++ b/src/dx/comms/__init__.py @@ -1 +0,0 @@ -from dx.comms.resample import handle_resample_comm diff --git a/src/dx/comms/resample.py b/src/dx/comms/resample.py index 3efcd98f..d3cfc764 100644 --- a/src/dx/comms/resample.py +++ b/src/dx/comms/resample.py @@ -1,8 +1,5 @@ import structlog -from dx.filtering import handle_resample -from dx.types.filters import DEXResampleMessage - logger = structlog.get_logger(__name__) @@ -20,7 +17,10 @@ def _recv(msg): comm.send({"status": "connected", "source": "resampler"}) -def handle_resample_comm(msg): +def handle_resample_comm(msg: dict) -> None: + from dx.filtering import handle_resample + from dx.types.filters import DEXResampleMessage + data = msg.get("content", {}).get("data", {}) if not data: return diff --git a/src/dx/datatypes/__init__.py b/src/dx/datatypes/__init__.py index dd9c63a4..e69de29b 100644 --- a/src/dx/datatypes/__init__.py +++ b/src/dx/datatypes/__init__.py @@ -1,6 +0,0 @@ -from dx.datatypes.date_time import * -from dx.datatypes.geometry import * -from dx.datatypes.main import * -from dx.datatypes.misc import * -from dx.datatypes.numeric import * -from dx.datatypes.text import * diff --git a/src/dx/datatypes/date_time.py b/src/dx/datatypes/date_time.py index 73cc349e..78d3593d 100644 --- a/src/dx/datatypes/date_time.py +++ b/src/dx/datatypes/date_time.py @@ -9,16 +9,6 @@ settings = get_settings() logger = structlog.get_logger(__name__) -__all__ = [ - "generate_datetime_series", - "generate_datetimetz_series", - "generate_date_series", - "generate_time_series", - "generate_time_period_series", - "generate_time_interval_series", - "generate_time_delta_series", -] - def generate_datetime_series(num_rows: int) -> pd.Series: """ diff --git a/src/dx/datatypes/geometry.py b/src/dx/datatypes/geometry.py index 14098958..b4915c53 100644 --- a/src/dx/datatypes/geometry.py +++ b/src/dx/datatypes/geometry.py @@ -14,14 +14,6 @@ logger = structlog.get_logger(__name__) -__all__ = [ - "generate_lat_float_series", - "generate_lon_float_series", - "generate_latlon_series", - "generate_filled_geojson_series", - "generate_exterior_bounds_geojson_series", -] - def generate_lat_float_series(num_rows: int): """ diff --git a/src/dx/datatypes/main.py b/src/dx/datatypes/main.py index beff943c..62abae88 100644 --- a/src/dx/datatypes/main.py +++ b/src/dx/datatypes/main.py @@ -6,11 +6,6 @@ logger = structlog.get_logger(__name__) -__all__ = [ - "random_dataframe", - "quick_random_dataframe", - "generate_nested_tabular_series", -] # this is primarily used for testing to match the optional # data types used for random dataframe generation, diff --git a/src/dx/datatypes/misc.py b/src/dx/datatypes/misc.py index 97ecfcd0..845b0395 100644 --- a/src/dx/datatypes/misc.py +++ b/src/dx/datatypes/misc.py @@ -9,17 +9,6 @@ logger = structlog.get_logger(__name__) -__all__ = [ - "generate_boolean_series", - "generate_dtype_series", - "generate_dict_series", - "generate_list_series", - "generate_bytes_series", - "generate_ipv4_series", - "generate_ipv6_series", - "generate_uuid4_series", -] - ### Generator helper functions ### def generate_boolean_series(num_rows: int) -> pd.Series: diff --git a/src/dx/datatypes/numeric.py b/src/dx/datatypes/numeric.py index e458aadf..e1c8d1bf 100644 --- a/src/dx/datatypes/numeric.py +++ b/src/dx/datatypes/numeric.py @@ -7,13 +7,6 @@ logger = structlog.get_logger(__name__) -__all__ = [ - "generate_integer_series", - "generate_float_series", - "generate_decimal_series", - "generate_complex_number_series", -] - ### Generator helper functions ### def generate_integer_series( diff --git a/src/dx/datatypes/text.py b/src/dx/datatypes/text.py index c5ad1f11..9d59a0a9 100644 --- a/src/dx/datatypes/text.py +++ b/src/dx/datatypes/text.py @@ -5,22 +5,8 @@ import pandas as pd import structlog -try: - from faker import Faker - - fake = Faker() - FAKER_INSTALLED = True -except ImportError: - FAKER_INSTALLED = False - - logger = structlog.get_logger(__name__) -__all__ = [ - "generate_text_series", - "generate_keyword_series", -] - def generate_text_series(num_rows: int) -> pd.Series: """ @@ -31,11 +17,15 @@ def generate_text_series(num_rows: int) -> pd.Series: num_rows: int Number of rows to generate """ - if not FAKER_INSTALLED: + try: + from faker import Faker + + except ImportError: logger.warning("faker is not installed, skipping text_column") return np.nan - return pd.Series([fake.text() for _ in range(num_rows)]) + faker_instance = Faker() + return pd.Series([faker_instance.text() for _ in range(num_rows)]) def generate_keyword_series(num_rows: int, num_letters: int = 2) -> pd.Series: diff --git a/src/dx/formatters/__init__.py b/src/dx/formatters/__init__.py index 2d43f5c5..e69de29b 100644 --- a/src/dx/formatters/__init__.py +++ b/src/dx/formatters/__init__.py @@ -1,4 +0,0 @@ -from dx.formatters.enhanced import register -from dx.formatters.main import handle_format -from dx.formatters.plain import reset -from dx.formatters.simple import deregister diff --git a/src/dx/settings.py b/src/dx/settings.py index f514d09b..3b0f58c7 100644 --- a/src/dx/settings.py +++ b/src/dx/settings.py @@ -16,17 +16,6 @@ logger = structlog.get_logger(__name__) -__all__ = [ - "get_settings", - "enable_dev_mode", - "disable_dev_mode", - "set_display_mode", - "set_log_level", - "set_option", - "settings_context", - "add_renderable_type", -] - class Settings(BaseSettings): LOG_LEVEL: Union[int, str] = logging.WARNING diff --git a/src/dx/types/__init__.py b/src/dx/types/__init__.py index d66a4062..e69de29b 100644 --- a/src/dx/types/__init__.py +++ b/src/dx/types/__init__.py @@ -1,2 +0,0 @@ -from .filters import * -from .main import *