Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix order of edge or vertex attributes
When edge or vertex attributes are added via `add.attributes.to.network`, as of igraph version 1.4.0, existing attributes are not re-added or re-ordered. That is, if attributes `name` and `type` already exist and ones adds the new attributes `kind` and `type`, then `kind` is added after `type` as `type` already existed. However, this breaks the ordering of the attributes and leads to failing tests, as the order of the attributes is also tested in some of our tests. To fix this problem, remove and re-add an attribute that was already present before. This way, we make sure that the new attributes are added in the expected order. (The only exception is the `name` attribute: This attribute is expected to be the first attribute, and it should not be removed and readded as this could lead to serious problems.) This addresses se-sic#236. Signed-off-by: Thomas Bock <bockthom@cs.uni-saarland.de>
- Loading branch information