Skip to content

Commit

Permalink
Bug fix importing BF_BifacialIrradiances. some Py3 code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeline committed Sep 28, 2022
1 parent 6b6ce44 commit 539ebce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Expand Up @@ -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:
Expand Down Expand Up @@ -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")


2 changes: 2 additions & 0 deletions bifacialvf/__init__.py
Expand Up @@ -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']
Expand Down
8 changes: 3 additions & 5 deletions bifacialvf/analysis.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -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"],
Expand Down

0 comments on commit 539ebce

Please sign in to comment.