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

Fix plotting warnings in Pytest, add news for removal of six support #215

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

bobleesj
Copy link
Contributor

@bobleesj bobleesj commented Sep 30, 2024

Closes #213
Closes #152

curveRef = self.subplot.plot(xData, yData, stylestr, **properties)[0]
self.subplot.legend(**legendBoxProperties())
_, properties = self.__translateStyles(style)
curveRef = self.subplot.plot(xData, yData, **properties)[0]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Warning 1: UserWarning: linestyle is redundantly defined by the 'linestyle' keyword argument

properties already has linestyle shown below:

           properties.update({"color": color, "linestyle": lineStyle, "linewidth": lineWidth})

_, properties = self.__translateStyles(style)
curveRef = self.subplot.plot(xData, yData, **properties)[0]
if "legend" in style:
self.subplot.legend(**legendBoxProperties())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Warning 2: No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument.

Solution - just check whether style contains legend like it was checked in line 321 of extendedplotframe.py

        if "legend" in style:
            properties["label"] = style["legend"]
        return stylestr, properties

Copy link
Contributor Author

@bobleesj bobleesj left a comment

Choose a reason for hiding this comment

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

Ready for review @sbillinge

Screenshot 2024-09-30 at 6 10 50 PM

@bobleesj bobleesj marked this pull request as ready for review September 30, 2024 22:11
Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

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

This looks good. I will merge, but @bobleesj it would be good if we can figure out a way to test that this hasn't broken any thing in the interface. Can we maybe figure out where these code statements are used and make sure the GUI hasn't changed?

@sbillinge sbillinge merged commit a75f347 into diffpy:main Oct 1, 2024
3 checks passed
@bobleesj bobleesj deleted the warning-remove branch October 1, 2024 14:12
@bobleesj
Copy link
Contributor Author

bobleesj commented Oct 1, 2024

I've left an issue for now. Will double-check after we can pre-release on conda-forge.

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