|
50 | 50 | _LONG_TERM_FORECAST_PLANT_LIFETIME_YEARS = 8 |
51 | 51 |
|
52 | 52 | _GRAPH_DPI = 300 |
| 53 | +_SAVEFIG_ARGS = {'dpi': _GRAPH_DPI, 'metadata': {'Date': None}} |
53 | 54 |
|
54 | 55 |
|
55 | 56 | @dataclass |
@@ -355,13 +356,13 @@ def _generate_production_temperature_comparison_graph( |
355 | 356 | output_path_stem.parent.mkdir(parents=True, exist_ok=True) |
356 | 357 |
|
357 | 358 | ax.set_ylim(0.0, 200.0) |
358 | | - fig.savefig(f'{output_path_stem}-1.png', dpi=_GRAPH_DPI, bbox_inches='tight') |
| 359 | + fig.savefig(f'{output_path_stem}-1.png', bbox_inches='tight', **_SAVEFIG_ARGS) |
359 | 360 |
|
360 | 361 | ax.set_ylim( |
361 | 362 | 175, |
362 | 363 | 185, |
363 | 364 | ) |
364 | | - fig.savefig(f'{output_path_stem}-2.png', dpi=_GRAPH_DPI, bbox_inches='tight') |
| 365 | + fig.savefig(f'{output_path_stem}-2.png', bbox_inches='tight', **_SAVEFIG_ARGS) |
365 | 366 |
|
366 | 367 | plt.close(fig) |
367 | 368 |
|
@@ -435,7 +436,7 @@ def _generate_long_term_forecast_graph( |
435 | 436 | ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.12), ncol=1, frameon=False, fontsize=11) |
436 | 437 |
|
437 | 438 | output_path.parent.mkdir(parents=True, exist_ok=True) |
438 | | - fig.savefig(output_path, dpi=_GRAPH_DPI, bbox_inches='tight') |
| 439 | + fig.savefig(output_path, bbox_inches='tight', **_SAVEFIG_ARGS) |
439 | 440 | plt.close(fig) |
440 | 441 |
|
441 | 442 |
|
@@ -658,8 +659,8 @@ def _savefig(version: int | str) -> None: |
658 | 659 | sensitivity_graph_path.with_name(f'{sensitivity_graph_path.stem}-{version}').with_suffix( |
659 | 660 | sensitivity_graph_path.suffix |
660 | 661 | ), |
661 | | - dpi=_GRAPH_DPI, |
662 | 662 | bbox_inches='tight', |
| 663 | + **_SAVEFIG_ARGS, |
663 | 664 | ) |
664 | 665 |
|
665 | 666 | ax.set_xlim(0.0, _LONG_TERM_FORECAST_PLANT_LIFETIME_YEARS) |
@@ -719,7 +720,7 @@ def _savefig(version: int | str) -> None: |
719 | 720 | ax_pwr.legend(handles=[baseline_patch, sensitivity_patch], loc='upper left', frameon=False) |
720 | 721 |
|
721 | 722 | power_graph_path.parent.mkdir(parents=True, exist_ok=True) |
722 | | - fig_pwr.savefig(power_graph_path, dpi=_GRAPH_DPI, bbox_inches='tight') |
| 723 | + fig_pwr.savefig(power_graph_path, bbox_inches='tight', **_SAVEFIG_ARGS) |
723 | 724 | plt.close(fig_pwr) |
724 | 725 |
|
725 | 726 | return df_power |
|
0 commit comments