-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Distplot #275
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
- Plotly version of seaborn.distplot to add to FigureFactory - plots histogram, curve (kde or normal), and rugplot
- add `validate_displot()` method to tools.py - add core tests for distplot parameters
- add protected import of scipy to tools.py - add distplot checks to tests_optional
- add scipy.stats - edit examples in docstring
- all distplot tests are depending on scipy
@chriddyp @theengineear @aneda @etpinard |
@cldougl from the Circle error:
it looks like our Circle build doesn't have scipy. Circle will only build the packages that we explicitly configure. Here is the circle configuration file: https://github.com/plotly/python-api/blob/master/circle.yml#L7, note the "optional-requirements.txt" reference. if you add |
ahh thank you @chriddyp !! |
_scipy_imported = True | ||
except ImportError: | ||
_scipy_imported = False | ||
|
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.
\o/
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.
Note that this is going to be a merge conflict with #274 . I guess we'll need to have some specific requirements specified... How about a syntax like:
_scipy_imported
_scipy__spatial_imported
_scipy__cluster__hierarchy_imported
I'm not sure which is going to land first, but the latter will have to implement this.
- DRYing type validation - fix over-indentation
"rgb(227, 119, 194)", "rgb(127, 127, 127)", | ||
"rgb(188, 189, 34)", "rgb(23, 190, 207)"] | ||
self.curve_x = [None]*self.trace_number | ||
self.curve_y = [None]*self.trace_number |
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.
pep:8ball: spaces around operators
@@ -1501,6 +1508,35 @@ def validate_ohlc(open, high, low, close, direction, **kwargs): | |||
"'both'") | |||
|
|||
@staticmethod | |||
def validate_distplot(hist_data, curve_type): |
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.
zeroline=False), | ||
yaxis1=dict(domain=[0., 1], | ||
anchor='free', | ||
position=0.0)) |
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.
otherwise, sweet! |
- hide validate functions from tab-tab helper - add pandas example and pandas type to validation - replace `**kwargs` with `rug_text` and `colors` in - updated the docstring with Andrew’s nice terse suggestions - hid tick label from rug plot - modified rug_text so its indexed across datasets, not copied - edited examples - added import numpy where needed - increased sample sizes - reversed legend - fix the show_legend issue so a legend is shown if the hist is hidden - add test to test_core to check exception for `scipy_import = False` - edit tests in test optional to reflect the changes (mentioned above) made
- scipy will currently import in test_core
@chriddyp can I merge this? |
Looking good! It doesn't look like the
|
Thx for fixing! All good by me now 💃 Can you add some python examples as ipython notebooks to /documentation? |
Thanks! yep doc's ready |
validate_displot()
method to tools.py