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

Add VDI profiles based on lpagg #50

Draft
wants to merge 25 commits into
base: v0.2dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/demandlib/bdew/heat_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def get_sf_values(self, filename="shlp_hour_factors.csv"):
+ (["weekday"] if not residential else [])
)

sf_mat = sf_mat.drop(drop_cols, 1)
sf_mat = sf_mat.drop(labels=drop_cols, axis=1)

# Determine the h values
length = len(self.temperature)
Expand Down
1 change: 1 addition & 0 deletions src/demandlib/vdi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .dwd_try import find_try_region # noqa: F401
from .dwd_try import read_dwd_weather_file # noqa: F401
from .regions import Region # noqa: F401
10 changes: 8 additions & 2 deletions src/demandlib/vdi/dwd_try.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ def find_try_region(longitude, latitude):
return int(try_map.loc[try_map.contains(my_point), "TRY_code"])


def read_dwd_weather_file(weather_file_path):
"""Read and interpolate "DWD Testreferenzjahr" files."""
def read_dwd_weather_file(weather_file_path=None, try_region=None):
"""Read and interpolate 'DWD Testreferenzjahr' files."""
if weather_file_path is None:
weather_file_path = os.path.join(
os.path.dirname(__file__),
"resources_weather",
"TRY2010_{:02d}_Jahr.dat".format(try_region),
)
# The comments in DWD files before the header are not commented out.
# Thus we have to search for the line with the header information:
Copy link
Member

Choose a reason for hiding this comment

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

Carefully reading the description, it is clear that we are talking about Testreferenzjahr files. However, there are a lot of types of DWD files (i.e. recordings from weather stations), maybe we could abbreviate it to TRY files like DWD does.

header_row = None
Expand Down