Mercurial > repos > jay > gaiac_sensor_performance_evaluation
changeset 2:abc767b6d4f4 draft
planemo upload for repository https://github.com/jaidevjoshi83/gaiac commit c31ef5726cd1d2659da9aeb956c22fb834b177ff
author | jay |
---|---|
date | Fri, 23 May 2025 17:56:46 +0000 |
parents | 1b6736f119c9 |
children | 957d0bc600d3 |
files | gaiac_pm_data_pulling/datapulling.py gaiac_pm_data_pulling/gaiac_data_download.py gaiac_pm_data_pulling/gaiac_pm_data_pulling.py gaiac_sensor_performance_evaluation/gaiac_sensor_performance_evaluation.xml |
diffstat | 4 files changed, 34 insertions(+), 72 deletions(-) [+] |
line wrap: on
line diff
--- a/gaiac_pm_data_pulling/datapulling.py Thu May 15 22:50:53 2025 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -import requests -import sys - -def download_files_from_server(urls): - """ - Function to download files from a FastAPI server. - - Args: - ip (str): The IP address of the FastAPI server. - file_names (list): List of file names to download. - - Returns: - None - """ - for url in urls: - file_name = url.split('/')[len(url.split('/'))-1] - response = requests.get(url) - if response.status_code == 200: - with open(f"{file_name}", "wb") as f: - f.write(response.content) - print(f"File {file_name} downloaded successfully!") - else: - print(f"Failed to download {file_name}. Status code: {response.status_code}") - -if __name__=="__main__": - - if len(sys.argv) > 1: - files = sys.argv[1].split(',') - download_files_from_server( files) \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gaiac_pm_data_pulling/gaiac_data_download.py Fri May 23 17:56:46 2025 +0000 @@ -0,0 +1,29 @@ +import requests +import sys + +def download_files_from_server(urls): + """ + Function to download files from a FastAPI server. + + Args: + ip (str): The IP address of the FastAPI server. + file_names (list): List of file names to download. + + Returns: + None + """ + for url in urls: + file_name = url.split('/')[len(url.split('/'))-1] + response = requests.get(url) + if response.status_code == 200: + with open(f"{file_name}", "wb") as f: + f.write(response.content) + print(f"File {file_name} downloaded successfully!") + else: + print(f"Failed to download {file_name}. Status code: {response.status_code}") + +if __name__=="__main__": + + if len(sys.argv) > 1: + files = sys.argv[1].split(',') + download_files_from_server( files) \ No newline at end of file
--- a/gaiac_pm_data_pulling/gaiac_pm_data_pulling.py Thu May 15 22:50:53 2025 +0000 +++ b/gaiac_pm_data_pulling/gaiac_pm_data_pulling.py Fri May 23 17:56:46 2025 +0000 @@ -15,7 +15,7 @@ def get_file_list(ip): - url = "%s/list-files"%(ip) + url = "%s/api/list-files"%(ip) with urllib.request.urlopen(url) as response: data = response.read() @@ -33,9 +33,7 @@ }} for i in get_file_list(ip): - # print("http://"+ip+'/download/'+i) - api_data[ip][i] = ip+'/download/'+i - + api_data[ip][i] = ip+'/api/download/'+i ul = [] for dataset, url in api_data[ip].items(): @@ -47,20 +45,6 @@ 'selected': False }) - # for urlname, genomes in api_data.items(): - # # URL-safe base64 encoding for the URL name - # urlname_64 = urlname - # ul = [] - # for genome, assets in genomes.items(): - # al = [] - - # ul.append({ - # 'name': genome, - # 'value': genome, - # 'options': [], - # 'selected': False - # }) - return ul except Exception as e: # Handle any potential errors @@ -73,26 +57,4 @@ if __name__ == '__main__': - simulate_dynamic_options('http://192.168.1.202:8080') - -# for i in simulate_dynamic_options('192.168.1.202:8080')[0]['options']: -# print(i) - # print(i) - # parser = argparse.ArgumentParser() - # parser.add_argument('-n', '--names', dest='names', action='store', default=None, help='Table names to reload') - # parser.add_argument('-u', '--url', dest='url', action='store', default=None, help='Base url for reload') - # parser.add_argument('-k', '--key', dest='key', action='store', default=None, help='Galaxy API Key') - # parser.add_argument('-g', '--graceful', dest='graceful', action='store_true', help='Fail gracefully') - - # args = parser.parse_args() - # try: - # if not args.names: - # tables = requests.get(urljoin(args.url, "api/tool_data"), params={'key': args.key}).json() - # args.names = [d.get('name') for d in tables] - # for name in args.names: - # print(requests.get(urljoin(args.url, "api/tool_data/%s/reload" % (name)), params={'key': args.key}).json()) - # except Exception as e: - # if args.graceful: - # print("Failed to reload data tables:\n%s" % (e)) - # else: - # raise e + simulate_dynamic_options('http://iotprojects.ddns.net')
--- a/gaiac_sensor_performance_evaluation/gaiac_sensor_performance_evaluation.xml Thu May 15 22:50:53 2025 +0000 +++ b/gaiac_sensor_performance_evaluation/gaiac_sensor_performance_evaluation.xml Fri May 23 17:56:46 2025 +0000 @@ -10,7 +10,7 @@ </requirements> <command detect_errors="exit_code"><![CDATA[ - python '$__tool_directory__/table.py' -I '$infile' --column_1 '$clm2' --column_2 '$clm1' --html_out_dir '$output2.extra_files_path' --html_file_name '$output2' + python '$__tool_directory__/gaiac_sensor_performance_evaluation.py' -I '$infile' --column_1 '$clm2' --column_2 '$clm1' --html_out_dir '$output2.extra_files_path' --html_file_name '$output2' ]]></command> <inputs> @@ -27,7 +27,7 @@ </inputs> <outputs> - <data name='output2' format='html' label="Table1.html" /> + <data name='output2' format='html' label="${tool.name} on $on_string (html)" /> </outputs> <tests>