: {'Back/FrontRatio': [0.171, 0.171, 0.173], 'Wm2Back': [43.126, 43.227, 43.703], 'Wm2Front': [252.608, 252.791, 252.974], 'backRatio': [0.171, 0.171, 0.173], 'hpc': False, 'mattype': ['a1.0.a0.test-module.6457', 'a1.0.a0.test-module.6457', 'a1.0.a0.test-module.6457'], 'name': '1axis_2021-01-13_1200', 'octfile': '1axis_2021-01-13_1200.oct', 'rearMat': ['a1.0.a0.test-module.2310', 'a1.0.a0.test-module.2310', 'a1.0.a0.test-module.2310'], 'rearX': [0.466, -0.0, -0.467], 'rearY': [0.0, -0.0, -0.0], 'rearZ': [1.318, 1.499, 1.68], 'x': [0.474, 0.008, -0.459], 'y': [0.0, 0.0, -0.0], 'z': [1.339, 1.52, 1.7]}, 'Wm2Front': [252.60800000000003, 252.7909, 252.9742], 'Wm2Back': [43.126380000000005, 43.22666, 43.70311999999999], 'backRatio': [0.17072384594373122, 0.17099701374925386, 0.17275653898089613]}}\n"
]
},
{
"data": {
"text/plain": [
- "73.50428000429895"
+ "73.25703819145978"
]
},
- "execution_count": 16,
+ "execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
@@ -273,7 +253,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 8,
"id": "fe18ea62",
"metadata": {},
"outputs": [
@@ -327,58 +307,62 @@
" 2021-01-13_1100 | \n",
" 149 | \n",
" 211 | \n",
- " [45.16279, 45.26495, 46.29665] | \n",
- " [254.9108, 255.7401, 255.45539999999997] | \n",
+ " [44.704460000000005, 45.11092, 45.9956] | \n",
+ " [254.0611, 254.9967, 254.1804] | \n",
" -44.14 | \n",
" 44.14 | \n",
" 90.0 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
- " 45.574797 | \n",
- " 255.368767 | \n",
- " 0.160620 | \n",
+ " 45.270327 | \n",
+ " 254.412733 | \n",
+ " 0.160146 | \n",
" \n",
" \n",
" 1 | \n",
" 2021-01-13_1200 | \n",
" 200 | \n",
" 249 | \n",
- " [43.32023999999999, 43.42238, 44.23265] | \n",
- " [254.43140000000002, 254.5634, 254.43729999999... | \n",
+ " [43.126380000000005, 43.22666, 43.70311999999999] | \n",
+ " [252.60800000000003, 252.7909, 252.9742] | \n",
" -21.20 | \n",
" 21.20 | \n",
" 90.0 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
- " 43.658423 | \n",
- " 254.477367 | \n",
- " 0.154405 | \n",
+ " 43.352053 | \n",
+ " 252.791033 | \n",
+ " 0.154344 | \n",
"
\n",
" \n",
"\n",
""
],
"text/plain": [
- " Unnamed: 0 dhi ghi Wm2Back \\\n",
- "0 2021-01-13_1100 149 211 [45.16279, 45.26495, 46.29665] \n",
- "1 2021-01-13_1200 200 249 [43.32023999999999, 43.42238, 44.23265] \n",
+ " Unnamed: 0 dhi ghi \\\n",
+ "0 2021-01-13_1100 149 211 \n",
+ "1 2021-01-13_1200 200 249 \n",
+ "\n",
+ " Wm2Back \\\n",
+ "0 [44.704460000000005, 45.11092, 45.9956] \n",
+ "1 [43.126380000000005, 43.22666, 43.70311999999999] \n",
"\n",
- " Wm2Front theta surf_tilt \\\n",
- "0 [254.9108, 255.7401, 255.45539999999997] -44.14 44.14 \n",
- "1 [254.43140000000002, 254.5634, 254.43729999999... -21.20 21.20 \n",
+ " Wm2Front theta surf_tilt surf_azm \\\n",
+ "0 [254.0611, 254.9967, 254.1804] -44.14 44.14 90.0 \n",
+ "1 [252.60800000000003, 252.7909, 252.9742] -21.20 21.20 90.0 \n",
"\n",
- " surf_azm clearance_height effective_irradiance Pout_module Wm2BackAvg \\\n",
- "0 90.0 NaN NaN NaN 45.574797 \n",
- "1 90.0 NaN NaN NaN 43.658423 \n",
+ " clearance_height effective_irradiance Pout_module Wm2BackAvg \\\n",
+ "0 NaN NaN NaN 45.270327 \n",
+ "1 NaN NaN NaN 43.352053 \n",
"\n",
" Wm2FrontAvg BifiRatio \n",
- "0 255.368767 0.160620 \n",
- "1 254.477367 0.154405 "
+ "0 254.412733 0.160146 \n",
+ "1 252.791033 0.154344 "
]
},
- "execution_count": 17,
+ "execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
@@ -387,6 +371,14 @@
"demo.exportTrackerDict(savefile=os.path.join('results','Final_Results.csv'),reindex=False)\n",
"pd.read_csv(os.path.join('results','Final_Results.csv'))"
]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "6c84aef5",
+ "metadata": {},
+ "outputs": [],
+ "source": []
}
],
"metadata": {
@@ -405,7 +397,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.7"
+ "version": "3.9.13"
}
},
"nbformat": 4,
diff --git a/docs/tutorials/21 - Weather to Module Performance.py b/docs/tutorials/21 - Weather to Module Performance.py
index 0ae93bfc..f8221a76 100644
--- a/docs/tutorials/21 - Weather to Module Performance.py
+++ b/docs/tutorials/21 - Weather to Module Performance.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# coding: utf-8
-# In[2]:
+# In[1]:
# This information helps with debugging and getting support :)
@@ -20,7 +20,7 @@
# This tutorial shows how to use the new function on bifacial_radiance calculatePerformanceModule performance, as well as how to find CEC Module parameters.
#
-# In[3]:
+# In[2]:
import os
@@ -36,7 +36,7 @@
print ("Your simulation will be stored in %s" % testfolder)
-# In[4]:
+# In[3]:
import bifacial_radiance
@@ -47,7 +47,7 @@
bifacial_radiance.__version__
-# In[5]:
+# In[4]:
# Selecting only two times as examples
@@ -67,7 +67,7 @@
# ## Geting a CEC Module
-# In[ ]:
+# In[5]:
url = 'https://raw.githubusercontent.com/NREL/SAM/patch/deploy/libraries/CEC%20Modules.csv'
@@ -78,7 +78,7 @@
#
# Make sure you select only 1 module from the database -- sometimes there are similar names.
-# In[ ]:
+# In[6]:
modfilter2 = db.index.str.startswith('SunPower') & db.index.str.endswith('SPR-E19-310-COM')
@@ -89,16 +89,25 @@
# ## Calculating the Performance and Exporting the Results to a CSV
-# In[ ]:
+# In[7]:
-demo.calculateResults(CECMod=CECMod)
+print(trackerdict)
+tracker_dict_sample = trackerdict['2021-01-13_1100']
+eff_irr = tracker_dict_sample['Wm2Front'] + tracker_dict_sample['Wm2Back']
+bifacial_radiance.performance.calculatePerformance(eff_irr[0],CECMod=CECMod)
#calculatePerformanceModule -> calculcateResults()
+# In[8]:
+
+
+demo.exportTrackerDict(savefile=os.path.join('results','Final_Results.csv'),reindex=False)
+pd.read_csv(os.path.join('results','Final_Results.csv'))
+
+
# In[ ]:
-#demo.exportTrackerDict(savefile=os.path.join('results','Final_Results.csv'),reindex=False)
-#pd.read_csv(os.path.join('results','Final_Results.csv'))
+
diff --git a/docs/tutorials/4 - Debugging with Custom Objects.ipynb b/docs/tutorials/4 - Debugging with Custom Objects.ipynb
index 66e2f250..93728b97 100644
--- a/docs/tutorials/4 - Debugging with Custom Objects.ipynb
+++ b/docs/tutorials/4 - Debugging with Custom Objects.ipynb
@@ -857,7 +857,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.7"
+ "version": "3.9.13"
}
},
"nbformat": 4,
diff --git a/docs/tutorials/4 - Debugging with Custom Objects.py b/docs/tutorials/4 - Debugging with Custom Objects.py
index 7e11d24a..224d9435 100644
--- a/docs/tutorials/4 - Debugging with Custom Objects.py
+++ b/docs/tutorials/4 - Debugging with Custom Objects.py
@@ -188,6 +188,7 @@
# In[6]:
+
## Comment the line below to run rvu from the Jupyter notebook instead of your terminal.
## Simulation will stop until you close the rvu window
@@ -258,8 +259,7 @@
print('CORRECT Annual bifacial ratio average: %0.3f' %( clean_results['Wm2Back'].sum() / clean_results['Wm2Front'].sum() ))
-print ("\n(If we had not done the cleaning routine, the bifacial ratio would have been ", \
- "calculated to %0.3f <-- THIS VALUE IS WRONG)" %( sum(analysis.Wm2Back) / sum(analysis.Wm2Front) ))
+print ("\n(If we had not done the cleaning routine, the bifacial ratio would have been ", "calculated to %0.3f <-- THIS VALUE IS WRONG)" %( sum(analysis.Wm2Back) / sum(analysis.Wm2Front) ))
#
@@ -304,6 +304,7 @@
# In[15]:
+
## Comment the line below to run rvu from the Jupyter notebook instead of your terminal.
## Simulation will stop until you close the rvu window
diff --git a/docs/tutorials/SAT Reflectors Example.ipynb b/docs/tutorials/SAT Reflectors Example.ipynb
index bd489e33..795fff0a 100644
--- a/docs/tutorials/SAT Reflectors Example.ipynb
+++ b/docs/tutorials/SAT Reflectors Example.ipynb
@@ -2,10 +2,21 @@
"cells": [
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 1,
"id": "4e0aa4be-9f97-44a7-bff8-4fedaf4c4179",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Working on a Windows 10\n",
+ "Python version 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)]\n",
+ "Pandas version 1.5.3\n",
+ "bifacial_radiance version 0.4.4.dev\n"
+ ]
+ }
+ ],
"source": [
"# This information helps with debugging and getting support :)\n",
"import sys, platform\n",
@@ -36,7 +47,7 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 2,
"id": "9e16eef3",
"metadata": {},
"outputs": [],
@@ -47,6 +58,7 @@
"import os\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
+ "from pathlib import Path\n",
"\n",
"#Import bifacial radiance code \n",
"try:\n",
@@ -65,7 +77,7 @@
},
{
"cell_type": "code",
- "execution_count": 3,
+ "execution_count": 4,
"id": "2e309b9a",
"metadata": {},
"outputs": [
@@ -73,6 +85,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
+ "Your simulation will be stored in C:\\Users\\cdeline\\Documents\\Python Scripts\\Bifacial_Radiance\\bifacial_radiance\\TEMP\\SAT_Reflectors_example\n",
"1 modules selected. Name of 1st entry: LONGi Green Energy Technology Co. Ltd. LR6-60HIBD-305M\n",
"305.52\n"
]
@@ -80,12 +93,12 @@
],
"source": [
"# Define locations within file system\n",
- "testfolder = Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP' / 'SAT_Reflectors_example'\n",
+ "test_folder = Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP' / 'SAT_Reflectors_example'\n",
"\n",
"# Another option using relative address; for some operative systems you might need '/' instead of '\\'\n",
"# testfolder = os.path.abspath(r'..\\..\\bifacial_radiance\\TEMP') \n",
"\n",
- "print (\"Your simulation will be stored in %s\" % testfolder)\n",
+ "print (\"Your simulation will be stored in %s\" % test_folder)\n",
"\n",
"if not os.path.exists(test_folder):\n",
" os.makedirs(test_folder) \n",
@@ -3888,7 +3901,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.7"
+ "version": "3.9.13"
}
},
"nbformat": 4,
diff --git a/docs/tutorials/SAT Reflectors Example.py b/docs/tutorials/SAT Reflectors Example.py
index 357ef69a..ad0f8c34 100644
--- a/docs/tutorials/SAT Reflectors Example.py
+++ b/docs/tutorials/SAT Reflectors Example.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# coding: utf-8
-# In[ ]:
+# In[1]:
# This information helps with debugging and getting support :)
@@ -20,7 +20,7 @@
# # Load packages
-# In[1]:
+# In[2]:
"""alewis 2022"""
@@ -29,6 +29,7 @@
import os
import pandas as pd
import matplotlib.pyplot as plt
+from pathlib import Path
#Import bifacial radiance code
try:
@@ -39,16 +40,16 @@
# # Inputs for location, PV system, reflectors, etc
-# In[3]:
+# In[4]:
# Define locations within file system
-testfolder = Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP' / 'SAT_Reflectors_example'
+test_folder = Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP' / 'SAT_Reflectors_example'
# Another option using relative address; for some operative systems you might need '/' instead of '\'
# testfolder = os.path.abspath(r'..\..\bifacial_radiance\TEMP')
-print ("Your simulation will be stored in %s" % testfolder)
+print ("Your simulation will be stored in %s" % test_folder)
if not os.path.exists(test_folder):
os.makedirs(test_folder)
diff --git a/requirements.txt b/requirements.txt
index 77b53b66..58a5d8ad 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,27 +1,29 @@
-docutils<0.18
-coverage==7.2.1
-cycler==0.11.0
-idna==3.4
-importlib-metadata==6.0.0
+docutils<0.20
+coverage==7.6.1
+cycler==0.12.1
+idna==3.10
+importlib-metadata==8.5.0
ipython==8.13.0
-kiwisolver==1.4.4
-matplotlib==3.5.1
-more-itertools==9.1.0
+kiwisolver==1.4.7
+matplotlib==3.7.5
+more-itertools==10.5.0
numba==0.58.1
-numpy==1.24.2
-pandas==1.4.4
-pluggy==1.0.0
-pvlib==0.9.4
+numpy==1.24.4
+pandas==2.0.3
+pluggy==1.5.0
+pvlib==0.11.0
pvmismatch==4.1
py==1.11.0
-pyparsing==3.0.9
+pyparsing==3.1.4
pysmarts==0.0.1
-pytest==7.2.2
-pytest-cov==4.0.0
-python-dateutil==2.8.2
-pytz==2021.3
+pytest==8.3.3
+pytest-cov==5.0.0
+python-dateutil==2.9.0.post0
+pytz==2024.2
six==1.16.0
-sphinx-autoapi==1.8.4
-sphinx-rtd-theme==1.0.0
+sphinx == 7.1.2
+pydata-sphinx-theme == 0.14.4
+sphinx-autoapi==3.3.2
+sphinx-rtd-theme==3.0.1
requests
future
diff --git a/setup.py b/setup.py
index fda4d1ef..312b5831 100644
--- a/setup.py
+++ b/setup.py
@@ -39,7 +39,7 @@
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
# version='0.3.4',
- use_scm_version={"fallback_version":"0.4.3"},
+ use_scm_version={"fallback_version":"0.4.4"},
description='Tools to interface with Radiance for the PV researcher',
long_description=long_description,
long_description_content_type="text/markdown",
@@ -74,6 +74,8 @@
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11',
+ 'Programming Language :: Python :: 3.12',
],
# What does your project relate to?
@@ -112,11 +114,11 @@
'ipython',
'sphinx >= 1.8.0',
'sphinx-autoapi>=1.1.0',
- 'pydata-sphinx-theme==0.8.1',
- 'nbsphinx==0.8.8',
+ 'pydata-sphinx-theme>=0.14.4',
+ 'nbsphinx>=0.8.8',
# sphinx-gallery is used indirectly for nbsphinx thumbnail galleries; see:
# https://nbsphinx.readthedocs.io/en/0.6.0/subdir/gallery.html#Creating-Thumbnail-Galleries
- 'sphinx-gallery==0.8.1',
+ 'sphinx-gallery>=0.8.1',
'tqdm',
],
'all': [
diff --git a/tests/ini_cell_level_module.ini b/tests/ini_cell_level_module.ini
index b2265a14..0fa63872 100644
--- a/tests/ini_cell_level_module.ini
+++ b/tests/ini_cell_level_module.ini
@@ -24,8 +24,8 @@ clearance_height = 0.8
hub_height = 0.9
[timeControlParamsDict]
-starttime: 06_21_11_00
-endtime: 06_21_12_00
+starttime: 06_21_11
+endtime: 06_21_12
[moduleParamsDict]
numpanels = 2
diff --git a/tests/ini_soltec.ini b/tests/ini_soltec.ini
index 63cd00ea..f66cd719 100644
--- a/tests/ini_soltec.ini
+++ b/tests/ini_soltec.ini
@@ -16,8 +16,8 @@ latitude: 37.5
longitude: -77.6
[timeControlParamsDict]
-starttime: 06_21_12_00
-endtime: 06_21_12_00
+starttime: 06_21_12
+endtime: 06_21_12
[sceneParamsDict]
gcrorpitch: pitch
diff --git a/tests/test_bifacial_radiance.py b/tests/test_bifacial_radiance.py
index 99fa585f..46c26356 100644
--- a/tests/test_bifacial_radiance.py
+++ b/tests/test_bifacial_radiance.py
@@ -356,7 +356,7 @@ def test_SingleModule_HPC():
print(demo.getfilelist())
octfile = demo.makeOct(demo.getfilelist()) # makeOct combines all of the ground, sky and object files into a .oct file.
analysis = bifacial_radiance.AnalysisObj(octfile, demo.name, hpc=True) # return an analysis object including the scan dimensions for back irradiance
- (frontscan,backscan) = analysis.moduleAnalysis(scene, sensorsy=1)
+ (frontscan,backscan) = analysis.moduleAnalysis(scene, sensorsy=1, debug=True)
analysis.analysis(octfile, demo.name, frontscan, backscan) # compare the back vs front irradiance
assert analysis.mattype[0][:12] == 'a0.0.a0.test'
assert analysis.rearMat[0][:12] == 'a0.0.a0.test'
@@ -619,4 +619,5 @@ def test_GH256_nomodule_error():
foodict = demo.makeScene1axis(trackerdict=foodict, module=moduletype,
sceneDict=sceneDict, cumulativesky=False)
+
\ No newline at end of file
diff --git a/tests/test_groundobj.py b/tests/test_groundobj.py
index 88aa5905..99445876 100644
--- a/tests/test_groundobj.py
+++ b/tests/test_groundobj.py
@@ -63,6 +63,8 @@ def test_RGB_timeseries():
albedo_bad = np.array([[0.2, 0.3, 0.4, 0.5], [0.12, 0.13, 0.26, 0.5]]) # invalid
ground = pytest.warns(UserWarning, bifacial_radiance.GroundObj, albedo_bad)
np.testing.assert_allclose(_groundtest(ground), testvals_const)
+ with pytest.raises(Exception):
+ temp = bifacial_radiance.GroundObj(np.array([[.1,.2],[.1,.2]]))
def test_printGroundMaterials():
ground = bifacial_radiance.GroundObj('litesoil')
@@ -70,4 +72,10 @@ def test_printGroundMaterials():
def test_albedo_greaterthan_one():
ground = bifacial_radiance.GroundObj(2)
- assert ground.ReflAvg[0] == 1
\ No newline at end of file
+ assert ground.ReflAvg[0] == 1
+
+def test_repr_and_normval():
+ ground = bifacial_radiance.GroundObj()
+ groundstr = ground.__repr__()
+ ground = bifacial_radiance.GroundObj([0.1, 0.2])
+ assert ground.normval == pytest.approx([0.10034, 0.20068])