Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update graph reference #292

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

Merged
theengineear merged 113 commits into master from update-graph-reference
Sep 26, 2015
Merged
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
793bfa9
(matplotlylib) Axis `autotick` —> `tickmode`.
theengineear Sep 15, 2015
3b2d398
(matplotlylib) Merge opacity into color.
theengineear Sep 15, 2015
92e6e4f
Add `get_by_path` and `node_generator` to utils.py
theengineear Sep 15, 2015
98e8bc9
Add function to change string to class name.
theengineear Sep 15, 2015
e38daa4
Compile the `OBJECTS` dict in graph_reference.py.
theengineear Sep 15, 2015
248fa95
Compile the `CLASS_NAMES_TO_OBJECT_NAMES` dict.
theengineear Sep 15, 2015
729a0bb
Add public method to `get_object_info`.
theengineear Sep 15, 2015
1963dcb
Add public method to tell if `attribute_is_array`.
theengineear Sep 15, 2015
c1ba309
Stop auto-updating keys (deprecation pending).
theengineear Sep 15, 2015
b129039
Add `assign_id_to_src` to `graph_objs_tools.py`.
theengineear Sep 15, 2015
84d7ca3
Refact (simplify) doc creation.
theengineear Sep 15, 2015
a21fe90
Remove old graph reference loading.
theengineear Sep 15, 2015
bd01684
Add small helper function to sort attributes.
theengineear Sep 15, 2015
e747302
Replace old `value_is_data` with `get_role`.
theengineear Sep 15, 2015
a90a922
:dolls: We *do* perform some magic now...
theengineear Sep 15, 2015
69b868f
Add a new `PlotlyBase` class.
theengineear Sep 15, 2015
3543781
Add `GraphObjectFactory`.
theengineear Sep 15, 2015
59a703e
Inherit from `PlotlyBase`.
theengineear Sep 15, 2015
f3495e5
Remove `to_graph_objs`, `validate`, `get_ordered`.
theengineear Sep 15, 2015
f8610e3
Remove `_assign_id_to_src`. It moved.
theengineear Sep 15, 2015
45729be
Add private attrs to `PlotlyList` and `PlotlyDict`
theengineear Sep 15, 2015
e46276a
Update PlotlyDict and PlotlyList `update` methods.
theengineear Sep 15, 2015
b421c35
Update `strip_style` methods.
theengineear Sep 15, 2015
6d27008
Update `get_data` methods.
theengineear Sep 15, 2015
e8b342e
Update `to_string` methods.
theengineear Sep 15, 2015
06be891
Update `force_clean` methods.
theengineear Sep 15, 2015
687969e
Add `value_to_graph_object` methods.
theengineear Sep 15, 2015
9f27eba
Add PlotlyDict method to allow int-appended attrs.
theengineear Sep 15, 2015
7dcfc96
Make PlotlyList magic.
theengineear Sep 15, 2015
d338502
Make PlotlyDict magic.
theengineear Sep 15, 2015
50184c9
Add in support for the `copy` module. (more)
theengineear Sep 15, 2015
e96ffc7
Simply define `Figure` instead of patching it.
theengineear Sep 15, 2015
1dd6035
Simply define `Data` instead of patching.
theengineear Sep 15, 2015
d961a7a
Simply define `Layout` instead of patching it.
theengineear Sep 15, 2015
52b9d0d
Remove `PlotlyTrace` and no validation on `Trace`.
theengineear Sep 15, 2015
84fe0d6
We no longer need to patch Annotations.
theengineear Sep 15, 2015
514a3ee
Refact how we generate all the dynamic classes.
theengineear Sep 15, 2015
c997773
Update imports.
theengineear Sep 15, 2015
08a76c7
Export an appropriate `__all__`.
theengineear Sep 15, 2015
3a715c6
Set `grid_ref` and `grid_str` on `__dict__`.
theengineear Sep 15, 2015
cc62571
Update `get_valid_graph_obj`.
theengineear Sep 15, 2015
59c12c7
Update `validate`. Not *really* needed though...
theengineear Sep 15, 2015
a79dbf4
Update `return_figure_from_figure_or_data`.
theengineear Sep 15, 2015
42f450c
Refact plotly_list / plotly_dict tests.
theengineear Sep 15, 2015
ecc267d
Remove get ordered tests.
theengineear Sep 15, 2015
aa2da24
Remove `PlotlyTrace` tests (DNE).
theengineear Sep 15, 2015
a0ae2a2
Remove old `test_graph_objs_tools` tests.
theengineear Sep 15, 2015
801d81d
Update `test_annotations.py`.
theengineear Sep 15, 2015
8920dc2
Update `test_append_trace.py`. <— @etpinard
theengineear Sep 15, 2015
ace9f68
Update `test_data.py`.
theengineear Sep 15, 2015
b434a3c
Update `test_error_bars.py`.
theengineear Sep 15, 2015
8d31b6e
Update `test_to_string.py`.
theengineear Sep 15, 2015
2649be7
Update `test_update.py`.
theengineear Sep 15, 2015
3fd16ba
Merge branch 'cache-plot-schema' into update-graph-reference
theengineear Sep 15, 2015
3615088
Add `+=` operator via `__iadd__`.
theengineear Sep 16, 2015
d653001
Stop hard-coding `META_KEYS` (is in the schema).
theengineear Sep 16, 2015
fbdd9e8
Use `hrName` from graph reference.
theengineear Sep 16, 2015
0d34997
:hocho: the old `get_class_instance_by_name`.
theengineear Sep 16, 2015
b2fa961
Merge branch 'cache-plot-schema' into update-graph-reference
theengineear Sep 17, 2015
96c226a
In PY3 `.keys()` returns a `view` not a `list`!
theengineear Sep 17, 2015
f9edd67
Missed another one, same as above. `list(keys)`
theengineear Sep 17, 2015
a31dbd5
Don’t store paths for objects under meta keys.
theengineear Sep 17, 2015
fca4d5f
Return deprecated attrs along with object info.
theengineear Sep 17, 2015
de24bd8
Allow deprecated attrs to be set *as-is*.
theengineear Sep 17, 2015
8ed7f81
Add deprecated attributes to figure and layout.
theengineear Sep 17, 2015
80d17e1
return subplot_attributes with object info.
theengineear Sep 17, 2015
4950915
Use _isSubplotObj instead of hard-coded strings.
theengineear Sep 17, 2015
5e6b465
Suppress warnings in `get_figure` tests.
theengineear Sep 17, 2015
56100a7
Tag slow tests with `@attr(‘slow’)`. (more)
theengineear Sep 17, 2015
8049439
Tag skipped tests with GH issues.
theengineear Sep 17, 2015
45b3fc7
Add some :tiger2:s for `graph_objs_tools.py`.
theengineear Sep 17, 2015
4f610fc
:cow2: Removing redundant parens.
theengineear Sep 17, 2015
301f21d
Fix `force_clean` call signature. Still :cactus:.
theengineear Sep 17, 2015
f8dc6a3
Be clearer about instantiating `data` in `Figure`.
theengineear Sep 17, 2015
992a73a
:dolls: so many :dolls:.
theengineear Sep 17, 2015
eccb469
Go completely path-based / dynamic. (messy commit)
theengineear Sep 18, 2015
8fc79ff
`value_to_graph_object` > `_value_to_graph_object`
theengineear Sep 18, 2015
c12fc2c
Merge branch 'cache-plot-schema' into update-graph-reference
theengineear Sep 18, 2015
7a24734
Merge branch 'cache-plot-schema' into update-graph-reference
theengineear Sep 19, 2015
1f84f23
Merge branch 'master' into update-graph-reference
theengineear Sep 19, 2015
2131e98
Expect deprecated attributes to have `role`.
theengineear Sep 19, 2015
496242d
Make `get_attributes` return homogenous `dict`.
theengineear Sep 21, 2015
e387a16
Move `get_role` to `graph_reference.py`.
theengineear Sep 21, 2015
4bd19d4
Add dynamic `.help()` for Graph Objects.
theengineear Sep 21, 2015
4320ce4
Use dynamic help to construct doc string.
theengineear Sep 21, 2015
3edbe08
Add methods for patching `Data` and `Figure`.
theengineear Sep 21, 2015
0ed1c98
Allow `Figure` and `Data` to be auto-generated.
theengineear Sep 21, 2015
79132b3
Help user find deprecation description when warned
theengineear Sep 21, 2015
7b01986
TODO-daloo.
theengineear Sep 21, 2015
35224f6
Remove `TODO` (no GH issue)
theengineear Sep 21, 2015
80fa6c9
Add helper method `get_parent_object_names`.
theengineear Sep 21, 2015
f4beea0
`get_path` to `_get_path`.
theengineear Sep 21, 2015
d207577
`get_parents` to `_get_parents`.
theengineear Sep 21, 2015
9cfa817
Make `get_parent_object_names` private.
theengineear Sep 21, 2015
6e80023
Re-organize private defs above public ones.
theengineear Sep 21, 2015
c215ab8
`print()` not `print`, PY3 fix.
theengineear Sep 21, 2015
91c51e4
Test help calls on all attributes of all objects.
theengineear Sep 21, 2015
211f46c
Add patch to fix test.
theengineear Sep 21, 2015
97c8801
Add some more :tiger2:s for graph reference.
theengineear Sep 21, 2015
dcf6d45
Removing skipped tests.
theengineear Sep 21, 2015
bda1c93
Add back `DataTypeError`
theengineear Sep 21, 2015
924f181
Stop using `hrName`. (just patch it).
theengineear Sep 24, 2015
0be0d20
Add failing specs for current/future class names.
theengineear Sep 25, 2015
033e8dd
:cactus: Require obj_type in `get_valid_graph_obj`
theengineear Sep 25, 2015
691bf73
Add new organization to `graph_reference.py`.
theengineear Sep 25, 2015
41e9675
Use the new `CLASSES` in `tools.py`.
theengineear Sep 25, 2015
1b0f007
Add `object_name_to_class_name` function. (more)
theengineear Sep 25, 2015
02adc54
Allow `PlotlyDict` and `PlotlyList` to be used.
theengineear Sep 25, 2015
4f65904
Remove unused test...
theengineear Sep 25, 2015
00c1f83
Use `_get_class_name()` over `__class__.__name__`.
theengineear Sep 25, 2015
fa3e928
Init sub-objects as generic objects.
theengineear Sep 25, 2015
19be9ab
Remove old graph_reference compat framework.
theengineear Sep 25, 2015
d315065
Update code for new plot-schema structure.
theengineear Sep 25, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove to_graph_objs, validate, get_ordered.
(these are short-circuited in the `PlotlyBase` class)
  • Loading branch information
