From 539ebcec650e4be604033d99074571e4413503f6 Mon Sep 17 00:00:00 2001 From: cdeline Date: Wed, 28 Sep 2022 15:40:30 -0600 Subject: [PATCH] Bug fix importing BF_BifacialIrradiances. some Py3 code changes. --- .../calculatePVMismatch_BilinearInterpolation.py | 4 ++-- bifacialvf/__init__.py | 2 ++ bifacialvf/analysis.py | 8 +++----- setup.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bifacialvf/BF_BifacialIrradiances/calculatePVMismatch_BilinearInterpolation.py b/bifacialvf/BF_BifacialIrradiances/calculatePVMismatch_BilinearInterpolation.py index 417e42f..6e7e37f 100644 --- a/bifacialvf/BF_BifacialIrradiances/calculatePVMismatch_BilinearInterpolation.py +++ b/bifacialvf/BF_BifacialIrradiances/calculatePVMismatch_BilinearInterpolation.py @@ -61,7 +61,7 @@ myfall=myfolder+'/'+myf[mainloop] #data, meta = loadVFresults(myfall) writefiletitle=myfolder+"testtest.csv" - print "Working on ", myf[mainloop] + print (f"Working on {myf[mainloop]}") with open(myfall,'r') as csvinput: with open(writefiletitle, 'w') as csvoutput: @@ -131,6 +131,6 @@ #writer.writerows(all) toc = time.clock() - print "Results Ready in ", (toc-tic)/60.0 , " minutes" + print (f"Results Ready in {(toc-tic)/60.0} minutes") diff --git a/bifacialvf/__init__.py b/bifacialvf/__init__.py index 9edde23..b3ec6bc 100644 --- a/bifacialvf/__init__.py +++ b/bifacialvf/__init__.py @@ -5,6 +5,8 @@ from bifacialvf.vf import getSkyConfigurationFactors, trackingBFvaluescalculator, rowSpacing # helper functions from bifacialvf.sun import hrSolarPos, perezComp, solarPos, sunIncident # solar position and value from bifacialvf.loadVFresults import loadVFresults # utility for reading result files +from bifacialvf.BF_BifacialIrradiances.LandscapeSingleHour import LandscapeSingleHour # For calculateBilInterpol +from bifacialvf.BF_BifacialIrradiances.PortraitSingleHour import PortraitSingleHour # For calculateBilInterpol from ._version import get_versions __version__ = get_versions()['version'] diff --git a/bifacialvf/analysis.py b/bifacialvf/analysis.py index 3dc66a5..d74a3cd 100644 --- a/bifacialvf/analysis.py +++ b/bifacialvf/analysis.py @@ -9,8 +9,6 @@ import scipy.io as sio import sys, os #sys.path.insert(0, 'BF_BifacialIrradiances') -from bifacialvf.BF_BifacialIrradiances.PortraitSingleHour import PortraitSingleHour # For calculateBilInterpol -from bifacialvf.BF_BifacialIrradiances.LandscapeSingleHour import LandscapeSingleHour # For calculateBilInterpol from pvmismatch import * # this imports everything we need import bifacialvf import os @@ -186,7 +184,7 @@ def calculateVFBilinearInterpolation(portraitorlandscape, sensorsy, interpolA, I cellCenterValFront = frontGTIrow cellCenterValBack = backGTIrow - [PmaxIdeal, PmaxUnmatched, PmaxAvg] = LandscapeSingleHour(cellCenterValFront, cellCenterValBack, Tamb, VWind, 6, interpolA,IVArray,beta_voc_all,m_all,bee_all) + [PmaxIdeal, PmaxUnmatched, PmaxAvg] = bifacialvf.LandscapeSingleHour(cellCenterValFront, cellCenterValBack, Tamb, VWind, 6, interpolA,IVArray,beta_voc_all,m_all,bee_all) return PmaxIdeal, PmaxUnmatched @@ -250,10 +248,10 @@ def analyseVFResultsBilInterpol(filename, portraitorlandscape='landscape', bifif for i in range (0,len(frontGTI)): cellCenterValFront=frontGTI.iloc[i] cellCenterValBack=backGTI.iloc[i] - [PmaxIdeal, PmaxUnmatched, PmaxAvg] = LandscapeSingleHour(cellCenterValFront, cellCenterValBack, data['Tamb'][i], data['VWind'][i], 6, interpolA,IVArray,beta_voc_all,m_all,bee_all) + [PmaxIdeal, PmaxUnmatched, PmaxAvg] = bifacialvf.LandscapeSingleHour(cellCenterValFront, cellCenterValBack, data['Tamb'][i], data['VWind'][i], 6, interpolA,IVArray,beta_voc_all,m_all,bee_all) PowerAveraged_all.append(PmaxIdeal) PowerDetailed_all.append(PmaxUnmatched) - [PmaxIdeal, PmaxUnmatched, PmaxAvg] = LandscapeSingleHour(cellCenterValFront, cellCenterValBack, data['Tamb'][i], data['VWind'][i], 6, interpolA,IVArray,beta_voc_all,m_all,bee_all) + [PmaxIdeal, PmaxUnmatched, PmaxAvg] = bifacialvf.LandscapeSingleHour(cellCenterValFront, cellCenterValBack, data['Tamb'][i], data['VWind'][i], 6, interpolA,IVArray,beta_voc_all,m_all,bee_all) PowerAveraged_FrontOnly_all.append(PmaxIdeal) PowerDetailed_FrontOnly_all.append(PmaxUnmatched) diff --git a/setup.py b/setup.py index 489ee8f..b1eca8b 100644 --- a/setup.py +++ b/setup.py @@ -74,8 +74,8 @@ # You can just specify the packages manually here if your project is # simple. Or you can use find_packages(). - #packages=find_packages(exclude=['contrib', 'docs', 'tests']) + ['data'], - packages = ['bifacialvf'], + packages=find_packages(), + #packages = ['bifacialvf'], # Alternatively, if you want to distribute just a my_module.py, uncomment # this: #py_modules=["bifacialvf"],