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

Feature/holidays in industrial profile #68

Merged
merged 22 commits into from
Aug 6, 2024

Conversation

birgits
Copy link
Member

@birgits birgits commented Aug 1, 2024

@pep8speaks
Copy link

pep8speaks commented Aug 1, 2024

Hello @birgits! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-08-05 09:51:42 UTC

@birgits birgits requested a review from p-snft August 2, 2024 07:33
@birgits
Copy link
Member Author

birgits commented Aug 2, 2024

@maurerle and @ddceruti feel free to also review this PR if you like :)

Copy link
Contributor

@maurerle maurerle left a comment

Choose a reason for hiding this comment

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

I would split the test cases a little bit more into separate tests - other than that it looks good :)

@birgits
Copy link
Member Author

birgits commented Aug 2, 2024

Thank you @maurerle for the review. I implemented your suggestions on splitting up the test.

Copy link
Member

@p-snft p-snft left a comment

Choose a reason for hiding this comment

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

Looks pretty good. I just have two questions.

tests/test_particular_profiles.py Show resolved Hide resolved
Comment on lines 181 to 183
# Check for NAN values in the dataframe
if self.dataframe["ind"].isnull().any(axis=0):
logging.error("NAN value found in industrial load profile")
Copy link
Member

Choose a reason for hiding this comment

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

Why would that happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

This check has been there before. It can happen when weekdays, weekend days and holidays are set inconsistently, for example when day 5 does not appear in any of the lists for "week", "weekend" or "holiday". I can't think of any other constellation leading to NaN values, but maybe it can also happen due to something else.

Copy link
Member

Choose a reason for hiding this comment

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

I see. Maybe just don't add the comment. As you added it, I assumed that you were knowledgeable about possible errors. In fact, the error code is not included to the unit tests.

PS: What happens can be seen in the code. Comments should tell, why something is done or useful. So, this comment is not needed anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

Building on your comment I wanted to add a test for the NaN error raising but realised, that NaN values are not really possible, as we initialise the dataframe column "ind" with zeros. I can't think of a case that could lead to NaN values, so we could also take out the entire NaN check. What do you think?

Copy link
Member

@p-snft p-snft Aug 5, 2024

Choose a reason for hiding this comment

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

I would have suggested the same but did not really know if there might be cases where NAN may occur. If its hardly possible, we could delete the check. (Should be in another PR, however. It does not have to do with improving the profiles. Maybe, we leave it in for after the release.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for the quick replies :) I took out the NaN check.

@p-snft p-snft merged commit 82ecd09 into dev Aug 6, 2024
12 checks passed
@p-snft p-snft deleted the feature/holidays_in_industrial_profile branch August 6, 2024 17:45
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.

4 participants