iam.schlick_diffuse returns inf and nan at surface_tilt=180
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
先閱讀 pvlib.iam.schlick_diffuse 及其測試,了解 surface_tilt=0 時現有的地面項特殊情況。接著在 surface_tilt=180 時重現回報的結果,再檢查端點和附近傾角下的兩個散射分量。完成標準是:函式在沒有除以零警告的情況下傳回預期的天空值和地面值,且回歸測試涵蓋此行為。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
pvlib.iam.schlick_diffuse(180) returns {'sky': inf, 'ground': nan} with a RuntimeWarning: divide by zero. Eq 4 for the sky term divides by 1 + cos(surface_tilt), which is 0/0 at 180. The ground term is already special-cased at tilt 0 (surface_tilt < 1e-6); the sky term has no equivalent at 180.
To Reproduce
import pvlib
pvlib.iam.schlick_diffuse(180)
# {'sky': inf, 'ground': nan}
Expected behavior
sky is 0 (a surface facing straight down sees no sky; the value tends to 0 as the tilt approaches 180) and ground is 20/21 = 0.9524, the same as sky at tilt 0. marion_diffuse('schlick', surface_tilt=180) gives 0 and 0.95236.
Versions:
pvlib.__version__: 0.16.2.dev19+gc5de586d7pandas.__version__: 3.1.1- python: 3.12.12
Additional context
Found while reading the code. PVSystem.get_iam_diffuse(180, iam_model='schlick_diffuse') returns the same. I can open a PR that applies the same 1e-6 clamp to the sky term.
- 主要語言
- Python
- 星號
- 1.7k
- 分支
- 1.2k
- 平均合併
- 3 天 4 小時
- 30 天內合併 PR
- 8
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
pvlib/pvlib-python 的其他 Issue
-
detect_clearsky and prilliman fail on DST days, kimber fails on tz-naive data (since #2924)可能已有人在做 @pranaysb 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
pvlib/pvlib-python#2935 ·
維護者通常 1 天內回覆
-
documentation
難度 1/5 1 小時以內 新手友好度 72/100
pvlib/pvlib-python#2921 · 4 則留言 · 3 個 reaction ·
維護者通常 1 天內回覆
-
Possibility of beam irradiance from behind plane of array可能重新可做 關聯的 PR 已關閉且未合併。 未關閉bug
難度 2/5 1-3 小時 新手友好度 78/100
pvlib/pvlib-python#2903 · 5 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
use offset parameter instead of calculating bday in cdrom可能已有人在做 @chenyi6758-source 於 20 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 92/100
pvlib/pvlib-python#2902 ·
維護者通常 1 天內回覆
-
Add an example or documentation on using 'bhi' from ERA5可能重新可做 @anshurajbisoyi98-ctrl 於 35 天前認領,目前沒有進行中的 PR。 未關閉
難度 2/5 1-3 小時 新手友好度 66/100
pvlib/pvlib-python#2880 · 2 則留言 ·
維護者通常 1 天內回覆
查看 pvlib/pvlib-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
adafruit/Fruit-Jam-OS#98 ·
-
python triage
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/semantic-kernel#14753 ·
維護者通常 5 天內回覆
-
area:cli area:configuration documentation priority:low size:small
難度 1/5 1-3 小時 新手友好度 80/100
RonaldHensbergen/composable-data-stack#1222 ·
維護者通常 1 天內回覆
-
bug python
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
area: i18n bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 3 天內回覆