55import numpy as np
66import pandas as pd
77from pydantic import ValidationError
8- from typing import Any , Dict , List
8+ from typing import Any , Dict , List , AnyStr
99import logging
1010import warnings
1111import os
1414
1515from mdf_connect_client import MDFConnectClient
1616from mdf_forge import Forge
17- from dlhub_sdk import DLHubClient
1817from globus_sdk import AuthClient
1918
2019from .auth import PubAuths
@@ -37,15 +36,14 @@ class Foundry(FoundryBase):
3736 """Foundry Client Base Class
3837
3938 Foundry object used for all interactions with Foundry datasets and models. Interfaces with MDF Connect Client,
40- Globus Compute, Globus Auth, Globus Transfer, Globus Search, DLHub, and relevant Globus Endpoints
39+ Globus Compute, Globus Auth, Globus Transfer, Globus Search, and relevant Globus Endpoints
4140 """
4241
43- dlhub_client : Any
4442 forge_client : Any
4543 connect_client : Any
4644 transfer_client : Any
4745 auth_client : Any
48- index = ""
46+ index : AnyStr = ""
4947 auths : Any
5048
5149 def __init__ (
@@ -84,9 +82,7 @@ def __init__(
8482 "search" ,
8583 "petrel" ,
8684 "transfer" ,
87- "dlhub" ,
8885 "openid" ,
89- "https://auth.globus.org/scopes/facd7ccc-c5f4-42aa-916b-a0e270e2c2a9/all" , # funcx
9086 "https://auth.globus.org/scopes/f10a69a9-338c-4e5b-baa1-0dc92359ab47/https" , # Eagle HTTPS
9187 "https://auth.globus.org/scopes/82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/https" , # NCSA HTTPS
9288 "https://auth.globus.org/scopes/d31d4f5d-be37-4adc-a761-2f716b7af105/action_all" , # Globus Search Lambda
@@ -115,7 +111,7 @@ def __init__(
115111 search_client = self .auths ["search" ],
116112 transfer_client = self .auths ["transfer" ],
117113 data_mdf_authorizer = self .auths ["data_mdf" ],
118- petrel_authorizer = self .auths ["petrel" ],
114+ petrel_authorizer = self .auths ["petrel" ]
119115 )
120116
121117 self .transfer_client = self .auths ['transfer' ]
@@ -132,19 +128,6 @@ def __init__(
132128 authorizer = self .auths ["mdf_connect" ], test = test
133129 )
134130
135- self .dlhub_client = DLHubClient (
136- dlh_authorizer = self .auths ["dlhub" ],
137- search_authorizer = self .auths ["search_authorizer" ],
138- fx_authorizer = self .auths [
139- "https://auth.globus.org/scopes/facd7ccc-c5f4-42aa-916b-a0e270e2c2a9/all"
140- ],
141- openid_authorizer = self .auths ['openid' ],
142- sl_authorizer = self .auths [
143- "https://auth.globus.org/scopes/d31d4f5d-be37-4adc-a761-2f716b7af105/action_all"
144- ],
145- force_login = False ,
146- )
147-
148131 def load (self , name , download = True , globus = False , verbose = False , metadata = None , authorizers = None , ** kwargs ):
149132 """Load the metadata for a Foundry dataset into the client
150133
@@ -250,22 +233,6 @@ def list(self):
250233 """
251234 return self .search ()
252235
253- def run (self , name , inputs , funcx_endpoint = None , ** kwargs ):
254- """Run a model on inputted data
255-
256- Args:
257- name (str): DLHub model name
258- inputs: Data to send to DLHub as inputs (should be JSON serializable, example types include dict, list,
259- np.ndarray, etc)
260- funcx_endpoint (str) (optional): UUID for the funcx endpoint to run the model on, if not the default (eg River)
261-
262- Returns:
263- Results after invocation via the DLHub service
264- """
265- if funcx_endpoint is not None :
266- self .dlhub_client .fx_endpoint = funcx_endpoint
267- return self .dlhub_client .run (name , inputs = inputs , ** kwargs )
268-
269236 def load_data (self , source_id = None , globus = True , as_hdf5 = False , splits = []):
270237 """Load in the data associated with the prescribed dataset
271238
@@ -469,36 +436,6 @@ def publish_dataset(
469436 res = None
470437 return res
471438
472- def publish_model (self , title , creators , short_name , servable_type , serv_options , affiliations = None , paper_doi = None ):
473- """Simplified publishing method for servables
474-
475- Args:
476- title (string): title for the servable
477- creators (string | list): either the creator's name (FamilyName, GivenName) or a list of the creators' names
478- short_name (string): shorthand name for the servable
479- servable_type (string): the type of the servable, must be a member of ("static_method",
480- "class_method",
481- "keras",
482- "pytorch",
483- "tensorflow",
484- "sklearn")
485- serv_options (dict): the servable_type specific arguments that are necessary for publishing. arguments can
486- be found at https://dlhub-sdk.readthedocs.io/en/latest/source/dlhub_sdk.models.servables.html
487- under the appropriate ``create_model`` signature. use the argument names as keys and their values as
488- the values.
489- affiliations (list): list of affiliations for each author
490- paper_doi (str): DOI of a paper that describes the servable
491-
492- Returns:
493- (string): task id of this submission, can be used to check for success
494-
495- Raises:
496- ValueError: If the given servable_type is not in the list of acceptable types
497- Exception: If the serv_options are incomplete or the request to publish results in an error
498- """
499- return self .dlhub_client .easy_publish (title , creators , short_name , servable_type , serv_options , affiliations ,
500- paper_doi )
501-
502439 def check_status (self , source_id , short = False , raw = False ):
503440 """Check the status of your submission.
504441
0 commit comments