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

Fixed electricity example, added holiday functionality to industrial profile generation. #60

Closed
wants to merge 7 commits into from

Conversation

ddceruti
Copy link
Contributor

Correcten an error in the electricity_demand_example where the "i0" to "i2" profiles did not produce any time series. Added a funcitonality to particular_profiles.py to allow defining holiday weights, which were being treated as weekend days until now. If the holiday key is not specified, the function treats the holidays as weekend days as before. Simplified the function by adding a loop.

Fix the load profiles named "i0", "i1" and "i2", which do not produce any profile to the new naming scheme ("l0" to "l2") which do.
Added functionality to add holiday profiles to the industrial electricity profile generator. Addittionally simplified the particular_profiles.py function with a loop to reduce the amount of repetitive function calls. Fixed a futurewarning arising from the initialization of the "int" column with an int instead of a float.
@pep8speaks
Copy link

pep8speaks commented Jun 17, 2024

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

Line 81:80: E501 line too long (84 > 79 characters)
Line 87:80: E501 line too long (81 > 79 characters)
Line 89:80: E501 line too long (81 > 79 characters)
Line 91:80: E501 line too long (81 > 79 characters)
Line 93:80: E501 line too long (81 > 79 characters)
Line 105:80: E501 line too long (81 > 79 characters)
Line 108:80: E501 line too long (84 > 79 characters)

Comment last updated at 2024-07-16 16:52:31 UTC

except KeyError as e:
warnings.warn(f"Missing entry for {e} in profile_factors", UserWarning)

# Example usage
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this comment mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed for clarity, this comment was not supposed to be there.

inplace=True,
)
except KeyError as e:
warnings.warn(f"Missing entry for {e} in profile_factors", UserWarning)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather use logging.warning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed! Thanks for your feedback

src/demandlib/particular_profiles.py Outdated Show resolved Hide resolved
@p-snft p-snft mentioned this pull request Jul 31, 2024
@p-snft
Copy link
Member

p-snft commented Aug 6, 2024

Thanks for your efforts. Your ideas were considered in #68, as far as I see.

@p-snft p-snft closed this Aug 6, 2024
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