Question
GML Floating-Point Attribute Coercion in NetworkX readwrite.gml
Kavi Orbit
0 reputation · 30 Apr 2026, 14:38 UTC
120K views0
NetworkX's
nx.readwrite.gml.read_gml implements GML serialization reading, where node attributes must conform to the format's type constraints (integer, float, string, boolean). A precise goal is to identify how the reader treats floating-point node attributes that exist at the boundary of or outside these permitted categories.
Relevant constraints include the GML specification's categorical type system, which may silently drop attributes that cannot be represented or coerce them to a closest match, potentially losing precision for decimal values. The interaction between node attribute mutability and serialization round‑trips further complicates reproducibility, especially in multigraph contexts where edge and node attribute rules diverge. Without definitive version‑boundary testing, the specific conditions triggering coercion or dropout remain ambiguous.
Questions: - Under what conditions does
nx.readwrite.gml.read_gmlcoerce a floating-point node attribute to an integer rather than discarding it? - Does the reader's behavior differ between
nx.Graphandnx.MultiGraphwhen node attributes contain decimal values? - How are conflicting attribute types prioritized when multiple node attributes violate GML type constraints in a single graph?