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

DEP Deprecate steps plot argument in favor of matplotlib drawstyle #433

Open
drewejohnson opened this issue Dec 22, 2020 · 0 comments
Open
Labels
Deprecations Features slated for deprecation and removal

Comments

@drewejohnson
Copy link
Collaborator

Initially brought up in #432 for the HomogUniv class. As we start forwarding more plot options to the underlying matplotlib plot functions (#417, #423, #422 and friends) there may be a point where we want to rely on users passing drawstyle=<option> rather than our own logic for the step argument.

Some examples

drawstyle = 'steps-post' if steps else None
if steps:
if 'drawstyle' in kwargs:
debug('Defaulting to drawstyle specified in kwargs as {}'
.format(kwargs['drawstyle']))
else:
kwargs['drawstyle'] = 'steps-post'
kwargs.setdefault("drawstyle", "steps")
ax.errorbar(energies, yVals, yErrs, label=label,
drawstyle='steps-post')

Roadmap

I propose that by 0.10.0 we support passing steps and drawstyle for the methods that currently support steps. Methods like the sensitivity plotter can have a default drawstyle using kwargs.setdefault("drawstyle", ...).

Instances where both are passed should raise a DeprecationWarning by 0.10.0. Following 0.11.0 we should no longer support the steps argument, instead falling back to the matplotlib drawstyle argument.

Instances where we currently allow steps and additional kwargs should raise a pending deprecation warning by 0.9.4

Extras

Some care should be taken for the spectrum plot and other cases where we perform a line plot with some uncertainties. Here we wish to draw the errorbars in the middle of the bin (#428)

@drewejohnson drewejohnson added the Deprecations Features slated for deprecation and removal label Dec 22, 2020
@drewejohnson drewejohnson added this to the 0.9.4 milestone Dec 22, 2020
drewejohnson added a commit to drewejohnson/serpent-tools that referenced this issue Dec 24, 2020
drewejohnson added a commit to drewejohnson/serpent-tools that referenced this issue Mar 22, 2021
Closes CORE-GATECH-GROUP#423

Default drawstyle is steps-post

Related to
- CORE-GATECH-GROUP#433 - relying on `drawstyle` over `steps`
- CORE-GATECH-GROUP#417 - passing more kwargs to matplotlib plot routines
drewejohnson added a commit to drewejohnson/serpent-tools that referenced this issue Apr 15, 2021
Passing label is not allowed since we label based on dictionary values
passed for y and right quantities.

Closes CORE-GATECH-GROUP#422

Related to CORE-GATECH-GROUP#433 and CORE-GATECH-GROUP#417
@drewejohnson drewejohnson removed this from the 0.9.4 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecations Features slated for deprecation and removal
Projects
None yet
Development

No branches or pull requests

1 participant