Skip to content

Broken LOTR Example #1333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
abhishektiwari opened this issue Oct 14, 2023 · 1 comment
Closed

Broken LOTR Example #1333

abhishektiwari opened this issue Oct 14, 2023 · 1 comment

Comments

@abhishektiwari
Copy link

abhishektiwari commented Oct 14, 2023

Running LOTR example (Raphtory/examples/py/lotr ) using Python 3.11.4 with raphtory==0.6.1. Example worked after several changes based on latest API documentation.

1

Code Block:

graph = Graph(1)

**Error:**
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[1], line 7
      5 structure_file = "lotr.csv"
      6 properties_file = "lotr_properties.csv"
----> 7 graph = Graph(1)

TypeError: Graph.__new__() takes 0 positional arguments but 1 was given

2

Code Block:

print("Number of edges: %i" % len(graph.edges))

Error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[30], line 5
      3 print("Number of vertices: %i" % len(graph.vertices))
      4 print(graph.edges)
----> 5 print("Number of edges: %i" % len(graph.edges))

TypeError: object of type 'builtins.Edges' has no len()

Example should be using graph.count_edges()

3

Code Block:

with open(properties_file, 'r') as csvfile:
    datareader = csv.reader(csvfile)
    for row in datareader:
        graph.add_vertex_properties(row[0], {"race": row[1],"gender": row[2]})

Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[28], line 4
      2 datareader = csv.reader(csvfile)
      3 for row in datareader:
----> 4     graph.add_vertex_properties(row[0], {"race": row[1],"gender": row[2]})

AttributeError: 'builtins.Graph' object has no attribute 'add_vertex_properties'

For JOSS Review

@miratepuffin
Copy link
Collaborator

Hi @abhishektiwari - as mentioned in #1332, since creating the documentation on raphtory.com this examples folder has become more of a test space than explicit using facing examples. I shall tidy this up today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants