Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add timeline plot for wind-up input data #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samuelwnaylor
Copy link
Collaborator

@samuelwnaylor samuelwnaylor commented Feb 12, 2025

Plot includes key milestones, analysis and exclusion periods. This provides a useful overview of the configuration used for an analysis.

How has it been tested?

Example plots used as test cases may be viewed in the files:

  • tests/plots/baseline_images/test_input_data/input_data_timeline_fig_toggle.png
  • tests/plots/baseline_images/test_input_data/input_data_timeline_fig_prepost.png

Design implementations to note?

Refactored the Smarteole AssessmentInputs into a pytest.fixture which is then used across the Smarteole test cases.

@samuelwnaylor samuelwnaylor marked this pull request as ready for review February 12, 2025 12:51
@samuelwnaylor samuelwnaylor force-pushed the data-timeline-plot branch 2 times, most recently from 2302d07 to 74a48e4 Compare February 19, 2025 12:24
Plot includes key milestones, analysis and exclusion periods. This
provides a useful overview of the configuration used for an analysis.
Copy link
Contributor

@aclerc aclerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the smarteole notebook needs re-running because I think this PR would add a new plot to it

*,
figsize: tuple[int, int] = (12, 6),
height_ratios: tuple[int, int] = (2, 1),
save_to_folder: Path | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if save_to_folder is None I would just return before doing anything, what do you think?

@@ -773,6 +774,10 @@ def run_wind_up_analysis(
random_seed: int = RANDOM_SEED,
) -> pd.DataFrame:
"""Run a wind up analysis."""
plot_input_data_timeline(
assessment_inputs=inputs, save_to_folder=inputs.plot_cfg.plots_dir if inputs.plot_cfg.save_plots else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer avoiding implicit type conversion (ie here I would have done save_to_folder=inputs.plot_cfg.plots_dir if inputs.plot_cfg.save_plots is not None else None) but I might be in the minority there

def plot_input_data_timeline(
assessment_inputs: AssessmentInputs,
*,
figsize: tuple[int, int] = (12, 6),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think to support wind farms with lots of turbines the figsize would want to be calculated, giving the figure more height when the number of turbines exceeds some number (say 10), and increasing the height of the figure up to some reasonable maximum. But I don't think it's essential for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants