def _tests(): # Variables from .. import filesystem fs = filesystem.Filesystem().fs workDir = pJoin(__metaModel__._omfDir, "data", "Model") inData = {"simStartDate": "2012-04-01", "simLengthUnits": "hours", "modelType": "pvWatts", "zipCode": "64735", "simLength": "100", "systemSize": "10", "derate": "77", "trackingMode": "0", "azimuth": "180", "runTime": "", "rotlim": "45.0", "gamma": "0.45", "inv_eff": "92", "tilt": "45.0", "w_stow": "0", "inverterSize": "8"} modelLoc = pJoin(workDir, "admin", "Automated pvWatts Testing") # Blow away old test results if necessary. try: shutil.rmtree(modelLoc) except: # No previous test results. pass # No-input template. renderAndShow(template, fs) # Run the model. run(modelLoc, inData, fs) # Show the output. renderAndShow(template, fs, modelDir=modelLoc)
def _tests(): # Variables from .. import filesystem fs = filesystem.Filesystem().fs inData = {"simStartDate": "2012-04-01", "simLengthUnits": "hours", "feederName": "public___Olin Barre GH EOL Solar", "modelType": "solarEngineering", "zipCode": "64735", "simLength": "24", "runTime": ""} modelLoc = pJoin(__metaModel__._omfDir, "data", "Model", "admin", "Automated solarEngineering Test") # Blow away old test results if necessary. try: shutil.rmtree(modelLoc) except: # No previous test results. pass # No-input template. # renderAndShow(template) # Run the model. runForeground(modelLoc, fs, inData) # Cancel the model. # time.sleep(2) # cancel(modelLoc) # Show the output. renderAndShow(template, fs, modelDir=modelLoc)
def _tests(): # Variables from .. import filesystem fs = filesystem.Filesystem().fs workDir = pJoin(__metaModel__._omfDir, "data", "Model") inData = { "batteryEfficiency": "92", "cellCapacity": "100", "discountRate": "2.5", "created": "2015-06-12 17:20:39.308239", "dischargeRate": "50", "modelType": "energyStorage", "chargeRate": "50", "demandCurve": fs.open(pJoin(__metaModel__._omfDir, "scratch", "batteryModel", "OlinBeckenhamScada.csv")).read(), "cellCost": "25000", "cellQuantity": "3", "runTime": "0:00:03", "projYears": "10", "demandCharge": "50"} modelLoc = pJoin(workDir, "admin", "Automated energyStorage Testing") # Blow away old test results if necessary. try: shutil.rmtree(modelLoc) except: # No previous test results. pass # No-input template. renderAndShow(template, fs) # Run the model. run(modelLoc, inData, fs) # Show the output. renderAndShow(template, fs, modelDir=modelLoc)
def _tests(): # # First just test the charting. # tree = json.load(open("../data/Feeder/public/Olin Barre Geo.json")).get("tree",{}) # chart = voltPlot(tree) # chart.savefig("/Users/dwp0/Desktop/testChart.png") # plt.show() # Variables from .. import filesystem fs = filesystem.Filesystem().fs # Our HTML template for the interface: with fs.open(pJoin(__metaModel__._myDir, "voltageDrop.html"), "r") as tempFile: template = Template(tempFile.read()) workDir = pJoin(__metaModel__._omfDir, "data", "Model") inData = {"feederName": "public___Olin Barre Geo", "modelType": "voltageDrop", "runTime": "", "layoutAlgorithm": "geospatial"} modelLoc = pJoin(workDir, "admin", "Automated voltageDrop Testing") # Blow away old test results if necessary. try: shutil.rmtree(modelLoc) except: # No previous test results. pass # No-input template. renderAndShow(template, fs) # Run the model. run(modelLoc, inData, fs) # Show the output. renderAndShow(template, fs, modelDir=modelLoc)
def _tests(): # Variables from .. import filesystem fs = filesystem.Filesystem().fs workDir = pJoin(__metaModel__._omfDir, "data", "Model") # TODO: Fix inData because it's out of date. inData = {"modelType": "solarSunda", # Cooperative "zipCode": "64735", "systemSize": "1000", "systemDcSize": "1390.8", "landOwnership": "Owned", # Leased, Purchased, or Owned "landAmount": "6", "costAcre": "10000", "moduleCost": "0.70", "rackCost": "0.137", "inverterCost": "107000", "pmCost": "15000", "EPCRate": "3", "mechLabor": "35", "elecLabor": "50", "devCost": "2", "interCost": "25000", "distAdder": "0", # Financing Information "discRate": "2.32", "loanRate": "2.00", "NCREBRate": "4.06", "taxLeaseRate": "-4.63", "taxEquityReturn": "8.50", # PPA Information "firstYearEnergyCostPPA": "57.5", "annualEscRatePPA": "3", # Misc "lifeSpan": "25", "degradation": "0.8", "inverterEfficiency": "96", "nonInverterEfficiency": "87", "tilt": "-", "trackingMode": "0", "module_type": "1", # PVWatts v5 feature: 1 = premium "azimuth": "180"} modelLoc = pJoin(workDir, "admin", "Automated solarSunda Testing") # Blow away old test results if necessary. try: shutil.rmtree(modelLoc) except: # No previous test results. pass # No-input template. # renderAndShow(template) # Run the model. run(modelLoc, inData, fs) # Show the output. renderAndShow(template, fs, modelDir=modelLoc)
def _tests(): # Variables from .. import filesystem fs = filesystem.Filesystem().fs workDir = pJoin(__metaModel__._omfDir, "data", "Model") # TODO: Fix inData because it's out of date. inData = {"simStartDate": "2013-01-01", "simLengthUnits": "hours", "modelType": "solarFinancial", "zipCode": "64735", "simLength": "8760", "systemSize": "100", "installCost": "100000", "lifeSpan": "30", "degradation": "0.5", "retailCost": "0.10", "discountRate": "7", "pvModuleDerate": "100", "mismatch": "98", "diodes": "99.5", "dcWiring": "98", "acWiring": "99", "soiling": "95", "shading": "100", "sysAvail": "100", "age": "100", "inverterEfficiency": "92", "inverterSize": "75", "tilt": "-", "srecCashFlow": "5,5,3,3,2", "trackingMode": "0", "azimuth": "180", "runTime": "", "rotlim": "45.0", "gamma": "-0.45", "omCost": "1000"} modelLoc = pJoin(workDir, "admin", "Automated solarFinancial Testing") # Blow away old test results if necessary. try: shutil.rmtree(modelLoc) except: # No previous test results. pass # No-input template. renderAndShow(template,fs) # Run the model. run(modelLoc, inData, fs) # Show the output. renderAndShow(template, fs, modelDir=modelLoc)
def _tests(): # Variables from .. import filesystem fs = filesystem.Filesystem().fs workDir = pJoin(__metaModel__._omfDir, "data", "Model") inData = { "simStartDate": "2012-04-01", "simLengthUnits": "hours", # "feederName": "admin___Simple Market System", # "feederName2": "admin___Simple Market System BROKEN", # configure error # "feederName3": "public___13 Node Embedded DO NOT SAVE", # feeder error # "feederName4": "public___13 Node Ref Feeder Flat", # "feederName5": "public___13 Node Ref Feeder Laid Out ZERO CVR", # "feederName6": "public___13 Node Ref Feeder Laid Out", # "feederName7": "public___ABEC Columbia", # "feederName8": "public___ABEC Frank LO Houses", # feeder error # "feederName9": "public___ABEC Frank LO", # "feederName10": "public___ACEC Geo", # "feederName11": "public___Battery 13 Node Centralized", # "feederName12": "public___Battery 13 Node Distributed", # "feederName13": "public___DEC Red Base", # "feederName14": "public___DEC Red Battery", # "feederName15": "public___DEC Red CVR", # "feederName16": "public___DEC Red DG", # "feederName17": "public___INEC Renoir", # "feederName18": "public___Olin Barre CVR Base", # "feederName19": "public___Olin Barre Geo", # "feederName20": "public___Olin Barre Housed 05Perc Solar", # "feederName21": "public___Olin Barre Housed 20Perc Solar", # "feederName22": "public___Olin Barre Housed 50Perc Solar", # "feederName23": "public___Olin Barre Housed 90Perc Solar", # "feederName24": "public___Olin Barre Housed Battery", # "feederName25": "public___Olin Barre Housed Wind", # "feederName26": "public___Olin Barre Housed", # "feederName27": "public___Olin Barre", # feeder error # "feederName28": "public___PNNL Taxonomy Feeder 1", # "feederName29": "public___Simple Market System Comm Solar", # "feederName30": "public___Simple Market System Indy Solar", "feederName31": "public___Simple Market System", # "feederName": "public___Battery 13 Node Distributed", "modelType": "gridlabMulti", "zipCode": "64735", "simLength": "24", "runTime": "", } modelLoc = pJoin(workDir, "admin", "Automated Multiple GridlabD Testing") # Blow away old test results if necessary. try: shutil.rmtree(modelLoc) except: # No previous test results. pass # No-input template. renderAndShow(template, fs) # Run the model. run(modelLoc, inData, fs) # Cancel the model. # time.sleep(2) # cancel(modelLoc) # Show the output. renderAndShow(template, fs, modelDir=modelLoc)
def _tests(): # Variables import shutil from .. import filesystem fs = filesystem.Filesystem().fs workDir = pJoin(__metaModel__._omfDir, "data", "Model") friendshipTree = json.load(fs.open(pJoin( __metaModel__._omfDir, "data", "Feeder", "public", "ABEC Frank LO.json")))["tree"] colomaTree = json.load(fs.open(pJoin( __metaModel__._omfDir, "data", "Feeder", "public", "ABEC Columbia.json")))["tree"] colomaMonths = {"janAvg": 914000.0, "janPeak": 1290000.0, "febAvg": 897000.00, "febPeak": 1110000.0, "marAvg": 731000.00, "marPeak": 1030000.0, "aprAvg": 864000.00, "aprPeak": 2170000.0, "mayAvg": 1620000.0, "mayPeak": 4580000.0, "junAvg": 2210000.0, "junPeak": 5550000.0, "julAvg": 3570000.0, "julPeak": 6260000.0, "augAvg": 3380000.0, "augPeak": 5610000.0, "sepAvg": 1370000.0, "sepPeak": 3740000.0, "octAvg": 1030000.0, "octPeak": 1940000.0, "novAvg": 1020000.0, "novPeak": 1340000.0, "decAvg": 1030000.0, "decPeak": 1280000.0} # friendshipMonths = {"janAvg": 2740000.0, "janPeak": 4240000.0, # "febAvg": 2480000.0, "febPeak": 3310000.0, # "marAvg": 2030000.0, "marPeak": 2960000.0, # "aprAvg": 2110000.0, "aprPeak": 3030000.0, # "mayAvg": 2340000.0, "mayPeak": 4080000.0, # "junAvg": 2770000.0, "junPeak": 5810000.0, # "julAvg": 3970000.0, "julPeak": 6750000.0, # "augAvg": 3270000.0, "augPeak": 5200000.0, # "sepAvg": 2130000.0, "sepPeak": 4900000.0, # "octAvg": 1750000.0, "octPeak": 2340000.0, # "novAvg": 2210000.0, "novPeak": 3550000.0, # "decAvg": 2480000.0, "decPeak": 3370000.0} inData = {"modelType": "cvrStatic", "feederName": "public___ABEC Columbia", "runTime": "", "capitalCost": 30000, "omCost": 1000, "wholesaleEnergyCostPerKwh": 0.06, "retailEnergyCostPerKwh": 0.10, "peakDemandCostSpringPerKw": 5.0, "peakDemandCostSummerPerKw": 10.0, "peakDemandCostFallPerKw": 6.0, "peakDemandCostWinterPerKw": 8.0, "baselineTap": 3.0, "z_percent": 0.5, "i_percent": 0.0, "p_percent": 0.5, "power_factor": 0.9} for key in colomaMonths: inData[key] = colomaMonths[key] modelLoc = pJoin(workDir, "admin", "Automated staticCVR Testing") # Blow away old test results if necessary. try: shutil.rmtree(modelLoc) except: pass # No-input template. renderAndShow(template, fs) # Run the model. run(modelLoc, inData, fs) # # Show the output. renderAndShow(template, fs, modelDir=modelLoc)
def _tests(): # Variables from .. import filesystem fs = filesystem.Filesystem().fs workDir = pJoin(__metaModel__._omfDir, "data", "Model") # TODO: Fix inData because it's out of date. monthlyData = { "janSale": "46668", "janKWh": "64467874", "janRev": "8093137", "janKWhT": "85628959", "janRevT": "10464278", "febSale": "46724", "febKWh": "66646882", "febRev": "8812203", "febKWhT": "89818661", "febRevT": "11508047", "marSale": "46876", "marKWh": "62467031", "marRev": "8277498", "marKWhT": "84780954", "marRevT": "10874720", "aprSale": "46858", "aprKWh": "49781827", "aprRev": "6664021", "aprKWhT": "70552865", "aprRevT": "9122130", "maySale": "46919", "mayKWh": "41078029", "mayRev": "5567683", "mayKWhT": "63397699", "mayRevT": "8214078", "junSale": "46977", "junKWh": "40835343", "junRev": "5528717", "junKWhT": "64781785", "junRevT": "8332117", "julSale": "47013", "julKWh": "58018686", "julRev": "7585330", "julKWhT": "86140915", "julRevT": "10793395", "augSale": "47114", "augKWh": "67825037", "augRev": "8836269", "augKWhT": "98032727", "augRevT": "12219454", "sepSale": "47140", "sepKWh": "59707578", "sepRev": "7809767", "sepKWhT": "88193645", "sepRevT": "11052318", "octSale": "47088", "octKWh": "46451858", "octRev": "6146975", "octKWhT": "70425336", "octRevT": "8936767", "novSale": "47173", "novKWh": "41668828", "novRev": "5551288", "novKWhT": "65008851", "novRevT": "8228072", "decSale": "47081", "decKWh": "53354283", "decRev": "7014717", "decKWhT": "73335526", "decRevT": "9385203"} inData = { "modelType": "solarRates", "zipCode": "64735", "runTime": "", # Single data point "avgSystemSize": "5", "resPenetration": "5", "customServiceCharge": "20", "solarServiceCharge": "0", "solarLCoE": "0.09", "otherElecRevenue": "1544165", "totalKWhPurchased": "999330657", # Form 7 data "powerProExpense": "0", "costPurchasedPower": "80466749", "transExpense": "15027", "distriExpenseO": "5294026", "distriExpenseM": "5535844", "customerAccountExpense": "4426441", "customerServiceExpense": "643418", "salesExpense": "127084", "adminGeneralExpense": "8264362", "depreAmortiExpense": "8975862", "taxExpensePG": "0", "taxExpense": "197924", "interestLongTerm": "10195988", "interestConstruction": "0", "interestExpense": "209969", "otherDeductions": "126640", "nonOpMarginInterest": "123401", "fundsUsedConstruc": "0", "incomeEquityInvest": "0", "nonOpMarginOther": "811043", "genTransCapCredits": "1015764", "otherCapCreditsPatroDivident": "1135379", "extraItems": "0"} for key in monthlyData: inData[key] = monthlyData[key] modelLoc = pJoin(workDir, "admin", "Automated solarRates Testing") # Blow away old test results if necessary. try: fs.remove(modelLoc) except: # No previous test results. pass # No-input template. renderAndShow(template, fs) # Run the model. run(modelLoc, inData, fs) # Show the output. renderAndShow(template, fs, modelDir=modelLoc)