Skip to content

Conversation

henryiii
Copy link
Member

@henryiii henryiii commented Mar 24, 2021

I think this fixes #167.

test_image_plot_pull

Also closes #159.

@matthewfeickert
Copy link
Member

Awesome! Thanks for being super speedy @henryiii. 👍 Also thanks to this I now have learned about plt.setp.

# error bar keyword arguments
eb_kwargs = _filter_dict(kwargs, "eb_")
eb_kwargs.setdefault("label", "Histogram Data")
eb_kwargs.setdefault("fmt", "o")
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I agree that the "o" maker looks much better visually then the previous defaults.

def pdf(x, a=1 / np.sqrt(2 * np.pi), x0=0, sigma=1, offset=0):
return a * np.exp(-((x - x0) ** 2) / (2 * sigma ** 2)) + offset

fig, ax = plt.subplots()
Copy link
Member

@matthewfeickert matthewfeickert Mar 24, 2021

Choose a reason for hiding this comment

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

As there is still overlap of y-axes on the test plots, can this get changed to

Suggested change
fig, ax = plt.subplots()
fig = plt.figure()

? That then fixes the axis overlap problem
test_image_plot_pull

Copy link
Member

Choose a reason for hiding this comment

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

...and now with me suggesting actual code and not a URL by accident. sigh.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 24, 2021

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.62%.

Quality metrics Before After Change
Complexity 6.29 ⭐ 6.87 ⭐ 0.58 👎
Method Length 149.00 😞 149.65 😞 0.65 👎
Working memory 16.65 ⛔ 16.92 ⛔ 0.27 👎
Quality 43.38% 😞 42.76% 😞 -0.62% 👎
Other metrics Before After Change
Lines 1017 1023 6
Changed files Quality Before Quality After Quality Change
src/hist/plot.py 38.25% 😞 37.05% 😞 -1.20% 👎
tests/test_plot.py 48.10% 😞 48.10% 😞 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
src/hist/plot.py plot_pull 23 😞 716 ⛔ 22 ⛔ 16.50% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/hist/plot.py plot2d_full 9 🙂 278 ⛔ 14 😞 38.61% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_plot.py test_general_plot1d.test_general_plot2d.test_general_plot2d_full.test_general_plot.test_named_plot1d.test_named_plot2d.test_named_plot2d_full.test_named_plot.test_named_plot_pull 0 ⭐ 369 ⛔ 16 ⛔ 42.53% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_plot.py test_general_plot1d.test_general_plot2d.test_general_plot2d_full.test_general_plot.test_general_plot_pull 0 ⭐ 361 ⛔ 16 ⛔ 42.67% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_plot.py test_general_plot1d.test_general_plot2d.test_general_plot2d_full.test_general_plot.test_named_plot1d.test_named_plot2d.test_named_plot2d_full.test_named_plot 0 ⭐ 246 ⛔ 20 ⛔ 43.21% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@henryiii henryiii merged commit abddcf2 into master Mar 24, 2021
@henryiii henryiii deleted the feat/fit_fmt branch March 24, 2021 15:16
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.

[BUG] Plot artifact in baseline test images [FEATURE] Remove fit result summary from pull plot legend as default

2 participants