...
 
Commits (6)
......@@ -14,7 +14,7 @@ job_gcc_amd64:
job_clang_amd64:
script:
- ./autogen.sh
- ./configure CXX="ccache clang++" PYTHON=python3 --prefix=$PWD/install --with-python-module-path=$PWD/install/site-packages CXXFLAGS="-O3 -flto=thin" LDFLAGS=""
- ./configure CXX="ccache clang++" PYTHON=python3 --prefix=$PWD/install --with-python-module-path=$PWD/install/site-packages CXXFLAGS="-O3" LDFLAGS=""
- CCACHE_BASEDIR=$PWD make $MAKEOPTS
- make install
- export PYTHONPATH=$PWD/install/site-packages
......
......@@ -20,7 +20,7 @@ website http://graph-tool.skewed.de.
graph-tool is free software, you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License, version 3 or
above. See LICENSE and LICENSE.LESSER for details.
above. See COPYING and COPYING.LESSER for details.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
......
......@@ -21,10 +21,6 @@
#include <boost/graph/breadth_first_search.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/python/object.hpp>
#include <boost/python/list.hpp>
#include <boost/python/extract.hpp>
#include "histogram.hh"
#include "hash_map_wrap.hh"
......
......@@ -25,8 +25,6 @@
#include "graph_avg_correlations.hh"
#include <iostream>
using namespace std;
using namespace boost;
using namespace graph_tool;
......
......@@ -21,12 +21,8 @@
#include <algorithm>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/python/object.hpp>
#include <boost/python/list.hpp>
#include <boost/python/extract.hpp>
#include "histogram.hh"
#include "numpy_bind.hh"
#include "shared_map.hh"
namespace graph_tool
{
......
......@@ -22,7 +22,6 @@
#include "graph_filtering.hh"
#include <boost/python.hpp>
#include <boost/utility/enable_if.hpp>
#include "graph_selectors.hh"
#include "graph_properties.hh"
......
......@@ -22,7 +22,6 @@
#include "graph_selectors.hh"
#include "graph_properties.hh"
#include <boost/mpl/quote.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <cmath>
......
......@@ -21,7 +21,6 @@
#include "graph.hh"
#include "graph_filtering.hh"
#include "graph_util.hh"
#include "graph_python_interface.hh"
#ifdef _OPENMP
#include <omp.h>
#endif
......
......@@ -21,7 +21,6 @@
#include "graph_selectors.hh"
#include "graph_properties.hh"
#include <boost/bind/placeholders.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/python.hpp>
......
......@@ -21,7 +21,6 @@
#include "graph_selectors.hh"
#include "graph_properties.hh"
#include <boost/bind/placeholders.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/python.hpp>
......
......@@ -21,7 +21,6 @@
#include "graph_selectors.hh"
#include "graph_properties.hh"
#include <boost/bind/placeholders.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/python.hpp>
......
......@@ -21,7 +21,6 @@
#include "graph_selectors.hh"
#include "graph_properties.hh"
#include <boost/bind/placeholders.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/python.hpp>
......
......@@ -21,7 +21,6 @@
#include "graph_selectors.hh"
#include "graph_properties.hh"
#include <boost/bind/placeholders.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/python.hpp>
......
......@@ -20,8 +20,6 @@
#include <tuple>
#include <iostream>
#include <boost/functional/hash.hpp>
#include <boost/multi_array.hpp>
#include "graph.hh"
#include "graph_filtering.hh"
......
......@@ -21,8 +21,6 @@
#include "graph_union.hh"
#include <boost/python/extract.hpp>
using namespace graph_tool;
using namespace boost;
......
......@@ -20,9 +20,6 @@
#include "graph_union.hh"
#include <boost/python/extract.hpp>
using namespace graph_tool;
using namespace boost;
......
......@@ -29,7 +29,6 @@
#include <boost/variant/get.hpp>
#include <boost/spirit/include/support_istream_iterator.hpp>
#include <boost/foreach.hpp>
#include <boost/type_traits.hpp>
#include <boost/algorithm/string/replace.hpp>
......@@ -44,7 +43,6 @@
#include <fstream>
#include <string>
#include <vector>
#include <unordered_map>
#include "base64.hh"
......
......@@ -21,7 +21,6 @@
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
#include <iostream>
using namespace std;
using namespace boost;
......
......@@ -19,11 +19,11 @@
#define GRAPH_HH
#include "config.h"
#include <Python.h>
#include <boost/python/object.hpp>
#include <boost/python/dict.hpp>
#include <boost/python/list.hpp>
#include <boost/python/tuple.hpp>
#include <deque>
#include <boost/any.hpp>
#include "graph_adjacency.hh"
......@@ -31,7 +31,7 @@
#include "fast_vector_property_map.hh"
#include <boost/variant.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/bool_fwd.hpp>
#include "graph_properties.hh"
#include "graph_exceptions.hh"
......
......@@ -22,7 +22,6 @@
#include <deque>
#include <utility>
#include <numeric>
#include <iostream>
#include <tuple>
#include <boost/iterator.hpp>
#include <boost/graph/graph_traits.hpp>
......
......@@ -21,7 +21,6 @@
#include "graph_selectors.hh"
#include <boost/mpl/for_each.hpp>
#include <boost/mpl/contains.hpp>
#include <boost/python/extract.hpp>
using namespace std;
......
......@@ -22,31 +22,14 @@
#include <boost/version.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/erase.hpp>
#include <boost/mpl/clear.hpp>
#include <boost/mpl/map.hpp>
#include <boost/mpl/for_each.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/logical.hpp>
#include <boost/mpl/inserter.hpp>
#include <boost/mpl/insert_range.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/divides.hpp>
#include <boost/mpl/arithmetic.hpp>
#include <boost/mpl/greater_equal.hpp>
#include <boost/mpl/comparison.hpp>
#include <boost/mpl/transform_view.hpp>
#include <boost/mpl/quote.hpp>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/print.hpp>
#include "graph_adaptor.hh"
#include "graph_filtered.hh"
#include "graph_reverse.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#include "mpl_nested_loop.hh"
......
......@@ -22,8 +22,7 @@
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/graph/graphml.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/xpressive/xpressive.hpp>
......
......@@ -26,24 +26,22 @@
#include <boost/functional/hash.hpp>
#include <boost/python/object.hpp>
#include <boost/python/extract.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/version.hpp>
#if (BOOST_VERSION >= 104000)
# include <boost/property_map/property_map.hpp>
# include <boost/property_map/dynamic_property_map.hpp>
#else
# include <boost/property_map.hpp>
# include <boost/dynamic_property_map.hpp>
#endif
#include "fast_vector_property_map.hh"
#include <boost/mpl/vector.hpp>
#include <boost/mpl/for_each.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/find.hpp>
#include <boost/mpl/bind.hpp>
#include "graph.hh"
#include "graph_exceptions.hh"
#include "hash_map_wrap.hh"
// this file provides general functions for manipulating graph properties
......
......@@ -19,9 +19,6 @@
#include "graph_filtering.hh"
#include "graph_properties.hh"
#include <boost/mpl/contains.hpp>
#include <boost/python/extract.hpp>
#include "graph_properties_copy.hh"
using namespace std;
......
......@@ -22,9 +22,7 @@
#include "graph_filtering.hh"
#include "graph_properties.hh"
#include "graph_util.hh"
#include <boost/mpl/contains.hpp>
#include <boost/python/extract.hpp>
#include "hash_map_wrap.hh"
namespace graph_tool
{
......
......@@ -22,8 +22,6 @@
#include "graph_properties_group.hh"
#include <boost/python/extract.hpp>
using namespace std;
using namespace boost;
using namespace graph_tool;
......
......@@ -23,8 +23,6 @@
#include "graph_util.hh"
#include "hash_map_wrap.hh"
#include <boost/mpl/for_each.hpp>
#include <boost/python/extract.hpp>
using namespace std;
......
......@@ -23,10 +23,6 @@
#include "graph_util.hh"
#include "hash_map_wrap.hh"
#include <boost/mpl/for_each.hpp>
#include <boost/python/extract.hpp>
using namespace std;
using namespace boost;
using namespace graph_tool;
......
......@@ -22,8 +22,6 @@
#include "graph_properties_group.hh"
#include <boost/python/extract.hpp>
using namespace std;
using namespace boost;
using namespace graph_tool;
......
......@@ -21,8 +21,6 @@
#include "graph_python_interface.hh"
#include <boost/python.hpp>
#include <boost/python/stl_iterator.hpp>
#include <set>
#include "coroutine.hh"
......@@ -854,7 +852,7 @@ void do_add_edge_list(GraphInterface& gi, python::object aedge_list,
python::object eprops);
void do_add_edge_list_hashed(GraphInterface& gi, python::object aedge_list,
boost::any& vertex_map, bool is_str,
boost::any& vertex_map,
python::object eprops);
void do_add_edge_list_iter(GraphInterface& gi, python::object edge_list,
......
......@@ -19,7 +19,6 @@
#define PYTHON_INTERFACE_HH
#include <boost/python.hpp>
#include <boost/python/type_id.hpp>
namespace std
{
......@@ -37,6 +36,12 @@ namespace std
#include <boost/mpl/logical.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/version.hpp>
#if (BOOST_VERSION >= 104000)
# include <boost/property_map/dynamic_property_map.hpp>
#else
# include <boost/dynamic_property_map.hpp>
#endif
#include <type_traits>
#include "graph.hh"
......
......@@ -21,7 +21,6 @@
#include "demangle.hh"
#include <boost/python.hpp>
#include <boost/lambda/bind.hpp>
using namespace std;
using namespace boost;
......
This diff is collapsed.
......@@ -26,9 +26,8 @@
#include <boost/graph/adjacency_iterator.hpp>
#include <boost/graph/properties.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits.hpp>
#include <boost/mpl/if.hpp>
#include <utility>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
// Stay out of the way of the concept checking class
......
......@@ -24,11 +24,12 @@
#include <boost/mpl/map.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/find.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/logical.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/any.hpp>
#include <boost/graph/graph_traits.hpp>
#include "graph_adaptor.hh"
#include "graph_properties.hh"
#include "graph.hh"
......
......@@ -30,13 +30,9 @@ namespace boost { namespace python { namespace detail {
} } }
#include <boost/graph/graph_traits.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <string>
#include <boost/functional/hash.hpp>
......@@ -44,7 +40,6 @@ namespace boost { namespace python { namespace detail {
#include <random>
#include "graph_selectors.hh"
#include "graph_reverse.hh"
#include "graph_filtered.hh"
namespace graph_tool
......
......@@ -10,13 +10,11 @@
// Tiago de Paula Peixoto
#include <boost/python.hpp>
#include <boost/variant.hpp>
#include <expat.h>
#include <boost/graph/graphml.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/archive/iterators/xml_escape.hpp>
#include <boost/archive/iterators/ostream_iterator.hpp>
#include <boost/archive/iterators/insert_linebreaks.hpp>
#include <sstream>
#include "base64.hh"
......
......@@ -25,7 +25,6 @@
#define BOOST_DISABLE_ASSERTS
#include <boost/multi_array.hpp>
#include <boost/type_traits.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/int.hpp>
......
......@@ -21,8 +21,6 @@
#include "numpy_bind.hh"
#include "hash_map_wrap.hh"
#include <boost/math/special_functions/gamma.hpp>
using namespace std;
using namespace boost;
using namespace graph_tool;
......
......@@ -21,6 +21,8 @@
#include "../support/util.hh"
#include "../support/int_part.hh"
#include "hash_map_wrap.hh"
namespace graph_tool
{
......
......@@ -17,7 +17,6 @@
#include "graph_latent_multigraph.hh"
#include <boost/mpl/push_back.hpp>
#include <boost/python.hpp>
using namespace std;
......
......@@ -23,8 +23,6 @@
#include <vector>
#include <cmath>
#include <boost/math/special_functions/gamma.hpp>
namespace graph_tool
{
using namespace std;
......
......@@ -15,9 +15,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <boost/math/special_functions/zeta.hpp>
#include <boost/math/special_functions/gamma.hpp>
#include "graph_tool.hh"
#include "hash_map_wrap.hh"
#include "int_part.hh"
......
......@@ -25,7 +25,6 @@
#include "graph_tool.hh"
#include "../support/graph_state.hh"
#include "graph_blockmodel_dynamics.hh"
#include "graph_python_interface.hh"
namespace graph_tool
{
......
......@@ -19,8 +19,6 @@
#include "graph.hh"
#include "graph_properties.hh"
#include <boost/lambda/bind.hpp>
#include "graph_arf.hh"
using namespace std;
......
......@@ -31,10 +31,6 @@ Value power(Value value, int n)
}
#endif
#include <boost/math/special_functions/gamma.hpp>
#include <boost/math/special_functions/hypot.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/graph/fruchterman_reingold.hpp>
using namespace std;
......
......@@ -20,8 +20,6 @@
#include "graph_properties.hh"
#include "graph_exceptions.hh"
#include <boost/lambda/bind.hpp>
#include "graph_sfdp.hh"
#include "random.hh"
#include "hash_map_wrap.hh"
......
......@@ -33,7 +33,6 @@
#define BOOST_DISABLE_ASSERTS
#include <boost/multi_array.hpp>
#include <boost/type_traits.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/map.hpp>
......
......@@ -25,8 +25,6 @@
// Ronald Garcia
//
#include <boost/ref.hpp>
#include <boost/function/function2.hpp>
#include <boost/version.hpp>
#if (BOOST_VERSION >= 104000)
# include <boost/property_map/dynamic_property_map.hpp>
......@@ -47,8 +45,6 @@
#include <cstdlib>
#include <boost/throw_exception.hpp>
#include <boost/regex.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/graph/graphviz.hpp>
namespace boost {
......
......@@ -28,7 +28,6 @@
#include "graph_astar.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -16,7 +16,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "graph_filtering.hh"
#include "graph_python_interface.hh"
#include <boost/python.hpp>
#include <boost/graph/astar_search.hpp>
......
......@@ -26,7 +26,6 @@
#include "graph_util.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -10,14 +10,12 @@
#include <boost/python.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/undirected_dfs.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -26,7 +26,6 @@
#include "graph_util.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -19,8 +19,6 @@
#define GRAPH_AVERAGE_HH
#include <algorithm>
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
namespace graph_tool
{
......
......@@ -23,7 +23,6 @@
#include <boost/python/object.hpp>
#include <boost/python/list.hpp>
#include <boost/python/extract.hpp>
#include "histogram.hh"
#include "numpy_bind.hh"
......
......@@ -23,7 +23,6 @@
#include <boost/python/object.hpp>
#include <boost/python/list.hpp>
#include <boost/python/extract.hpp>
#include "histogram.hh"
#include "numpy_bind.hh"
......
......@@ -22,8 +22,6 @@
#include <boost/numeric/conversion/bounds.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/python/object.hpp>
#include <boost/python/list.hpp>
#include <boost/python/extract.hpp>
#include "numpy_bind.hh"
#include "histogram.hh"
#include "shared_map.hh"
......
......@@ -22,8 +22,6 @@
#include "graph_util.hh"
#include "idx_map.hh"
#include <boost/range/adaptor/reversed.hpp>
namespace graph_tool
{
using namespace std;
......
......@@ -30,7 +30,6 @@
#include <boost/graph/dijkstra_shortest_paths_no_color_map.hpp>
#include <boost/graph/bellman_ford_shortest_paths.hpp>
#include <boost/graph/dag_shortest_paths.hpp>
#include <boost/python/stl_iterator.hpp>
#include <boost/python.hpp>
#if (BOOST_VERSION >= 106000)
......
......@@ -21,6 +21,8 @@
#include <array>
#include <deque>
#include "hash_map_wrap.hh"
namespace graph_tool
{
......
......@@ -24,7 +24,6 @@
#ifdef _OPENMP
#include <omp.h>
#include <boost/type_traits.hpp>
#endif
......
......@@ -594,7 +594,7 @@ class PropertyMap(object):
ma = property(__get_set_m_array,
lambda self, v: self.__get_set_m_array(v, False),
doc=r"""The same as the :attr:`~PropertyMap.a` attribute, but
instead a :class:`~numpy.ma.MaskedArray` object is returned,
instead a :class:`numpy.ma.MaskedArray` object is returned,
which contains only entries for vertices/edges which are not
filtered out. If there are no filters in place, a regular
:class:`~graph_tool.PropertyArray` is returned, which
......@@ -951,7 +951,7 @@ class GraphPropertyMap(PropertyMap):
class PropertyArray(numpy.ndarray):
"""This is a :class:`~numpy.ndarray` subclass which keeps a reference of its
"""This is a :class:`numpy.ndarray` subclass which keeps a reference of its
:class:`~graph_tool.PropertyMap` owner.
"""
......@@ -2407,11 +2407,11 @@ class Graph(object):
"""
return libcore.remove_edge(self.__graph, edge)
def add_edge_list(self, edge_list, hashed=False, string_vals=False,
def add_edge_list(self, edge_list, hashed=False, hash_type="string",
eprops=None):
"""Add a list of edges to the graph, given by ``edge_list``, which can
be an iterator of ``(source, target)`` pairs where both ``source`` and
``target`` are vertex indexes, or a :class:`~numpy.ndarray` of shape
``target`` are vertex indexes, or a :class:`numpy.ndarray` of shape
``(E,2)``, where ``E`` is the number of edges, and each line specifies a
``(source, target)`` pair. If the list references vertices which do not
exist in the graph, they will be created.
......@@ -2420,10 +2420,11 @@ class Graph(object):
are not assumed to correspond to vertex indices directly. In this case
they will be mapped to vertex indices according to the order in which
they are encountered, and a vertex property map with the vertex values
is returned. If ``string_vals == True``, the algorithm assumes that the
vertex values are strings. Otherwise, they will be assumed to be numeric
if ``edge_list`` is a :class:`~numpy.ndarray`, or arbitrary python
objects if it is not.
is returned. The option ``hash_type`` will determine the expected type
used by the hash keys, and they can be any property map value type (see
:class:`PropertyMap`), unless ``edge_list`` is a :class:`numpy.ndarray`,
in which case the value of this option is ignored, and the type is
determined automatically.
If given, ``eprops`` should specify an iterable containing edge property
maps that will be filled with the remaining values at each row, if there
......@@ -2465,13 +2466,10 @@ class Graph(object):
else:
if isinstance(edge_list, numpy.ndarray):
vprop = self.new_vertex_property(_gt_type(edge_list.dtype))
elif string_vals:
vprop = self.new_vertex_property("string")
else:
vprop = self.new_vertex_property("object")
vprop = self.new_vertex_property(hash_type)
libcore.add_edge_list_hashed(self.__graph, edge_list,
_prop("v", self, vprop),
string_vals, eprops)
_prop("v", self, vprop), eprops)
return vprop
def set_fast_edge_removal(self, fast=True):
......@@ -3329,7 +3327,7 @@ def load_graph(file_name, fmt="auto", ignore_vp=None, ignore_ep=None,
return g
def load_graph_from_csv(file_name, directed=False, eprop_types=None,
eprop_names=None, string_vals=True, hashed=False,
eprop_names=None, hashed=True, hash_type="string",
skip_first=False, strip_whitespace=True, ecols=(0,1),
csv_options={"delimiter": ",", "quotechar": '"'}):
"""Load a graph from a :mod:`csv` file containing a list of edges and edge
......@@ -3349,16 +3347,14 @@ def load_graph_from_csv(file_name, directed=False, eprop_types=None,
this is ``None``, and ``skip_first`` is ``True`` their values will be
obtained from the first line, otherwise they will be called ``c1, c2,
...``).
string_vals : ``bool`` (optional, default: ``True``)
If ``True``, the vertex values are assumed to be arbitrary strings,
otherwise they will be assumed to correspond to integers.
hashed : ``bool`` (optional, default: ``False``)
If ``True`` and ``string_vals == False``, the vertex values in the edge
list are not assumed to correspond to vertex indices directly. In this
case they will be mapped to vertex indices according to the order in
which they are encountered, and a vertex property map with the vertex
values is returned. If ``string_vals == True``, this automatically means
``hashed = True``.
hashed : ``bool`` (optional, default: ``True``)
If ``True`` the vertex values in the edge list are not assumed to
correspond to vertex indices directly. In this case they will be mapped
to vertex indices according to the order in which they are encountered,
and a vertex property map with the vertex values is returned.
hash_type : ``str`` (optional, default: ``string``)
If ``hashed == True``, this will determined the type of the vertex values.
It can be any property map value type (see :class:`PropertyMap`).
skip_first : ``bool`` (optional, default: ``False``)
If ``True`` the first line of the file will be skipped.
strip_whitespace : ``bool`` (optional, default: ``True``)
......@@ -3416,10 +3412,9 @@ def load_graph_from_csv(file_name, directed=False, eprop_types=None,
yield [s, t] + row
r = reorder(r)
if not string_vals:
if not hashed:
def conv(rows):
for row in rows:
row = list(row)
row = list(row)
row[0] = int(row[0])
row[1] = int(row[1])
......@@ -3434,10 +3429,8 @@ def load_graph_from_csv(file_name, directed=False, eprop_types=None,
else:
eprops = [g.new_ep(t) for t in eprop_types]
name = g.add_edge_list(itertools.chain([line], r),
string_vals=string_vals,
hashed=hashed or string_vals,
eprops=eprops)
name = g.add_edge_list(itertools.chain([line], r), hashed=hashed,
hash_type=hash_type, eprops=eprops)
if eprop_names is None and skip_first and len(first_line) == len(line):
eprop_names = list(first_line)
......@@ -3475,7 +3468,7 @@ class GraphView(Graph):
The argument ``g`` must be an instance of a :class:`~graph_tool.Graph`
class. If specified, ``vfilt`` and ``efilt`` select which vertices and edges
are filtered, respectively. These parameters can either be a boolean-valued
:class:`~graph_tool.PropertyMap` or :class:`~numpy.ndarray`, which specify
:class:`~graph_tool.PropertyMap` or :class:`numpy.ndarray`, which specify
which vertices/edges are selected, or an unary function that returns
``True`` if a given vertex/edge is to be selected, or ``False`` otherwise.
......
......@@ -225,7 +225,7 @@ def betweenness(g, pivots=None, vprop=None, eprop=None, weight=None, norm=True):
----------
g : :class:`~graph_tool.Graph`
Graph to be used.
pivots : list or :class:`~numpy.ndarray`, optional (default: None)
pivots : list or :class:`numpy.ndarray`, optional (default: None)
If provided, the betweenness will be estimated using the vertices in
this list as pivots. If the list contains all nodes (the default) the
algorithm will be exact, and if the vertices are randomly chosen the
......
......@@ -216,11 +216,11 @@ def corr_hist(g, deg_source, deg_target, bins=[[0, 1], [0, 1]], weight=None,
Returns
-------
bin_counts : :class:`~numpy.ndarray`
bin_counts : :class:`numpy.ndarray`
Two-dimensional array with the bin counts.
source_bins : :class:`~numpy.ndarray`
source_bins : :class:`numpy.ndarray`
Source degree bins
target_bins : :class:`~numpy.ndarray`
target_bins : :class:`numpy.ndarray`
Target degree bins
......@@ -315,11 +315,11 @@ def combined_corr_hist(g, deg1, deg2, bins=[[0, 1], [0, 1]], float_count=True):
Returns
-------
bin_counts : :class:`~numpy.ndarray`
bin_counts : :class:`numpy.ndarray`
Two-dimensional array with the bin counts.
first_bins : :class:`~numpy.ndarray`
first_bins : :class:`numpy.ndarray`
First degree bins
second_bins : :class:`~numpy.ndarray`
second_bins : :class:`numpy.ndarray`
Second degree bins
Notes
......@@ -406,12 +406,12 @@ def avg_neighbor_corr(g, deg_source, deg_target, bins=[0, 1], weight=None):
Returns
-------
bin_avg : :class:`~numpy.ndarray`
bin_avg : :class:`numpy.ndarray`
Array with the deg_target average for the get_source bins.
bin_dev : :class:`~numpy.ndarray`
bin_dev : :class:`numpy.ndarray`
Array with the standard deviation of the deg_target average for the
get_source bins.
bins : :class:`~numpy.ndarray`
bins : :class:`numpy.ndarray`
Source degree bins,
......@@ -498,11 +498,11 @@ def avg_combined_corr(g, deg1, deg2, bins=[0, 1]):
Returns
-------
bin_avg : :class:`~numpy.ndarray`
bin_avg : :class:`numpy.ndarray`
Array with the deg2 average for the deg1 bins.
bin_dev : :class:`~numpy.ndarray`
bin_dev : :class:`numpy.ndarray`
Array with the standard deviation of the deg2 average for the deg1 bins.
bins : :class:`~numpy.ndarray`
bins : :class:`numpy.ndarray`
The deg1 bins.
Notes
......
......@@ -1172,7 +1172,7 @@ class PottsGlauberState(DiscreteStateBase):
----------
g : :class:`~graph_tool.Graph`
Graph to be used for the dynamics
f : list of lists or two-dimensional :class:`~numpy.ndarray`
f : list of lists or two-dimensional :class:`numpy.ndarray`
Matrix of interactions between spin values, of dimension
:math:`q\times q`, where :math:`q` is the number of spins.
w : :class:`~graph_tool.EdgePropertyMap` or ``float`` (optional, default: ``1.``)
......@@ -1263,7 +1263,7 @@ class PottsMetropolisState(DiscreteStateBase):
----------
g : :class:`~graph_tool.Graph`
Graph to be used for the dynamics
f : list of lists or two-dimensional :class:`~numpy.ndarray`
f : list of lists or two-dimensional :class:`numpy.ndarray`
Matrix of interactions between spin values, of dimension
:math:`q\times q`, where :math:`q` is the number of spins.
w : :class:`~graph_tool.EdgePropertyMap` or ``float`` (optional, default: ``1.``)
......
......@@ -102,13 +102,13 @@ def random_graph(N, deg_sampler, directed=True,
If ``True``, parallel edges are allowed.
self_loops : bool (optional, default: ``False``)
If ``True``, self-loops are allowed.
block_membership : list or :class:`~numpy.ndarray` or function (optional, default: ``None``)
block_membership : list or :class:`numpy.ndarray` or function (optional, default: ``None``)
If supplied, the graph will be sampled from a stochastic blockmodel
ensemble, and this parameter specifies the block membership of the
vertices, which will be passed to the
:func:`~graph_tool.generation.random_rewire` function.
If the value is a list or a :class:`~numpy.ndarray`, it must have
If the value is a list or a :class:`numpy.ndarray`, it must have
``len(block_membership) == N``, and the values will define to which
block each vertex belongs.
......@@ -1650,7 +1650,7 @@ def triangulation(points, type="simple", periodic=False):
Parameters
----------
points : :class:`~numpy.ndarray`
points : :class:`numpy.ndarray`
Point set for the triangulation. It may be either a N x d array, where N
is the number of points, and d is the space dimension (either 2 or 3).
type : string (optional, default: ``'simple'``)
......@@ -1768,7 +1768,7 @@ def lattice(shape, periodic=False):
Parameters
----------
shape : list or :class:`~numpy.ndarray`
shape : list or :class:`numpy.ndarray`
List of sizes in each dimension.
periodic : bool (optional, default: ``False``)
If ``True``, periodic boundary conditions will be used.
......@@ -1926,13 +1926,13 @@ def geometric_graph(points, radius, ranges=None):
Parameters
----------
points : list or :class:`~numpy.ndarray`
points : list or :class:`numpy.ndarray`
List of points. This must be a two-dimensional array, where the rows are
coordinates in a N-dimensional space.
radius : float
Pairs of points with an euclidean distance lower than this parameters
will be connected.
ranges : list or :class:`~numpy.ndarray` (optional, default: ``None``)
ranges : list or :class:`numpy.ndarray` (optional, default: ``None``)
If provided, periodic boundary conditions will be assumed, and the
values of this parameter it will be used as the ranges in all
dimensions. It must be a two-dimensional array, where each row will
......
......@@ -80,9 +80,9 @@ def vertex_hist(g, deg, bins=[0, 1], float_count=True):
Returns
-------
counts : :class:`~numpy.ndarray`
counts : :class:`numpy.ndarray`
The bin counts.
bins : :class:`~numpy.ndarray`
bins : :class:`numpy.ndarray`
The bin edges.
See Also
......@@ -142,9 +142,9 @@ def edge_hist(g, eprop, bins=[0, 1], float_count=True):
Returns
-------
counts : :class:`~numpy.ndarray`
counts : :class:`numpy.ndarray`
The bin counts.
bins : :class:`~numpy.ndarray`
bins : :class:`numpy.ndarray`
The bin edges.
See Also
......@@ -391,9 +391,9 @@ def distance_histogram(g, weight=None, bins=[0, 1], samples=None,
Returns
-------
counts : :class:`~numpy.ndarray`
counts : :class:`numpy.ndarray`
The bin counts.
bins : :class:`~numpy.ndarray`
bins : :class:`numpy.ndarray`
The bin edges.
See Also
......
......@@ -1210,9 +1210,9 @@ def label_components(g, vprop=None, directed=None, attractors=False):
-------
comp : :class:`~graph_tool.VertexPropertyMap`
Vertex property map with component labels.
hist : :class:`~numpy.ndarray`
hist : :class:`numpy.ndarray`
Histogram of component labels.
is_attractor : :class:`~numpy.ndarray`
is_attractor : :class:`numpy.ndarray`
A Boolean array specifying if the strongly connected components are
attractors or not. This returned only if ``attractors == True``, and the
graph is directed.
......