Skip to content

Commit 2ef360c

Browse files
committed
Merge branch 'main' into development
2 parents 2a3a7f5 + 82b8fbc commit 2ef360c

File tree

14 files changed

+71
-17095
lines changed

14 files changed

+71
-17095
lines changed

.DS_Store

-8 KB
Binary file not shown.

.github/workflows/pytest.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
# 2) 'pip install --upgrade --upgrade-strategy=eager .' to install upgraded
1616
# dependencies from PyPi using version ranges defined within setup.py
1717
env: [
18-
'-r requirements.txt .[all]',
19-
'--upgrade --upgrade-strategy=eager .[all]'
18+
'-r requirements.txt .[all]'
2019
]
2120
include:
22-
- python-version: "3.12"
21+
- python-version: "3.13"
22+
env: '--upgrade --upgrade-strategy=eager .[all]'
23+
- python-version: "3.14"
2324
env: '--upgrade --upgrade-strategy=eager .[all]'
24-
2525

2626
steps:
2727
- uses: actions/checkout@v4
@@ -68,7 +68,8 @@ jobs:
6868
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a # GUI testing requires xvfb
6969
with:
7070
run: |
71-
pytest --cov=bifacial_radiance
71+
coverage run -m pytest
72+
coverage report
7273
env: # environment variables available to this step
7374
RAYPATH: .:/home/runner/work/bifacial_radiance/bifacial_radiance/radiance-5.3.012cb17835-Linux/usr/local/radiance/lib
7475
SMARTSPATH: /home/runner/work/bifacial_radiance/bifacial_radiance/SMARTS_295_Linux

bifacial_radiance/.DS_Store

-8 KB
Binary file not shown.

