diff --git a/idaes/apps/grid_integration/multiperiod/price_taker_model.py b/idaes/apps/grid_integration/multiperiod/price_taker_model.py index 8d14a89dd5..67168c2d3e 100644 --- a/idaes/apps/grid_integration/multiperiod/price_taker_model.py +++ b/idaes/apps/grid_integration/multiperiod/price_taker_model.py @@ -429,7 +429,7 @@ def build_multiperiod_model(self, **kwargs): raise ConfigurationError( "Before invoking the build_multiperiod_model method, call the append_lmp_data method on PriceTakerModel class first." ) - + self.mp_model = MultiPeriodModel( n_time_points=self._n_time_points, set_days=self.set_days, diff --git a/idaes/apps/grid_integration/multiperiod/tests/test_price_taker.py b/idaes/apps/grid_integration/multiperiod/tests/test_price_taker.py index bfd75f14bf..74c606898e 100644 --- a/idaes/apps/grid_integration/multiperiod/tests/test_price_taker.py +++ b/idaes/apps/grid_integration/multiperiod/tests/test_price_taker.py @@ -986,6 +986,7 @@ def test_build_multiperiod_model_no_LMP_logger_message(): flowsheet_options={"sofc_design": None}, ) + @pytest.mark.unit def test_build_multiperiod_model_before_append_lmp_data_logger_messages(): m = PriceTakerModel() @@ -1003,17 +1004,17 @@ def test_build_multiperiod_model_before_append_lmp_data_logger_messages(): linking_variable_func=None, flowsheet_options={"sofc_design": None}, ) - + # Next exception that would arise relates to either set_years or set_days attributes not existing, indicating append_lmp_data method was not run first. m1 = PriceTakerModel() m1._n_time_points = 240 m1.set_days = None with pytest.raises( - ConfigurationError, - match=( - "Before invoking the build_multiperiod_model method, call the append_lmp_data method on PriceTakerModel class first, which will assign the number of time points, n_time_points, to be used in the MultiPeriodModel." - ), + ConfigurationError, + match=( + "Before invoking the build_multiperiod_model method, call the append_lmp_data method on PriceTakerModel class first, which will assign the number of time points, n_time_points, to be used in the MultiPeriodModel." + ), ): # Build the multiperiod model m.build_multiperiod_model( @@ -1027,10 +1028,10 @@ def test_build_multiperiod_model_before_append_lmp_data_logger_messages(): m2.set_years = None with pytest.raises( - ConfigurationError, - match=( - "Before invoking the build_multiperiod_model method, call the append_lmp_data method on PriceTakerModel class first, which will assign the number of time points, n_time_points, to be used in the MultiPeriodModel." - ), + ConfigurationError, + match=( + "Before invoking the build_multiperiod_model method, call the append_lmp_data method on PriceTakerModel class first, which will assign the number of time points, n_time_points, to be used in the MultiPeriodModel." + ), ): # Build the multiperiod model m.build_multiperiod_model( @@ -1039,6 +1040,7 @@ def test_build_multiperiod_model_before_append_lmp_data_logger_messages(): flowsheet_options={"sofc_design": None}, ) + @pytest.mark.unit def test_build_hourly_cashflow_logger_message_no_des_blks(excel_data, caplog): # Tests building the model with startup/shutdown then ramping rate with LMP as a single year with all time points