Skip to content

Commit

Permalink
Change how analysis1axis append=False warning shows up.
Browse files Browse the repository at this point in the history
Update tutorial 21 weather to module performance.
  • Loading branch information
cdeline committed Sep 24, 2024
1 parent f3e5878 commit dc25bde
Show file tree
Hide file tree
Showing 5 changed files with 475 additions and 371 deletions.
2 changes: 1 addition & 1 deletion bifacial_radiance/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def _printRow(analysisobj, key):

for key in trackerdict:
try:
extra_columns = ['surf_azm','surf_tilt','theta','temp_air']
extra_columns = ['surf_azm','surf_tilt','theta']
data_extra = df(dict([(col,trackerdict[key][col]) \
for col in extra_columns if col in trackerdict[key]]),
index=[0])
Expand Down
2 changes: 1 addition & 1 deletion bifacial_radiance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,7 @@ def analysis1axis(self, trackerdict=None, singleindex=None, accuracy='low',
print('No trackerdict value passed or available in self')

if not append:
warnings.warn('Append=False. Over-writing any existing `AnalysisObj` in trackerdict.')
print('\nAnalysis1axis: append=False. Over-writing any existing `AnalysisObj` in trackerdict.\n')
for key in trackerdict:
trackerdict[key]['AnalysisObj'] = []

Expand Down
71 changes: 40 additions & 31 deletions docs/development/(dev) test_gencumskyMTX.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"output_type": "stream",
"text": [
"Working on a Windows 10\n",
"Python version 3.11.7 | packaged by Anaconda, Inc. | (main, Dec 15 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)]\n",
"Pandas version 2.1.0\n",
"bifacial_radiance version 0.4.2+323.gdc53a62.dirty\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.dev373+g013fa7c.d20240911\n"
]
}
],
Expand Down Expand Up @@ -87,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "09d4398b-2ca0-4697-ab16-03bab27245ce",
"metadata": {},
"outputs": [
Expand All @@ -105,7 +105,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 12,
"id": "deb9a103-9227-4eee-a6a5-d9d65ca738c4",
"metadata": {},
"outputs": [
Expand All @@ -123,12 +123,12 @@
}
],
"source": [
"!epw2wea USA_VA_Richmond.724010_TMY2.epw USA_VA_Richmond.724010_TMY2.wea"
"!epw2wea .\\EPWs\\USA_VA_Richmond.724010_TMY2.epw .\\EPWs\\USA_VA_Richmond.724010_TMY2.wea"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 7,
"id": "c3b05db2-416e-4147-83a5-7ab7cd694ca4",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -175,7 +175,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"id": "0295c42d-1169-495f-b0a0-f5e87244832b",
"metadata": {},
"outputs": [
Expand All @@ -199,7 +199,7 @@
"'skies\\\\cumulative.rad'"
]
},
"execution_count": 11,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -237,12 +237,12 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 15,
"id": "0c89bc69-a76a-4888-a17e-663e2ebdc9b6",
"metadata": {},
"outputs": [],
"source": [
"!gendaymtx -m 1 -A USA_VA_Richmond.724010_TMY2.wea > visible_results.mtx"
"!gendaymtx -m 1 -A .\\EPWs\\USA_VA_Richmond.724010_TMY2.wea > .\\EPWs\\visible_results.mtx"
]
},
{
Expand All @@ -268,34 +268,34 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 16,
"id": "fbd85aab-c593-4df1-b7ed-f362966817a5",
"metadata": {},
"outputs": [],
"source": [
"# total irradiance, not just visible\n",
"!gendaymtx -m 1 -A -O1 USA_VA_Richmond.724010_TMY2.wea > totalirrad_results.mtx"
"!gendaymtx -m 1 -A -O1 .\\EPWs\\USA_VA_Richmond.724010_TMY2.wea > .\\EPWs\\totalirrad_results.mtx"
]
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 17,
"id": "1b55facc-f0f3-4c9d-bd50-692bb394166f",
"metadata": {},
"outputs": [],
"source": [
"# More patches\n",
"!gendaymtx -m 2 -A -O1 USA_VA_Richmond.724010_TMY2.wea > totalirrad_results_m2.mtx"
"!gendaymtx -m 2 -A -O1 .\\EPWs\\USA_VA_Richmond.724010_TMY2.wea > .\\EPWs\\totalirrad_results_m2.mtx"
]
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 18,
"id": "c7cdae60-f74c-4299-a18d-24e4f57a5933",
"metadata": {},
"outputs": [],
"source": [
"!gendaymtx -m 1 USA_VA_Richmond.724010_TMY2.wea > I_think_hourly_results.mtx"
"!gendaymtx -m 1 .\\EPWs\\USA_VA_Richmond.724010_TMY2.wea > .\\EPWs\\I_think_hourly_results.mtx"
]
},
{
Expand Down Expand Up @@ -323,7 +323,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 19,
"id": "24faa0a6-132f-46e6-b2d3-adfdb00da759",
"metadata": {},
"outputs": [
Expand All @@ -334,7 +334,7 @@
"\n",
"Module Name: test-module\n",
"Module test-module updated in module.json\n",
"{'x': 2, 'y': 1, 'z': 0.02, 'modulematerial': 'black', 'scenex': 2.01, 'sceney': 1.0, 'scenez': 0.1, 'numpanels': 1, 'bifi': 1, 'text': '! genbox black test-module 2 1 0.02 | xform -t -1.0 -0.5 0 -a 1 -t 0 1.0 0', 'modulefile': 'objects\\\\test-module.rad', 'glass': False, 'offsetfromaxis': 0, 'xgap': 0.01, 'ygap': 0.0, 'zgap': 0.1}\n"
"<class 'bifacial_radiance.module.ModuleObj'> : {'x': 2, 'y': 1, 'z': 0.02, 'modulematerial': 'black', 'scenex': 2.01, 'sceney': 1.0, 'scenez': 0.1, 'numpanels': 1, 'bifi': 1, 'text': '! genbox black test-module 2 1 0.02 | xform -t -1.0 -0.5 0 -a 1 -t 0 1.0 0', 'modulefile': 'objects\\\\test-module.rad', 'glass': False, 'offsetfromaxis': 0, 'xgap': 0.01, 'ygap': 0.0, 'zgap': 0.1}\n"
]
}
],
Expand All @@ -346,7 +346,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 20,
"id": "28471434-b6fd-4e01-b9af-bed2e0126ae3",
"metadata": {},
"outputs": [],
Expand All @@ -359,7 +359,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 31,
"id": "e78c464f-46c4-43a8-a20f-e7389487176e",
"metadata": {},
"outputs": [
Expand All @@ -371,7 +371,7 @@
" 'objects\\\\test-module_C_0.20_rtr_3.00_tilt_10_20modsx7rows_origin0,0.rad']"
]
},
"execution_count": 34,
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -383,19 +383,19 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 26,
"id": "b6a97676-5f01-41d3-9516-f03ae618ff52",
"metadata": {},
"outputs": [],
"source": [
"newfilelist = ['materials\\\\ground.rad',\n",
" 'totalirrad_results.mtx',\n",
" 'EPWs\\\\totalirrad_results.mtx',\n",
" 'objects\\\\test-module_C_0.20_rtr_3.00_tilt_10_20modsx7rows_origin0,0.rad']"
]
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 23,
"id": "a62e3ba1-f7d7-4221-bb4c-8ec1b7cf7c53",
"metadata": {},
"outputs": [],
Expand All @@ -407,7 +407,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 28,
"id": "8d169212-3788-4774-a63f-e9ab6bc0d822",
"metadata": {},
"outputs": [
Expand All @@ -420,25 +420,34 @@
}
],
"source": [
"octfile = demo.makeOct(filelist) \n"
"octfile = demo.makeOct(demo.getfilelist()) \n"
]
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 33,
"id": "207a0797-3a7b-466e-b7c2-65a6e5f15355",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Created tutorial_1.oct\n"
"Created tutorial_1_v2.oct.oct\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\users\\cdeline\\documents\\python scripts\\bifacial_radiance\\bifacial_radiance\\main.py:2210: Warning: oconv: fatal - (EPWs\\totalirrad_results.mtx): undefined modifier \"gendaymtx\"\n",
" warnings.warn(err[9:], Warning)\n"
]
}
],
"source": [
"octfile = demo.makeOct(newfilelist2) \n"
"# not working...\n",
"octfile2 = demo.makeOct(newfilelist, octname='tutorial_1_v2.oct') \n"
]
},
{
Expand Down Expand Up @@ -537,7 +546,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit dc25bde

Please sign in to comment.