theengineear committed Sep 15, 2015
commit f3495e59ded2011c6471e78f38bf00b89d0ea1b0
63 changes: 0 additions & 63 deletions plotly/graph_objs/graph_objs.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,6 @@ def __init__(self, *args):
"list-like graph_objs.\nIt is not meant to be a "
"user interface.")

def to_graph_objs(self, caller=True):
"""Change any nested collections to subclasses of PlotlyDict/List.

Procedure:
1. Attempt to convert all entries to a subclass of PlotlyDict.
2. Call `to_graph_objects` on each of these entries.

"""
for index, entry in enumerate(self):
if isinstance(entry, PlotlyDict):
try:
entry.to_graph_objs(caller=False)
except exceptions.PlotlyGraphObjectError as err:
err.add_to_error_path(index)
err.prepare()
raise # re-raise current exception
else:
raise exceptions.PlotlyListEntryError(obj=self,
index=index,
entry=entry)

def update(self, changes, make_copies=False):
"""Update current list with changed_list, which must be iterable.
The 'changes' should be a list of dictionaries, however,
Expand Down Expand Up @@ -267,20 +246,6 @@ def to_string(self, level=0, indent=4, eol='\n',
"{eol}{indent}])").format(eol=eol, indent=' ' * indent * level)
return string

def get_ordered(self, caller=True):
if caller:
try:
self.to_graph_objs(caller=False)
except exceptions.PlotlyGraphObjectError as err:
err.add_note("Could not order list because it could not be "
"converted to a valid graph object.")
err.prepare()
raise
ordered_list = []
for index, entry in enumerate(self):
ordered_list += [entry.get_ordered()]
return ordered_list

def force_clean(self, caller=True):
"""Attempts to convert to graph_objs and calls force_clean() on entries.

