diff xarray_tool.py @ 1:6baac361495b draft

"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 5cdfeb9e100109892a8490ebb4b9bff498c795b5"
author ecology
date Sat, 31 Oct 2020 11:00:25 +0000
parents 225d0d275a24
children 123a9a629bef
line wrap: on
line diff
--- a/xarray_tool.py	Fri May 22 05:19:15 2020 -0400
+++ b/xarray_tool.py	Sat Oct 31 11:00:25 2020 +0000
@@ -84,8 +84,8 @@
         writer = csv.writer(f, delimiter='\t')
         header = ['VariableName', 'NumberOfDimensions']
         for idx, val in enumerate(ds.dims.items()):
-            header.append('Dim'+str(idx)+'Name')
-            header.append('Dim'+str(idx)+'Size')
+            header.append('Dim' + str(idx) + 'Name')
+            header.append('Dim' + str(idx) + 'Size')
         writer.writerow(header)
         for name, da in ds.data_vars.items():
             line = [name]
@@ -113,8 +113,7 @@
         if filter_varname == self.select:
             # filter on values of the selected variable
             if op == 'bi':
-                self.dset = self.dset.where((self.dset <= rl) &
-                                            (self.dset >= ll))
+                self.dset = self.dset.where((self.dset <= rl) & (self.dset >= ll))
             elif op == 'le':
                 self.dset = self.dset.where(self.dset <= ll)
             elif op == 'ge':
@@ -207,8 +206,7 @@
         for row in fcoords.itertuples():
             self.latvalN = row[0]
             self.lonvalE = row[1]
-            self.outfile = (self.outputdir + '/' + self.select + '_'
-                            + str(row.Index) + '.tabular')
+            self.outfile = (self.outputdir + '/' + self.select + '_' + str(row.Index) + '.tabular')
             self.selection()