-
Notifications
You must be signed in to change notification settings - Fork 23
feat: add plot_recipe method to FitRecipe
#143
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
Conversation
|
@sbillinge ready for review, new |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #143 +/- ##
==========================================
+ Coverage 66.60% 69.36% +2.76%
==========================================
Files 25 25
Lines 3171 3457 +286
==========================================
+ Hits 2112 2398 +286
Misses 1059 1059
🚀 New features to boost your workflow:
|
sbillinge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great. Actually, more configurable than I kind of intended, but ok. A few questions:
- make sure that we are using the group style-sheet.
- Start all the docstring descriptions with The (so
Label for y-axisbecomesThe label for the y-axis. Never don't do that (i.e. ALWAYS start descriptions with The, it always works.) - I like the examples. Very nice.
- It would be quite a bit of typing, but do we want to hold the parameters as attributes of the class? That way the user could just update the attribute to customize their plot and it would stay persistent for all their plots until they reset it or reinstantiated?
- Tests look good. Very comprehensive.
- Do we want to move the "build_recipe" functions to
conftest.pyas fixtures? In that way simple test recipes will be available to all tests.
All in all, this is excellent.
| from collections import OrderedDict | ||
|
|
||
| import matplotlib.pyplot as plt | ||
| import six |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't need six, what is it being used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbillinge for instance checks like isinstance(x, six.string_types). This can be replaced with just str
|
in the plot there are no figure axis labels. Is there a ready way to guess these? I guess the challenge is to know what is being fit and what is on teh x-axis so it may be more trouble than it is worth. |
|
@sbillinge ready for review
Done
Done
I added a
Done |
| If the recipe has multiple contributions, a separate | ||
| plot is created for each contribution. | ||
|
|
||
| Parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this docstring needs to be moved somewhere, at least, deleted from here. But maybe method that sets these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbillinge I moved it to set_plot_defaults
@sbillinge I added functionality to do this just for PDF files. The PDFParser loads metadata and one of the metadata is filename. so if gr is in the filename it defaults the labels to PDF labels. The user-defined labels will override that default though |
|
I merged. Please can we update the docs with, more or less what is in the docstrings which are very good and informational. the code was a bit verbose, I am guessing we could have structured it better, but let's leave that for the future......don't let perfect be the enemy of good. |

closes #142