question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic model expects dynamic graph but not streaming network

See original GitHub issue

Running through tests for dynamic networks, as in tutorial here

As is, error is thrown that seems to indicate that the ndlib.models.dynamic.DynKerteszThresholdModel.DynKerteszThresholdModel object should receive a DynGraph as input, since a base networkx graph (g) does not have a temporal_snapshots_ids attribute, like a DynGraph (dg) does:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-13-88e2748d22a3> in <module>
     12 
     13 # Model selection
---> 14 model = ks.DynKerteszThresholdModel(g)
     15 
     16 # Model Configuration

~/anaconda3/envs/eng-net/lib/python3.6/site-packages/ndlib/models/dynamic/DynKerteszThresholdModel.py in __init__(self, graph)
     24              :param graph: A networkx graph object
     25          """
---> 26         super(self.__class__, self).__init__(graph)
     27         self.available_statuses = {
     28             "Susceptible": 0,

~/anaconda3/envs/eng-net/lib/python3.6/site-packages/ndlib/models/DynamicDiffusionModel.py in __init__(self, graph)
     57         self.initial_status = {}
     58 
---> 59         snapshot_ids = self.dyngraph.temporal_snapshots_ids()
     60         self.min_snapshot_id = min(snapshot_ids)
     61         self.max_snapshot_id = max(snapshot_ids)

AttributeError: 'Graph' object has no attribute 'temporal_snapshots_ids'

However, modifying the tutorial code to use dg (model = ks.DynKerteszThresholdModel(dg)) returns another, less obvious error code that I have been unable to find a cause of:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-14-594262860f33> in <module>
     31 
     32 # Simulation interaction graph based execution
---> 33 iterations = model.execute_iterations()

~/anaconda3/envs/eng-net/lib/python3.6/site-packages/ndlib/models/DynamicDiffusionModel.py in execute_iterations(self, node_status)
     82                 self.graph = nx.Graph()
     83                 self.graph.add_edge(e[0], e[1])
---> 84                 its = self.iteration(node_status)
     85                 system_status.append(its)
     86         return system_status

~/anaconda3/envs/eng-net/lib/python3.6/site-packages/ndlib/models/dynamic/DynKerteszThresholdModel.py in iteration(self, node_status)
     70         # streaming
     71         if self.stream_execution:
---> 72             raise ValueError("Streaming network not allowed.")
     73         # snapshot
     74         else:

ValueError: Streaming network not allowed.

This is strange since, before executing the iterations, calling model.stream_execution returns False.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tbsextoncommented, Dec 3, 2018

I’m going to clone a branch to see if I can figure out what’s going on, and run the notebooks as tests, hopefully get a pull request going if I figure something out!

0reactions
GiulioRossetticommented, Dec 7, 2018

All patches have been implemented in master.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic Graph Stream Algorithms in o(n) Space | SpringerLink
In this paper we study graph problems in the dynamic streaming model, where the input is defined by a sequence of edge insertions...
Read more >
Practice of Streaming and Dynamic Graphs: Concepts, Models ...
Graph streaming frameworks are specifically crafted to enable the processing of such highly dynamic workloads. Recent years have seen the development of many ......
Read more >
The dynamic data type - Azure Data Explorer | Microsoft Learn
This article describes The dynamic data type in Azure Data Explorer.
Read more >
Practice of Streaming Processing of Dynamic Graphs - arXiv
Graph streaming frameworks are specifically crafted to enable the processing of such highly dynamic workloads. Recent years have seen the development of many ......
Read more >
Node embeddings in dynamic graphs | Applied Network Science
By contrast, modeling the dynamics of the nodes in temporal networks requires ... networks are considered in the edge or graph stream model...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found