Commit 9b58ad6c authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Convert internally-stored networks in the collection module to new 'gt' format

parent 1b9b952d
......@@ -24,25 +24,25 @@ graph_tool_generationdir = $(MOD_DIR)/generation
graph_tool_collection_PYTHON = \
collection/__init__.py
graph_tool_collection_DATA = \
collection/adjnoun.xml.gz \
collection/as-22july06.xml.gz \
collection/astro-ph.xml.gz \
collection/celegansneural.xml.gz \
collection/cond-mat-2003.xml.gz \
collection/cond-mat-2005.xml.gz \
collection/cond-mat.xml.gz \
collection/dolphins.xml.gz \
collection/football.xml.gz \
collection/hep-th.xml.gz \
collection/karate.xml.gz \
collection/lesmis.xml.gz \
collection/netscience.xml.gz \
collection/polblogs.xml.gz \
collection/polbooks.xml.gz \
collection/power.xml.gz \
collection/pgp-strong-2009.xml.gz \
collection/serengeti-foodweb.xml.gz \
collection/email-Enron.xml.gz
collection/adjnoun.gt.gz \
collection/as-22july06.gt.gz \
collection/astro-ph.gt.gz \
collection/celegansneural.gt.gz \
collection/cond-mat-2003.gt.gz \
collection/cond-mat-2005.gt.gz \
collection/cond-mat.gt.gz \
collection/dolphins.gt.gz \
collection/football.gt.gz \
collection/hep-th.gt.gz \
collection/karate.gt.gz \
collection/lesmis.gt.gz \
collection/netscience.gt.gz \
collection/polblogs.gt.gz \
collection/polbooks.gt.gz \
collection/power.gt.gz \
collection/pgp-strong-2009.gt.gz \
collection/serengeti-foodweb.gt.gz \
collection/email-Enron.gt.gz
graph_tool_collectiondir = $(MOD_DIR)/collection
graph_tool_correlations_PYTHON = \
......
......@@ -283,12 +283,14 @@ descriptions = {
def get_data_path(name):
r"""Return the full path of the corresponding dataset."""
return base_dir + "/" + name + ".xml.gz"
return base_dir + "/" + name + ".gt.gz"
class LazyDataDict(dict):
def __getitem__(self, k):
if k not in self:
fname = get_data_path(k)
if not os.path.exists(fname):
raise KeyError(k)
g = load_graph(fname)
dict.__setitem__(self, k, g)
return g
......
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