Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

defaults:
run:
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,9 @@ dmypy.json
.pyre/

# AI files
.claude
.claude

# EnergyPlus simulation outputs
resources/output/
*.eso
*.sql
4 changes: 3 additions & 1 deletion db_eplusout_reader/db_esofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def frequencies(self):
order = {TS: 0, H: 1, D: 2, M: 3, A: 4, RP: 5}
return sorted(list(self.header.keys()), key=lambda x: order[x])

def get_results(self, variables, frequency, alike=False, start_date=None, end_date=None):
def get_results(
self, variables, frequency, alike=False, start_date=None, end_date=None
):
"""
Extract results from the parsed ESO file data.

Expand Down
12 changes: 9 additions & 3 deletions db_eplusout_reader/processing/esofile_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def set_start_date(orig, refs):
if timestep_to_monthly_dates:
for frequency in (M, A, RP):
if frequency in dates:
dates[frequency] = set_start_date(dates[frequency], timestep_to_monthly_dates)
dates[frequency] = set_start_date(
dates[frequency], timestep_to_monthly_dates
)
return dates


Expand All @@ -133,13 +135,17 @@ def validate_year(year, is_leap, date, day):
"WinterDesignDay",
):
max_year = datetime.now().year + 10 # give some choices from future
suitable_years = get_allowed_years(is_leap, date, day, max_year, n_samples=3)
suitable_years = get_allowed_years(
is_leap, date, day, max_year, n_samples=3
)
formatted_day = test_datetime.strftime("%Y-%m-%d")
raise StartDayMismatch(
"Start day '{}' for given day '{}'"
" does not correspond to real calendar day '{}'!"
"\nEither set 'year' kwarg as 'None' to identify year automatically"
" or use one of '{}'.".format(day, formatted_day, test_day, suitable_years)
" or use one of '{}'.".format(
day, formatted_day, test_day, suitable_years
)
)
else:
raise LeapYearMismatch(
Expand Down
4 changes: 3 additions & 1 deletion db_eplusout_reader/results_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def to_csv(

"""
table = ResultsHandler.convert_dict_to_table(self, explode_header)
ResultsWriter.write_table_to_csv(table, path, delimiter, append, title, **kwargs)
ResultsWriter.write_table_to_csv(
table, path, delimiter, append, title, **kwargs
)


class ResultsHandler:
Expand Down
4 changes: 1 addition & 3 deletions db_eplusout_reader/sql_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ def get_sliced_outputs(conn, id_, start_date, end_date):

def get_outputs(conn, id_):
"""Get array of output values for given variable id."""
statement = (
"SELECT ReportData.Value FROM ReportData WHERE ReportData.ReportDataDictionaryIndex = ?"
)
statement = "SELECT ReportData.Value FROM ReportData WHERE ReportData.ReportDataDictionaryIndex = ?"
return [r[0] for r in conn.execute(statement, (id_,))]


Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = []

[dependency-groups]
dev = [
"eppy>=0.5.69",
"ruff>=0.9.0",
"pylint>=3.0.3",
"pre-commit>=3.6.1",
Expand Down
Loading
Loading