Skip to content

The copy method on Variables does not work as expected #32

@jrising

Description

@jrising

MetaCSV objects support a copy method, which applies copy to all the contained information, including the variables, going so far as to create a new Variables object in the new MetaCSV object. But changing the newly copied object changes the original. This is because the final copy is not a deep-copy, and all content, like units and descriptions, are a second level deep.

I currently work around this by saying:

newcsv['variables']._data = copy.deepcopy(newcsv['variables']._data)

before updating information in the variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions