| 103 | | new_namespace["specification"] = specification |
| 104 | | self.model_system.do_process(new_namespace) |
| 105 | | self.extract_coefficients_and_specification() |
| | 103 | keys_coeff_spec = self.get_keys_for_coefficients_and_specification() |
| | 104 | new_namespace[keys_coeff_spec["specification"]] = self.specification |
| | 105 | self.coefficients, coeff_dict_dummy = self.model_system.do_process(new_namespace) |
| | 106 | ## update run_year_namespce since it's not been updated by do_process |
| | 107 | self.model_system.run_year_namespace = new_namespace |
| | 108 | self.model_system.run_year_namespace[keys_coeff_spec["coefficients"]] = self.coefficients |
| | 109 | |
| | 110 | ## this gets coeff and spec from run_year_namespce and is only updated in _run_year method |
| | 111 | #self.extract_coefficients_and_specification() |
| | 294 | |
| | 295 | def get_keys_for_coefficients_and_specification(self): |
| | 296 | result = {} |
| | 297 | for key in self.model_system.run_year_namespace.keys(): |
| | 298 | if isinstance(self.model_system.run_year_namespace[key], Coefficients): |
| | 299 | result['coefficients'] = key |
| | 300 | if isinstance(self.model_system.run_year_namespace[key], EquationSpecification): |
| | 301 | result['specification'] = key |
| | 302 | if not result.has_key('coefficients'): |
| | 303 | logger.log_warning("No Coefficients object is found in the name space of model_system ") |
| | 304 | if not result.has_key('specification'): |
| | 305 | logger.log_warning("No EquationSpecification object is found in the name space of model_system ") |
| | 306 | |
| | 307 | return result |
| | 308 | |