Expand Down Expand Up @@ -551,34 +516,6 @@ def to_string(self, level=0, indent=4, eol='\n',
string += "{eol}{indent})".format(eol=eol, indent=' ' * indent * level)
return string

def get_ordered(self, caller=True):
if caller: # change everything to 'order-able' objs
try:
self.to_graph_objs(caller=False)
except exceptions.PlotlyGraphObjectError as err:
err.add_note("dictionary could not be ordered because it "
"could not be converted to a valid plotly graph "
"object.")
err.prepare()
raise
obj_type = NAME_TO_KEY[self.__class__.__name__]
ordered_dict = OrderedDict()
# grab keys like xaxis1, xaxis2, etc...
unordered_keys = [key for key in self
if key not in INFO[obj_type]['keymeta']]
for key in INFO[obj_type]['keymeta']:
if key in self:
if isinstance(self[key], (PlotlyDict, PlotlyList)):
ordered_dict[key] = self[key].get_ordered(caller=False)
else:
ordered_dict[key] = self[key]
for key in unordered_keys:
if isinstance(self[key], (PlotlyDict, PlotlyList)):
ordered_dict[key] = self[key].get_ordered(caller=False)
else:
ordered_dict[key] = self[key]
return ordered_dict

def force_clean(self, caller=True):
"""Attempts to convert to graph_objs and call force_clean() on values.

Expand Down

AltStyle によって変換されたページ (->オリジナル) /