From d99d522a388cdf5a891f00c29e24815698314ac3 Mon Sep 17 00:00:00 2001 From: Russel Torres Date: Wed, 27 Mar 2024 00:55:21 -0700 Subject: [PATCH 1/2] docstrings: semi-automated docstrings --- .../lens_correction/lens_correction_solver.py | 118 +++++++++++++---- em_stitch/lens_correction/utils.py | 65 ++++++++++ em_stitch/montage/montage_solver.py | 122 ++++++++++++++++++ em_stitch/plots/montage_plots.py | 34 +++++ 4 files changed, 313 insertions(+), 26 deletions(-) diff --git a/em_stitch/lens_correction/lens_correction_solver.py b/em_stitch/lens_correction/lens_correction_solver.py index 4be3502..203f3ee 100644 --- a/em_stitch/lens_correction/lens_correction_solver.py +++ b/em_stitch/lens_correction/lens_correction_solver.py @@ -39,6 +39,26 @@ class LensCorrectionException(Exception): def one_file(fdir, fstub): + """ + Get a single file matching a directory and filename pattern. + + Parameters + ---------- + fdir : str + The directory where the file should be located. + fstub : str + The filename pattern to match. + + Returns + ------- + str + The full path of the single file matching the pattern. + + Raises + ------ + LensCorrectionException + If no file or more than one file is found matching the pattern. + """ fullstub = os.path.join(fdir, fstub) files = glob.glob(fullstub) lf = len(files) @@ -52,6 +72,27 @@ def one_file(fdir, fstub): def tilespec_input_from_metafile( metafile, mask_file, output_dir, log_level, compress): + """ + get tilespec input data from a metafile. + + Parameters + ---------- + metafile : str + Path to the metafile. + mask_file : str + Path to the mask file. + output_dir : str + Directory where the output will be stored. + log_level : int + Log level for the operation. + compress : bool + Whether to compress the output. + + Returns + ------- + Dict[str, Union[str, int, bool]] + A dictionary containing the generated tilespec input data. + """ result = {} result['metafile'] = metafile @@ -75,6 +116,35 @@ def filter_match_collection( n_clusters=None, n_cluster_pts=20, ransacReprojThreshold=40., ignore_match_indices=(), input_n_key="n_from_gpu", output_n_key="n_after_filter"): + """ + Filter a collection of matches based on specified criteria. + + Parameters + ---------- + matches : List[Dict[str, Any]] + The collection of matches to filter. + threshold : float + Threshold value. + model : str, optional + Model type, by default "Similarity". + n_clusters : int, optional + Number of clusters, by default None. + n_cluster_pts : int, optional + Number of cluster points, by default 20. + ransacReprojThreshold : float, optional + RANSAC reprojection threshold, by default 40.0. + ignore_match_indices : Optional[Iterable[int]], optional + Indices of matches to ignore, by default None. + input_n_key : str, optional + Key to store input count in counts dictionary, by default "n_from_gpu". + output_n_key : str, optional + Key to store output count in counts dictionary, by default "n_after_filter". + + Returns + ------- + Tuple[List[Dict[str, Any]], List[Dict[str, int]]] + A tuple containing the filtered matches and their corresponding counts. + """ ignore_match_indices = (set() if ignore_match_indices is None else ignore_match_indices) ignore_match_indices = set(ignore_match_indices) @@ -115,7 +185,27 @@ def make_collection_json( thresh, # FIXME thresh not used in this version compress, ignore_match_indices=None): - + """ + Create a JSON collection file from a template file. + + Parameters + ---------- + template_file : str + Path to the template file. + output_dir : str + Directory where the output will be stored. + thresh : float + Threshold value. + compress : bool + Whether to compress the output. + ignore_match_indices : Optional[List[int]], optional + Indices of matches to ignore, by default None. + + Returns + ------- + Tuple[str, List[Dict[str, int]]] + A tuple containing the path to the collection file and a list of counts. + """ with open(template_file, 'r') as f: template_match_md = json.load(f) @@ -124,31 +214,7 @@ def make_collection_json( m, counts = filter_match_collection( input_matches, thresh, ignore_match_indices=ignore_match_indices - ) - - # counts = [] - # for m in template_match_md['collection']: - # counts.append({}) - # ind = np.arange(len(m['matches']['p'][0])) - # counts[-1]['n_from_gpu'] = ind.size - - # _, _, w, _ = common_utils.pointmatch_filter( - # m, - # n_clusters=None, - # n_cluster_pts=20, - # ransacReprojThreshold=40.0, - # model='Similarity') - - # m['matches']['w'] = w.tolist() - - # counts[-1]['n_after_filter'] = np.count_nonzero(w) - - # m = matches['collection'] - - # if ignore_match_indices: - # m = [match for i, match in enumerate(matches['collection']) - # if i not in ignore_match_indices] - # logger.warning("you are ignoring some point matches") + ) collection_file = os.path.join(output_dir, "collection.json") collection_file = jsongz.dump(m, collection_file, compress=compress) diff --git a/em_stitch/lens_correction/utils.py b/em_stitch/lens_correction/utils.py index 7888e87..a0ad108 100644 --- a/em_stitch/lens_correction/utils.py +++ b/em_stitch/lens_correction/utils.py @@ -11,6 +11,23 @@ def split_inverse_tform(tform, src, block_size): + """ + Split and inverse transform the source array using the provided transformation. + + Parameters + ---------- + tform : Any + Transformation object. + src : np.ndarray + Source array. + block_size : int + Size of each block. + + Returns + ------- + np.ndarray + Inverse transformed array. + """ nsplit = np.ceil(float(src.shape[0]) / float(block_size)) split_src = np.array_split(src, nsplit, axis=0) dst = [] @@ -21,6 +38,28 @@ def split_inverse_tform(tform, src, block_size): def maps_from_tform(tform, width, height, block_size=10000, res=32): + """ + Generate maps and a mask for remapping based on the provided transformation. + + Parameters + ---------- + tform : Any + Transformation object. + width : int + Width of the map. + height : int + Height of the map. + block_size : int, optional + Size of each block, by default 10000. + res : int, optional + cell resolution, by default 32. + + Returns + ------- + Tuple[np.ndarray, np.ndarray, np.ndarray] + Tuple containing map1, map2, and mask arrays. + + """ t0 = time.time() x = np.arange(0, width + res, res) @@ -53,6 +92,22 @@ def maps_from_tform(tform, width, height, block_size=10000, res=32): def estimate_stage_affine(t0, t1): + """ + Estimate affine transformation between two sets of translations. + + Parameters + ---------- + t0 : Iterable + List of transformations (t0). + t1 : Iterable + List of transformations (t1). + + Returns + ------- + renderapi.transform.AffineModel + Estimated affine transformation. + + """ src = np.array([t.tforms[0].translation for t in t0]) dst = np.array([t.tforms[1].translation for t in t1]) aff = renderapi.transform.AffineModel() @@ -61,6 +116,16 @@ def estimate_stage_affine(t0, t1): def remove_weighted_matches(matches, weight=0.0): + """ + Remove matches with specified weight. + + Parameters + ---------- + matches : List[Dict[str, Any]] + List of matches. + weight : float, optional + Weight threshold, by default 0.0. + """ for m in matches: ind = np.invert(np.isclose(np.array(m['matches']['w']), weight)) m['matches']['p'] = np.array(m['matches']['p'])[:, ind].tolist() diff --git a/em_stitch/montage/montage_solver.py b/em_stitch/montage/montage_solver.py index c40f74c..d81a531 100644 --- a/em_stitch/montage/montage_solver.py +++ b/em_stitch/montage/montage_solver.py @@ -33,6 +33,23 @@ class MontageSolverException(Exception): def do_solve(template_path, args, index): + """ + Perform alignment solving based on the provided template and arguments. + + Parameters + ---------- + template_path : str + Path to the template file. + args : Dict[str, Any] + Arguments dictionary containing input and output information. + index : int + Index. + + Returns + ------- + Dict[str, Any] + Results of the alignment solving process. + """ with open(template_path, 'r') as f: template = json.load(f) template['input_stack']['input_file'] = \ @@ -76,6 +93,27 @@ def do_solve(template_path, args, index): def do_solves(collection, input_stack, z, compress, solver_args): + """ + Perform multiple alignment solving processes. + + Parameters + ---------- + collection : str + Collection file. + input_stack : str + Input stack file. + z : int + Z value. + compress : bool + Whether to compress the output. + solver_args : List[Dict[str, Any]] + List of solver arguments. + + Returns + ------- + List[Dict[str, Any]] + List of results from alignment solving processes. + """ args = {'input_stack': {}, 'output_stack': {}, 'pointmatch': {}} args['input_stack']['input_file'] = input_stack args['pointmatch']['input_file'] = collection @@ -90,6 +128,19 @@ def do_solves(collection, input_stack, z, compress, solver_args): def montage_filter_matches(matches, thresh, model='Similarity'): + """ + Filter matches in a montage. + + Parameters + ---------- + matches : List[Dict[str, Any]] + List of matches. + thresh : float + Threshold value. + model : str, optional + Model type, by default 'Similarity'. + + """ for match in matches: _, _, w, _ = pointmatch_filter( match, @@ -101,10 +152,43 @@ def montage_filter_matches(matches, thresh, model='Similarity'): def get_metafile_path(datadir): + """ + Get the path of the metadata file in the specified directory. + + Parameters + ---------- + datadir : str + Directory where the metadata file is located. + + Returns + ------- + str + Path of the metadata file. + """ return glob.glob(os.path.join(datadir, '_metadata*.json'))[0] def make_raw_tilespecs(metafile, outputdir, groupId, compress): + """ + Generate raw tilespecs from a metadata file. + + Parameters + ---------- + metafile : str + Path to the metadata file. + outputdir : str + Directory where the output will be stored. + groupId : str + Group ID. + compress : bool + Whether to compress the output. + + Returns + ------- + Tuple[str, int] + Path of the generated raw tilespecs file and the corresponding z value. + + """ z = get_z_from_metafile(metafile) tspecin = { "metafile": metafile, @@ -119,6 +203,25 @@ def make_raw_tilespecs(metafile, outputdir, groupId, compress): def get_transform(metafile, tfpath, refdict, read_from): + """ + Get transformation based on specified parameters. + + Parameters + ---------- + metafile : str + Path to the metadata file. + tfpath : str + Path to the transformation file. + refdict : Dict[str, Any] + Reference dictionary for transformation. + read_from : str + Source to read transformation data from ('metafile', 'reffile', or 'dict'). + + Returns + ------- + renderapi.transform.Transform + Transformation object. + """ if read_from == 'metafile': with open(metafile, 'r') as f: j = json.load(f) @@ -132,6 +235,25 @@ def get_transform(metafile, tfpath, refdict, read_from): def make_resolved(rawspecpath, tform, outputdir, compress): + """ + Generate resolved tiles from raw tilespecs and a transformation. + + Parameters + ---------- + rawspecpath : str + Path to the raw tilespecs file. + tform : renderapi.transform.Transform + Transformation object. + outputdir : str + Directory where the output will be stored. + compress : bool + Whether to compress the output. + + Returns + ------- + str + Path of the generated resolved tiles file. + """ # read in the tilespecs rtj = jsongz.load(rawspecpath) tspecs = [renderapi.tilespec.TileSpec(json=t) for t in rtj] diff --git a/em_stitch/plots/montage_plots.py b/em_stitch/plots/montage_plots.py index ee13859..e458357 100644 --- a/em_stitch/plots/montage_plots.py +++ b/em_stitch/plots/montage_plots.py @@ -16,6 +16,25 @@ def tspec_transform(tspec, mpq, shared=None): + """ + Transform points using the transformations associated with a tilespec. + Assumes any reference transforms are included in initial points and skips + calculation for those. + + Parameters + ---------- + tspec : renderapi.tilespec.TileSpec + Tilespec object containing transformations. + mpq : List[Tuple[float, float]] + List of (x, y) points to transform. + shared : Optional[Any], optional + Shared information, by default None. + + Returns + ------- + np.ndarray + Transformed points. + """ xy = np.array(mpq).transpose() for tf in tspec.tforms: if isinstance(tf, renderapi.transform.ReferenceTransform): @@ -27,6 +46,21 @@ def tspec_transform(tspec, mpq, shared=None): def make_xyres(matches, resolved): + """ + Create XY coordinates and residuals from matches and resolved tiles. + + Parameters + ---------- + matches : List[Dict[str, Any]] + List of matches. + resolved : renderapi.resolvedtiles.ResolvedTiles + Resolved tiles object. + + Returns + ------- + Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray] + Tuple containing XY coordinates and residuals for valid and invalid matches. + """ tids = np.array([t.tileId for t in resolved.tilespecs]) xy = [] res = [] From 072923fb86e611399a3efad8c26307168f15cf9a Mon Sep 17 00:00:00 2001 From: Russel Torres Date: Wed, 27 Mar 2024 01:13:09 -0700 Subject: [PATCH 2/2] imports: format import order --- .../lens_correction/lens_correction_solver.py | 26 +++++++++++-------- .../mesh_and_solve_transform.py | 24 ++++++++++------- em_stitch/lens_correction/schemas.py | 7 +++-- em_stitch/lens_correction/utils.py | 12 +++++---- em_stitch/montage/meta_to_collection.py | 2 +- em_stitch/montage/montage_solver.py | 16 +++++++----- em_stitch/montage/schemas.py | 8 ++++-- em_stitch/plots/lens_quiver_plots.py | 20 ++++++++------ em_stitch/plots/montage_plots.py | 11 +++++--- em_stitch/plots/schemas.py | 4 +-- em_stitch/plots/view_matches.py | 15 ++++++----- .../generate_EM_tilespecs_from_metafile.py | 11 +++++--- em_stitch/utils/schemas.py | 7 +++-- em_stitch/utils/utils.py | 6 +++-- em_stitch/viz/schemas.py | 5 +++- em_stitch/viz/set_permissions.py | 11 +++++--- em_stitch/viz/set_update_upload.py | 6 +++-- em_stitch/viz/update_urls.py | 11 +++++--- em_stitch/viz/upload_to_render.py | 8 +++--- 19 files changed, 130 insertions(+), 80 deletions(-) diff --git a/em_stitch/lens_correction/lens_correction_solver.py b/em_stitch/lens_correction/lens_correction_solver.py index 203f3ee..1b33a9e 100644 --- a/em_stitch/lens_correction/lens_correction_solver.py +++ b/em_stitch/lens_correction/lens_correction_solver.py @@ -1,19 +1,23 @@ +import glob +import json +import logging +import os +import warnings + +import cv2 +import numpy as np + from argschema import ArgSchemaParser +from bigfeta import jsongz +import renderapi + from .schemas import LensCorrectionSchema -from ..utils.generate_EM_tilespecs_from_metafile import \ - GenerateEMTileSpecsModule +from ..utils.generate_EM_tilespecs_from_metafile import ( + GenerateEMTileSpecsModule) from ..utils import utils as common_utils from .mesh_and_solve_transform import MeshAndSolveTransform from . import utils -from bigfeta import jsongz -import logging -import os -import glob -import json -import numpy as np -import renderapi -import cv2 -import warnings + warnings.simplefilter(action='ignore', category=FutureWarning) logger = logging.getLogger(__name__) diff --git a/em_stitch/lens_correction/mesh_and_solve_transform.py b/em_stitch/lens_correction/mesh_and_solve_transform.py index 2312f08..916e1fa 100644 --- a/em_stitch/lens_correction/mesh_and_solve_transform.py +++ b/em_stitch/lens_correction/mesh_and_solve_transform.py @@ -1,21 +1,25 @@ +import copy +import datetime +import logging +import os + +from six.moves import urllib + +import cv2 import numpy as np -import triangle import scipy.optimize -from scipy.spatial import Delaunay import scipy.sparse as sparse from scipy.sparse import csr_matrix from scipy.sparse.linalg import factorized -import renderapi -import copy -import os -import datetime -import cv2 -from six.moves import urllib +from scipy.spatial import Delaunay +import triangle + from argschema import ArgSchemaParser +from bigfeta import jsongz +import renderapi + from .schemas import MeshLensCorrectionSchema from .utils import remove_weighted_matches -from bigfeta import jsongz -import logging try: # pandas unique is faster than numpy, use where appropriate diff --git a/em_stitch/lens_correction/schemas.py b/em_stitch/lens_correction/schemas.py index 6a9458d..385e30c 100644 --- a/em_stitch/lens_correction/schemas.py +++ b/em_stitch/lens_correction/schemas.py @@ -1,11 +1,14 @@ import warnings + from marshmallow.warnings import ChangedInMarshmallow3Warning import marshmallow as mm + from argschema import ArgSchema from argschema.schemas import DefaultSchema from argschema.fields import ( - Boolean, InputDir, InputFile, Float, List, - Int, OutputDir, Nested, Str, Dict) + Boolean, InputDir, InputFile, Float, List, + Int, OutputDir, Nested, Str, Dict) + warnings.simplefilter( action='ignore', category=ChangedInMarshmallow3Warning) diff --git a/em_stitch/lens_correction/utils.py b/em_stitch/lens_correction/utils.py index a0ad108..1a7fd48 100644 --- a/em_stitch/lens_correction/utils.py +++ b/em_stitch/lens_correction/utils.py @@ -1,11 +1,13 @@ -import numpy as np -import cv2 -import renderapi import time -from scipy import ndimage import logging -from ..utils import utils as common_utils +import cv2 +import numpy as np +from scipy import ndimage + +import renderapi + +from ..utils import utils as common_utils logger = logging.getLogger(__name__) diff --git a/em_stitch/montage/meta_to_collection.py b/em_stitch/montage/meta_to_collection.py index 872c5fd..4011747 100644 --- a/em_stitch/montage/meta_to_collection.py +++ b/em_stitch/montage/meta_to_collection.py @@ -5,11 +5,11 @@ ''' import argparse +from enum import IntEnum import glob import json import os import sys -from enum import IntEnum # Position codes in metafile diff --git a/em_stitch/montage/montage_solver.py b/em_stitch/montage/montage_solver.py index d81a531..3620ddc 100644 --- a/em_stitch/montage/montage_solver.py +++ b/em_stitch/montage/montage_solver.py @@ -1,15 +1,17 @@ +import glob +import json +import os + from argschema import ArgSchemaParser +from bigfeta import jsongz +import bigfeta.bigfeta as bfa import renderapi + from em_stitch.montage import meta_to_collection from em_stitch.montage.schemas import MontageSolverSchema -from em_stitch.utils.generate_EM_tilespecs_from_metafile import \ - GenerateEMTileSpecsModule +from em_stitch.utils.generate_EM_tilespecs_from_metafile import ( + GenerateEMTileSpecsModule) from em_stitch.utils.utils import pointmatch_filter, get_z_from_metafile -from bigfeta import jsongz -import bigfeta.bigfeta as bfa -import json -import os -import glob dname = os.path.join( os.path.dirname(os.path.abspath(__file__)), diff --git a/em_stitch/montage/schemas.py b/em_stitch/montage/schemas.py index 088a456..f22679d 100644 --- a/em_stitch/montage/schemas.py +++ b/em_stitch/montage/schemas.py @@ -1,10 +1,14 @@ +import os import warnings + from marshmallow.warnings import ChangedInMarshmallow3Warning import marshmallow as mm + from argschema import ArgSchema from argschema.fields import ( - Boolean, InputDir, InputFile, Float, OutputDir, List, Str, Dict) -import os + Boolean, InputDir, InputFile, Float, + OutputDir, List, Str, Dict) + warnings.simplefilter( action='ignore', category=ChangedInMarshmallow3Warning) diff --git a/em_stitch/plots/lens_quiver_plots.py b/em_stitch/plots/lens_quiver_plots.py index 94ff938..90a0cba 100644 --- a/em_stitch/plots/lens_quiver_plots.py +++ b/em_stitch/plots/lens_quiver_plots.py @@ -1,17 +1,21 @@ -import renderapi -from matplotlib.backends.backend_pdf import PdfPages -import matplotlib.pyplot as plt -import json -import numpy as np +import datetime import glob +import json import os import re import warnings -import datetime -from em_stitch.utils.utils import src_from_xy -from em_stitch.plots.schemas import LensQuiverSchema + +from matplotlib.backends.backend_pdf import PdfPages +import matplotlib.pyplot as plt +import numpy as np + from argschema import ArgSchemaParser from bigfeta import jsongz +import renderapi + +from em_stitch.utils.utils import src_from_xy +from em_stitch.plots.schemas import LensQuiverSchema + warnings.simplefilter(action='ignore', category=FutureWarning) example = { diff --git a/em_stitch/plots/montage_plots.py b/em_stitch/plots/montage_plots.py index e458357..444f8dc 100644 --- a/em_stitch/plots/montage_plots.py +++ b/em_stitch/plots/montage_plots.py @@ -1,13 +1,16 @@ +import json +import os + from matplotlib.backends.backend_pdf import PdfPages -from argschema import ArgSchemaParser import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable -import renderapi import numpy as np -import json + +from argschema import ArgSchemaParser from bigfeta import jsongz +import renderapi + from em_stitch.plots.schemas import MontagePlotsSchema -import os example = { "collection_path": "/data/em-131fs3/lctest/T4.2019.04.29b/001738/0/collection.json.gz", diff --git a/em_stitch/plots/schemas.py b/em_stitch/plots/schemas.py index 2a24f71..3141b7f 100644 --- a/em_stitch/plots/schemas.py +++ b/em_stitch/plots/schemas.py @@ -1,7 +1,7 @@ from argschema import ArgSchema from argschema.fields import ( - InputDir, InputFile, Str, List, Boolean, Int, - OutputFile, Float) + InputDir, InputFile, Str, List, Boolean, Int, + OutputFile, Float) class LensQuiverSchema(ArgSchema): diff --git a/em_stitch/plots/view_matches.py b/em_stitch/plots/view_matches.py index e67b72e..f8b6050 100644 --- a/em_stitch/plots/view_matches.py +++ b/em_stitch/plots/view_matches.py @@ -1,14 +1,17 @@ -from matplotlib.backends.backend_pdf import PdfPages -import matplotlib.pyplot as plt +import logging import os + +import cv2 import numpy as np -import logging -from em_stitch.lens_correction.utils import maps_from_tform +from matplotlib.backends.backend_pdf import PdfPages +import matplotlib.pyplot as plt + +from argschema import ArgSchemaParser from bigfeta import jsongz import renderapi -import cv2 + from em_stitch.plots.schemas import ViewMatchesSchema -from argschema import ArgSchemaParser +from em_stitch.lens_correction.utils import maps_from_tform logger = logging.getLogger() diff --git a/em_stitch/utils/generate_EM_tilespecs_from_metafile.py b/em_stitch/utils/generate_EM_tilespecs_from_metafile.py index 2706985..9db8392 100644 --- a/em_stitch/utils/generate_EM_tilespecs_from_metafile.py +++ b/em_stitch/utils/generate_EM_tilespecs_from_metafile.py @@ -1,10 +1,13 @@ -import renderapi -import os import json -import numpy +import os import pathlib -from bigfeta import jsongz + +import numpy + from argschema import ArgSchemaParser +from bigfeta import jsongz +import renderapi + from .schemas import GenerateEMTileSpecsParameters # this is a modification of https://github.com/AllenInstitute/ diff --git a/em_stitch/utils/schemas.py b/em_stitch/utils/schemas.py index d06fd2b..a066c27 100644 --- a/em_stitch/utils/schemas.py +++ b/em_stitch/utils/schemas.py @@ -1,9 +1,12 @@ import warnings + from marshmallow.warnings import ChangedInMarshmallow3Warning + from argschema import ArgSchema from argschema.fields import ( - InputDir, InputFile, Float, - Int, OutputFile, Str, Boolean) + InputDir, InputFile, Float, + Int, OutputFile, Str, Boolean) + warnings.simplefilter( action='ignore', category=ChangedInMarshmallow3Warning) diff --git a/em_stitch/utils/utils.py b/em_stitch/utils/utils.py index 739e737..37b8ede 100644 --- a/em_stitch/utils/utils.py +++ b/em_stitch/utils/utils.py @@ -1,6 +1,8 @@ -import numpy as np -import cv2 import json + +import cv2 +import numpy as np + import renderapi diff --git a/em_stitch/viz/schemas.py b/em_stitch/viz/schemas.py index 6f6305d..04c24ae 100644 --- a/em_stitch/viz/schemas.py +++ b/em_stitch/viz/schemas.py @@ -1,9 +1,12 @@ import warnings + from marshmallow.warnings import ChangedInMarshmallow3Warning + from argschema import ArgSchema from argschema.schemas import DefaultSchema from argschema.fields import ( - Nested, Int, Str, Boolean, List) + Nested, Int, Str, Boolean, List) + warnings.simplefilter( action='ignore', category=ChangedInMarshmallow3Warning) diff --git a/em_stitch/viz/set_permissions.py b/em_stitch/viz/set_permissions.py index ef07770..47d531d 100644 --- a/em_stitch/viz/set_permissions.py +++ b/em_stitch/viz/set_permissions.py @@ -1,9 +1,12 @@ -from argschema import ArgSchemaParser -from .schemas import SetPermissionsSchema +import logging +import os + import subprocess import sys -import os -import logging + +from argschema import ArgSchemaParser + +from .schemas import SetPermissionsSchema logger = logging.getLogger(__name__) diff --git a/em_stitch/viz/set_update_upload.py b/em_stitch/viz/set_update_upload.py index c824050..9c190d8 100644 --- a/em_stitch/viz/set_update_upload.py +++ b/em_stitch/viz/set_update_upload.py @@ -1,10 +1,12 @@ +import logging +import os + from argschema import ArgSchemaParser + from em_stitch.viz.schemas import SetUpdateUploadSchema from em_stitch.viz.set_permissions import SetPermissions from em_stitch.viz.update_urls import UpdateUrls from em_stitch.viz.upload_to_render import UploadToRender -import os -import logging logger = logging.getLogger(__name__) diff --git a/em_stitch/viz/update_urls.py b/em_stitch/viz/update_urls.py index df80ec6..147d23d 100644 --- a/em_stitch/viz/update_urls.py +++ b/em_stitch/viz/update_urls.py @@ -1,12 +1,15 @@ +import logging import os +import pathlib import shutil + from six.moves import urllib -import pathlib -from bigfeta import jsongz + from argschema import ArgSchemaParser -from .schemas import UpdateUrlSchema +from bigfeta import jsongz import renderapi -import logging + +from .schemas import UpdateUrlSchema logger = logging.getLogger(__name__) diff --git a/em_stitch/viz/upload_to_render.py b/em_stitch/viz/upload_to_render.py index ddedfae..ded702e 100644 --- a/em_stitch/viz/upload_to_render.py +++ b/em_stitch/viz/upload_to_render.py @@ -1,9 +1,11 @@ +import logging +import os + from argschema import ArgSchemaParser +from bigfeta import jsongz import renderapi + from .schemas import UploadToRenderSchema -from bigfeta import jsongz -import os -import logging logger = logging.getLogger(__name__)