From 672addaf70210b65ede04067877a6a63a31d37a3 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 4 Jun 2021 17:07:38 -0700 Subject: [PATCH 1/3] Fix postprocess set of fields in custom class generator --- src/hdmf/build/__init__.py | 2 +- src/hdmf/build/classgenerator.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hdmf/build/__init__.py b/src/hdmf/build/__init__.py index 5f467d916..ea5d21152 100644 --- a/src/hdmf/build/__init__.py +++ b/src/hdmf/build/__init__.py @@ -1,5 +1,5 @@ from .builders import Builder, DatasetBuilder, GroupBuilder, LinkBuilder, ReferenceBuilder, RegionBuilder -from .classgenerator import CustomClassGenerator +from .classgenerator import CustomClassGenerator, MCIClassGenerator from .errors import (BuildError, OrphanContainerBuildError, ReferenceTargetNotBuiltError, ContainerConfigurationError, ConstructError) from .manager import BuildManager, TypeMap diff --git a/src/hdmf/build/classgenerator.py b/src/hdmf/build/classgenerator.py index edd95a6e7..db4f326d3 100644 --- a/src/hdmf/build/classgenerator.py +++ b/src/hdmf/build/classgenerator.py @@ -268,9 +268,10 @@ def post_process(cls, classdict, bases, docval_args, spec): :param spec: The spec for the container class to generate. """ # convert classdict['__fields__'] from list to tuple if present - fields = classdict.get(bases[0]._fieldsname) - if fields is not None: - classdict[bases[0]._fieldsname] = tuple(fields) + for b in bases: + fields = classdict.get(b._fieldsname) + if fields is not None and not isinstance(fields, tuple): + classdict[b._fieldsname] = tuple(fields) # if spec provides a fixed name for this type, remove the 'name' arg from docval_args so that values cannot # be passed for a name positional or keyword arg From 2d94ea45ce158457d5d79ca4a34ed3ce8e29fbf2 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 4 Jun 2021 17:10:27 -0700 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af8b8930b..552704961 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # HDMF Changelog +## HDMF 2.5.7 (June 7, 2021) + +### Bug fix +- Fix generation of extension classes that extend MultiContainerInterface and use a custom _fieldsname. @rly (#626) + ## HDMF 2.5.6 (May 19, 2021) ### Bug fix From 8bc16d574a07e2f5183647c7a66316e7828c465c Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 4 Jun 2021 17:45:24 -0700 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 552704961..a00a384ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # HDMF Changelog -## HDMF 2.5.7 (June 7, 2021) +## HDMF 2.5.7 (June 4, 2021) ### Bug fix - Fix generation of extension classes that extend MultiContainerInterface and use a custom _fieldsname. @rly (#626)