Skip to content

added Ishikawa plot in response to issue #25222 add organizational ch… #25248

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

Closed
wants to merge 62 commits into from

Conversation

rbt94
Copy link

@rbt94 rbt94 commented Feb 18, 2023

…arts to supported plots

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@rcomer
Copy link
Member

rcomer commented Feb 18, 2023

Thank you for your contribution @rbt94! It looks like there are some style problems that need fixing, shown by the automated checks. So I'm going to mark this as "draft" for now. Please mark it as "ready for review" when you are ready. In the meantime, if you need help, feel free to ask questions here. Or you may prefer to ask them in our incubator gitter room.

@rcomer rcomer marked this pull request as draft February 18, 2023 18:01
@rcomer rcomer linked an issue Feb 18, 2023 that may be closed by this pull request
@rbt94 rbt94 marked this pull request as ready for review February 19, 2023 10:35
@rbt94
Copy link
Author

rbt94 commented Feb 19, 2023

sorry @rcomer I have modified the code and I wanted to rerun the github checks before "marking for review" the code. Could you please describe to me the procedure before actually review the code? Sorry but I am pretty new to github. Thanks a lot

Maximum recursion level set. The default is 4.
DEBUG : bool, optional
debug : bool, optional
Copy link
Member

Choose a reason for hiding this comment

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

Suggest use the logging module instead of manual debugging.

Copy link
Member

Choose a reason for hiding this comment

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

using the logging you can also emit to the logger, but it the log level is set higher it will be automatically dropped so you do not need to thread this parameter through.


fig.savefig(output_path,
Copy link
Member

Choose a reason for hiding this comment

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

Please do not add savefig calls in examples. Don't need show, and probably don't need to encapsulate in a __main__.

Copy link
Member

Choose a reason for hiding this comment

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

To elaborate a bit more, the way our documentation build system works is we run the examples and then find and show any figures that are created.

While using '__main__' is a good practice for stand-alone scripts, will effectively hide the example from the docs which will in turn prevent the rendered image from showing up in the build docs!

'''


def ishikawaplot(data, figsize=(20, 10), left_margin: float = 0.05, right_margin: float = 0.05, alpha_ps: float = 60.0,
Copy link
Member

Choose a reason for hiding this comment

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

We have an 88-character line limit. Please wrap...

.flake8 Outdated
@@ -92,6 +92,7 @@ per-file-ignores =
examples/lines_bars_and_markers/marker_reference.py: E402
examples/misc/print_stdout_sgskip.py: E402
examples/misc/table_demo.py: E201
examples/specialty_plots/ishikawa.py: E501
Copy link
Member

Choose a reason for hiding this comment

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

Please wrap the example instead of adding an exception for it.

@tacaswell
Copy link
Member

I have modified the code and I wanted to rerun the github checks before "marking for review" the code.

if you install flake8 and invoke it from the top level of our docs you should catch most of the formatting issues. To be more through you can also install pre-commit (see https://matplotlib.org/devdocs/devel/development_setup.html#install-pre-commit-hooks-optional) which will run the exact same checks locally for you.

@tacaswell tacaswell added this to the v3.8.0 milestone Feb 20, 2023
Ishikawa Diagrams
===============

Ishikawa Diagrams are useful for visualizing the effect to many cause relationships
Copy link
Contributor

Choose a reason for hiding this comment

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

Wikipedia says that these are also known as "fishbone diagrams, herringbone diagrams, and cause-and-effect diagrams". Could you add those alternate names to the description so they show up in a search?

Copy link
Member

Choose a reason for hiding this comment

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

It may also be good to link to Wikipedia so that readers can find additional information on this plot type.

@rbt94
Copy link
Author

rbt94 commented Feb 20, 2023 via email

@jklymak jklymak marked this pull request as draft February 20, 2023 21:58
- improved example description docstring
- removed __main__ call
- debug print converted into logging.debug strings
- removed sohw fig and save fig and related Path library
- removed exception from flake8 conf file
@rbt94
Copy link
Author

rbt94 commented Feb 21, 2023

Hello @matplotlib/developers I have implemented the reported modifications and passed the pre-commit checks before committing. Unfortunately I cannot reach a successful test of the entire commit. Can you please help me by indicating what else needs to be fixed in order to pass the test? Is it the sphinx warning "Title overline too short" or something else?

Thank you,
Robert

@scottshambaugh
Copy link
Contributor

scottshambaugh commented Feb 21, 2023

I left a comment indicating how to fix the sphinx build error. I believe the Main Pytest Windows_py311 failure is a random CI timeout, let's see if it passes when you push up that change and it runs again. If it's consistent then I believe it's a separate issue from your code changes that we'll have to look into.

@rbt94
Copy link
Author

rbt94 commented Feb 22, 2023

Thank you @scottshambaugh. It is now sufficient to mark for review or there are any other issue to fix? I do not know how codecov works.

Thanks

return None


def ishikawaplot(data, figsize=(20, 10), left_margin: float = 0.05,
Copy link
Member

Choose a reason for hiding this comment

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

This method really just acts on a single axes. Strongly suggest re-structuring without figsize and just passing in an axes. If no axes is passed in, then make a new figure, and return the new axes.

tacaswell and others added 18 commits March 2, 2023 12:34
Disable discarded animation warning on save
By combining A/B parameters, to match the style of the CurveBracket,
CurveFilled, etc.

Also, tweak the example image so that it is not scaled down in the docs,
and explicitly shows 0°.
BLD: Pre-download Qhull license to put in wheels
Tk: Fix size of spacers when changing display DPI
"Inactive" workflow: bump operations-per-run
- improved example description docstring
- removed __main__ call
- debug print converted into logging.debug strings
- removed sohw fig and save fig and related Path library
- removed exception from flake8 conf file
- added wikipedia link to ishikawa desc doc string
- reformatted function def to work on axes object
- fix plt.tight_layout leaving the user to choose
- reduced fisize still mantaining a decent rendering
- added swotplot.py for SWOT plots with the same logic, design pattern
  and style
@rbt94
Copy link
Author

rbt94 commented Mar 4, 2023

I'm not sure that the input data on either of these functions needs to be a dictionary. The names and data are paired, but don't seem to be inherently dictionary-like.

The logic and formatting I have used was to resemble a plain JSON file format, just to speed-up operations in a larger application.

- integrated hypot call instead sqrt formula
- fix dict iteration
- debug eliminated
- alpha vars renaming
- docstrings minor fixes
@melissawm
Copy link
Member

Hi @rbt94 - it looks like something went wrong with a rebase? Do you need help fixing this or moving the PR forward?

@rbt94
Copy link
Author

rbt94 commented Apr 8, 2023 via email

@melissawm
Copy link
Member

@rbt94 no worries, would you prefer trying to solve this or could another contributor take over your PR, as long as they keep you as a co-author? Cheers!

@rbt94
Copy link
Author

rbt94 commented Apr 15, 2023

@rbt94 no worries, would you prefer trying to solve this or could another contributor take over your PR, as long as they keep you as a co-author? Cheers!

Thank you @melissawm It would be perfect for me. Cheers!

@QuLogic
Copy link
Member

QuLogic commented Jun 6, 2023

Replaced by #26064, IIUC. Thank you for your initial work on this, @rbt94.

@QuLogic QuLogic closed this Jun 6, 2023
@rbt94
Copy link
Author

rbt94 commented Jun 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

[ENH]: add organizational charts to supported plots