Skip to content

Fix and Update plot_energy_dist.py#149

Merged
andthum merged 5 commits intomainfrom
fix/scripts/gmx/plot-energy-dist
Feb 14, 2023
Merged

Fix and Update plot_energy_dist.py#149
andthum merged 5 commits intomainfrom
fix/scripts/gmx/plot-energy-dist

Conversation

@andthum
Copy link
Owner

@andthum andthum commented Feb 14, 2023

Fix and Update plot_energy_dist.py

Related issue(s)

The type of the argparse input variable NUM_POINTS was float but has to by int, because it is used for indexing arrays.

Type of change

  • Change of core package.
  • Change of scripts.
  • Bug fix.
  • New feature.
  • Code refactoring.
  • Dependency update.
  • Documentation update.
  • Maintenance.
  • Other: Description.
  • Non-breaking (backward-compatible) change.
  • Breaking (non-backward-compatible) change.

Proposed changes

  • Remove --num-points option entirely and replace it by the options --cutout-start and --cutout-end which allows the users to specify a start and end point for the cutout plot instead of just plotting the last --num-points data points.
  • Additionally to the centered moving average and the cumulative average, also plot the total average.
  • MDTools plot style: Set the handlelength in legends to 1.8. Before it was the default value of 2.0. This leads to a nicer representation of dashed lines in legends.
  • [plot.py]: Decrease the handlelength for small legends to from 1.6 to 1.35. This leads to a nicer representation of dashed lines in small legends and additionally shrinks the legend further.

PR checklist

  • I followed the guidelines in the Developer's guide.
  • New/changed code is properly tested.
  • New/changed code is properly documented.
  • The CI workflow is passing.

Fix the dtype of the argparse variable `NUM_POINTS` from float to int.
If `NUM_POINTS` is a float, indexing arrays with it will fail.
Additionally to the centered moving average and the cumulative average,
also plot the total average to the plot.
Replace the option `--num-points` by the options `--cutout-start` and
`--cutout-end`.

Before, users could only specify how many data points to show in the
cutout plot from the end of the data series.  Now, the users can specify
a start and end point for the cutout plot.
Set the handlelength in legends to 1.8.  Before it was the default value
of 2.0.  This leads to a nicer representation of dashed lines in
legends.
Decrease the handlelength for small legends to from 1.6 to 1.35.  This
leads to a nicer representation of dashed lines in small legends and
additionally shrinks the legend further.
@github-actions github-actions bot added breaking Breaking changes bugfix Pull requests that fix a bug enhancement New feature or request major-scripts Breaking change in one ore more scripts labels Feb 14, 2023
@andthum andthum merged commit 03b8bb6 into main Feb 14, 2023
@andthum andthum deleted the fix/scripts/gmx/plot-energy-dist branch February 14, 2023 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking changes bugfix Pull requests that fix a bug enhancement New feature or request major-scripts Breaking change in one ore more scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant