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

Improve ObjectMapper and fix related issues #463

Merged
merged 10 commits into from
Nov 16, 2020
Merged

Improve ObjectMapper and fix related issues #463

merged 10 commits into from
Nov 16, 2020

Conversation

rly
Copy link
Contributor

@rly rly commented Nov 16, 2020

Motivation

  • Fix Error with unnamed collections of links #453. When handling collections of links, ObjectMapper.convert_dt_name(...) now uses the name of the LinkSpec target type to generate the attribute name instead of throwing an error.
  • Raise a warning if a GroupSpec has a collection of groups/datasets/links with quantity '+' and is built with no objects. See also Validator should check for quantity #197.
  • Fix Containers in a subgroup can get built twice #342. No longer build containers that do not match the data type of the given spec.
  • Remove extra code in ObjectMapper that caused some objects to be built multiple times.
  • Allow writing of collections of empty Container and Data objects. These would previously not be written. Fix empty Containers not writing #224.
  • Restrict NamespaceCatalog.is_sub_data_type(...) to accept only strings and refactor.
  • Raise ContainerConfigurationError if a container class has no attribute mapped to a spec.
  • Replace some ValueErrors / plain Exceptions with BuildErrors / ConstructErrors. See Plain base Exception instances should not be raised #340.
  • Create alias MissingRequiredBuildWarning for MissingRequiredWarning. Use the new warning throughout.
  • Enhance BuildManager.is_sub_data_type method to support checking whether a given AbstractContainer is a sub-data_type of the data type defined by a Spec.
  • Remove impossible-to-reach code from GroupSpec.set_link(...)
  • Remove impossible-to-reach code from ObjectMapper.get_builder_name(...)
  • Make ObjectMapper warn for incorrect quantity and missing cases for required groups. Related to Validator should check for quantity #197
  • Add hdmf.testing.assertBuilderEqual(...) which compares builder names

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Have you checked our Contributing document?
  • Have you ensured the PR clearly describes the problem and the solution?
  • Is your contribution compliant with our coding style? This can be checked running flake8 from the source directory.
  • Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.

@rly
Copy link
Contributor Author

rly commented Nov 16, 2020

The changelog needs to be updated after this is reviewed.

@rly rly requested a review from ajtritt November 16, 2020 23:05
@rly rly merged commit b12a62b into dev Nov 16, 2020
@rly rly deleted the improve_objectmapper branch November 16, 2020 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants