Skip to content

Commit

Permalink
Adhere to Black
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Jul 31, 2024
1 parent cacedb8 commit b6d1558
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/demandlib/particular_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,18 @@ def simple_profile(self, annual_demand, **kwargs):
weekend_filter = self.dataframe["weekday"].isin(weekend)

# Update 'ind' column based on day/night filters and weekday/weekend conditions
self.dataframe.loc[day_filter & week_filter, "ind"] = profile_factors["week"]["day"]
self.dataframe.loc[night_filter & week_filter, "ind"] = profile_factors["week"]["night"]
self.dataframe.loc[day_filter & weekend_filter, "ind"] = profile_factors["weekend"]["day"]
self.dataframe.loc[night_filter & weekend_filter, "ind"] = profile_factors["weekend"]["night"]
self.dataframe.loc[day_filter & week_filter, "ind"] = profile_factors[
"week"
]["day"]
self.dataframe.loc[night_filter & week_filter, "ind"] = (
profile_factors["week"]["night"]
)
self.dataframe.loc[day_filter & weekend_filter, "ind"] = (
profile_factors["weekend"]["day"]
)
self.dataframe.loc[night_filter & weekend_filter, "ind"] = (
profile_factors["weekend"]["night"]
)

if self.dataframe["ind"].isnull().any(axis=0):
logging.error("NAN value found in industrial load profile")
Expand Down

0 comments on commit b6d1558

Please sign in to comment.