def setUp(self):
        if Configuration.DEBUG == True: print(".....HotSpotsByAreaTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.incidentToolboxPath + Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()
        
        DataDownload.runDataDownload(Configuration.incidentAnalysisDataPath, Configuration.incidentInputGDB, Configuration.incidentURL)
        if (self.incidentScratchGDB == None) or (not arcpy.Exists(self.incidentScratchGDB)):
            self.incidentScratchGDB = UnitTestUtilities.createScratch(Configuration.incidentAnalysisDataPath)
        
        self.inputAOIFeatures = os.path.join(Configuration.incidentInputGDB, "Districts")
        self.inputIncidents = os.path.join(Configuration.incidentInputGDB, "Incidents")

        UnitTestUtilities.checkFilePaths([Configuration.incidentAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.incidentInputGDB, \
                                           self.incidentScratchGDB, \
                                           self.toolboxUnderTest, \
                                           self.inputAOIFeatures, \
                                           self.inputIncidents])
示例#2
0
    def setUp(self):
        if Configuration.DEBUG == True:
            print("         DistanceToAssetsTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''
        self.toolboxUnderTest = Configuration.distancetoAssetsToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()
        DataDownload.runDataDownload(Configuration.distanceToAssetsDataPath, \
           Configuration.distanceToAssetsInputGDB, Configuration.distanceToAssetsURL)

        self.inputAssets = os.path.join(Configuration.distanceToAssetsInputGDB,
                                        "AssetsGeocoded")
        self.inputBases = os.path.join(Configuration.distanceToAssetsInputGDB,
                                       "BasesGeocoded")

        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(
                Configuration.distanceToAssetsDataPath)

        self.suffix = Configuration.GetToolboxSuffix()
        UnitTestUtilities.checkFilePaths(
            [Configuration.distanceToAssetsDataPath])

        UnitTestUtilities.checkGeoObjects([
            Configuration.distanceToAssetsInputGDB, self.toolboxUnderTest,
            self.scratchGDB, self.inputAssets, self.inputBases
        ])
    def setUp(self):
        if Configuration.DEBUG == True:
            print(".....HotSpotsByAreaTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.incidentToolboxPath + Configuration.GetToolboxSuffix(
        )

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.incidentAnalysisDataPath,
                                     Configuration.incidentInputGDB,
                                     Configuration.incidentURL)
        if (self.incidentScratchGDB
                == None) or (not arcpy.Exists(self.incidentScratchGDB)):
            self.incidentScratchGDB = UnitTestUtilities.createScratch(
                Configuration.incidentAnalysisDataPath)

        self.inputAOIFeatures = os.path.join(Configuration.incidentInputGDB,
                                             "Districts")
        self.inputIncidents = os.path.join(Configuration.incidentInputGDB,
                                           "Incidents")

        UnitTestUtilities.checkFilePaths(
            [Configuration.incidentAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.incidentInputGDB, \
                                           self.incidentScratchGDB, \
                                           self.toolboxUnderTest, \
                                           self.inputAOIFeatures, \
                                           self.inputIncidents])
    def setUp(self):
        if Configuration.DEBUG == True:
            print(".....FindPercentChangeTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.incidentToolboxPath + Configuration.GetToolboxSuffix(
        )

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.incidentAnalysisDataPath,
                                     Configuration.incidentInputGDB,
                                     Configuration.incidentURL)

        # set up inputs
        self.inputOldIncidents = os.path.join(Configuration.incidentInputGDB,
                                              "Incidents2014")
        self.inputNewIncidents = os.path.join(Configuration.incidentInputGDB,
                                              "Incidents2015")
        self.inputAOIFeatures = os.path.join(Configuration.incidentInputGDB,
                                             "Districts")

        UnitTestUtilities.checkFilePaths(
            [Configuration.incidentAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.incidentInputGDB, \
                                           Configuration.incidentResultGDB, \
                                           self.toolboxUnderTest, \
                                           self.inputOldIncidents, \
                                           self.inputNewIncidents, \
                                           self.inputAOIFeatures])
