Skip to content

incorrect handling of igraph warnings if the user turns them into an exception #38

@ntamas

Description

@ntamas

From Stack Overflow. A short code fragment to reproduce:

warnings.simplefilter('error', 'Cannot shuffle graph')
degseq = [1,2,2,3]
try:
    testgraph = igraph.Graph.Degree_Sequence(degseq,method = "vl")
except RuntimeWarning:
    print degseq
else:
    print "go on"

This will print:

MemoryError: Error at src/attributes.c:284: not enough memory to allocate attribute hashes, Out of memory

The problem is that the C core of igraph never anticipates that some warnings are turned into errors, therefore it does not bail out from igraph_degree_sequence_game at the point where the warning was raised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    todoTriaged for implementation in some unspecified future version

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions