revert if __name__ == "__main__" removal. keep in development.
@@ -3951,3 +3951,58 @@ def quickExample(testfolder=None):
sum(analysis.Wm2Back) / sum(analysis.Wm2Front) ) )
return analysis
+
+
+if __name__ == "__main__":
+ '''
+ Example of how to run a Radiance routine for a simple rooftop bifacial system
+
+ '''
+ import multiprocessing as mp
+
+ # print("This is daydate %s" % (daydate))
+ demo = RadianceObj(simulationname,path=testfolder)
+ #epwfile = demo.getEPW(44, -110)
+ #print(epwfile)
+ demo.setGround(albedo)
+ # metdata = demo.readWeatherFile(epwfile)
+ # moduleDict=demo.makeModule(name=moduletype,x=x,y=y,bifi=bifi,
+ # torquetube=torqueTube, diameter = diameter, tubetype = tubetype,
+ # material = torqueTubeMaterial, zgap = zgap, numpanels = numpanels, ygap = ygap,
+ # rewriteModulefile = True, xgap=xgap,
+ # axisofrotationTorqueTube=axisofrotationTorqueTube)
+
+ sceneDict = {'module_type':moduletype, 'pitch': pitch, 'hub_height':hub_height, 'nMods':nMods, 'nRows':nRows}
+
+ cores = mp.cpu_count()
+ pool = mp.Pool(processes=cores)
+ res = None
+ print ("This is cores", cores)
+
+ try:
+ nodeID = int(os.environ['SLURM_NODEID'])
+ except:
+ nodeID = 0
+ day_index = (36 * (nodeID))
+
+ # doing less days for testing
+ start = datetime.datetime.strptime("01-01-2014", "%d-%m-%Y")
+ end = datetime.datetime.strptime("31-12-2014", "%d-%m-%Y") # 2014 not a leap year.
+ #start = datetime.datetime.strptime("14-02-2014", "%d-%m-%Y")
+ #end = datetime.datetime.strptime("26-02-2014", "%d-%m-%Y") # 2014 not a leap year.
+ date_generated = [start + datetime.timedelta(days=x) for x in range(0, (end-start).days)]
+
+ daylist = []
+ for date in date_generated:
+ daylist.append(date.strftime("%m_%d"))
+ # loop doesn't add last day :
+
+# print (daylist)
+ for job in range(cores):
+ if day_index+job>=60: #len(daylist):
+ break
+ pool.apply_async(runJob, (daylist[day_index+job],))
+
+ pool.close()
+ pool.join()
+ pool.terminate()
