Skip to content
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

HOTFIX: remove incorrect tojson() methods #551

Merged
merged 1 commit into from Feb 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 0 additions & 53 deletions menpo/shape/graph.py
Expand Up @@ -281,18 +281,6 @@ def _check_vertex(self, vertex):
raise ValueError('The vertex must be between '
'0 and {}.'.format(self.n_vertices - 1))

def tojson(self):
r"""
Convert the graph to a dictionary JSON representation.

Returns
-------
json : `dict`
Dictionary with ``adjacency_array`` key. Suitable or use in the by
the `json` standard library package.
"""
return {'adjacency_array': self.adjacency_array.tolist()}


class UndirectedGraph(Graph):
r"""
Expand Down Expand Up @@ -1191,20 +1179,6 @@ def from_mask(self, mask):
pg.points = pg.points[mask, :]
return pg

def tojson(self):
r"""
Convert this PointUndirectedGraph to a dictionary JSON representation.

Returns
-------
json : `dict`
Dictionary with ``points`` and ``adjacency_array`` keys. Both are
lists suitable or use in the by the `json` standard library package.
"""
json_dict = PointCloud.tojson(self)
json_dict.update(UndirectedGraph.tojson(self))
return json_dict


class PointDirectedGraph(PointGraph, DirectedGraph):
r"""
Expand Down Expand Up @@ -1340,20 +1314,6 @@ def from_mask(self, mask):
pt.predecessors_list = pt._get_predecessors_list()
return pt

def tojson(self):
r"""
Convert this `PointDirectedGraph` to a dictionary JSON representation.

Returns
-------
json : `dict`
Dictionary with ``points`` and ``adjacency_array`` keys. Both are
lists suitable or use in the by the `json` standard library package.
"""
json_dict = PointCloud.tojson(self)
json_dict.update(DirectedGraph.tojson(self))
return json_dict


class PointTree(PointDirectedGraph, Tree):
r"""
Expand Down Expand Up @@ -1435,19 +1395,6 @@ def from_mask(self, mask):
pt.predecessors_list = pt._get_predecessors_list()
return pt

def tojson(self):
r"""
Convert this `PointUndirectedGraph` to a dictionary JSON representation.

Returns
-------
dictionary with 'points' and 'adjacency_array' keys. Both are lists
suitable or use in the by the `json` standard library package.
"""
json_dict = PointCloud.tojson(self)
json_dict.update(UndirectedGraph.tojson(self))
return json_dict


def _unique_array_rows(array):
r"""
Expand Down