Skip to content

feat(crystal): add optional plotting control and type annotations to calc_Darwin_curve#10

Open
HenriqueTortura wants to merge 4 commits intomasterfrom
feat/darwin-curve-optional-plot-flag
Open

feat(crystal): add optional plotting control and type annotations to calc_Darwin_curve#10
HenriqueTortura wants to merge 4 commits intomasterfrom
feat/darwin-curve-optional-plot-flag

Conversation

@HenriqueTortura
Copy link
Copy Markdown
Member

This PR adds a plotting toggle and type annotations to calc_Darwin_curve.

Changes

  • Adds plot_fig argument to control figure generation
  • Ensures plt.savefig() is executed before plt.show(), so figures are saved before being shown
  • Adds type annotations to function signature and return values

Notes

  • Default behavior unchanged
  • No changes to computation logic

Possible follow-ups

  • Further decouple computation and visualization into separate functions

Introduce a `plot_fig` boolean flag to allow disabling figure generation in calc_Darwin_curve. This prevents unnecessary plotting during batch executions and parameter sweeps, improving runtime performance and avoiding GUI blocking in non-interactive contexts. The default behavior is unchanged (plotting enabled), preserving backward compatibility.
Move plt.show() after optional plt.savefig() to ensure figures are properly written to disk before rendering or closing the figure. This prevents empty or incomplete image files when saving figures in non-interactive or batch execution environments.
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.

1 participant