Skip to content

Commit

Permalink
fixing broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noah80 committed Mar 19, 2023
1 parent a973bcb commit 37fa83f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/basic_household_with_new_hp_hds_hws_and_pv.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def basic_household_new(
my_simulation_parameters = SimulationParameters.full_year_only_plots(
year=year, seconds_per_timestep=seconds_per_timestep
)
my_simulation_parameters.post_processing_options.append(postprocessingoptions.PostProcessingOptions.PROVIDE_DETAILED_ITERATION_LOGGING)
# my_simulation_parameters.post_processing_options.append(postprocessingoptions.PostProcessingOptions.PROVIDE_DETAILED_ITERATION_LOGGING)

my_sim.set_simulation_parameters(my_simulation_parameters)

Expand Down
2 changes: 2 additions & 0 deletions examples/modular_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def modular_household_explicit(
my_simulation_parameters.post_processing_options.append(PostProcessingOptions.PLOT_CARPET)
my_simulation_parameters.post_processing_options.append(PostProcessingOptions.GENERATE_PDF_REPORT)
my_simulation_parameters.post_processing_options.append(PostProcessingOptions.GENERATE_CSV_FOR_HOUSING_DATA_BASE)
my_simulation_parameters.post_processing_options.append(PostProcessingOptions.WRITE_COMPONENTS_TO_REPORT)
my_simulation_parameters.post_processing_options.append(PostProcessingOptions.INCLUDE_CONFIGS_IN_PDF_REPORT)
my_simulation_parameters.post_processing_options.append(
PostProcessingOptions.COMPUTE_AND_WRITE_KPIS_TO_REPORT
)
Expand Down
4 changes: 2 additions & 2 deletions hisim/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def get_differences_for_error_msg(self, previous_values: Any, outputs: List[Comp
error_msg = ""
for i in range(count):
if abs(previous_values.values[i] - self.values[i]) > 0.0001:
error_msg += outputs[i].get_pretty_name() + " previously: " + "{:4.2f}".format(previous_values.values[i]) \
+ " currently: " + "{:4.2f}".format(self.values[i]) + " | "
error_msg += outputs[i].get_pretty_name() + " previously: " + f"{previous_values.values[i]:4.2f}" \
+ " currently: " + f"{self.values[i]:4.2f}" + " | "
return error_msg


Expand Down
5 changes: 1 addition & 4 deletions hisim/components/controller_l1_heatpump.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,4 @@ def calculate_state(self, timestep: int, stsv: cp.SingleTimeStepValues) -> None:

def write_to_report(self) -> List[str]:
"""Writes the information of the current component to the report."""
lines: List[str] = []
lines.append(f"Name: {self.component_name + str(self.config.source_weight)}")
lines.append(self.config.get_string_dict()) # type: ignore
return lines
return self.config.get_string_dict()
2 changes: 2 additions & 0 deletions hisim/postprocessing/reportgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def write_with_normal_alignment(
if len(text) != 0:
for part in text:
if part is not None:
if not isinstance(part, str):
raise ValueError("Got a non-string somehow: " + str(part))
ptext = f'<font size="12">{part.strip()}</font>'
self.story.append(Paragraph(ptext, self.styles["Normal"]))
else:
Expand Down
2 changes: 1 addition & 1 deletion hisim/postprocessing/system_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import pydot

import log
from hisim import log
from hisim.postprocessing.postprocessing_datatransfer import PostProcessingDataTransfer


Expand Down
1 change: 1 addition & 0 deletions hisim/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(
self.module_directory = module_directory
self.simulation_repository = sim_repository.SimRepository()
self.results_data_frame: pd.DataFrame
self.iteration_logging_path: str = ""


def set_simulation_parameters(
Expand Down

0 comments on commit 37fa83f

Please sign in to comment.