Commit 641d0024 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix removal of 'core' submodule

This fixes a leftover bug from the removal of the 'core' submodule.
parent 011d7b65
...@@ -43,7 +43,7 @@ Contents ...@@ -43,7 +43,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_centrality") dl_import("import libgraph_tool_centrality")
from .. core import _prop, ungroup_vector_property from .. import _prop, ungroup_vector_property
import sys import sys
import numpy import numpy
......
...@@ -44,7 +44,7 @@ Contents ...@@ -44,7 +44,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_clustering as _gt") dl_import("import libgraph_tool_clustering as _gt")
from .. core import _degree, _prop, Graph from .. import _degree, _prop, Graph
from .. topology import isomorphism from .. topology import isomorphism
from .. generation import random_rewire from .. generation import random_rewire
from .. stats import vertex_hist from .. stats import vertex_hist
...@@ -463,7 +463,7 @@ def motif_significance(g, k, n_shuffles=100, p=1.0, motif_list=None, ...@@ -463,7 +463,7 @@ def motif_significance(g, k, n_shuffles=100, p=1.0, motif_list=None,
shuffled networks. shuffled networks.
shuffle_strategy : string (optional, default: "uncorrelated") shuffle_strategy : string (optional, default: "uncorrelated")
Shuffle strategy to use. Can be either "correlated" or "uncorrelated". Shuffle strategy to use. Can be either "correlated" or "uncorrelated".
See random_rewire() for details. See :func:`~graph_tool.generation.random_rewire` for details.
Returns Returns
------- -------
......
...@@ -42,7 +42,7 @@ Contents ...@@ -42,7 +42,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_community") dl_import("import libgraph_tool_community")
from .. core import _degree, _prop, Graph, libcore from .. import _degree, _prop, Graph, libcore
import random import random
import sys import sys
......
...@@ -43,7 +43,7 @@ Contents ...@@ -43,7 +43,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_correlations") dl_import("import libgraph_tool_correlations")
from .. core import _degree, _prop from .. import _degree, _prop
from numpy import * from numpy import *
__all__ = ["assortativity", "scalar_assortativity", "corr_hist", __all__ = ["assortativity", "scalar_assortativity", "corr_hist",
......
...@@ -37,7 +37,7 @@ Contents ...@@ -37,7 +37,7 @@ Contents
""" """
import sys, os, os.path, time, warnings, tempfile import sys, os, os.path, time, warnings, tempfile
from .. core import _degree, _prop, PropertyMap, _check_prop_vector,\ from .. import _degree, _prop, PropertyMap, _check_prop_vector,\
_check_prop_scalar, _check_prop_writable, group_vector_property,\ _check_prop_scalar, _check_prop_writable, group_vector_property,\
ungroup_vector_property ungroup_vector_property
from .. decorators import _limit_args from .. decorators import _limit_args
......
...@@ -73,7 +73,7 @@ The following network will be used as an example throughout the documentation. ...@@ -73,7 +73,7 @@ The following network will be used as an example throughout the documentation.
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_flow") dl_import("import libgraph_tool_flow")
from .. core import _prop, _check_prop_scalar, _check_prop_writable from .. import _prop, _check_prop_scalar, _check_prop_writable
__all__ = ["edmonds_karp_max_flow", "push_relabel_max_flow", __all__ = ["edmonds_karp_max_flow", "push_relabel_max_flow",
"boykov_kolmogorov_max_flow", "max_cardinality_matching"] "boykov_kolmogorov_max_flow", "max_cardinality_matching"]
......
...@@ -45,7 +45,7 @@ Contents ...@@ -45,7 +45,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_generation") dl_import("import libgraph_tool_generation")
from .. core import Graph, _check_prop_scalar, _prop, _limit_args from .. import Graph, _check_prop_scalar, _prop, _limit_args
from .. stats import label_parallel_edges, label_self_loops from .. stats import label_parallel_edges, label_self_loops
import sys, numpy, numpy.random import sys, numpy, numpy.random
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys, string, hashlib, os.path, re, glob import sys, string, hashlib, os.path, re, glob
from .. import core from .. import *
from .. import libgraph_tool_core from .. import libgraph_tool_core
import numpy import numpy
import DLFCN import DLFCN
...@@ -66,7 +66,7 @@ def clean_prop_type(t): ...@@ -66,7 +66,7 @@ def clean_prop_type(t):
replace("__", "_") replace("__", "_")
for d in ["vertex", "edge", "graph"]: for d in ["vertex", "edge", "graph"]:
for t in core.value_types(): for t in value_types():
props += "typedef %s_prop_t::as<%s >::type %sprop_%s_t;\n" % \ props += "typedef %s_prop_t::as<%s >::type %sprop_%s_t;\n" % \
(d, t.replace("bool", "uint8_t"), d[0], clean_prop_type(t)) (d, t.replace("bool", "uint8_t"), d[0], clean_prop_type(t))
...@@ -158,7 +158,7 @@ def inline(code, arg_names=None, local_dict=None, ...@@ -158,7 +158,7 @@ def inline(code, arg_names=None, local_dict=None,
arg_val = local_dict[arg] arg_val = local_dict[arg]
else: else:
arg_val = global_dict[arg] arg_val = global_dict[arg]
if issubclass(type(arg_val), core.Graph): if issubclass(type(arg_val), Graph):
alias = "__gt__" + arg alias = "__gt__" + arg
gi = "__gt__" + arg + "__gi" gi = "__gt__" + arg + "__gi"
graph_type = get_graph_type(arg_val) graph_type = get_graph_type(arg_val)
...@@ -170,7 +170,7 @@ def inline(code, arg_names=None, local_dict=None, ...@@ -170,7 +170,7 @@ def inline(code, arg_names=None, local_dict=None,
(arg, arg, graph_type, gi, gi) (arg, arg, graph_type, gi, gi)
arg_alias.append(alias) arg_alias.append(alias)
alias_dict[alias] = gi_val alias_dict[alias] = gi_val
elif type(arg_val) == core.PropertyMap: elif type(arg_val) == PropertyMap:
alias = "__gt__" + arg alias = "__gt__" + arg
if arg_val == arg_val.get_graph().vertex_index: if arg_val == arg_val.get_graph().vertex_index:
prop_name = "GraphInterface::vertex_index_map_t" prop_name = "GraphInterface::vertex_index_map_t"
...@@ -222,8 +222,8 @@ def inline(code, arg_names=None, local_dict=None, ...@@ -222,8 +222,8 @@ def inline(code, arg_names=None, local_dict=None,
else: else:
arg_val = global_dict[arg] arg_val = global_dict[arg]
if arg not in mask_ret and \ if arg not in mask_ret and \
type(arg_val) not in [numpy.ndarray, core.PropertyMap] and \ type(arg_val) not in [numpy.ndarray, PropertyMap] and \
not issubclass(type(arg_val), core.Graph): not issubclass(type(arg_val), Graph):
return_vals += 'return_vals["%s"] = %s;\n' % (arg, arg) return_vals += 'return_vals["%s"] = %s;\n' % (arg, arg)
support_code += globals()["support_template"] support_code += globals()["support_template"]
...@@ -241,7 +241,7 @@ def inline(code, arg_names=None, local_dict=None, ...@@ -241,7 +241,7 @@ def inline(code, arg_names=None, local_dict=None,
extra_compile_args +\ extra_compile_args +\
extra_objects + \ extra_objects + \
extra_link_args) + \ extra_link_args) + \
headers_hash + core.__version__).hexdigest() headers_hash + __version__).hexdigest()
code += "\n// support code hash: " + support_hash code += "\n// support code hash: " + support_hash
inline_code = string.Template(globals()["code_template"]).\ inline_code = string.Template(globals()["code_template"]).\
substitute(var_defs=arg_def, var_extract=arg_conv, substitute(var_defs=arg_def, var_extract=arg_conv,
......
...@@ -78,7 +78,7 @@ Contents ...@@ -78,7 +78,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_search") dl_import("import libgraph_tool_search")
from .. core import _prop from .. import _prop
from .. decorators import _wraps from .. decorators import _wraps
import sys import sys
import weakref import weakref
...@@ -191,8 +191,7 @@ class BFSVisitor(object): ...@@ -191,8 +191,7 @@ class BFSVisitor(object):
@_perm_wrap(["initialize_vertex", "examine_vertex", "finish_vertex"], @_perm_wrap(["initialize_vertex", "examine_vertex", "finish_vertex"],
["initialize_vertex"]) ["initialize_vertex"])
def bfs_search(g, source, visitor=BFSVisitor()): def bfs_search(g, source, visitor=BFSVisitor()):
r"""This function performs a breadth-first traversal of the vertices in a r"""Breadth-first traversal of a directed or undirected graph.
directed or undirected graph.
Parameters Parameters
---------- ----------
...@@ -401,8 +400,7 @@ class DFSVisitor(object): ...@@ -401,8 +400,7 @@ class DFSVisitor(object):
@_perm_wrap(["initialize_vertex", "discover_vertex", "finish_vertex", @_perm_wrap(["initialize_vertex", "discover_vertex", "finish_vertex",
"start_vertex"], ["initialize_vertex"]) "start_vertex"], ["initialize_vertex"])
def dfs_search(g, source, visitor=DFSVisitor()): def dfs_search(g, source, visitor=DFSVisitor()):
r"""This function performs a depth-first traversal of the vertices in a r"""Depth-first traversal of a directed or undirected graph.
directed or undirected graph.
Parameters Parameters
---------- ----------
...@@ -631,7 +629,7 @@ class DijkstraVisitor(object): ...@@ -631,7 +629,7 @@ class DijkstraVisitor(object):
def dijkstra_search(g, source, weight, visitor=DijkstraVisitor(), dist_map=None, def dijkstra_search(g, source, weight, visitor=DijkstraVisitor(), dist_map=None,
pred_map=None, combine=lambda a, b: a + b, pred_map=None, combine=lambda a, b: a + b,
compare=lambda a, b: a < b, zero=0, infinity=float('inf')): compare=lambda a, b: a < b, zero=0, infinity=float('inf')):
r"""This function performs a Dijsktra traversal of the vertices in a directed or undirected graph, with non-negative weights. r"""Dijsktra traversal of a directed or undirected graph, with non-negative weights.
Parameters Parameters
---------- ----------
...@@ -898,7 +896,7 @@ def bellman_ford_search(g, source, weight, visitor=BellmanFordVisitor(), ...@@ -898,7 +896,7 @@ def bellman_ford_search(g, source, weight, visitor=BellmanFordVisitor(),
combine=lambda a, b: a + b, combine=lambda a, b: a + b,
compare=lambda a, b: a < b, zero=0, compare=lambda a, b: a < b, zero=0,
infinity=float('inf')): infinity=float('inf')):
r"""This function performs a Bellman-Ford traversal of the vertices in a directed or undirected graph, with negative weights. r"""Bellman-Ford traversal of a directed or undirected graph, with negative weights.
Parameters Parameters
---------- ----------
...@@ -1171,7 +1169,7 @@ def astar_search(g, source, weight, visitor=AStarVisitor(), ...@@ -1171,7 +1169,7 @@ def astar_search(g, source, weight, visitor=AStarVisitor(),
compare=lambda a, b: a < b, zero=0, compare=lambda a, b: a < b, zero=0,
infinity=float('inf'), implicit=False): infinity=float('inf'), implicit=False):
r""" r"""
This algorithm implements a heuristic :math:`A^*` search on a weighted, directed or undirected graph for the case where all edge weights are non-negative. Heuristic :math:`A^*` search on a weighted, directed or undirected graph for the case where all edge weights are non-negative.
Parameters Parameters
---------- ----------
......
...@@ -36,7 +36,7 @@ Contents ...@@ -36,7 +36,7 @@ Contents
++++++++ ++++++++
""" """
from .. core import _degree, _prop, Graph, _limit_args from .. import _degree, _prop, Graph, _limit_args
from numpy import * from numpy import *
import scipy.sparse import scipy.sparse
......
...@@ -47,7 +47,7 @@ Contents ...@@ -47,7 +47,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_stats") dl_import("import libgraph_tool_stats")
from .. core import _degree, _prop from .. import _degree, _prop
from numpy import * from numpy import *
import numpy import numpy
import sys import sys
......
...@@ -49,7 +49,7 @@ Contents ...@@ -49,7 +49,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_topology") dl_import("import libgraph_tool_topology")
from .. core import _prop, Vector_int32_t, _check_prop_writable, \ from .. import _prop, Vector_int32_t, _check_prop_writable, \
_check_prop_scalar, _check_prop_vector, Graph, PropertyMap _check_prop_scalar, _check_prop_vector, Graph, PropertyMap
import random, sys, numpy, weakref import random, sys, numpy, weakref
__all__ = ["isomorphism", "subgraph_isomorphism", "mark_subgraph", __all__ = ["isomorphism", "subgraph_isomorphism", "mark_subgraph",
......
...@@ -41,7 +41,7 @@ Contents ...@@ -41,7 +41,7 @@ Contents
from .. dl_import import dl_import from .. dl_import import dl_import
dl_import("import libgraph_tool_util") dl_import("import libgraph_tool_util")
from .. core import _degree, _prop from .. import _degree, _prop
import weakref import weakref
__all__ = ["find_vertex", "find_vertex_range", "find_edge", "find_edge_range"] __all__ = ["find_vertex", "find_vertex_range", "find_edge", "find_edge_range"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment