Skip to content

Commit

Permalink
Moved geopandas file load out of constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesanto committed Sep 19, 2023
1 parent 4b55395 commit 6b52253
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ads/dataset/sampled_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ def __init__(
self.correlation = None
self.feature_dist_html_dict = {}
self.feature_types = metadata if metadata is not None else {}
self.world = geopandas.read_file(
geopandas.datasets.get_path("naturalearth_lowres")
)

self.numeric_columns = self.sampled_df.select_dtypes(
utils.numeric_pandas_dtypes()
Expand Down Expand Up @@ -706,6 +703,11 @@ def _visualize_feature_distribution(self, html_widget):
gdf = geopandas.GeoDataFrame(
df, geometry=geopandas.points_from_xy(df["lon"], df["lat"])
)

self.world = geopandas.read_file(
geopandas.datasets.get_path("naturalearth_lowres")
)

self.world.plot(
ax=ax, color="lightgrey", linewidth=0.5, edgecolor="white"
)
Expand Down

0 comments on commit 6b52253

Please sign in to comment.