|
17 | 17 |
|
18 | 18 | from zepben.eas.client.study import Study |
19 | 19 | from zepben.eas.client.util import construct_url |
20 | | -from zepben.eas.client.work_package import WorkPackageConfig, FixedTime, TimePeriod |
| 20 | +from zepben.eas.client.work_package import WorkPackageConfig, FixedTime, TimePeriod, ForecastConfig, FeederConfigs |
21 | 21 |
|
22 | 22 | __all__ = ["EasClient"] |
23 | 23 |
|
@@ -211,15 +211,46 @@ async def async_get_work_package_cost_estimation(self, work_package: WorkPackage |
211 | 211 | "variables": { |
212 | 212 | "workPackageName": work_package.name, |
213 | 213 | "input": { |
214 | | - "feeders": work_package.feeders, |
215 | | - "years": work_package.years, |
216 | | - "scenarios": work_package.scenarios, |
217 | | - "fixedTime": work_package.load_time.time.isoformat() |
218 | | - if isinstance(work_package.load_time, FixedTime) else None, |
219 | | - "timePeriod": { |
220 | | - "startTime": work_package.load_time.start_time.isoformat(), |
221 | | - "endTime": work_package.load_time.end_time.isoformat(), |
222 | | - } if isinstance(work_package.load_time, TimePeriod) else None, |
| 214 | + "feederConfigs": { |
| 215 | + "configs": [ |
| 216 | + { |
| 217 | + "feeder": config.feeder, |
| 218 | + "years": config.years, |
| 219 | + "scenarios": config.scenarios, |
| 220 | + "timePeriod": { |
| 221 | + "startTime": config.load_time.start_time.isoformat(), |
| 222 | + "endTime": config.load_time.end_time.isoformat(), |
| 223 | + "overrides": config.load_time.load_overrides and { |
| 224 | + key: value.__dict__ |
| 225 | + for key, value in config.load_time.load_overrides.items()} |
| 226 | + } if isinstance(config.load_time, TimePeriod) else None, |
| 227 | + "fixedTime": config.load_time and { |
| 228 | + "loadTime": config.load_time.time.isoformat(), |
| 229 | + "overrides": config.load_time.load_overrides and { |
| 230 | + key: value.__dict__ |
| 231 | + for key, value in config.load_time.load_overrides.items()} |
| 232 | + } if isinstance(config.load_time, FixedTime) else None, |
| 233 | + } for config in work_package.syf_config.configs |
| 234 | + ] |
| 235 | + } if isinstance(work_package.syf_config, FeederConfigs) else None, |
| 236 | + "forecastConfig": { |
| 237 | + "feeders": work_package.syf_config.feeders, |
| 238 | + "years": work_package.syf_config.years, |
| 239 | + "scenarios": work_package.syf_config.scenarios, |
| 240 | + "timePeriod": { |
| 241 | + "startTime": work_package.syf_config.load_time.start_time.isoformat(), |
| 242 | + "endTime": work_package.syf_config.load_time.end_time.isoformat(), |
| 243 | + "overrides": work_package.syf_config.load_time.load_overrides and { |
| 244 | + key: value.__dict__ |
| 245 | + for key, value in work_package.syf_config.load_time.load_overrides.items()} |
| 246 | + } if isinstance(work_package.syf_config.load_time, TimePeriod) else None, |
| 247 | + "fixedTime": work_package.syf_config.load_time and { |
| 248 | + "loadTime": work_package.syf_config.load_time.fetch_load_time.isoformat(), |
| 249 | + "overrides": work_package.syf_config.load_time.load_overrides and { |
| 250 | + key: value.__dict__ |
| 251 | + for key, value in work_package.syf_config.load_time.load_overrides.items()} |
| 252 | + } if isinstance(work_package.syf_config.load_time, FixedTime) else None |
| 253 | + } if isinstance(work_package.syf_config, ForecastConfig) else None, |
223 | 254 | "qualityAssuranceProcessing": work_package.quality_assurance_processing, |
224 | 255 | "generatorConfig": work_package.generator_config and { |
225 | 256 | "model": work_package.generator_config.model and { |
@@ -273,7 +304,7 @@ async def async_get_work_package_cost_estimation(self, work_package: WorkPackage |
273 | 304 | "defaultGenWatts": work_package.generator_config.model.default_gen_watts, |
274 | 305 | "defaultLoadVar": work_package.generator_config.model.default_load_var, |
275 | 306 | "defaultGenVar": work_package.generator_config.model.default_gen_var, |
276 | | - "transformerTapSettings": work_package.generator_config.model.transformer_tap_settings |
| 307 | + "transformerTapSettings": work_package.generator_config.model.transformer_tap_settings, |
277 | 308 | }, |
278 | 309 | "solve": work_package.generator_config.solve and { |
279 | 310 | "normVMinPu": work_package.generator_config.solve.norm_vmin_pu, |
@@ -399,15 +430,46 @@ async def async_run_hosting_capacity_work_package(self, work_package: WorkPackag |
399 | 430 | "variables": { |
400 | 431 | "workPackageName": work_package.name, |
401 | 432 | "input": { |
402 | | - "feeders": work_package.feeders, |
403 | | - "years": work_package.years, |
404 | | - "scenarios": work_package.scenarios, |
405 | | - "fixedTime": work_package.load_time.time.isoformat() |
406 | | - if isinstance(work_package.load_time, FixedTime) else None, |
407 | | - "timePeriod": { |
408 | | - "startTime": work_package.load_time.start_time.isoformat(), |
409 | | - "endTime": work_package.load_time.end_time.isoformat(), |
410 | | - } if isinstance(work_package.load_time, TimePeriod) else None, |
| 433 | + "feederConfigs": { |
| 434 | + "configs": [ |
| 435 | + { |
| 436 | + "feeder": config.feeder, |
| 437 | + "years": config.years, |
| 438 | + "scenarios": config.scenarios, |
| 439 | + "timePeriod": { |
| 440 | + "startTime": config.load_time.start_time.isoformat(), |
| 441 | + "endTime": config.load_time.end_time.isoformat(), |
| 442 | + "overrides": config.load_time.load_overrides and { |
| 443 | + key: value.__dict__ |
| 444 | + for key, value in config.load_time.load_overrides.items()} |
| 445 | + } if isinstance(config.load_time, TimePeriod) else None, |
| 446 | + "fixedTime": config.load_time and { |
| 447 | + "loadTime": config.load_time.time.isoformat(), |
| 448 | + "overrides": config.load_time.load_overrides and { |
| 449 | + key: value.__dict__ |
| 450 | + for key, value in config.load_time.load_overrides.items()} |
| 451 | + } if isinstance(config.load_time, FixedTime) else None, |
| 452 | + } for config in work_package.syf_config.configs |
| 453 | + ] |
| 454 | + } if isinstance(work_package.syf_config, FeederConfigs) else None, |
| 455 | + "forecastConfig": { |
| 456 | + "feeders": work_package.syf_config.feeders, |
| 457 | + "years": work_package.syf_config.years, |
| 458 | + "scenarios": work_package.syf_config.scenarios, |
| 459 | + "timePeriod": { |
| 460 | + "startTime": work_package.syf_config.load_time.start_time.isoformat(), |
| 461 | + "endTime": work_package.syf_config.load_time.end_time.isoformat(), |
| 462 | + "overrides": work_package.syf_config.load_time.load_overrides and { |
| 463 | + key: value.__dict__ |
| 464 | + for key, value in work_package.syf_config.load_time.load_overrides.items()} |
| 465 | + } if isinstance(work_package.syf_config.load_time, TimePeriod) else None, |
| 466 | + "fixedTime": work_package.syf_config.load_time and { |
| 467 | + "loadTime": work_package.syf_config.load_time.time.isoformat(), |
| 468 | + "overrides": work_package.syf_config.load_time.load_overrides and { |
| 469 | + key: value.__dict__ |
| 470 | + for key, value in work_package.syf_config.load_time.load_overrides.items()} |
| 471 | + } if isinstance(work_package.syf_config.load_time, FixedTime) else None |
| 472 | + } if isinstance(work_package.syf_config, ForecastConfig) else None, |
411 | 473 | "qualityAssuranceProcessing": work_package.quality_assurance_processing, |
412 | 474 | "generatorConfig": work_package.generator_config and { |
413 | 475 | "model": work_package.generator_config.model and { |
|
0 commit comments