From b69524fa3489be21dd9130556e1c93e5beb05f6a Mon Sep 17 00:00:00 2001 From: John DeSanto <202220+jdesanto@users.noreply.github.com> Date: Tue, 19 Sep 2023 12:17:52 -0700 Subject: [PATCH] Fixed file load so it will happen only once --- ads/dataset/sampled_dataset.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ads/dataset/sampled_dataset.py b/ads/dataset/sampled_dataset.py index 8d420c1c7..978acb922 100644 --- a/ads/dataset/sampled_dataset.py +++ b/ads/dataset/sampled_dataset.py @@ -704,9 +704,10 @@ def _visualize_feature_distribution(self, html_widget): df, geometry=geopandas.points_from_xy(df["lon"], df["lat"]) ) - self.world = geopandas.read_file( - geopandas.datasets.get_path("naturalearth_lowres") - ) + if not hasattr(self, "world"): + self.world = geopandas.read_file( + geopandas.datasets.get_path("naturalearth_lowres") + ) self.world.plot( ax=ax, color="lightgrey", linewidth=0.5, edgecolor="white"