From 20c4ed69d395a40e0e2ab1d35f44bbd82a499abf Mon Sep 17 00:00:00 2001 From: Eva Schiffer <evas@ssec.wisc.edu> Date: Thu, 16 Dec 2021 11:38:08 -0600 Subject: [PATCH] lots of style and detail cleanup --- pyglance/glance/collocation.py | 3 -- pyglance/glance/compare.py | 54 ++++++++++++++-------------- pyglance/glance/config_organizer.py | 14 ++++---- pyglance/glance/data.py | 13 +++---- pyglance/glance/delta.py | 2 +- pyglance/glance/figures.py | 20 +++++------ pyglance/glance/filters.py | 2 +- pyglance/glance/graphics.py | 4 +++ pyglance/glance/gui_figuremanager.py | 2 +- pyglance/glance/gui_model.py | 14 ++++---- pyglance/glance/gui_view.py | 30 ++++++++-------- pyglance/glance/io.py | 50 ++++++++++++++------------ pyglance/glance/lonlat_util.py | 12 +++---- pyglance/glance/plot.py | 8 +++-- pyglance/glance/report.py | 30 +++++++++------- pyglance/glance/stats.py | 8 ++--- pyglance/glance/util.py | 6 ++-- pyglance/setup.py | 4 +-- 18 files changed, 141 insertions(+), 135 deletions(-) diff --git a/pyglance/glance/collocation.py b/pyglance/glance/collocation.py index d9880be..f125001 100644 --- a/pyglance/glance/collocation.py +++ b/pyglance/glance/collocation.py @@ -11,9 +11,6 @@ Copyright (c) 2010 University of Wisconsin SSEC. All rights reserved. import logging import numpy as np -import glance.delta as delta - - LOG = logging.getLogger(__name__) diff --git a/pyglance/glance/compare.py b/pyglance/glance/compare.py index 547ca3c..fd47783 100644 --- a/pyglance/glance/compare.py +++ b/pyglance/glance/compare.py @@ -603,9 +603,9 @@ def report_one_input_library_call (a_path, var_list=None, variableBasedFilter = varRunInfo[VAR_FILTER_FUNCTION_A_KEY] if VAR_FILTER_FUNCTION_A_KEY in varRunInfo else None, altVariableFileObject = dataobj.FileInfo(varRunInfo[VAR_FILTER_ALT_FILE_A_KEY]).file_object if VAR_FILTER_ALT_FILE_A_KEY in varRunInfo else None, fileDescriptionForDisplay = "file A") - except Exception as e : + except Exception as ex : LOG.warning(displayName + " data could not be loaded. This variable will not be included in the output report. " + - "The following error was encountered while trying to load this variable:\n" + str(e)) + "The following error was encountered while trying to load this variable:\n" + str(ex)) continue # get variable attribute information for this variable @@ -613,7 +613,7 @@ def report_one_input_library_call (a_path, var_list=None, attributeInfo[A_FILE_TITLE_KEY] = aFile.file_object.get_variable_attributes(technical_name) # pre-check if this data should be plotted and if it should be compared to the longitude and latitude - include_images_for_this_variable = ((not(DO_MAKE_IMAGES_KEY in runInfo)) or (runInfo[DO_MAKE_IMAGES_KEY])) + include_images_for_this_variable = (DO_MAKE_IMAGES_KEY not in runInfo) or (runInfo[DO_MAKE_IMAGES_KEY]) if DO_MAKE_IMAGES_KEY in varRunInfo : include_images_for_this_variable = varRunInfo[DO_MAKE_IMAGES_KEY] do_not_test_with_lon_lat = (not include_images_for_this_variable) or (len(lon_lat_data) <= 0) @@ -623,7 +623,7 @@ def report_one_input_library_call (a_path, var_list=None, # check if this data can be examined # (don't compare lon/lat sizes if we won't be plotting) - if ( do_not_test_with_lon_lat or (aData.shape == good_shape_from_lon_lat) ) : + if do_not_test_with_lon_lat or (aData.shape == good_shape_from_lon_lat) : # check to see if there is a directory to put information about this variable in, # if not then create it @@ -635,7 +635,7 @@ def report_one_input_library_call (a_path, var_list=None, # form the doc and config paths relative to where the variable is upwardPath = './' - for number in range(len(displayName.split('/'))) : # TODO this is not general to windows + for num in range(len(displayName.split('/'))) : # TODO this is not general to windows upwardPath = os.path.join(upwardPath, '../') varRunInfo[DOCUMENTATION_PATH_KEY] = quote(os.path.join(upwardPath, 'doc.html')) if CONFIG_FILE_NAME_KEY in runInfo : @@ -658,7 +658,7 @@ def report_one_input_library_call (a_path, var_list=None, } # create the images for this variable - if (include_images_for_this_variable) : + if include_images_for_this_variable : plotFunctionGenerationObjects = [ ] @@ -671,14 +671,14 @@ def report_one_input_library_call (a_path, var_list=None, plotFunctionGenerationObjects.append(plotcreate.InspectMappedQuiverPlotFunctionFactory()) # if the data is one dimensional we can plot it as lines - elif (len(aData.shape) == 1) : + elif len(aData.shape) == 1 : plotFunctionGenerationObjects.append(plotcreate.InspectLinePlotsFunctionFactory()) # if the data is 2D we have some options based on the type of data - elif (len(aData.shape) == 2) : + elif len(aData.shape) == 2 : # if the data is not mapped to a longitude and latitude, just show it as an image - if (do_not_test_with_lon_lat) : + if do_not_test_with_lon_lat : plotFunctionGenerationObjects.append(plotcreate.InspectIMShowPlotFunctionFactory()) # if it's 2D and mapped to the Earth, contour plot it on the earth @@ -718,7 +718,7 @@ def report_one_input_library_call (a_path, var_list=None, LOG.info("\tfinished creating figures for: " + explanationName) # create the report page for this variable - if (runInfo[DO_MAKE_REPORT_KEY]) : + if runInfo[DO_MAKE_REPORT_KEY] : # hang on to some info on our variable variableInspections[displayName] = { @@ -744,7 +744,7 @@ def report_one_input_library_call (a_path, var_list=None, # the end of the loop to examine all the variables # generate our general report pages once we've analyzed all the variables - if (runInfo[DO_MAKE_REPORT_KEY]) : + if runInfo[DO_MAKE_REPORT_KEY] : # get the current time runInfo[TIME_INFO_KEY] = datetime.datetime.ctime(datetime.datetime.now()) @@ -920,10 +920,10 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None, variableBasedFilter = varRunInfo[VAR_FILTER_FUNCTION_B_KEY] if VAR_FILTER_FUNCTION_B_KEY in varRunInfo else None, altVariableFileObject = dataobj.FileInfo(varRunInfo[VAR_FILTER_ALT_FILE_B_KEY]).file_object if VAR_FILTER_ALT_FILE_B_KEY in varRunInfo else None, fileDescriptionForDisplay = "file B") - except Exception as e: + except Exception as ex: LOG.warning( displayName + " data could not be loaded. This variable will not be included in the output report. " + - "The following error was encountered while trying to load this variable:\n" + str(e)) + "The following error was encountered while trying to load this variable:\n" + str(ex)) continue # get variable attribute information for this variable @@ -958,7 +958,7 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None, # form the doc and config paths relative to where the variable is upwardPath = './' - for number in range(len(displayName.split('/'))) : # TODO this is not general to windows + for num in range(len(displayName.split('/'))) : # TODO this is not general to windows upwardPath = os.path.join(upwardPath, '../') varRunInfo[DOCUMENTATION_PATH_KEY] = quote(os.path.join(upwardPath, 'doc.html')) if CONFIG_FILE_NAME_KEY in runInfo : @@ -1007,24 +1007,24 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None, } # create the images for this variable - if (include_images_for_this_variable) : + if include_images_for_this_variable : plotFunctionGenerationObjects = [ ] # if there's magnitude and direction data, figure out the u and v, otherwise these will be None aUData, aVData = get_UV_info_from_magnitude_direction_info (aFile.file_object, - varRunInfo[MAGNITUDE_VAR_NAME_KEY] if (MAGNITUDE_VAR_NAME_KEY) in varRunInfo else None, - varRunInfo[DIRECTION_VAR_NAME_KEY] if (DIRECTION_VAR_NAME_KEY) in varRunInfo else None, + varRunInfo[MAGNITUDE_VAR_NAME_KEY] if MAGNITUDE_VAR_NAME_KEY in varRunInfo else None, + varRunInfo[DIRECTION_VAR_NAME_KEY] if DIRECTION_VAR_NAME_KEY in varRunInfo else None, lon_lat_data[A_FILE_KEY][INVALID_MASK_KEY] if (A_FILE_KEY in lon_lat_data) and (INVALID_MASK_KEY in lon_lat_data[A_FILE_KEY]) else None) bUData, bVData = get_UV_info_from_magnitude_direction_info (bFile.file_object, - varRunInfo[MAGNITUDE_B_VAR_NAME_KEY] if (MAGNITUDE_B_VAR_NAME_KEY) in varRunInfo else varRunInfo[MAGNITUDE_VAR_NAME_KEY] if (MAGNITUDE_VAR_NAME_KEY) in varRunInfo else None, - varRunInfo[DIRECTION_B_VAR_NAME_KEY] if (DIRECTION_B_VAR_NAME_KEY) in varRunInfo else varRunInfo[DIRECTION_VAR_NAME_KEY] if (DIRECTION_VAR_NAME_KEY) in varRunInfo else None, + varRunInfo[MAGNITUDE_B_VAR_NAME_KEY] if MAGNITUDE_B_VAR_NAME_KEY in varRunInfo else varRunInfo[MAGNITUDE_VAR_NAME_KEY] if MAGNITUDE_VAR_NAME_KEY in varRunInfo else None, + varRunInfo[DIRECTION_B_VAR_NAME_KEY] if DIRECTION_B_VAR_NAME_KEY in varRunInfo else varRunInfo[DIRECTION_VAR_NAME_KEY] if DIRECTION_VAR_NAME_KEY in varRunInfo else None, lon_lat_data[B_FILE_KEY][INVALID_MASK_KEY] if (B_FILE_KEY in lon_lat_data) and (INVALID_MASK_KEY in lon_lat_data[B_FILE_KEY]) else None) # if the data is the same size, we can always make our basic statistical comparison plots - if (aData.shape == bData.shape) : + if aData.shape == bData.shape : plotFunctionGenerationObjects.append(plotcreate.BasicComparisonPlotsFunctionFactory()) # if the bin and tuple are defined, try to analyze the data as complex @@ -1039,14 +1039,14 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None, plotFunctionGenerationObjects.append(plotcreate.MappedQuiverPlotFunctionFactory()) # if the data is one dimensional we can plot it as lines - elif (len(aData.shape) == 1) : + elif len(aData.shape) == 1 : plotFunctionGenerationObjects.append(plotcreate.LinePlotsFunctionFactory()) # if the data is 2D we have some options based on the type of data - elif (len(aData.shape) == 2) : + elif len(aData.shape) == 2 : # if the data is not mapped to a longitude and latitude, just show it as an image - if (do_not_test_with_lon_lat) : + if do_not_test_with_lon_lat : plotFunctionGenerationObjects.append(plotcreate.IMShowPlotFunctionFactory()) # if it's 2D and mapped to the Earth, contour plot it on the earth @@ -1087,7 +1087,7 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None, LOG.info("\tfinished creating figures for: " + explanationName) # create the report page for this variable - if (runInfo[DO_MAKE_REPORT_KEY]) : + if runInfo[DO_MAKE_REPORT_KEY] : # hang on to our good % and other info to describe our comparison epsilonPassedPercent = (1.0 - epsilon_failed_fraction) * 100.0 @@ -1124,8 +1124,8 @@ def report_two_inputs_library_call (a_path, b_path, var_list=None, + 'longitude ' + str(good_shape_from_lon_lat) + ' and ' + 'latitude ' + str(good_shape_from_lon_lat) + ' variables.') LOG.warning(message) - except ValueErrorStringToFloat as e: - LOG.warning("Unable to compare "+displayName+": "+str(e)) + except ValueErrorStringToFloat as ex: + LOG.warning("Unable to compare "+displayName+": "+str(ex)) # the end of the loop to examine all the variables @@ -1250,7 +1250,7 @@ def stats_two_inputs_library_call(afn, bfn, var_list=None, total_data_failure_tolerance_default=tempDefaults[TOTAL_FAIL_TOLERANCE_KEY], min_acceptable_r_squared_default=tempDefaults[MIN_OK_R_SQUARED_COEFF_KEY], ) - has_failed = has_failed or not(didPass) + has_failed = has_failed or (not didPass) lal = list(variable_stats.dictionary_form().items()) #lal = list(statistics.summarize(aData, bData, epsilon, (amiss,bmiss)).items()) lal.sort() diff --git a/pyglance/glance/config_organizer.py b/pyglance/glance/config_organizer.py index 1998280..3f1e187 100644 --- a/pyglance/glance/config_organizer.py +++ b/pyglance/glance/config_organizer.py @@ -58,7 +58,7 @@ def parse_varnames(names, terms, epsilon=0.0, missing=None, warn_unfound=False,) """filter variable names and substitute default epsilon and missing settings if none provided returns (variable name, epsilon, missing) triples - >>> _parse_varnames( ['foo','bar', 'baz', 'zoom', 'cat'], ['f..:0.5:-999', 'ba.*:0.001', 'c.t::-9999'], 1e-7 ) + >>> parse_varnames( ['foo','bar', 'baz', 'zoom', 'cat'], ['f..:0.5:-999', 'ba.*:0.001', 'c.t::-9999'], 1e-7 ) set([('foo', 0.5, -999.0), ('cat', 9.9999999999999995e-08, -9999.0), ('bar', 0.001, None), ('baz', 0.001, None)]) names - all the variable names in the file (ie. names that should be considered valid) @@ -133,10 +133,10 @@ def resolve_names(fileAObject, fileBObject, defaultValues, fileCommonNames = nameComparison[SHARED_VARIABLE_NAMES_KEY] finalNames = {} # if the user gave us a config file to pull info from - if (usingConfigFileFormat) : + if usingConfigFileFormat : # if the user didn't ask for any specific variables, try everything - if (len(requestedNames) == 0) : + if len(requestedNames) == 0 : finalFromCommandLine = parse_varnames(fileCommonNames, ['.*'], defaultValues[EPSILON_KEY], defaultValues[FILL_VALUE_KEY]) for name, epsilon, missing in finalFromCommandLine : @@ -173,7 +173,7 @@ def resolve_names(fileAObject, fileBObject, defaultValues, name = currNameInfo[VARIABLE_TECH_NAME_KEY] name_b = name - if (VARIABLE_B_TECH_NAME_KEY in currNameInfo) : + if VARIABLE_B_TECH_NAME_KEY in currNameInfo : name_b = currNameInfo[VARIABLE_B_TECH_NAME_KEY] if ( (name in fileCommonNames) and (VARIABLE_B_TECH_NAME_KEY not in currNameInfo)) or \ @@ -258,10 +258,10 @@ def resolve_names_one_file(fileObject, defaultValues, # figure out which names should be selected based on the user requested names finalNames = {} - if (usingConfigFileFormat) : + if usingConfigFileFormat : # if the user didn't ask for any, try everything - if (len(requestedNames) == 0) : + if len(requestedNames) == 0 : finalFromCommandLine = parse_varnames(possibleNames, ['.*'], None, defaultValues[FILL_VALUE_KEY]) for name, _, missing in finalFromCommandLine : @@ -292,7 +292,7 @@ def resolve_names_one_file(fileObject, defaultValues, if VARIABLE_TECH_NAME_KEY in currNameInfo : name = currNameInfo[VARIABLE_TECH_NAME_KEY] - if (name in possibleNames) : + if name in possibleNames : finalNames[dispName] = defaultValues.copy() finalNames[dispName][DISPLAY_NAME_KEY] = dispName finalNames[dispName].update(currNameInfo) diff --git a/pyglance/glance/data.py b/pyglance/glance/data.py index bdfa6c8..d240ffc 100644 --- a/pyglance/glance/data.py +++ b/pyglance/glance/data.py @@ -8,7 +8,7 @@ Copyright (c) 2010 University of Wisconsin SSEC. All rights reserved. """ import logging -import os, subprocess, datetime +import os, datetime import numpy as np import glance.delta as delta @@ -424,9 +424,9 @@ class DiffInfoObject (object) : # the valid data which is too different between the two sets according to the given epsilon outside_epsilon_mask = np.zeros(shape, dtype=np.bool) - if (epsilonValue is not None) : + if epsilonValue is not None : outside_epsilon_mask |= (abs(raw_diff) > epsilonValue) & valid_in_both - if (epsilonPercent is not None) : + if epsilonPercent is not None : outside_epsilon_mask |= (abs(raw_diff) > abs(aDataObject.data * (float(epsilonPercent) / 100.0))) & valid_in_both # mismatch points = mismatched nans, mismatched missing-values, differences that are too large @@ -524,12 +524,7 @@ class FileInfo (object) : get a version of this object without a file object (this method is useful if you want file information but do not need access and want to save space) """ - toReturn = None - - if self.file_object is None: - toReturn = self - else: - toReturn = FileInfo(self.path, self.md5_sum, self.last_modified) + toReturn = self if self.file_object is None else FileInfo(self.path, self.md5_sum, self.last_modified) return toReturn diff --git a/pyglance/glance/delta.py b/pyglance/glance/delta.py index 8304492..1e549b2 100644 --- a/pyglance/glance/delta.py +++ b/pyglance/glance/delta.py @@ -211,7 +211,7 @@ class BinTupleMapping (object) : self.original_data_shape = dataShape # set up our tuple if it wasn't selected - if (tupleIndexNumber is None) : + if tupleIndexNumber is None : tupleIndexNumber = numberOfDimensions - 1 # are the bin and tuple ok? diff --git a/pyglance/glance/figures.py b/pyglance/glance/figures.py index 49d262d..117ccfb 100644 --- a/pyglance/glance/figures.py +++ b/pyglance/glance/figures.py @@ -120,11 +120,11 @@ def _plot_tag_data_simple(tagData, axes_obj) : (height, width) = tagData.shape tempX = [ ] tempY = [ ] - for h in range(height) : - for w in range(width) : - if tagData[h, w] : - tempX.append(w) - tempY.append(h) + for hIndex in range(height) : + for wIndex in range(width) : + if tagData[hIndex, wIndex] : + tempX.append(wIndex) + tempY.append(hIndex) # if we have only a few points, make them more obvious with purple circles if numMismatchPoints < 500 : _ = plot(tempX, tempY, 'o', color='#993399', markersize=5) @@ -816,10 +816,10 @@ def _cmap_discretize_linear(cmap, N): cmap = get_cmap(cmap) colors_i = concatenate((linspace(0, 1., N), (0., 0., 0., 0.))) colors_rgba = cmap(colors_i) - indices = linspace(0, 1., N + 1) + tmp_indices = linspace(0, 1., N + 1) cdict = {} - for ki, key in enumerate(('red', 'green', 'blue')): - cdict[key] = [(indices[i], colors_rgba[i - 1, ki], colors_rgba[i, ki]) for i in range(N + 1)] + for k_index, key_val in enumerate(('red', 'green', 'blue')): + cdict[key_val] = [(tmp_indices[i], colors_rgba[i - 1, k_index], colors_rgba[i, k_index]) for i in range(N + 1)] # Return colormap object. return matplotlib.colors.LinearSegmentedColormap(cmap.name + "_%d" % N, cdict, 1024) @@ -838,8 +838,8 @@ def _cmap_discretize_nl(cmap, rangeLimits): colors_rgba = cmap(colors_i) #indices = linspace(0, 1., N + 1) cdict = {} - for ki, key in enumerate(('red', 'green', 'blue')): - cdict[key] = [(colors_i[i], colors_rgba[i - 1, ki], colors_rgba[i, ki]) for i in range(N + 1)] + for k_index, key_val in enumerate(('red', 'green', 'blue')): + cdict[key_val] = [(colors_i[i], colors_rgba[i - 1, k_index], colors_rgba[i, k_index]) for i in range(N + 1)] # Return colormap object. return matplotlib.colors.LinearSegmentedColormap(cmap.name + "_nl_%d" % N, cdict, 1024) diff --git a/pyglance/glance/filters.py b/pyglance/glance/filters.py index 9558b04..54a983c 100644 --- a/pyglance/glance/filters.py +++ b/pyglance/glance/filters.py @@ -286,7 +286,7 @@ def organize_ipopp_data_into_image(original_ipopp_data, wave_number=None, missin # figure out the value we're moving data_pt = None data_array = original_ipopp_data[scan_line][field_of_regard][detector] - if (wave_number is not None): + if wave_number is not None : data_pt = data_array[wave_number] else: if (propagate_partial_missing_values diff --git a/pyglance/glance/graphics.py b/pyglance/glance/graphics.py index e5c34eb..306a35c 100644 --- a/pyglance/glance/graphics.py +++ b/pyglance/glance/graphics.py @@ -285,6 +285,8 @@ def quiver_plot_on_map(lon, lat, axes_object, in_projection, uData=None, vData=N Show a quiver plot of the given vector data at the given longitude and latitude """ + img_temp = None + # show the quiver plot if there is data if (uData is not None) and (vData is not None): @@ -300,6 +302,8 @@ def plot_on_map(lon, lat, axes_object, in_projection, marker_const='o', color_co Show a simple point plot at the given longitude and latitude. """ + img_temp = None + # show the plot if there is data if (lon.size > 0) and (lat.size > 0) and (lon.size == lat.size) : diff --git a/pyglance/glance/gui_figuremanager.py b/pyglance/glance/gui_figuremanager.py index 4eb69de..5b18464 100644 --- a/pyglance/glance/gui_figuremanager.py +++ b/pyglance/glance/gui_figuremanager.py @@ -30,7 +30,7 @@ LOG = logging.getLogger(__name__) #temp_dict = {'blue': [(0.0, 0.75, 0.75), (0.11, 0.99955436720142599, 0.99955436720142599), (0.34000000000000002, 0.99810246679316883, 0.99810246679316883), (0.34999999999999998, 0.98545224541429477, 0.98545224541429477), (0.375, 0.94117647058823528, 0.94117647058823528), (0.64000000000000001, 0.51739405439595187, 0.51739405439595187), (0.65000000000000002, 0.5, 0.5), (0.66000000000000003, 0.5, 0.5), (0.89000000000000001, 0.5, 0.5), (0.91000000000000003, 0.5, 0.5), (1.0, 0.5, 0.5)], 'green': [(0.0, 0.5, 0.5), (0.11, 0.5, 0.5), (0.125, 0.50098039215686274, 0.50098039215686274), (0.34000000000000002, 0.93235294117647061, 0.93235294117647061), (0.34999999999999998, 0.94803921568627447, 0.94803921568627447), (0.375, 1.0, 1.0), (0.64000000000000001, 1.0, 1.0), (0.65000000000000002, 0.97966594045025435, 0.97966594045025435), (0.66000000000000003, 0.96514161220043593, 0.96514161220043593), (0.89000000000000001, 0.53667392883079168, 0.53667392883079168), (0.91000000000000003, 0.50036310820624552, 0.50036310820624552), (1.0, 0.5, 0.5)], 'red': [(0.0, 0.5, 0.5), (0.11, 0.5, 0.5), (0.125, 0.5, 0.5), (0.34000000000000002, 0.5, 0.5), (0.34999999999999998, 0.5, 0.5), (0.375, 0.54269449715370022, 0.54269449715370022), (0.64000000000000001, 0.96647691334598351, 0.96647691334598351), (0.65000000000000002, 0.98545224541429466, 0.98545224541429466), (0.66000000000000003, 0.99810246679316883, 0.99810246679316883), (0.89000000000000001, 0.99955436720142621, 0.99955436720142621), (0.91000000000000003, 0.9549910873440286, 0.9549910873440286), (1.0, 0.75, 0.75)]} temp_dict = {'blue': [(0.0, 0.58333333333333326, 0.58333333333333326), (0.11, 0.91607248960190135, 0.91607248960190135), (0.125, 0.91666666666666663, 0.91666666666666663), (0.34000000000000002, 0.91413662239089188, 0.91413662239089188), (0.34999999999999998, 0.89726966055239299, 0.89726966055239299), (0.375, 0.83823529411764708, 0.83823529411764708), (0.64000000000000001, 0.27319207252793593, 0.27319207252793593), (0.65000000000000002, 0.25, 0.25), (0.66000000000000003, 0.25, 0.25), (0.89000000000000001, 0.25, 0.25), (0.91000000000000003, 0.25, 0.25), (1.0, 0.25, 0.25)], 'green': [(0.0, 0.25, 0.25), (0.11, 0.25, 0.25), (0.125, 0.25130718954248366, 0.25130718954248366), (0.34000000000000002, 0.82647058823529418, 0.82647058823529418), (0.34999999999999998, 0.84738562091503267, 0.84738562091503267), (0.375, 0.91666666666666663, 0.91666666666666663), (0.64000000000000001, 0.91666666666666663, 0.91666666666666663), (0.65000000000000002, 0.88955458726700576, 0.88955458726700576), (0.66000000000000003, 0.87018881626724787, 0.87018881626724787), (0.89000000000000001, 0.29889857177438889, 0.29889857177438889), (0.91000000000000003, 0.25048414427499405, 0.25048414427499405), (1.0, 0.25, 0.25)], 'red': [(0.0, 0.25, 0.25), (0.11, 0.25, 0.25), (0.125, 0.25, 0.25), (0.34000000000000002, 0.25, 0.25), (0.34999999999999998, 0.25, 0.25), (0.375, 0.30692599620493355, 0.30692599620493355), (0.64000000000000001, 0.87196921779464465, 0.87196921779464465), (0.65000000000000002, 0.89726966055239288, 0.89726966055239288), (0.66000000000000003, 0.91413662239089177, 0.91413662239089177), (0.89000000000000001, 0.91607248960190157, 0.91607248960190157), (0.91000000000000003, 0.85665478312537158, 0.85665478312537158), (1.0, 0.58333333333333326, 0.58333333333333326)]} -DESAT_MAP = matplotlib.colors.LinearSegmentedColormap('colormap', temp_dict, 1024) +DESAT_MAP = colors.LinearSegmentedColormap('colormap', temp_dict, 1024) # colormaps that are available in the GUI temp_spectral = cm.spectral if hasattr(cm, 'spectral') else cm.Spectral # newer matplotlib changed the name of this color map diff --git a/pyglance/glance/gui_model.py b/pyglance/glance/gui_model.py index 5ef1c09..922061d 100644 --- a/pyglance/glance/gui_model.py +++ b/pyglance/glance/gui_model.py @@ -221,9 +221,9 @@ class GlanceGUIModel (object) : # get the list of variables, and pick one variableList = sorted(newFile.file_object()) # gets a list of all the variables in the file other_file_var_name = None - if ((filePrefix == A_CONST) & (self.fileData[B_CONST].ALL_VARIABLES is not None)): + if (filePrefix == A_CONST) & (self.fileData[B_CONST].ALL_VARIABLES is not None): other_file_var_name = self.fileData[B_CONST].variable - if ((filePrefix == B_CONST) & (self.fileData[A_CONST].ALL_VARIABLES is not None)): + if (filePrefix == B_CONST) & (self.fileData[A_CONST].ALL_VARIABLES is not None): other_file_var_name = self.fileData[A_CONST].variable tempVariable = self._pick_variable_to_load_on_file_load(variableList, other_file_var_name,) LOG.debug ("selected variable: " + str(tempVariable)) @@ -354,9 +354,9 @@ class GlanceGUIModel (object) : dataListener.updateEpsilon(self.epsilon) dataListener.updateEpsilonPercent(self.epsilonPercent) dataListener.updateLLEpsilon(self.llEpsilon) - dataListener.updateImageTypes(self.imageType, list=IMAGE_TYPES) - dataListener.updateColormaps(self.colormap, list=COLORMAP_NAMES) - dataListener.updateDataForms(self.dataForm, list=DATA_FORMS) + dataListener.updateImageTypes(self.imageType, typesList=IMAGE_TYPES) + dataListener.updateColormaps(self.colormap, mapsList=COLORMAP_NAMES) + dataListener.updateDataForms(self.dataForm, formsList=DATA_FORMS) dataListener.updateUseSharedRange(self.useSharedRange) dataListener.updatePlotGeoTiffAsRGB(self.plotGeoTiffAsRGB) @@ -405,7 +405,7 @@ class GlanceGUIModel (object) : previous_variable = self.fileData[file_prefix].variable if ( (file_prefix == A_CONST) & (self.fileData[B_CONST].variable == previous_variable) & (self.fileData[B_CONST].ALL_VARIABLES is not None) ) : - if (newVariableText in self.fileData[B_CONST].ALL_VARIABLES) : + if newVariableText in self.fileData[B_CONST].ALL_VARIABLES : newBVar = newVariableText LOG.debug("Setting file " + file_prefix + " variable selection to: " + newVariableText) @@ -786,7 +786,7 @@ class GlanceGUIModel (object) : """ isGeoTiff = False - if ( self.fileData[filePrefix].file is not None ) : + if self.fileData[filePrefix].file is not None : extension_temp = path.splitext(self.fileData[filePrefix].file.path)[-1] isGeoTiff = (extension_temp == '.tiff') or (extension_temp == '.tif') or (extension_temp == '.tifa') diff --git a/pyglance/glance/gui_view.py b/pyglance/glance/gui_view.py index 2086b69..4df2802 100644 --- a/pyglance/glance/gui_view.py +++ b/pyglance/glance/gui_view.py @@ -7,11 +7,11 @@ Created by evas Oct 2011. Copyright (c) 2011 University of Wisconsin SSEC. All rights reserved. """ -import sys, os.path, logging +import os.path, logging import numpy from PyQt5.QtWidgets import QWidget, QTabWidget, QGridLayout, QLabel, QLineEdit, \ - QComboBox, QPushButton, QSizePolicy, QHeaderView, \ + QComboBox, QPushButton, QHeaderView, \ QCheckBox, QTableWidget, QFileDialog, QMessageBox, \ QTextEdit, QTableView from PyQt5.QtGui import QDoubleValidator, QValidator @@ -66,9 +66,9 @@ class _DoubleOrNoneValidator (QDoubleValidator) : """ if (value == "") or (value is None) or (value == "None") : - return (QValidator.Acceptable, value, pos) + return tuple([QValidator.Acceptable, value, pos]) if (value == "N") or (value == "No") or (value == "Non") : - return (QValidator.Intermediate, value, pos) + return tuple([QValidator.Intermediate, value, pos]) return super(self.__class__, self).validate(value, pos) @@ -82,7 +82,7 @@ class _DoubleOrNoneValidator (QDoubleValidator) : if (value == "N") or (value == "No") or (value == "Non") : value = "None" ok = True - if (value == "") or (value == None) : + if (value == "") or (value is None) : value = "" ok = True @@ -951,7 +951,7 @@ class GlanceGUIView (QWidget) : newData.data = numpy.array([variableDataObject.data.item()]) variableDataObject = newData - if len(variableDataObject.data.shape) > 0 and len(variableDataObject.data.shape) <= 2 : + if 0 < len(variableDataObject.data.shape) <= 2 : tempID = self.infoWindowsCounter self.infoWindowsCounter += 1 @@ -1059,46 +1059,46 @@ class GlanceGUIView (QWidget) : self.llepsilonWidget.setText(str(newLonLatEpsilon)) - def updateImageTypes (self, imageType, list=None) : + def updateImageTypes (self, imageType, typesList=None) : """ update the image type that's selected, if the list is given, clear and reset the list of possible image types """ # replace the list if needed - if list is not None : + if typesList is not None : self.imageSelectionDropDown.clear() - self.imageSelectionDropDown.addItems(list) + self.imageSelectionDropDown.addItems(typesList) # change the currently selected image type tempPosition = self.imageSelectionDropDown.findText(imageType) self.imageSelectionDropDown.setCurrentIndex(tempPosition) - def updateColormaps(self, colormap, list=None) : + def updateColormaps(self, colormap, mapsList=None) : """ update the colormap that's selected, if the list is given, clear and reset the list of possible colormaps """ # replace the list if needed - if list is not None : + if mapsList is not None : self.colormapDropDown.clear() - self.colormapDropDown.addItems(list) + self.colormapDropDown.addItems(mapsList) #change the currently selected colormap tempPosition = self.colormapDropDown.findText(colormap) self.colormapDropDown.setCurrentIndex(tempPosition) - def updateDataForms(self, dataForm, list=None) : + def updateDataForms(self, dataForm, formsList=None) : """ update the data form that's selected, if the list is given, clear and reset the list of possible data forms """ # replace the list if needed - if list is not None : + if formsList is not None : self.dataDisplayFormDropDown.clear() - self.dataDisplayFormDropDown.addItems(list) + self.dataDisplayFormDropDown.addItems(formsList) # change the currently selected data form tempPosition = self.dataDisplayFormDropDown.findText(dataForm) diff --git a/pyglance/glance/io.py b/pyglance/glance/io.py index 3af9b43..7dff7a3 100644 --- a/pyglance/glance/io.py +++ b/pyglance/glance/io.py @@ -220,7 +220,7 @@ def _get_data_uptype (input_dtype) : input_info = numpy.finfo(input_dtype) if numpy.issubdtype(input_dtype, numpy.floating,) else numpy.iinfo(input_dtype) # if our input won't fit into the default, pick a bigger type - if ( (default_finfo.min > input_info.min) or (default_finfo.max < input_info.max) ) : + if (default_finfo.min > input_info.min) or (default_finfo.max < input_info.max) : LOG.debug("Input data will not fit in default float32 data type, using larger type.") default_uptype = numpy.float64 @@ -249,7 +249,9 @@ class hdf (object): self.attributeCache = CaseInsensitiveAttributeCache(self) def __call__(self): - "yield names of variables to be compared" + """ + yield names of variables to be compared + """ return list(self._hdf.datasets()) # this returns a numpy array with a copy of the full, scaled @@ -295,7 +297,7 @@ class hdf (object): INTEGER(kind=int1) :: LOG_SCALE ! 2 INTEGER(kind=int1) :: SQRT_SCALE ! 3 """ - if (scaling_method == 0) : + if scaling_method == 0 : return raw_data_copy if not ((scaling_method is None) or (int(scaling_method) <= 1)) : LOG.warning ('Scaling method of \"' + str(scaling_method) + '\" will be ignored in favor of hdf standard method. ' @@ -334,7 +336,7 @@ class hdf (object): raise IOUnimplimentedError('Unable to create variable in hdf file, this functionality is not yet available.') - return None + #return None def add_attribute_data_to_variable(self, variableName, newAttributeName, newAttributeValue) : """ @@ -344,14 +346,14 @@ class hdf (object): raise IOUnimplimentedError('Unable add attribute to hdf file, this functionality is not yet available.') - return + #return def get_variable_attributes (self, variableName, caseInsensitive=True) : """ returns all the attributes associated with a variable name """ - toReturn = None + #toReturn = None if caseInsensitive : toReturn = self.attributeCache.get_variable_attributes(variableName) else : @@ -380,7 +382,7 @@ class hdf (object): get a list of all the global attributes for this file or None """ - toReturn = None + #toReturn = None if caseInsensitive : toReturn = self.attributeCache.get_global_attributes() @@ -502,7 +504,7 @@ class nc (object): #***** just do the darn unsigned handling ourselves, ugh # if our data is labeled as being unsigned by the appropriately set attribute - if UNSIGNED_ATTR_STR in temp and str(temp[UNSIGNED_ATTR_STR]).lower() == ("true"): + if UNSIGNED_ATTR_STR in temp and str(temp[UNSIGNED_ATTR_STR]).lower() == "true": LOG.debug("Correcting for unsigned values in variable data.") where_temp = (scaled_data_copy < 0.0) & ~missing_mask # where we have negative but not missing data scaled_data_copy[where_temp] += (numpy.iinfo(numpy.uint16).max + 1.0) # add the 2's complement @@ -607,7 +609,7 @@ class nc (object): return None # TODO, the type managment here is going to cause problems with larger floats, review this - dataType = None + #dataType = None if numpy.issubdtype(data.dtype, int) : dataType = numpy.int #print("Picked INT") @@ -685,7 +687,7 @@ class nc (object): returns all the attributes associated with a variable name """ - toReturn = None + #toReturn = None if caseInsensitive : toReturn = self.attributeCache.get_variable_attributes(variableName) @@ -719,7 +721,7 @@ class nc (object): get a list of all the global attributes for this file or None """ - toReturn = None + #toReturn = None if caseInsensitive : toReturn = self.attributeCache.get_global_attributes() @@ -796,7 +798,7 @@ class h5(object): LOG.debug('variables from visiting h5 file structure: ' + str(variableList)) - return(variableList) + return variableList @staticmethod def trav(h5,pth): @@ -877,7 +879,7 @@ class h5(object): raise IOUnimplimentedError('Unable to create variable in hdf 5 file, this functionality is not yet available.') - return None + #return None def add_attribute_data_to_variable(self, variableName, newAttributeName, newAttributeValue) : """ @@ -887,14 +889,14 @@ class h5(object): raise IOUnimplimentedError('Unable to add attribute to hdf 5 file, this functionality is not yet available.') - return + #return def get_variable_attributes (self, variableName, caseInsensitive=True) : """ returns all the attributes associated with a variable name """ - toReturn = None + #toReturn = None if caseInsensitive : toReturn = self.attributeCache.get_variable_attributes(variableName) @@ -914,7 +916,7 @@ class h5(object): else : temp_attrs = self.get_variable_attributes(variableName, caseInsensitive=False) - if (attributeName in temp_attrs) : + if attributeName in temp_attrs : toReturn = temp_attrs[attributeName] return toReturn @@ -924,7 +926,7 @@ class h5(object): get a list of all the global attributes for this file or None """ - toReturn = None + #toReturn = None if caseInsensitive : toReturn = self.attributeCache.get_global_attributes() @@ -1030,7 +1032,7 @@ class aeri(object): raise IOUnimplimentedError('Unable to create variable in aeri file, this functionality is not yet available.') - return None + #return None def add_attribute_data_to_variable(self, variableName, newAttributeName, newAttributeValue) : """ @@ -1040,7 +1042,7 @@ class aeri(object): raise IOUnimplimentedError('Unable to add attribute to aeri file, this functionality is not yet available.') - return + #return def get_variable_attributes (self, variableName, caseInsensitive=True) : """ @@ -1160,7 +1162,7 @@ class tiff (object): def _get_generic_band_name (self, number) : """get a generic band name for this number""" - return ("band at index " + str(number)) + return "band at index " + str(number) def _get_band_index_from_name (self, name) : """get an index for the band from a name @@ -1193,7 +1195,9 @@ class tiff (object): self.revIndex = self.REV_INFO[self._tiff.RasterCount] if self._tiff.RasterCount in self.REV_INFO else { } def __call__(self): - "yield names of variables to be compared" + """ + yield names of variables to be compared + """ # GeoTIFF files don't actually have named variables, so get something appropriate based on the numbering of bands num_bands = self._tiff.RasterCount @@ -1379,7 +1383,7 @@ class jpss_adl(object): raise IOUnimplimentedError('Unable to create variable in JPSS ADL file, this functionality is not yet available.') - return None + #return None def add_attribute_data_to_variable(self, variableName, newAttributeName, newAttributeValue) : """ @@ -1389,7 +1393,7 @@ class jpss_adl(object): raise IOUnimplimentedError('Unable to add attribute to JPSS ADL file, this functionality is not yet available.') - return + #return def get_variable_attributes (self, variableName, caseInsensitive=True) : """ diff --git a/pyglance/glance/lonlat_util.py b/pyglance/glance/lonlat_util.py index 8faa22d..f296048 100644 --- a/pyglance/glance/lonlat_util.py +++ b/pyglance/glance/lonlat_util.py @@ -31,10 +31,10 @@ def check_lon_lat_equality(longitudeADataObject, latitudeADataObject, If the latitude or longitude cannot be compared, this may raise a VariableComparisonError. """ # first of all, if the latitude and longitude are not the same shape, then things can't ever be "equal" - if (longitudeADataObject.data.shape != longitudeBDataObject.data.shape) : + if longitudeADataObject.data.shape != longitudeBDataObject.data.shape : raise VariableComparisonError ("Unable to compare longitude variables due to different sizes (" + str(longitudeADataObject.data.shape) + ") and (" + str(longitudeBDataObject.data.shape) +").") - if (latitudeADataObject.data.shape != latitudeBDataObject.data.shape) : + if latitudeADataObject.data.shape != latitudeBDataObject.data.shape : raise VariableComparisonError ("Unable to compare latitude variables due to different sizes (" + str(latitudeADataObject.data.shape) + ") and (" + str(latitudeBDataObject.data.shape) +").") @@ -48,12 +48,12 @@ def check_lon_lat_equality(longitudeADataObject, latitudeADataObject, lon_lat_not_equal_points_percent = (float(lon_lat_not_equal_points_count) / float(lon_lat_not_equal_mask.size)) * 100.0 # if we have unequal points, create user legible info about the problem - if (lon_lat_not_equal_points_count > 0) : + if lon_lat_not_equal_points_count > 0 : LOG.warning("Possible mismatch in values stored in file a and file b longitude and latitude values." + " Depending on the degree of mismatch, some data value comparisons may be " + "distorted or spatially nonsensical.") # if we are making images, make two showing the invalid lons/lats - if (doMakeImages) : + if doMakeImages : if ((len(longitudeADataObject.data[~longitudeADataObject.masks.ignore_mask]) > 0) and (len( latitudeADataObject.data[~ latitudeADataObject.masks.ignore_mask]) > 0)) : @@ -123,7 +123,7 @@ def compare_spatial_invalidity(longitude_a_object, longitude_b_object, latitude_common [valid_only_in_mask_b] = latitude_b_object.data[valid_only_in_mask_b] # plot the points that are only valid one file and not the other - if ((spatial_info[A_FILE_TITLE_KEY][NUMBER_INVALID_PTS_KEY] > 0) and (do_include_images) and + if ((spatial_info[A_FILE_TITLE_KEY][NUMBER_INVALID_PTS_KEY] > 0) and do_include_images and (len(longitude_a_object.data[~invalid_in_a_mask]) > 0) and (len( latitude_a_object.data[~invalid_in_a_mask]) > 0)) : plot.plot_and_save_spacial_mismatch(longitude_a_object, latitude_a_object, @@ -132,7 +132,7 @@ def compare_spatial_invalidity(longitude_a_object, longitude_b_object, "SpatialMismatch", output_path, fullDPI=fullDPI, thumbDPI=thumbDPI, units="degrees") - if ((spatial_info[B_FILE_TITLE_KEY][NUMBER_INVALID_PTS_KEY] > 0) and (do_include_images) and + if ((spatial_info[B_FILE_TITLE_KEY][NUMBER_INVALID_PTS_KEY] > 0) and do_include_images and (len(longitude_b_object.data[~invalid_in_b_mask]) > 0) and (len( latitude_b_object.data[~invalid_in_b_mask]) > 0) ) : diff --git a/pyglance/glance/plot.py b/pyglance/glance/plot.py index 77aae1c..b7566bf 100644 --- a/pyglance/glance/plot.py +++ b/pyglance/glance/plot.py @@ -167,7 +167,7 @@ def plot_and_save_comparison_figures (aData, bData, doFork=False, shouldClearMemoryWithThreads=False, shouldUseSharedRangeForOriginal=False, - doPlotSettingsDict={ }, + doPlotSettingsDict=None, aUData=None, aVData=None, bUData=None, bVData=None, binIndex=None, tupleIndex=None, @@ -242,7 +242,9 @@ def plot_and_save_comparison_figures (aData, bData, ** May fail due to a known bug on MacOSX systems. """ - + + doPlotSettingsDict = { } if doPlotSettingsDict is None else doPlotSettingsDict + # lists to hold information on the images we make original_images = [ ] compared_images = [ ] @@ -340,7 +342,7 @@ def plot_and_save_comparison_figures (aData, bData, # now we need to wait for all of our child processes to terminate before returning - if (isParent) : # just in case + if isParent : # just in case if len(childPids) > 0 : LOG.info ("waiting for completion of " + variableDisplayName + " images...") for pid in childPids: diff --git a/pyglance/glance/report.py b/pyglance/glance/report.py index 25eea66..47487f2 100644 --- a/pyglance/glance/report.py +++ b/pyglance/glance/report.py @@ -7,12 +7,11 @@ Created by rayg Apr 2009. Copyright (c) 2009 University of Wisconsin SSEC. All rights reserved. """ -import sys, logging, os +import logging, os from pkg_resources import resource_string, resource_filename #, resource_stream from mako.template import Template from mako.lookup import TemplateLookup -import types as types import numpy as np import shutil as shutil import locale @@ -67,7 +66,7 @@ def _make_and_save_page (fullFilePath, templateFileNameToUse, **kwargs) : def make_formatted_display_string(displayData, customDisplayFormat=None) : """given a piece of data return a display string """ - displayString = '' + #displayString = '' formatStr = customDisplayFormat # check to see if there is a format string to use @@ -84,9 +83,9 @@ def generate_and_save_summary_report(files, outputPath, reportFileName, runInfo, variables, - spatial={}, - varNames={}, - globalAttrs={},) : + spatial=None, + varNames=None, + globalAttrs=None,) : """ given two files, and information about them, save a summary of their comparison The summary report, in html format will be saved to the given outputPath/outputFile @@ -172,7 +171,9 @@ def generate_and_save_summary_report(files, """ # pack up all the data needed to build the summary report - + spatial = { } if spatial is None else spatial + varNames = { } if varNames is None else varNames + globalAttrs = { } if globalAttrs is None else globalAttrs varNamesToUse = { VAR_NAMES_UNIQUE_TO_A_KEY: [ ], @@ -194,7 +195,7 @@ def generate_and_save_summary_report(files, _make_and_save_page((outputPath + "/" + reportFileName), MAIN_REPORT_TEMPLATE, **kwargs) # copy the original configuration file, TODO should I move this to a list input in the parameters? - if (CONFIG_FILE_PATH_KEY in runInfo) : + if CONFIG_FILE_PATH_KEY in runInfo : originalConfigFile = runInfo[CONFIG_FILE_PATH_KEY] shutil.copy(originalConfigFile, outputPath) @@ -538,9 +539,9 @@ def generate_and_save_inspection_summary_report(files, outputPath, reportFileName, runInfo, variables, - spatial={}, - varNames={}, - globalAttrs={},) : + spatial=None, + varNames=None, + globalAttrs=None,) : """ given a file, and information about it, save a summary report about the file The summary report, in html format will be saved to the given outputPath/outputFile @@ -598,7 +599,10 @@ def generate_and_save_inspection_summary_report(files, """ # pack up all the data needed to build the summary report - + spatial = { } if spatial is None else spatial + varNames = { } if varNames is None else varNames + globalAttrs = { } if globalAttrs is None else globalAttrs + # TODO, more automated defaults varNameDefaults = { POSSIBLE_NAMES_KEY: [ ],} varNamesToUse = varNameDefaults @@ -617,7 +621,7 @@ def generate_and_save_inspection_summary_report(files, _make_and_save_page((outputPath + "/" + reportFileName), INSPECT_MAIN_REPORT_TEMPLATE, **kwargs) # copy the original configuration file, TODO should I move this to a list input in the parameters? - if (CONFIG_FILE_PATH_KEY in runInfo) : + if CONFIG_FILE_PATH_KEY in runInfo : originalConfigFile = runInfo[CONFIG_FILE_PATH_KEY] shutil.copy(originalConfigFile, outputPath) diff --git a/pyglance/glance/stats.py b/pyglance/glance/stats.py index 2879f75..df94b47 100644 --- a/pyglance/glance/stats.py +++ b/pyglance/glance/stats.py @@ -173,7 +173,7 @@ class MissingValueStatistics (StatisticalData) : get a dictionary form of the statistics """ - toReturn = { } + #toReturn = { } # if we only have stats for one data set if self.is_one_data_set : @@ -328,7 +328,7 @@ class FiniteDataStatistics (StatisticalData) : get a dictionary form of the statistics """ - toReturn = { } + #toReturn = { } # if we only have stats for one data set if self.is_one_data_set : @@ -467,7 +467,7 @@ class NotANumberStatistics (StatisticalData) : get a dictionary form of the statistics """ - toReturn = { } + #toReturn = { } # if we only have stats for one data set if self.is_one_data_set : @@ -686,7 +686,7 @@ class GeneralStatistics (StatisticalData) : get a dictionary form of the statistics """ - toReturn = { } + #toReturn = { } # if we only have stats for one data set if self.is_one_data_set : diff --git a/pyglance/glance/util.py b/pyglance/glance/util.py index 065c0d2..46fc5a5 100644 --- a/pyglance/glance/util.py +++ b/pyglance/glance/util.py @@ -36,11 +36,11 @@ def clean_path(string_path) : """ Return a clean form of the path without any '.', '..', or '~' """ - clean_path = None + clean_path_str = None if string_path is not None : - clean_path = os.path.abspath(os.path.expanduser(string_path)) + clean_path_str = os.path.abspath(os.path.expanduser(string_path)) - return clean_path + return clean_path_str def setup_dir_if_needed(dirPath, descriptionName) : """ diff --git a/pyglance/setup.py b/pyglance/setup.py index 8c01963..b63665f 100644 --- a/pyglance/setup.py +++ b/pyglance/setup.py @@ -19,13 +19,13 @@ easy_install -U -vi http://larch.ssec.wisc.edu/eggs/repos uwglance """ # changed to support egg distribution -from setuptools import setup, find_packages +from setuptools import setup setup( name="uwglance", version="0.5.5", zip_safe = False, entry_points = { 'console_scripts': [ 'glance = glance.compare:main' ] }, - packages = ['glance'], #find_packages('.'), + packages = ['glance'], install_requires=[ 'numpy', 'matplotlib', 'cartopy', 'scipy', 'mako', 'pillow', ], package_data = {'': ['*.txt', '*.gif']} ) -- GitLab