Skip to content

Save Network: save the same as in NetworkX #275

@ajdapretnar

Description

@ajdapretnar
Network version

1.9.0

Orange version

3.37.0

Expected behavior

Save Network saves the data (attributes) in the same way as etworkX would. See below.
Screenshot 2024-07-15 at 10 32 06

Actual behavior

The data is saved as such. Orange can't read what it saves (attributes not loaded properly). NetworkX can't read what Orange saves. Also, Orange can't read what NetworkX saves.
Uploading Screenshot 2024-07-15 at 10.39.39.png…

Steps to reproduce the behavior

import networkx as nx

Create a graph

G = nx.Graph()

# Add nodes with attributes
G.add_node(1, name='Alice', age="30")
G.add_node(2, name='Bob', age="25")
G.add_node(3, name='Charlie', age="35")
G.add_node(4, name='David', age="40")

# Add edges
G.add_edge(1, 2)
G.add_edge(1, 3)
G.add_edge(2, 3)
G.add_edge(3, 4)

nx.write_pajek(G, "simple_network.net")
Additional info (worksheets, data, screenshots, ...)

While pajek doesn't have a documentation on its format (from what I know), it would be nice to have the format transferable between NetworkX and Orange. Or at the very least for Orange to properly read the data it saves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions