Skip to content

Add calculate dhi option to PVSystem class#11

Merged
iantsednv merged 4 commits intomainfrom
feature/add-pvsystem-energy-option-calculate-dhi
Apr 22, 2026
Merged

Add calculate dhi option to PVSystem class#11
iantsednv merged 4 commits intomainfrom
feature/add-pvsystem-energy-option-calculate-dhi

Conversation

@javlor
Copy link
Copy Markdown
Collaborator

@javlor javlor commented Apr 21, 2026

No description provided.

@javlor javlor requested a review from iantsednv April 21, 2026 11:29
@iantsednv
Copy link
Copy Markdown
Collaborator

@javlor, let's add some unit tests for this following the pattern used for enable_spectral_modeling for example:

def test_calculate_dhi_off_by_default(self, plant):
    payload = json.loads(construct_plant(plant))
    opts = payload["energyCalculationOptions"]
    assert opts.get("calculateDHI", False) is False

def test_calculate_dhi_on_when_enabled(self, plant):
    plant.calculate_dhi_weather = True
    payload = json.loads(construct_plant(plant))
    assert payload["energyCalculationOptions"]["calculateDHI"] is True

Comment thread solarfarmer/models/pvsystem/pvsystem.py Outdated
Comment thread solarfarmer/models/pvsystem/pvsystem.py Outdated
Copy link
Copy Markdown
Collaborator

@iantsednv iantsednv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments

@javlor javlor requested a review from iantsednv April 22, 2026 08:01
@iantsednv iantsednv merged commit 9a34fc5 into main Apr 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants