Skip to content
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

Node/Edge Attribute read & write inconsistencies #1187

Closed
bernlu opened this issue Feb 12, 2024 · 0 comments · Fixed by #1220
Closed

Node/Edge Attribute read & write inconsistencies #1187

bernlu opened this issue Feb 12, 2024 · 0 comments · Fixed by #1220

Comments

@bernlu
Copy link
Contributor

bernlu commented Feb 12, 2024

Writing a string attribute and reading it back does not always result in the same attribute data.

Example:

NetworKit::Graph G(1);
auto stringAttr = G.nodeAttributes().attach<std::string>("stringAttr");
stringAttr[0] = "test with spaces";
stringAttr.write("stringAttr.txt");
stringAttr.read("stringAttr.txt");
std::cout << stringAttr.get(0);
// prints: test

(the specific problem here is that the read function currently stops reading a line after the first whitespace)

I have implemented a quick fix for this for my specific use case (link), but I think we should add some more general tests and make sure it works for most data types that usually occur (at least int/double/string since those are available via python bindings as well, and maybe vectors of those types).

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

Successfully merging a pull request may close this issue.

1 participant