changeset 2:b5c6975c6033 draft

planemo upload for repository https://github.com/jaidevjoshi83/gaiac commit c31ef5726cd1d2659da9aeb956c22fb834b177ff
author jay
date Fri, 23 May 2025 17:54:26 +0000
parents deffa3669ffc
children 9ccfa88ff16f
files gaiac_data_averaging/gaiac_dataaveraging.xml gaiac_pm_data_pulling/datapulling.py gaiac_pm_data_pulling/gaiac_data_download.py gaiac_pm_data_pulling/gaiac_pm_data_pulling.py
diffstat 4 files changed, 37 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/gaiac_data_averaging/gaiac_dataaveraging.xml	Thu May 15 22:48:51 2025 +0000
+++ b/gaiac_data_averaging/gaiac_dataaveraging.xml	Fri May 23 17:54:26 2025 +0000
@@ -13,13 +13,12 @@
   </stdio>
 
     <command detect_errors="exit_code"><![CDATA[
-        python '$__tool_directory__/dataaveraging.py' -I '$input1' -C '$Column' -O '$output' -T '$TimeInt'
+        python '$__tool_directory__/gaiac_dataaveraging.py' -I '$input' -C '$Column' -O '$output' -T '$TimeInt'
     ]]></command>
 
   <inputs>
-    <param name="input1" type="data" label="Input file" format="tabular" argument= "--InFile" help="Input csv data file."/>
-    <param name="Column" type='data_column' data_ref="input1"  label="Time Stamp column" argument="--dt_column" multiple="False" use_header_names="true" help="Class Label ex. 0 or 1">
-
+    <param name="input" type="data" label="Input file" format="tabular" argument= "--InFile" help="Input csv data file."/>
+    <param name="Column" type='data_column' data_ref="input"  label="Time Stamp column" argument="--dt_column" multiple="False" use_header_names="true" help="Class Label ex. 0 or 1">
       <validator type="no_options" message="Please select any one column."/>
     </param>
 
@@ -28,12 +27,12 @@
   </inputs>
 
   <outputs>
-    <data name='output' format='tabular' label="Out.tsv" from_work_dir="out.tsv"/> 
+    <data name='output' format='tabular' label="${tool.name} on $on_string (tabular)" from_work_dir="out.tsv"/> 
   </outputs>
 
   <tests>
     <test>
-      <param name="input1" value="test.tsv"/>
+      <param name="input" value="test.tsv"/>
       <param name="Column" value="1"/>
       <output name="output" file="out.tsv" ftype="tabular"/>
     </test>
--- a/gaiac_pm_data_pulling/datapulling.py	Thu May 15 22:48:51 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:54:26 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:48:51 2025 +0000
+++ b/gaiac_pm_data_pulling/gaiac_pm_data_pulling.py	Fri May 23 17:54:26 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')