Skip to content

Commit

Permalink
removed print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
grallewellyn committed Aug 22, 2024
1 parent 7e5a2f0 commit 3b6a432
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 45 deletions.
3 changes: 0 additions & 3 deletions maap/Profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ def account_info(self):
url=self._profile_endpoint,
headers=self._api_header
)
print("graceal1 in account info ")
print(self._profile_endpoint)
print(self._api_header)

if response:
return json.loads(response.text)
Expand Down
10 changes: 0 additions & 10 deletions maap/dps/DpsHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ def submit_job(self, request_url, **kwargs):
# ==================================
# Part 2: Build & Send Request
# ==================================
print("graceal1 in submit_job with")
print(fields)
print(params)
print(inputs)
req_xml = ''
ins_xml = ''

Expand All @@ -106,10 +102,6 @@ def submit_job(self, request_url, **kwargs):
# log request headers
logging.debug('headers:')
logging.debug(self._api_header)
print("graceal1 request and api header")
print(request_url)
print(req_xml)
print(self._api_header)

# -------------------------------
# Send Request
Expand All @@ -122,8 +114,6 @@ def submit_job(self, request_url, **kwargs):
)
logging.debug('status code {}'.format(r.status_code))
logging.debug('response text\n{}'.format(r.text))
print("graceal1 response is ")
print(r)

# ==================================
# Part 3: Check & Parse Response
Expand Down
26 changes: 0 additions & 26 deletions maap/maap.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
class MAAP(object):

def __init__(self, maap_host=os.getenv('MAAP_API_HOST', 'api.maap-project.org')):
print("graceal1 maap host in init is TEST")
print(maap_host)
self.config = MaapConfig(maap_host=maap_host)

self._CMR = CMR(self.config.indexed_attributes, self.config.page_size, self._get_api_header())
Expand Down Expand Up @@ -145,21 +143,17 @@ def getQueues(self):
return response

def registerAlgorithm(self, arg):
print("graceal1 in registerAlgorithm")
logger.debug('Registering algorithm with args ')
if type(arg) is dict:
arg = json.dumps(arg)
logger.debug(arg)
response = requests_utils.make_request(url=self.config.algorithm_register, config=self.config,
content_type='application/json', request_type=requests_utils.POST,
data=arg)
print("graceal1 response of posting algorithm was ")
print(response)
logger.debug('POST request sent to {}'.format(self.config.algorithm_register))
return response

def register_algorithm_from_yaml_file(self, file_path):
print("graceal1 in register_algorithm_from_yaml_file")
algo_config = algorithm_utils.read_yaml_file(file_path)
return self.registerAlgorithm(algo_config)

Expand Down Expand Up @@ -263,15 +257,8 @@ def cancelJob(self, jobid):
return job.cancel_job()

def listJobs(self, username=None, page_size=None, offset=None):
print("graceal1 in listJobs")
print(username)
print(self.profile)
print(self.profile.account_info())
print(self.profile.account_info().keys())
if username==None and self.profile is not None and 'username' in self.profile.account_info().keys():
username = self.profile.account_info()['username']
print("graceal1 username in listJobs in maap-py is ")
print(username)

url = os.path.join(self.config.dps_job, username, endpoints.DPS_JOB_LIST)
params = {k: v for k, v in (("page_size", page_size), ("offset", offset)) if v}
Expand All @@ -280,10 +267,6 @@ def listJobs(self, username=None, page_size=None, offset=None):
logger.debug('GET request sent to {}'.format(url))
logger.debug('headers:')
logger.debug(headers)
print("graceal1 making a request in listJobs to")
print(url)
print(headers)
print(params)
response = requests.get(
url=url,
headers=headers,
Expand All @@ -292,19 +275,10 @@ def listJobs(self, username=None, page_size=None, offset=None):
return response

def submitJob(self, identifier, algo_id, version, queue, retrieve_attributes=False, **kwargs):
print("graceal1 in submitJob maap-py and kwargs is")
print(kwargs)
print(self.profile)
if not 'username' in kwargs and self.profile is not None and 'username' in self.profile.account_info().keys():
print("graceal1 in submitJob and assigning username")
print(self.profile.account_info()['username'])
kwargs['username'] = self.profile.account_info()['username']
print("graceal1 username in submitJob in maap-py outside if is ")
print(kwargs['username'])
response = self._DPS.submit_job(request_url=self.config.dps_job,
identifier=identifier, algo_id=algo_id, version=version, queue=queue, **kwargs)
print("graceal1 response from submitting job is")
print(response)
job = DPSJob(self.config)
job.set_submitted_job_result(response)
try:
Expand Down
6 changes: 0 additions & 6 deletions maap/utils/requests_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ def make_request(url, config: MaapConfig, content_type=None, request_type: HTTPM
# TODO: Add support for request type DELETE
raise NotImplementedError(f"Request type {request_type} not supported")
else:
print("graceal1 posting algorithm with ")
print(request_type.value)
print(url)
print(not self_signed)
print(headers)
print(kwargs)
return requests.request(
method=request_type.value,
url=url,
Expand Down

0 comments on commit 3b6a432

Please sign in to comment.