soil issueshttps://lab.gsi.upm.es/soil/soil/-/issues2018-12-08T09:49:59Zhttps://lab.gsi.upm.es/soil/soil/-/issues/1Adapt gephi format2018-12-08T09:49:59ZJ. Fernando Sánchezjf.sanchez@upm.esAdapt gephi formatNewer versions of Gephi are complaining about the output of the simulation.
We have to make sure that:
* [ ] Gephi loads the network
* [ ] Node attributes can be visualized (e.g. polarity)
* [ ] Attribute changes are displayed (in time)Newer versions of Gephi are complaining about the output of the simulation.
We have to make sure that:
* [ ] Gephi loads the network
* [ ] Node attributes can be visualized (e.g. polarity)
* [ ] Attribute changes are displayed (in time)Tasio MendezTasio Mendez2017-04-07https://lab.gsi.upm.es/soil/soil/-/issues/2Separate models in modules2018-05-04T08:31:00ZAlberto PascualSeparate models in modulesCreate a module for each model.
Create settings documentation for each model.Create a module for each model.
Create settings documentation for each model.Tasio MendezTasio Mendezhttps://lab.gsi.upm.es/soil/soil/-/issues/3Update tutorial2017-07-03T16:19:26ZJ. Fernando Sánchezjf.sanchez@upm.esUpdate tutorialUse the new modules.Use the new modules.Tasio MendezTasio Mendezhttps://lab.gsi.upm.es/soil/soil/-/issues/4Geometric generators for geometric graphs2018-05-04T09:23:30ZTasio MendezGeometric generators for geometric graphsWhen trying to run a simulation with a geometric graph generator as `random_geometric_graph` and saving the output as gexf, next error is shown:
```
Traceback (most recent call last):
File "/home/tmendez/anaconda3/bin/soil", line 11, ...When trying to run a simulation with a geometric graph generator as `random_geometric_graph` and saving the output as gexf, next error is shown:
```
Traceback (most recent call last):
File "/home/tmendez/anaconda3/bin/soil", line 11, in <module>
sys.exit(main())
File "/home/tmendez/PycharmProjects/soil/soil/__init__.py", line 50, in main
simulation.run_from_config(args.file, dump=(not args.dry_run), results_dir=args.output)
File "/home/tmendez/PycharmProjects/soil/soil/simulation.py", line 255, in run_from_config
results = sim.run_simulation()
File "/home/tmendez/PycharmProjects/soil/soil/simulation.py", line 138, in run_simulation
return self.run()
File "/home/tmendez/PycharmProjects/soil/soil/simulation.py", line 141, in run
return list(self.run_simulation_gen())
File "/home/tmendez/PycharmProjects/soil/soil/simulation.py", line 148, in run_simulation_gen
res.dump_gexf(self.dir_path)
File "/home/tmendez/PycharmProjects/soil/soil/environment.py", line 230, in dump_gexf
nx.write_gexf(G, graph_path, version="1.2draft")
File "<decorator-gen-388>", line 2, in write_gexf
File "/home/tmendez/anaconda3/lib/python3.6/site-packages/networkx/utils/decorators.py", line 224, in _open_file
result = func(*new_args, **kwargs)
File "/home/tmendez/anaconda3/lib/python3.6/site-packages/networkx/readwrite/gexf.py", line 88, in write_gexf
writer.add_graph(G)
File "/home/tmendez/anaconda3/lib/python3.6/site-packages/networkx/readwrite/gexf.py", line 305, in add_graph
self.add_nodes(G, graph_element)
File "/home/tmendez/anaconda3/lib/python3.6/site-packages/networkx/readwrite/gexf.py", line 340, in add_nodes
node_data, default)
File "/home/tmendez/anaconda3/lib/python3.6/site-packages/networkx/readwrite/gexf.py", line 415, in add_attributes
for val, start, end in v:
TypeError: 'float' object is not iterable
```
A solution for this error could be iterating over the graph to change the name of the attribute and save it as `viz:position` instead of `pos`.
```
import networkx as nx
G = nx.random_geometric_graph(20,0.1)
for node in G.nodes():
G.node[node]['viz'] = {"position": {"x": G.node[node]['pos'][0], "y": G.node[node]['pos'][1], "z": 0.0}}
del (G.node[node]['pos'])
nx.write_gexf(G, 'path/to/file.gexf', version='1.2draft')
```J. Fernando Sánchezjf.sanchez@upm.esJ. Fernando Sánchezjf.sanchez@upm.es