[BUG]: modelchain fills nan with 0
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 54/100
Hướng nghiên cứu
Start in pvlib/modelchain.py at the two fillna(0) calls linked in the issue (around lines 668 and 769), then read the related tests to understand their intended behavior. Reproduce the reported case and check whether those calls replace NaNs in the AC results; done means NaNs are preserved without breaking existing ModelChain tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
We fillna(0) twice in modelchain.py
https://github.com/pvlib/pvlib-python/blob/9a0ad5504d821a81ec2a4531b40034794c6c42bd/pvlib/modelchain.py#L769
https://github.com/pvlib/pvlib-python/blob/9a0ad5504d821a81ec2a4531b40034794c6c42bd/pvlib/modelchain.py#L668
I can open a PR deleting these lines, which would make more sense to me, unless there was a specific reason to do so ?
To Reproduce
def calculate_pv_system_production(
pv_system: SimplifiedPVSystem, solar_inputs: SolarInputs
) -> np.ndarray:
"""
Returns AC power output in kW using the PVWatts model.
"""
# 1. Location
location = pvlib.location.Location(
latitude=pv_system.coordinates.latitude,
longitude=pv_system.coordinates.longitude,
tz=str(pv_system.timezone),
altitude=pv_system.coordinates.altitude,
)
# 2. System
system = pvlib.pvsystem.PVSystem( # todo review all of these parameters with dict
surface_tilt=pv_system.surface_tilt,
surface_azimuth=pv_system.surface_azimuth,
module_parameters={
"pdc0": pv_system.solar_power_kwp * 1000, # W peak DC
"gamma_pdc": pv_system.temp_coefficient,
},
inverter_parameters={
"pdc0": pv_system.solar_power_kwp * 1000,
"eta_inv_nom": pv_system.inverter_efficiency,
},
temperature_model_parameters=pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS[
"sapm"
]["open_rack_glass_glass"],
)
# 3. ModelChain
mc = pvlib.modelchain.ModelChain(
system,
location,
dc_model="pvwatts",
ac_model="pvwatts",
aoi_model="physical",
spectral_model="no_loss",
losses_model="pvwatts",
)
# 4. Run model — pvlib computes sun position internally from location + times
weather_data = {
"dni": solar_inputs.dni_wm2,
"dhi": solar_inputs.dhi_wm2,
"ghi": solar_inputs.ghi_wm2,
}
if solar_inputs.outdoor_air_temp_c is not None:
weather_data["temp_air"] = solar_inputs.outdoor_air_temp_c
solar_inputs_pvlib_format = pd.DataFrame(
index=solar_inputs.ts,
data=weather_data,
)
mc.run_model(solar_inputs_pvlib_format)
# 5. Return AC power in kW
return (mc.results.ac / 1000).to_numpy()
Expected behavior
Don't fill NaNs with 0, keep NaNs
Screenshots
This
Becomes
Versions:
pvlib.__version__: 0.15.2pandas.__version__:- python: 3.10
- Ngôn ngữ chính
- Python
- Star
- 1.7k
- Fork
- 1.2k
- Merge trung bình
- 3 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pvlib/pvlib-python
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pvlib/pvlib-python#2903 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
pvlib/pvlib-python#2902 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add an example or documentation on using 'bhi' from ERA5Có thể làm lại được @anshurajbisoyi98-ctrl đã nhận 14 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
pvlib/pvlib-python#2880 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Use "long-wave" rather than "infra-red" to refer to thermal radiation.Có thể làm lại được @Rahi-padwal đã nhận 251 ngày trước và không có pull request nào đang mở. Đang mởapi easy
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
pvlib/pvlib-python#2653 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
question
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
pvlib/pvlib-python#2637 · 10 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pvlib/pvlib-python
Issue tương tự
-
Custom provider API keys collide on one host: env slot keyed on host:port only, not URL pathĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#140958 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bisect issue233186Đang mởbisect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dtcxzyw/llvm-bisect-service#548 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sallowayma-git/IELTS-practice#248 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
anthropics/claude-plugins-official#6763 · 10 bình luận · 10 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày