Skip to content

Commit

Permalink
return shallow copy in build_const_args (#1103)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Avaylon <[email protected]>
  • Loading branch information
magland and mavaylon1 authored Aug 19, 2024
1 parent b0f068e commit 875712b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
dataset based on the shape of the dataset data and the dimension names in the spec for the data type. This attribute
is available on build (during the write process), but not on read of a dataset from a file. @rly [#1081](https://github.com/hdmf-dev/hdmf/pull/1081)
- Speed up loading namespaces by skipping register_type when already registered. @magland [#1102](https://github.com/hdmf-dev/hdmf/pull/1102)
- Speed up namespace loading: return a shallow copy rather than a deep copy in build_const_args. @magland [#1103](https://github.com/hdmf-dev/hdmf/pull/1103)

## HDMF 3.14.2 (July 7, 2024)

Expand Down
3 changes: 1 addition & 2 deletions src/hdmf/spec/spec.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import re
from abc import ABCMeta
from collections import OrderedDict
from copy import deepcopy
from warnings import warn

from ..utils import docval, getargs, popargs, get_docval
Expand Down Expand Up @@ -84,7 +83,7 @@ class ConstructableDict(dict, metaclass=ABCMeta):
def build_const_args(cls, spec_dict):
''' Build constructor arguments for this ConstructableDict class from a dictionary '''
# main use cases are when spec_dict is a ConstructableDict or a spec dict read from a file
return deepcopy(spec_dict)
return spec_dict.copy()

@classmethod
def build_spec(cls, spec_dict):
Expand Down

0 comments on commit 875712b

Please sign in to comment.