Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSYE-651: Adapt heat pump validator to also allow parcial provision o… #480

Merged
merged 8 commits into from
Oct 26, 2023

Conversation

hannesdiedrich
Copy link
Member

…f price parameters and validate if update_interval is not set to zero

…f price parameters and validate if update_interval is not set to zero
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #480 (aa11104) into master (55b0695) will increase coverage by 0.05%.
Report is 1 commits behind head on master.
The diff coverage is 87.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #480      +/-   ##
==========================================
+ Coverage   66.42%   66.48%   +0.05%     
==========================================
  Files          78       78              
  Lines        5147     5150       +3     
  Branches      851      852       +1     
==========================================
+ Hits         3419     3424       +5     
+ Misses       1566     1565       -1     
+ Partials      162      161       -1     

Comment on lines +71 to +72
and kwargs.get("final_buying_rate") is None
and kwargs.get("update_interval") is None):
Copy link
Member

Choose a reason for hiding this comment

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

I like the fix, however I think that this is or, not and. The original clause says: if not all 3 are not-None. Therefore the converted clause should say: if any of the 3 is None

Copy link
Member

Choose a reason for hiding this comment

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

After looking at the following clause though, I think that this clause is redundant, because we raise an exception if any of the 3 is None. I would recommend to remove this completely actually.

Copy link
Member

@spyrostz spyrostz left a comment

Choose a reason for hiding this comment

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

One comment, LGTM once resolved.

Comment on lines -70 to -72
if not(kwargs.get("initial_buying_rate")
and kwargs.get("final_buying_rate")
and kwargs.get("update_interval")):
Copy link
Member Author

Choose a reason for hiding this comment

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

@spyrostz Sorry to drag you into this one more time.
We need this clause in order to allow the user to not provide pricing at all and let the strategy use the default values.
For this case, we do not need to validate.

Copy link
Member Author

Choose a reason for hiding this comment

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

I rea-added it in the last commit

Copy link
Member

Choose a reason for hiding this comment

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

Understood and thank you for correcting the clause! It now is correct and reflects the condition of all being None, contrary to the former implementation which evaluated if one of them was None.

Copy link
Member

@spyrostz spyrostz left a comment

Choose a reason for hiding this comment

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

LGTM

@hannesdiedrich hannesdiedrich merged commit d7862f1 into master Oct 26, 2023
3 checks passed
@hannesdiedrich hannesdiedrich deleted the feature/GSYE-651 branch October 26, 2023 14:05
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