示例#5
0
def daily_process(date):

    DataDownload.download_data(date)

    DataDownload.make_sum()

    [os.remove(f) for f in glob.glob("../raw_images/*.nc")]
    def setUp(self):
        if Configuration.DEBUG == True: print("         DistanceToAssetsTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''
        self.toolboxUnderTest = Configuration.distancetoAssetsToolboxPath + \
            Configuration.GetToolboxSuffix()

        self.suffix = Configuration.GetToolboxSuffix()
        UnitTestUtilities.checkArcPy()
        DataDownload.runDataDownload(Configuration.distanceToAssetsDataPath, \
           Configuration.distanceToAssetsInputGDB, Configuration.distanceToAssetsURL)

        self.inputLocator = os.path.join(Configuration.distanceToAssetsDataPath, r"DistanceToAssetsTestData\Sample Locations\arcgisonline\World.GeocodeServer")


        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(Configuration.distanceToAssetsDataPath)


        UnitTestUtilities.checkFilePaths([Configuration.distanceToAssetsDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.distanceToAssetsInputGDB, self.toolboxUnderTest, self.scratchGDB, self.inputLocator])
示例#7
0
    def setUp(self):

        if Configuration.DEBUG == True:
            print(".....ClusterAnalysisTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.incidentToolboxPath + Configuration.GetToolboxSuffix(
        )

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.incidentAnalysisDataPath,
                                     Configuration.incidentInputGDB,
                                     Configuration.incidentURL)

        # set up inputs
        self.inputPointsFeatures = os.path.join(Configuration.incidentInputGDB,
                                                "Incidents")

        arcpy.env.OverwriteOutputs = True

        UnitTestUtilities.checkFilePaths(
            [Configuration.incidentAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.incidentInputGDB, \
                                           Configuration.incidentResultGDB, \
                                           self.toolboxUnderTest, \
                                           self.inputPointsFeatures])
    def setUp(self):
        if Configuration.DEBUG == True: print(".....CountIncidentsByLOCTestCase.setUp")  

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.incidentToolboxPath + Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()
        
        DataDownload.runDataDownload(Configuration.incidentAnalysisDataPath, Configuration.incidentInputGDB, Configuration.incidentURL)
        
        # set up inputs    
        self.inputPointsFeatures = os.path.join(Configuration.incidentInputGDB, "Incidents")
        self.inputLinesFeatures = os.path.join(Configuration.incidentInputGDB, "Roads")
        self.inputAOIFeatures = os.path.join(Configuration.incidentInputGDB, "Districts")
        self.resultCompareFeatures0001 = os.path.join(Configuration.incidentResultGDB, "resultsCountIncidentsByLOC_0001")

        UnitTestUtilities.checkFilePaths([Configuration.incidentAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.incidentInputGDB, \
                                           Configuration.incidentResultGDB, \
                                           self.toolboxUnderTest, \
                                           self.inputPointsFeatures, \
                                           self.inputLinesFeatures,  \
                                           self.inputAOIFeatures,  \
                                           self.resultCompareFeatures0001])
    def setUp(self):

        if Configuration.DEBUG == True: print(".....ClusterAnalysisTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.incidentToolboxPath + Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.incidentAnalysisDataPath, Configuration.incidentInputGDB, Configuration.incidentURL)

        # set up inputs
        self.inputPointsFeatures = os.path.join(Configuration.incidentInputGDB, "Incidents")

        arcpy.env.OverwriteOutputs = True

        UnitTestUtilities.checkFilePaths([Configuration.incidentAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.incidentInputGDB, \
                                           Configuration.incidentResultGDB, \
                                           self.toolboxUnderTest, \
                                           self.inputPointsFeatures])
示例#10
0
    def setUp(self):
        if Configuration.DEBUG is True: print("         CreateReferenceSystemGRGFromAreaTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''
        self.toolboxUnderTest = Configuration.grgToolboxPath

        UnitTestUtilities.checkArcPy()
        DataDownload.runDataDownload(Configuration.grgPath,
                                     Configuration.grgInputGDB,
                                     Configuration.grgURL)

        if (self.scratchGDB is None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(Configuration.grgPath)

        # set up inputs
        self.inputArea = os.path.join(Configuration.grgInputGDB, r"inputAO")
        self.inputArea10m = os.path.join(Configuration.grgInputGDB, r"inputAO10m")
        self.ref_grid = "MGRS"
        self.large_grid_handling = "ALLOW_LARGE_GRIDS"
        self.ignore_options = ["IGNORE_M",
                               "IGNORE_Z",
                               "IGNORE_POINTID",
                               "IGNORE_EXTENSION_PROPERTIES",
                               "IGNORE_SUBTYPES",
                               "IGNORE_RELATIONSHIPCLASSES",
                               "IGNORE_REPRESENTATIONCLASSES"]
        UnitTestUtilities.checkFilePaths([Configuration.grgPath])
        UnitTestUtilities.checkGeoObjects([Configuration.grgInputGDB,
                                           self.toolboxUnderTest,
                                           self.scratchGDB,
                                           self.inputArea])
    def setUp(self):
        if Configuration.DEBUG == True:
            print("         AppendMilitaryFeaturesTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.militaryFeaturesToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.militaryFeaturesDataPath, \
           Configuration.militaryFeaturesInputGDB, Configuration.militaryFeaturesURL)

        self.inputPointsFC = os.path.join(Configuration.militaryFeaturesInputGDBNonMilitaryFeatures, \
            r"FriendlyForces")

        UnitTestUtilities.checkFilePaths(
            [Configuration.militaryFeaturesDataPath])

        UnitTestUtilities.checkGeoObjects([self.toolboxUnderTest, \
            self.inputPointsFC,
            Configuration.militaryFeaturesInputGDBNonMilitaryFeatures,
            Configuration.militaryFeaturesBlankMilFeaturesGDB])
    def setUp(self):
        if Configuration.DEBUG == True: print("         DistanceToAssetsTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''
        self.toolboxUnderTest = Configuration.distancetoAssetsToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()
        DataDownload.runDataDownload(Configuration.distanceToAssetsDataPath, \
           Configuration.distanceToAssetsInputGDB, Configuration.distanceToAssetsURL)

        self.suffix = Configuration.GetToolboxSuffix()

        #self.inputND = os.path.join(Configuration.distanceToAssetsInputNDGDB, "Transportation/Streets_ND")
        self.inputND=r"\\redarchive2\disl\Development\Commercial\TestData\DistanceToAssets\SanFrancisco.gdb\Transportation\Streets_ND"
        self.inputAssetsPro = os.path.join(Configuration.distanceToAssetsInputGDB, "AssetsGeocoded_pro_SF")
        self.inputAssets = os.path.join(Configuration.distanceToAssetsInputGDB, "AssetsGeocoded_SF")
        self.inputBasesPro = os.path.join(Configuration.distanceToAssetsInputGDB, "BasesGeocoded_pro_SF")
        self.inputBases = os.path.join(Configuration.distanceToAssetsInputGDB, "BasesGeocoded_SF")

        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(Configuration.distanceToAssetsDataPath)


        UnitTestUtilities.checkFilePaths([Configuration.distanceToAssetsDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.distanceToAssetsInputGDB, self.toolboxUnderTest, self.scratchGDB, self.inputAssets, self.inputBases, self.inputND])
    def setUp(self):
        if Configuration.DEBUG == True:
            print("         GeoNamesTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.geonamesToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.geonamesDataPath, \
           Configuration.geonamesInputGDB, Configuration.geonamesURL)

        self.templateFeatureClass = os.path.join(
            Configuration.geonamesInputGDB, "GeonamesTemplate")
        self.loadResultsFeatureClass = os.path.join(
            Configuration.geonamesInputGDB, "MonacoResults")

        UnitTestUtilities.checkFilePaths([Configuration.geonamesDataPath])

        UnitTestUtilities.checkGeoObjects([self.toolboxUnderTest, \
            Configuration.geonamesInputGDB, self.loadResultsFeatureClass, \
            self.templateFeatureClass])
示例#14
0
    def setUp(self):
        if Configuration.DEBUG == True:
            print("         ClearingOperationsCreateGRGFromAreaTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''
        self.toolboxUnderTest = Configuration.clearingOperationsToolboxPath

        UnitTestUtilities.checkArcPy()
        DataDownload.runDataDownload(Configuration.clearingOperationsPath, \
           Configuration.clearingOperationsInputGDB, Configuration.clearingOperationsURL)

        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(
                Configuration.clearingOperationsPath)

        # set up inputs
        self.inputArea = os.path.join(Configuration.clearingOperationsInputGDB,
                                      r"AO")

        UnitTestUtilities.checkFilePaths(
            [Configuration.clearingOperationsPath])

        UnitTestUtilities.checkGeoObjects([
            Configuration.clearingOperationsInputGDB, self.toolboxUnderTest,
            self.scratchGDB, self.inputArea
        ])
    def setUp(self):
        if Configuration.DEBUG == True: print("         SunPositionAndHillshadeTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.sunPositionAnalysisToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.sunPositionAnalysisDataPath, \
           Configuration.sunPositionInputGDB, Configuration.sunPositionAnalysisURL)

        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(Configuration.sunPositionAnalysisDataPath)

        # set up inputs
        self.inputArea = os.path.join(Configuration.sunPositionInputGDB, r"inputArea")
        self.inputSurface = os.path.join(Configuration.sunPositionInputGDB, r"Jbad_SRTM_USGS_EROS")
        self.compareResults = os.path.join(Configuration.sunPositionInputGDB, r"compareResults_2017_8_10_16_30_00")

        UnitTestUtilities.checkFilePaths([Configuration.sunPositionAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.sunPositionInputGDB, \
            self.toolboxUnderTest, self.scratchGDB, \
            self.inputArea, self.inputSurface, \
            self.compareResults])
    def setUp(self):
        if Configuration.DEBUG == True:
            print("         WriteMilitaryFeatureFromMessageTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.militaryFeaturesToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.militaryFeaturesDataPath, \
           Configuration.militaryFeaturesInputGDB, Configuration.militaryFeaturesURL)

        outputWorkspace = os.path.join(Configuration.militaryFeaturesGeodatabasesPath, \
            "test_outputs.gdb")
        self.outputPointsFC = os.path.normpath(os.path.join(outputWorkspace, \
                                          r"FriendlyOperations/FriendlyEquipment"))

        UnitTestUtilities.checkFilePaths([Configuration.militaryFeaturesDataPath, \
                                          Configuration.militaryFeaturesMessagesPath])

        UnitTestUtilities.checkGeoObjects([self.toolboxUnderTest, \
                                           self.outputPointsFC])
示例#17
0
    def setUp(self):
        ''' set-up code '''
        if Configuration.DEBUG == True: print(".....HLZTouchdownPoints.setUp")
        UnitTestUtilities.checkArcPy()

        # Setup the test specific paths
        self.tbxProFolderPath = os.path.join(
            Configuration.repoPath, "capability", "toolboxes",
            "Helicopter Landing Zone Tools.tbx")
        self.tbxDesktopFolderPath = os.path.join(
            Configuration.repoPath, "capability", "toolboxes",
            "Helicopter Landing Zone Tools_10.4.tbx")
        self.dataDownloadURL = r"http://www.arcgis.com/sharing/content/items/eb5685e1af5d4c16b49fc8870ced036c/data"
        self.testDataFolderPath = DataDownload.createDataFolder(
            Configuration.capabilityPath)

        # Check the paths exist
        print("Created Capability test data folder.")
        UnitTestUtilities.checkFilePaths([
            self.testDataFolderPath, self.tbxProFolderPath,
            self.tbxDesktopFolderPath
        ])
        # set the geodatabase
        self.testDataGeodatabase = os.path.join(self.testDataFolderPath,
                                                r"test_hlz_tools.gdb")

        # Download the test data from arcgis.com
        self.testDataFolderPath = DataDownload.runDataDownload(
            Configuration.capabilityPath,
            os.path.basename(self.testDataGeodatabase), self.dataDownloadURL)

        # Check the test inputs (do they exist? or not?)
        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(
                self.testDataFolderPath)

        # Setup the test inputs
        self.inputAirframeTable = os.path.join(self.testDataGeodatabase,
                                               r"Aircraft_Specifications")
        self.inputSuitableAreas = os.path.join(self.testDataGeodatabase,
                                               r"HLZSelectionArea")
        self.inputSlope = os.path.join(self.testDataGeodatabase,
                                       r"SRTMPctSlope")
        self.outputGeodatabase = os.path.join(self.scratchGDB)
        self.outputCenterpoints = os.path.join(self.outputGeodatabase,
                                               r"centerPoints")
        self.outputCircles = os.path.join(self.outputGeodatabase, r"tdCircles")

        UnitTestUtilities.checkGeoObjects([
            self.testDataGeodatabase, self.outputGeodatabase,
            self.inputAirframeTable, self.inputSuitableAreas, self.inputSlope
        ])
        return
    def setUp(self):
        if Configuration.DEBUG == True:
            print("         SunPositionAndHillshadeTestCase.setUp")
        UnitTestUtilities.checkArcPy()

        name = "test_sun_position.gdb"
        self.sunPosDataPath = DataDownload.runDataDownload(
            Configuration.visibilityPaths, name, self.sunPosUrl)
        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(
                self.sunPosDataPath)

        UnitTestUtilities.checkFilePaths([
            self.proToolboxPath, self.desktopToolboxPath,
            Configuration.visibilityPaths, self.sunPosDataPath
        ])
        # set up inputs
        self.sunPosGDBPath = os.path.join(self.sunPosDataPath, name)
        self.inputArea = os.path.join(self.sunPosGDBPath, r"inputArea")
        self.inputSurface = os.path.join(self.sunPosGDBPath,
                                         r"Jbad_SRTM_USGS_EROS")
        self.compareResults = os.path.join(self.sunPosGDBPath,
                                           r"compareResults")
        UnitTestUtilities.checkGeoObjects(
            [self.inputArea, self.inputSurface, self.compareResults])
    def setUp(self):
        ''' set-up code '''
        if Configuration.DEBUG == True: print("         HLZTouchdownPoints.setUp")
        UnitTestUtilities.checkArcPy()
        self.testDataFolderPath = DataDownload.createDataFolder(Configuration.capabilityPath)
        print("Created Capability test data folder.")
        UnitTestUtilities.checkFilePaths([self.testDataFolderPath,
                                          self.tbxProFolderPath,
                                          self.tbxDesktopFolderPath])

        self.testDataGeodatabase = os.path.join(self.testDataFolderPath, r"test_hlz_tools.gdb")

        # Check the test inputs (do they exist? or not?)
        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(self.testDataFolderPath)

        # Setup the test inputs
        self.inputAirframeTable = os.path.join(self.testDataGeodatabase, r"Aircraft_Specifications")
        self.inputSuitableAreas = os.path.join(self.testDataGeodatabase, r"HLZSelectionArea")
        self.inputSlope = os.path.join(self.testDataGeodatabase, r"SRTMPctSlope")
        self.outputGeodatabase = os.path.join(self.scratchGDB)
        self.outputCenterpoints = os.path.join(self.outputGeodatabase, r"centerPoints")
        self.outputCircles = os.path.join(self.outputGeodatabase, r"tdCircles")

        UnitTestUtilities.checkGeoObjects([self.testDataGeodatabase,
                                           self.outputGeodatabase,
                                           self.inputAirframeTable,
                                           self.inputSuitableAreas,
                                           self.inputSlope])
        return
    def setUp(self):
        if Configuration.DEBUG == True:
            print(".....IncidentDensityTestCase.setUp")
        UnitTestUtilities.checkArcPy()

        Configuration.incidentDataPath = DataDownload.runDataDownload(
            Configuration.patternsPaths, Configuration.incidentGDBName,
            Configuration.incidentURL)
        if (Configuration.incidentScratchGDB == None) or (not arcpy.Exists(
                Configuration.incidentScratchGDB)):
            Configuration.incidentScratchGDB = UnitTestUtilities.createScratch(
                Configuration.incidentDataPath)
        Configuration.incidentInputGDB = os.path.join(
            Configuration.incidentDataPath, Configuration.incidentGDBName)

        UnitTestUtilities.checkFilePaths([
            Configuration.incidentDataPath, Configuration.incidentInputGDB,
            Configuration.patterns_ProToolboxPath,
            Configuration.patterns_DesktopToolboxPath
        ])

        self.inputPointFeatures = os.path.join(Configuration.incidentInputGDB,
                                               "Incidents")
        self.inputBoundaryFeatures = os.path.join(
            Configuration.incidentInputGDB, "Districts")
示例#21
0
    def setUp(self):
        if Configuration.DEBUG == True:
            print("     SubDepthRestrictionSuitabilityTestCase.setUp")

        UnitTestUtilities.checkArcPy()
        Configuration.maritimeDataPath = DataDownload.runDataDownload(
            Configuration.suitabilityPaths, Configuration.maritimeGDBName,
            Configuration.maritimeURL)
        if (Configuration.maritimeScratchGDB == None) or (not arcpy.Exists(
                Configuration.maritimeScratchGDB)):
            Configuration.maritimeScratchGDB = UnitTestUtilities.createScratch(
                Configuration.maritimeDataPath)

        self.maritimeDataGDB = os.path.join(Configuration.maritimeDataPath,
                                            "Maritime Decision Aid Tools.gdb")

        self.bathymetry = os.path.join(self.maritimeDataGDB,
                                       "SoCalDepthsGEBCO")
        self.subDepthOutput = os.path.join(Configuration.maritimeScratchGDB,
                                           "SubDepth")
        UnitTestUtilities.checkFilePaths([
            Configuration.maritimeDataPath,
            Configuration.maritime_DesktopToolboxPath,
            Configuration.maritime_ProToolboxPath
        ])
示例#22
0
    def setUp(self):
        if Configuration.DEBUG == True:
            print("     VisibilityRangeAtSeaTestCase.setUp")

        UnitTestUtilities.checkArcPy()
        Configuration.maritimeDataPath = DataDownload.runDataDownload(
            Configuration.suitabilityPaths, Configuration.maritimeGDBName,
            Configuration.maritimeURL)
        if (Configuration.maritimeScratchGDB == None) or (not arcpy.Exists(
                Configuration.maritimeScratchGDB)):
            Configuration.maritimeScratchGDB = UnitTestUtilities.createScratch(
                Configuration.maritimeDataPath)

        self.maritimeDataGDB = os.path.join(Configuration.maritimeDataPath,
                                            "Maritime Decision Aid Tools.gdb")

        self.visibleRange = os.path.join(Configuration.maritimeScratchGDB,
                                         "visRangeOutput")
        self.vessel = os.path.join(Configuration.maritimeScratchGDB,
                                   "vesselOutput")
        self.shipLocation = os.path.join(self.maritimeDataGDB, "Vessel")

        UnitTestUtilities.checkFilePaths([
            Configuration.maritimeDataPath,
            Configuration.maritime_DesktopToolboxPath,
            Configuration.maritime_ProToolboxPath
        ])
    def setUp(self):
        if Configuration.DEBUG == True: print("     ImportCRUToRasterTestCase.setUp")
        UnitTestUtilities.checkArcPy()

        Configuration.suitabilityDataPath = DataDownload.runDataDownload(Configuration.suitabilityPaths, "MilitaryAspectsOfWeatherTestData", Configuration.maowURL)
        self.inputCRUFolder = os.path.join(Configuration.suitabilityDataPath, "CRUdata")
        self.outputWorkspace = os.path.join(Configuration.suitabilityDataPath, "CRURasters.gdb")
       
        UnitTestUtilities.checkFilePaths([Configuration.suitabilityDataPath, Configuration.maow_ToolboxPath, self.outputWorkspace])
 def setUp(self):
     if Configuration.DEBUG == True: print("     FindSubmarinesTestCase.setUp")
         
     UnitTestUtilities.checkArcPy()
     Configuration.maritimeDataPath = DataDownload.runDataDownload(Configuration.suitabilityPaths, Configuration.maritimeGDBName, Configuration.maritimeURL)
     if(Configuration.maritimeScratchGDB == None) or (not arcpy.Exists(Configuration.maritimeScratchGDB)):
         Configuration.maritimeScratchGDB = UnitTestUtilities.createScratch(Configuration.maritimeDataPath)
         
     self.useableCanyons = os.path.join(Configuration.maritimeScratchGDB, "canyonsOutput")
     UnitTestUtilities.checkFilePaths([Configuration.maritimeDataPath, Configuration.maritime_DesktopToolboxPath, Configuration.maritime_ProToolboxPath])
 def setUp(self):
     if Configuration.DEBUG == True: print(".....IncidentHotSpotsTestCase.setUp")    
     UnitTestUtilities.checkArcPy()
     Configuration.incidentDataPath = DataDownload.runDataDownload(Configuration.patternsPaths, Configuration.incidentGDBName, Configuration.incidentURL)
     if (Configuration.incidentScratchGDB == None) or (not arcpy.Exists(Configuration.incidentScratchGDB)):
         Configuration.incidentScratchGDB = UnitTestUtilities.createScratch(Configuration.incidentDataPath)
     Configuration.incidentInputGDB = os.path.join(Configuration.incidentDataPath, Configuration.incidentGDBName)
     UnitTestUtilities.checkFilePaths([Configuration.incidentDataPath, Configuration.incidentInputGDB, Configuration.patterns_ProToolboxPath, Configuration.patterns_DesktopToolboxPath])
     self.inputPointFeatures = os.path.join(Configuration.incidentInputGDB, "Incidents")
     self.inputBoundaryFeatures = os.path.join(Configuration.incidentInputGDB, "Districts")
    def setUp(self):
        ''' set-up code '''
        if Configuration.DEBUG == True: print(".....HLZTouchdownPoints.setUp")
        UnitTestUtilities.checkArcPy()

        # Setup the test specific paths
        self.tbxProFolderPath = os.path.join(Configuration.repoPath, "capability", "toolboxes", "Helicopter Landing Zone Tools.tbx")
        self.tbxDesktopFolderPath = os.path.join(Configuration.repoPath, "capability", "toolboxes", "Helicopter Landing Zone Tools_10.4.tbx")
        self.dataDownloadURL = r"http://www.arcgis.com/sharing/content/items/eb5685e1af5d4c16b49fc8870ced036c/data"
        self.testDataFolderPath = DataDownload.createDataFolder(Configuration.capabilityPath)

        # Check the paths exist
        print("Created Capability test data folder.")
        UnitTestUtilities.checkFilePaths([self.testDataFolderPath,
                                          self.tbxProFolderPath,
                                          self.tbxDesktopFolderPath])
        # set the geodatabase
        self.testDataGeodatabase = os.path.join(self.testDataFolderPath, r"test_hlz_tools.gdb")
        
        # Download the test data from arcgis.com
        self.testDataFolderPath = DataDownload.runDataDownload(Configuration.capabilityPath,
                                                               os.path.basename(self.testDataGeodatabase),
                                                               self.dataDownloadURL)

        # Check the test inputs (do they exist? or not?)
        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(self.testDataFolderPath)

        # Setup the test inputs
        self.inputAirframeTable = os.path.join(self.testDataGeodatabase, r"Aircraft_Specifications")
        self.inputSuitableAreas = os.path.join(self.testDataGeodatabase, r"HLZSelectionArea")
        self.inputSlope = os.path.join(self.testDataGeodatabase, r"SRTMPctSlope")
        self.outputGeodatabase = os.path.join(self.scratchGDB)
        self.outputCenterpoints = os.path.join(self.outputGeodatabase, r"centerPoints")
        self.outputCircles = os.path.join(self.outputGeodatabase, r"tdCircles")

        UnitTestUtilities.checkGeoObjects([self.testDataGeodatabase,
                                           self.outputGeodatabase,
                                           self.inputAirframeTable,
                                           self.inputSuitableAreas,
                                           self.inputSlope])
        return
    def run(self):
        DataDownload.cleanup_dir()
        DataDownload.loan_data_download()
        DataDownload.loan_data_unzip_extract()
        DataDownload.reject_loan_data_download()
        print('inside d')
        DataDownload.reject_loan_data_unzip_extract()
        print('Data download completed!!!!!!!!!!!!!!!')
        print('Starting Preprocessing of accepted loans!!!!!!!!!')
        Data_PreProcessing_Loans.loan_preprocess_magic()
        print('Preprocessing of accepted loans complete!!!!!!!!!')
        print('Starting Preprocessing of rejected loans !!!!!!!!!')
        Data_PreProcessing_DeclinedLoans.declinedLoan_preprocess_magic()
        print('Preprocessing of rejected loans complete!!!!!!!!!')
        print('Uploading to S3 started!!!!!!!!!')
        access_key = self.acckey
        access_secret = self.accsec
        conn = S3Connection(access_key, access_secret)

        #Connecting to the bucket
        ts = time.time()
        st = datetime.datetime.fromtimestamp(ts)
        bucket_name = access_key.lower() + str(st).replace(" ", "").replace(
            "-", "").replace(":", "").replace(".", "")
        bucket = conn.create_bucket(bucket_name)
        #bucket_name = "assignment2team9apr7"
        #bucket = conn.get_bucket(bucket_name)

        #Setting up the keys
        k1 = Key(bucket)
        k1.key = "cleanedloan"
        k1.set_contents_from_filename("Cleaned_all_data.csv")
        print('CLeaned loan data uploaded to S3')

        k2 = Key(bucket)
        k2.key = "cleaneddeclinedloan"
        k2.set_contents_from_filename("Cleaned_all_data_declined.csv")
        print('CLeaned rejected loan data uploaded to S3')
        print(
            'If you are seeing this message it means that the efforts of Team9 has paid off and program has ended successfully.'
        )
 def setUp(self):
     if Configuration.DEBUG == True: print("     SubDepthRestrictionSuitabilityTestCase.setUp")
         
     UnitTestUtilities.checkArcPy()
     Configuration.maritimeDataPath = DataDownload.runDataDownload(Configuration.suitabilityPaths, Configuration.maritimeGDBName, Configuration.maritimeURL)
     if(Configuration.maritimeScratchGDB == None) or (not arcpy.Exists(Configuration.maritimeScratchGDB)):
         Configuration.maritimeScratchGDB = UnitTestUtilities.createScratch(Configuration.maritimeDataPath)
         
     self.maritimeDataGDB = os.path.join(Configuration.maritimeDataPath, "Maritime Decision Aid Tools.gdb")
     
     self.bathymetry = os.path.join(self.maritimeDataGDB, "SoCalDepthsGEBCO")
     self.subDepthOutput = os.path.join(Configuration.maritimeScratchGDB, "SubDepth")
     UnitTestUtilities.checkFilePaths([Configuration.maritimeDataPath, Configuration.maritime_DesktopToolboxPath, Configuration.maritime_ProToolboxPath])
    def setUp(self):
        if Configuration.DEBUG == True: print("     FarthestOnCircleTestCase.setUp")    
        
        UnitTestUtilities.checkArcPy()
        Configuration.maritimeDataPath = DataDownload.runDataDownload(Configuration.suitabilityPaths, Configuration.maritimeGDBName, Configuration.maritimeURL)
        if(Configuration.maritimeScratchGDB == None) or (not arcpy.Exists(Configuration.maritimeScratchGDB)):
            Configuration.maritimeScratchGDB = UnitTestUtilities.createScratch(Configuration.maritimeDataPath)
            
        self.maritimeDataGDB = os.path.join(Configuration.maritimeDataPath, "Maritime Decision Aid Tools.gdb")

        self.position = os.path.join(self.maritimeDataGDB, "Vessel")
        self.hoursOfTransit = os.path.join(Configuration.maritimeScratchGDB, "hoursOutput")
        UnitTestUtilities.checkFilePaths([Configuration.maritimeDataPath, Configuration.maritime_DesktopToolboxPath, Configuration.maritime_ProToolboxPath])
示例#30
0
    def setUp(self):
        if Configuration.DEBUG == True:
            print("         DistanceToAssetsTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''
        self.toolboxUnderTest = Configuration.distancetoAssetsToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()
        DataDownload.runDataDownload(Configuration.distanceToAssetsDataPath, \
           Configuration.distanceToAssetsInputGDB, Configuration.distanceToAssetsURL)

        self.suffix = Configuration.GetToolboxSuffix()

        #self.inputND = os.path.join(Configuration.distanceToAssetsInputNDGDB, "Transportation/Streets_ND")
        self.inputND = r"\\redarchive2\disl\Development\Commercial\TestData\DistanceToAssets\SanFrancisco.gdb\Transportation\Streets_ND"
        self.inputAssetsPro = os.path.join(
            Configuration.distanceToAssetsInputGDB, "AssetsGeocoded_pro_SF")
        self.inputAssets = os.path.join(Configuration.distanceToAssetsInputGDB,
                                        "AssetsGeocoded_SF")
        self.inputBasesPro = os.path.join(
            Configuration.distanceToAssetsInputGDB, "BasesGeocoded_pro_SF")
        self.inputBases = os.path.join(Configuration.distanceToAssetsInputGDB,
                                       "BasesGeocoded_SF")

        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(
                Configuration.distanceToAssetsDataPath)

        UnitTestUtilities.checkFilePaths(
            [Configuration.distanceToAssetsDataPath])

        UnitTestUtilities.checkGeoObjects([
            Configuration.distanceToAssetsInputGDB, self.toolboxUnderTest,
            self.scratchGDB, self.inputAssets, self.inputBases, self.inputND
        ])
    def setUp(self):
        if Configuration.DEBUG == True: print("         CalculateSidcTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.militaryFeaturesToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.militaryFeaturesDataPath, \
           Configuration.militaryFeaturesInputGDB, Configuration.militaryFeaturesURL)

        self.inputPointsFC = os.path.join(Configuration.militaryFeaturesInputGDB, \
                                          r"FriendlyOperations/FriendlyUnits")

        UnitTestUtilities.checkFilePaths([Configuration.militaryFeaturesDataPath])

        UnitTestUtilities.checkGeoObjects([self.toolboxUnderTest, \
            self.inputPointsFC])
    def setUp(self):
        if Configuration.DEBUG == True: print("         ClearingOperationsNumberFeaturesTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''
        self.toolboxUnderTest = Configuration.clearingOperationsToolboxPath

        UnitTestUtilities.checkArcPy()
        DataDownload.runDataDownload(Configuration.clearingOperationsPath, \
           Configuration.clearingOperationsInputGDB, Configuration.clearingOperationsURL)

        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(Configuration.clearingOperationsPath)

        # set up inputs
        self.inputArea = os.path.join(Configuration.clearingOperationsInputGDB, r"AO")
        self.pointFeatures = os.path.join(Configuration.clearingOperationsInputGDB, r"Structures")

        UnitTestUtilities.checkFilePaths([Configuration.clearingOperationsPath])

        UnitTestUtilities.checkGeoObjects([Configuration.clearingOperationsInputGDB, self.toolboxUnderTest, self.scratchGDB, self.inputArea, self.pointFeatures])
 def setUp(self):
     if Configuration.DEBUG == True: print("     IncidentTableToPointTestCase.setUp")    
     UnitTestUtilities.checkArcPy()
     
     Configuration.incidentDataPath = DataDownload.runDataDownload(Configuration.patternsPaths, Configuration.incidentGDBName, Configuration.incidentURL)
     if (Configuration.incidentScratchGDB == None) or (not arcpy.Exists(Configuration.incidentScratchGDB)):
         Configuration.incidentScratchGDB = UnitTestUtilities.createScratch(Configuration.incidentDataPath)
     Configuration.incidentInputGDB = os.path.join(Configuration.incidentDataPath, Configuration.incidentGDBName)
     
     UnitTestUtilities.checkFilePaths([Configuration.incidentDataPath, Configuration.incidentInputGDB, Configuration.patterns_ProToolboxPath, Configuration.patterns_DesktopToolboxPath])
     if (Configuration.incidentScratchGDB == None) or (not arcpy.Exists(Configuration.incidentScratchGDB)):
         Configuration.incidentScratchGDB = UnitTestUtilities.createScratch(Configuration.incidentDataPath)
         
     self.inputTable = os.path.join(Configuration.incidentInputGDB, "MontereyIncidents")
    def setUp(self):
        if Configuration.DEBUG == True:
            print(".....CountIncidentsByLOCTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.incidentToolboxPath + Configuration.GetToolboxSuffix(
        )

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.incidentAnalysisDataPath,
                                     Configuration.incidentInputGDB,
                                     Configuration.incidentURL)

        # set up inputs
        self.inputPointsFeatures = os.path.join(Configuration.incidentInputGDB,
                                                "Incidents")
        self.inputLinesFeatures = os.path.join(Configuration.incidentInputGDB,
                                               "Roads")
        self.inputAOIFeatures = os.path.join(Configuration.incidentInputGDB,
                                             "Districts")
        self.resultCompareFeatures0001 = os.path.join(
            Configuration.incidentResultGDB, "resultsCountIncidentsByLOC_0001")

        UnitTestUtilities.checkFilePaths(
            [Configuration.incidentAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.incidentInputGDB, \
                                           Configuration.incidentResultGDB, \
                                           self.toolboxUnderTest, \
                                           self.inputPointsFeatures, \
                                           self.inputLinesFeatures,  \
                                           self.inputAOIFeatures,  \
                                           self.resultCompareFeatures0001])
    def setUp(self):
        if Configuration.DEBUG == True: print("         GeoNamesTestCase.setUp")

        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.geonamesToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.geonamesDataPath, \
           Configuration.geonamesInputGDB, Configuration.geonamesURL)

        self.templateFeatureClass = os.path.join(Configuration.geonamesInputGDB, "GeonamesTemplate")
        self.loadResultsFeatureClass = os.path.join(Configuration.geonamesInputGDB, "MonacoResults")

        UnitTestUtilities.checkFilePaths([Configuration.geonamesDataPath])

        UnitTestUtilities.checkGeoObjects([self.toolboxUnderTest, \
            Configuration.geonamesInputGDB, self.loadResultsFeatureClass, \
            self.templateFeatureClass])
示例#36
0
    def setUp(self):
        if Configuration.DEBUG == True:
            print("         SunPositionAndHillshadeTestCase.setUp")
        ''' Initialization needed if running Test Case standalone '''
        Configuration.GetLogger()
        Configuration.GetPlatform()
        ''' End standalone initialization '''

        self.toolboxUnderTest = Configuration.sunPositionAnalysisToolboxPath + \
            Configuration.GetToolboxSuffix()

        UnitTestUtilities.checkArcPy()

        DataDownload.runDataDownload(Configuration.sunPositionAnalysisDataPath, \
           Configuration.sunPositionInputGDB, Configuration.sunPositionAnalysisURL)

        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(
                Configuration.sunPositionAnalysisDataPath)

        # set up inputs
        self.inputArea = os.path.join(Configuration.sunPositionInputGDB,
                                      r"inputArea")
        self.inputSurface = os.path.join(Configuration.sunPositionInputGDB,
                                         r"Jbad_SRTM_USGS_EROS")
        self.compareResults = os.path.join(
            Configuration.sunPositionInputGDB,
            r"compareResults_2017_8_10_16_30_00")

        UnitTestUtilities.checkFilePaths(
            [Configuration.sunPositionAnalysisDataPath])

        UnitTestUtilities.checkGeoObjects([Configuration.sunPositionInputGDB, \
            self.toolboxUnderTest, self.scratchGDB, \
            self.inputArea, self.inputSurface, \
            self.compareResults])
 def setUp(self):
     if Configuration.DEBUG == True: print("     VisibilityRangeAtSeaTestCase.setUp")
     
     UnitTestUtilities.checkArcPy()
     Configuration.maritimeDataPath = DataDownload.runDataDownload(Configuration.suitabilityPaths, Configuration.maritimeGDBName, Configuration.maritimeURL)
     if(Configuration.maritimeScratchGDB == None) or (not arcpy.Exists(Configuration.maritimeScratchGDB)):
         Configuration.maritimeScratchGDB = UnitTestUtilities.createScratch(Configuration.maritimeDataPath)
         
     self.maritimeDataGDB = os.path.join(Configuration.maritimeDataPath, "Maritime Decision Aid Tools.gdb")
     
     self.visibleRange = os.path.join(Configuration.maritimeScratchGDB, "visRangeOutput")
     self.vessel = os.path.join(Configuration.maritimeScratchGDB, "vesselOutput")
     self.shipLocation = os.path.join(self.maritimeDataGDB, "Vessel")
     
     UnitTestUtilities.checkFilePaths([Configuration.maritimeDataPath, Configuration.maritime_DesktopToolboxPath, Configuration.maritime_ProToolboxPath])
    def setUp(self):
        if Configuration.DEBUG == True: print("         SunPositionAndHillshadeTestCase.setUp")
        UnitTestUtilities.checkArcPy()

        name = "test_sun_position.gdb"
        self.sunPosDataPath = DataDownload.runDataDownload(Configuration.visibilityPaths, name, self.sunPosUrl)
        if (self.scratchGDB == None) or (not arcpy.Exists(self.scratchGDB)):
            self.scratchGDB = UnitTestUtilities.createScratch(self.sunPosDataPath)

        UnitTestUtilities.checkFilePaths([self.proToolboxPath, self.desktopToolboxPath, Configuration.visibilityPaths, self.sunPosDataPath])
        # set up inputs
        self.sunPosGDBPath = os.path.join(self.sunPosDataPath, name)
        self.inputArea = os.path.join(self.sunPosGDBPath, r"inputArea")
        self.inputSurface = os.path.join(self.sunPosGDBPath, r"Jbad_SRTM_USGS_EROS")
        self.compareResults = os.path.join(self.sunPosGDBPath, r"compareResults")
        UnitTestUtilities.checkGeoObjects([self.inputArea, self.inputSurface, self.compareResults])
示例#39
0
    def setUp(self):
        if Configuration.DEBUG == True:
            print("     ImportCRUToRasterTestCase.setUp")
        UnitTestUtilities.checkArcPy()

        Configuration.suitabilityDataPath = DataDownload.runDataDownload(
            Configuration.suitabilityPaths, "MilitaryAspectsOfWeatherTestData",
            Configuration.maowURL)
        self.inputCRUFolder = os.path.join(Configuration.suitabilityDataPath,
                                           "CRUdata")
        self.outputWorkspace = os.path.join(Configuration.suitabilityDataPath,
                                            "CRURasters.gdb")

        UnitTestUtilities.checkFilePaths([
            Configuration.suitabilityDataPath, Configuration.maow_ToolboxPath,
            self.outputWorkspace
        ])
 def setUp(self):
     if Configuration.DEBUG == True: print(".....CountIncidentsByLOCTestCase.setUp")  
     UnitTestUtilities.checkArcPy()
     
     Configuration.incidentDataPath = DataDownload.runDataDownload(Configuration.patternsPaths, Configuration.incidentGDBName, Configuration.incidentURL)
     if (Configuration.incidentScratchGDB == None) or (not arcpy.Exists(Configuration.incidentScratchGDB)):
         Configuration.incidentScratchGDB = UnitTestUtilities.createScratch(Configuration.incidentDataPath)
     Configuration.incidentInputGDB = os.path.join(Configuration.incidentDataPath, Configuration.incidentGDBName)
     Configuration.incidentResultGDB = os.path.join(Configuration.incidentDataPath, Configuration.incidentResultGDBName)
     
     UnitTestUtilities.checkFilePaths([Configuration.incidentDataPath, Configuration.incidentInputGDB, Configuration.patterns_ProToolboxPath, Configuration.patterns_DesktopToolboxPath])
  
     # set up inputs    
     self.inputPointsFeatures = os.path.join(Configuration.incidentInputGDB, "Incidents")
     self.inputLinesFeatures = os.path.join(Configuration.incidentInputGDB, "Roads")
     self.inputAOIFeatures = os.path.join(Configuration.incidentInputGDB, "Districts")
     self.resultCompareFeatures0001 = os.path.join(Configuration.incidentResultGDB, "resultsCountIncidentsByLOC_0001")
    def setUp(self):
        if Configuration.DEBUG == True:
            print("     ImportWMOStationsTestCase.setUp")
        UnitTestUtilities.checkArcPy()
        Configuration.suitabilityDataPath = DataDownload.runDataDownload(
            Configuration.suitabilityPaths, "MilitaryAspectsOfWeatherTestData",
            Configuration.maowURL)
        self.stationsTextFile = os.path.join(Configuration.suitabilityDataPath,
                                             "WMOStations.tab")
        self.WMOGDB = os.path.join(Configuration.suitabilityDataPath,
                                   "WMO.gdb")
        self.WMOStationsFC = os.path.join(self.WMOGDB, "WMOFC_output")

        UnitTestUtilities.checkFilePaths([
            Configuration.suitabilityDataPath, Configuration.maow_ToolboxPath,
            self.WMOGDB
        ])
        UnitTestUtilities.deleteIfExists(self.WMOStationsFC)
示例#42
0
    def setUp(self):
        if Configuration.DEBUG == True:
            print("     FindSubmarinesTestCase.setUp")

        UnitTestUtilities.checkArcPy()
        Configuration.maritimeDataPath = DataDownload.runDataDownload(
            Configuration.suitabilityPaths, Configuration.maritimeGDBName,
            Configuration.maritimeURL)
        if (Configuration.maritimeScratchGDB == None) or (not arcpy.Exists(
                Configuration.maritimeScratchGDB)):
            Configuration.maritimeScratchGDB = UnitTestUtilities.createScratch(
                Configuration.maritimeDataPath)

        self.useableCanyons = os.path.join(Configuration.maritimeScratchGDB,
                                           "canyonsOutput")
        UnitTestUtilities.checkFilePaths([
            Configuration.maritimeDataPath,
            Configuration.maritime_DesktopToolboxPath,
            Configuration.maritime_ProToolboxPath
        ])
    def setUp(self):
        if Configuration.DEBUG == True:
            print("     FarthestOnCircleTestCase.setUp")

        UnitTestUtilities.checkArcPy()
        Configuration.maritimeDataPath = DataDownload.runDataDownload(
            Configuration.suitabilityPaths, Configuration.maritimeGDBName,
            Configuration.maritimeURL)
        if (Configuration.maritimeScratchGDB == None) or (not arcpy.Exists(
                Configuration.maritimeScratchGDB)):
            Configuration.maritimeScratchGDB = UnitTestUtilities.createScratch(
                Configuration.maritimeDataPath)

        self.maritimeDataGDB = os.path.join(Configuration.maritimeDataPath,
                                            "Maritime Decision Aid Tools.gdb")

        self.position = os.path.join(self.maritimeDataGDB, "Vessel")
        self.hoursOfTransit = os.path.join(Configuration.maritimeScratchGDB,
                                           "hoursOutput")
        UnitTestUtilities.checkFilePaths([
            Configuration.maritimeDataPath,
            Configuration.maritime_DesktopToolboxPath,
            Configuration.maritime_ProToolboxPath
        ])
示例#44
0
def monthly_process():

    if datetime.datetime.today().day == 29:

        DataDownload.save_scvi()
        print('NASS SCVI data saved')
        DataDownload.save_nass_production()
        print('NASS production saved')
        DataDownload.update_csv()
        print('Updated master dataframe')
        DataDownload.run_r_spi()
        print('Calculated Monthly SPI in R')
        DataDownload.save_eddi()
        print('Calculated Monthly EDDI')
        DataDownload.run_r_scvi()
        print('Calculated SCVI in R')
        DataDownload.run_r_prod()
        print('Normalized production in R')
        DataDownload.calc_scpi('spi')
        print('Calculated SCPI using SPI')
        DataDownload.calc_scpi('eddi')
        print('Calculated SCPI using EDDI')
        DataDownload.run_r_graph()
        print('Ran R code to add popup graph data')
        DataDownload.run_r_mouse()
        print('Ran R code to add mouseover data')
        DataDownload.run_r_thin()
        print('Thinned final data frame')
示例#45
0
def create_dataset(two_entry_sets, num=20):
    return DataDownload.create_dataset(two_entry_sets, num)
示例#46
0
def entry_terms_extractor(search_terms):
    return DataDownload.create_entry_terms(search_terms)
    #Parsing Inputs
    args = parser.parse_args()
    print(args)

    #Setting Log Level
    logging.basicConfig(stream=sys.stdout, level=logging.ERROR)
    #logging.basicConfig(stream=sys.stdout, level=logging.INFO)

    #Create output folder if dosn't exist
    Path(args.outputfolder).mkdir(parents=True, exist_ok=True)

    imagefiles, maskfiles, outputfiles = [], [], []

    #Make List of all files
    if (args.Coco):
        files = dd.getCocoFolderLists(outputfolder=args.outputfolder)
        imagefiles += files[0]
        maskfiles += files[1]
        outputfiles += files[2]

    if (args.Sky):
        files = dd.getSkyFolderLists(outputfolder=args.outputfolder)
        imagefiles += files[0]
        maskfiles += files[1]
        outputfiles += files[2]

    if imagefiles == []:
        print("Error: No dataset specified")

    print(f"processing: {len(imagefiles)} files")
示例#48
0
        DataDownload.save_scvi()
        print('NASS SCVI data saved')
        DataDownload.save_nass_production()
        print('NASS production saved')
        DataDownload.update_csv()
        print('Updated master dataframe')
        DataDownload.run_r_spi()
        print('Calculated Monthly SPI in R')
        DataDownload.save_eddi()
        print('Calculated Monthly EDDI')
        DataDownload.run_r_scvi()
        print('Calculated SCVI in R')
        DataDownload.run_r_prod()
        print('Normalized production in R')
        DataDownload.calc_scpi('spi')
        print('Calculated SCPI using SPI')
        DataDownload.calc_scpi('eddi')
        print('Calculated SCPI using EDDI')
        DataDownload.run_r_graph()
        print('Ran R code to add popup graph data')
        DataDownload.run_r_mouse()
        print('Ran R code to add mouseover data')
        DataDownload.run_r_thin()
        print('Thinned final data frame')


[daily_process(str(d)) for d in DataDownload.download_latest()]
# monthly_process()
print('Complete')