Skip to content

Name of immutable graphs #15681

@nathanncohen

Description

@nathanncohen

Travis noticed in #15669 that immutable graphs were nameless. That's terrible.

sage: graphs.PetersenGraph()                      
Petersen graph: Graph on 10 vertices
sage: Graph(graphs.PetersenGraph(),immutable=True)
Graph on 10 vertices

This patch fixes it. So doing, we now store the name attribute in the Python graph itself and not in the backend, where it does not really belong. This thing is for storing the graph data, not fancy attributes !

New behaviour :

sage: graphs.PetersenGraph()
Petersen graph: Graph on 10 vertices
sage: Graph(graphs.PetersenGraph(),immutable=True)
Petersen graph: Graph on 10 vertices

This patch is based upon #15623, because God made it that we will have to pay the Poset's ._immutable hack until #15623 is merged :-P

Nathann

Depends on #15623

CC: @simon-king-jena @tscrim

Component: graph theory

Author: Nathann Cohen

Branch/Commit: u/tscrim/ticket/15681 @ 81fc8a4

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/15681

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions