From 4919926e5accc45cd900bc7dfbc2332079517b49 Mon Sep 17 00:00:00 2001 From: "Adam M. Krajewski" <54290107+amkrajewski@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:17:04 -0400 Subject: [PATCH] (MA) distributed optional dependency imports as needed --- pysipfenn/core/modelAdjusters.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pysipfenn/core/modelAdjusters.py b/pysipfenn/core/modelAdjusters.py index a3dd2a8..a5c89a2 100644 --- a/pysipfenn/core/modelAdjusters.py +++ b/pysipfenn/core/modelAdjusters.py @@ -17,9 +17,6 @@ # DEV requirements. Not installed by default. import plotly.express as px import plotly.graph_objects as go -from optimade.client import OptimadeClient -from optimade.adapters.structures import pymatgen as pymatgen_adapter -from optimade.models import StructureResource class LocalAdjuster: @@ -610,6 +607,8 @@ def __init__( taskName: str = "OPTIMADEFineTuning", maxResults: int = 10000 ) -> None: + from optimade.client import OptimadeClient + super().__init__( calculator=calculator, model=model, @@ -647,6 +646,9 @@ def fetchAndFeturize( parallelWorkers: int = 1, verbose: bool = True ) -> None: + from optimade.adapters.structures import pymatgen as pymatgen_adapter + from optimade.models import StructureResource + response = self.client.get(query) providerResponse = response['structures'][query] respondingProviderURL = list(providerResponse.keys())[0]