bifacial_radiance/data/module.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"PVmod": {
33
"bifi": 1,
44
"glass": false,
5-
"modulefile": "objects/PVmod.rad",
5+
"modulefile": null,
66
"modulematerial": "black",
77
"numpanels": 1,
88
"offsetfromaxis": 0,
@@ -65,7 +65,8 @@
6565
"test": {
6666
"bifi": 1,
6767
"glass": false,
68-
"modulefile": "objects\\test.rad",
68+
"glassEdge": 0.01,
69+
"modulefile": null,
6970
"modulematerial": "black",
7071
"numpanels": 1,
7172
"offsetfromaxis": 0,
@@ -83,6 +84,7 @@
8384
"test-module": {
8485
"bifi": 1,
8586
"glass": false,
87+
"glassEdge": 0.01,
8688
"modulefile": null,
8789
"modulematerial": "black",
8890
"numpanels": 1,

bifacial_radiance/main.py

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*RADIANCE software should be installed from https://github.com/NREL/Radiance/releases
1414
1515
*If you want to use gencumulativesky, move 'gencumulativesky.exe' from
16-
'bifacial_radiance\data' into your RADIANCE source directory.
16+
'bifacial_radiance/data' into your RADIANCE source directory.
1717
1818
*If using a Windows machine you should download the Jaloxa executables at
1919
http://www.jaloxa.eu/resources/radiance/radwinexe.shtml#Download
@@ -28,7 +28,7 @@
2828
different PV system orientations for rear bifacial irradiance.
2929
Note that this is simply an optical model - identifying available rear irradiance under different conditions.
3030
31-
For a detailed demonstration example, look at the .ipnyb notebook in \docs\
31+
For a detailed demonstration example, look at the .ipnyb notebook in /docs/
3232
3333
There are two solar resource modes in bifacial_radiance: `gendaylit` uses hour-by-hour solar
3434
resource descriptions using the Perez diffuse tilted plane model.
@@ -578,7 +578,7 @@ def addMaterial(self, material, Rrefl, Grefl, Brefl, materialtype='plastic',
578578
Returns
579579
-------
580580
None. Just adds the material to the material_file specified or the
581-
default in ``materials\ground.rad``.
581+
default in ``materials/ground.rad``.
582582
583583
References:
584584
See examples of documentation for more materialtype details.
@@ -787,7 +787,7 @@ def setGround(self, material=None, material_file=None):
787787
def getEPW(self, lat=None, lon=None, GetAll=False):
788788
"""
789789
Subroutine to download nearest epw files to latitude and longitude provided,
790-
into the directory \EPWs\
790+
into the directory /EPWs/
791791
based on github/aahoo.
792792
793793
.. warning::
@@ -1837,7 +1837,7 @@ def genCumSky(self, gencumsky_metfile=None, savefile=None):
18371837
gencumulativesky.exe is required to be installed,
18381838
which is not a standard radiance distribution.
18391839
You can find the program in the bifacial_radiance distribution directory
1840-
in \Lib\site-packages\bifacial_radiance\data
1840+
in /Lib/site-packages/bifacial_radiance/data
18411841
18421842
18431843
Use :func:`readWeatherFile(filename, starttime='YYYY-mm-dd_HHMM', endtime='YYYY-mm-dd_HHMM')`
@@ -2278,7 +2278,7 @@ def makeModule(self, name=None, x=None, y=None, z=None, modulefile=None,
22782278
from bifacial_radiance import ModuleObj
22792279

22802280
if name is None:
2281-
print("usage: makeModule(name,x,y,z, modulefile = '\objects\*.rad', "+
2281+
print("usage: makeModule(name,x,y,z, modulefile = '/objects/*.rad', "+
22822282
" zgap = 0.1 (module offset)"+
22832283
"numpanels = 1 (# of panels in portrait), ygap = 0.05 "+
22842284
"(slope distance between panels when arrayed), "+
@@ -2514,7 +2514,7 @@ def makeScene(self, module=None, sceneDict=None, radname=None,
25142514

25152515
def appendtoScene(self, radfile=None, customObject=None, text=''):
25162516
"""
2517-
Appends to the `Scene radfile` in folder `\objects` the text command in Radiance
2517+
Appends to the `Scene radfile` in folder `/objects` the text command in Radiance
25182518
lingo created by the user.
25192519
Useful when using addCustomObject to the scene.
25202520
@@ -2822,17 +2822,20 @@ def analysis1axis(self, trackerdict=None, singleindex=None, accuracy='low',
28222822
28232823
Returns
28242824
-------
2825-
trackerdict is returned with :py:class:`bifacial_radiance.AnalysisObj`
2826-
for each timestamp:
2827-
2828-
trackerdict.key.'AnalysisObj' : analysis object for this tracker theta
2829-
to get a dictionary of results, run :py:class:`bifacial_radiance.AnalysisObj`.results
2830-
:py:class:`bifacial_radiance.AnalysisObj`.results returns the following df:
2831-
'name', 'modNum', 'rowNum', 'sceneNum', 'x','y','z', 'mattype', 'rearMat',
2832-
'Wm2Front' : np.array of front Wm-2 irradiances, len=sensorsy_back
2833-
'Wm2Back' : np.array of rear Wm-2 irradiances, len=sensorsy_back
2834-
'backRatio' : np.array of rear irradiance ratios, len=sensorsy_back
2835-
2825+
trackerdict : dict
2826+
trackerdict.key. :py:class:`bifacial_radiance.AnalysisObj`
2827+
for each timestamp or tracker theta.
2828+
2829+
Note
2830+
----
2831+
:py:class:`bifacial_radiance.AnalysisObj`.results returns a DataFrame with
2832+
the following columns:
2833+
2834+
* 'name', 'modNum', 'rowNum', 'sceneNum', 'x','y','z', 'mattype', 'rearMat'
2835+
* 'Wm2Front' : np.array of front Wm-2 irradiances, len=sensorsy_back
2836+
* 'Wm2Back' : np.array of rear Wm-2 irradiances, len=sensorsy_back
2837+
* 'backRatio' : np.array of rear irradiance ratios, len=sensorsy_back
2838+
28362839
"""
28372840

28382841
import warnings, itertools
@@ -2952,13 +2955,11 @@ def analysis1axisground(self, trackerdict=None, singleindex=None, accuracy='low'
29522955
Returns
29532956
-------
29542957
trackerdict is returned with :py:class:`bifacial_radiance.AnalysisObj`
2955-
for each timestamp:
2958+
for each timestamp.
29562959
2957-
trackerdict.key.'AnalysisObj' : analysis object for this tracker theta
2958-
to get a dictionary of results, run :py:class:`bifacial_radiance.AnalysisObj`.results
2959-
:py:class:`bifacial_radiance.AnalysisObj`.results returns the following keys:
2960-
'Wm2Ground' : np.array of Wm-2 irradiances along the ground, len=sensorsground
2961-
'sensorsground' : int of number of ground scan points
2960+
* :py:class:`bifacial_radiance.AnalysisObj`.results returns the following keys:
2961+
* 'Wm2Ground' : np.array of Wm-2 irradiances along the ground, len=sensorsground
2962+
* 'sensorsground' : int of number of ground scan points
29622963
29632964
"""
29642965

@@ -3034,31 +3035,29 @@ def calculatePerformance1axis(self, trackerdict=None, module=None,
30343035
considering electrical mismatch, using
30353036
PVLib. Cell temperature is calculated
30363037
3037-
30383038
Parameters
30393039
----------
30403040
module: ModuleObj from scene.module
30413041
It's best to set this in advance in the ModuleObj.
30423042
If passed in here, it overrides the value that may be set in the
30433043
trackerdict already.
3044-
CECMod2 : Dict
3044+
CECMod2 : dict, optional
30453045
Dictionary with CEC Module Parameters for a Monofacial module. If None,
30463046
same module as CECMod is used for the BGE calculations, but just
30473047
using the front irradiance (Gfront).
30483048
30493049
Returns
30503050
-------
3051-
trackerdict
3051+
trackerdict : dict
30523052
Trackerdict with new entries for each key of irradiance and Power
3053-
Output for the module.
3054-
POA_eff: mean of [(mean of clean Gfront) + clean Grear * bifaciality factor]
3055-
Gfront_mean: mean of clean Gfront
3056-
Grear_mean: mean of clean Grear
3057-
Mismatch: mismatch calculated from the MAD distribution of
3058-
POA_total
3059-
Pout_raw: power output calculated from POA_total, considers
3060-
wind speed and temp_amb if in trackerdict.
3061-
Pout: power output considering electrical mismatch
3053+
Output for the module. Each entry contains the keys:
3054+
3055+
* 'POA_eff': mean of [(mean of clean Gfront) + clean Grear * bifaciality factor]
3056+
* 'Gfront_mean': mean of clean Gfront
3057+
* 'Grear_mean': mean of clean Grear
3058+
* 'Mismatch': mismatch calculated from the MAD distribution of POA_total
3059+
* 'Pout_raw': power output calculated from POA_total, considers wind speed and temp_amb if in trackerdict.
3060+
* 'Pout': power output considering electrical mismatch losses.
30623061
30633062
"""
30643063

@@ -3707,7 +3706,7 @@ def _makeSceneNxR(self, modulename=None, sceneDict=None, radname=None, addhubhei
37073706

37083707
def appendtoScene(self, customObject=None, radfile=None, text=''):
37093708
"""
3710-
Appends to the `Scene radfile` in folder `\objects` the text command in Radiance
3709+
Appends to the `Scene radfile` in folder `/objects` the text command in Radiance
37113710
lingo created by the user.
37123711
Useful when using addCustomObject to the scene.
37133712
@@ -5552,12 +5551,13 @@ def calculatePerformance(self, meteo_data, cumulativesky, module,
55525551
-------
55535552
performance : dictionary with performance results for that simulation.
55545553
Keys:
5555-
'POA_eff': mean of [(mean of clean Gfront) + clean Grear * bifaciality factor]
5556-
'Gfront_mean': mean of clean Gfront
5557-
'Grear_mean': mean of clean Grear
5558-
'Mismatch': mismatch calculated from the MAD distribution of POA_total
5559-
'Pout_raw': power output calculated from POA_total, considers wind speed and temp_amb if in trackerdict.
5560-
'Pout': power output considering electrical mismatch
5554+
5555+
* 'POA_eff': mean of [(mean of clean Gfront) + clean Grear * bifaciality factor]
5556+
* 'Gfront_mean': mean of clean Gfront
5557+
* 'Grear_mean': mean of clean Grear
5558+
* 'Mismatch': mismatch calculated from the MAD distribution of POA_total
5559+
* 'Pout_raw': power output calculated from POA_total, considers wind speed and temp_amb if in trackerdict.
5560+
* 'Pout': power output considering electrical mismatch
55615561
55625562
"""
55635563

bifacial_radiance/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def _saveModule(self, savedata, json=True, rewriteModulefile=True):
346346
with open(self.modulefile, 'wb') as f:
347347
f.write(self.text.encode('ascii'))
348348
except FileNotFoundError:
349-
raise Exception(f'ModuleObj Error: directory "\{os.path.dirname(self.modulefile)}" not found '\
349+
raise Exception(f'ModuleObj Error: directory "/{os.path.dirname(self.modulefile)}" not found '\
350350
f' in current path which is {os.getcwd()}. Cannot create '\
351351
f'{os.path.basename(self.modulefile)}. '\
352352
'Are you in a valid bifacial_radiance directory?')

bifacial_radiance/spectral_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def integrated_spectrum(spectra_folder, metdata ):
495495
496496
497497
Returns:
498-
-------
498+
--------
499499
integrated_sums: (list)
500500
list of integrated sums for DNI, DHI, DNI*ALB, DHI*ALB
501501
"""

docs/.DS_Store

-6 KB
Binary file not shown.

docs/sphinx/source/whatsnew/v0.5.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _whatsnew_050:
22

3-
v0.5.0 (XX / XX / 2025)
3+
v0.5.0 (November 6, 2025)
44
------------------------
55
Major release with new functionality. Specifically multiple SceneObjs can be defined using makeScene(append=True).
66
Also, results are stored in a DataFrame as RadianceObj.results and AnalysisObj.results

0 commit comments

Comments
 (0)