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

Addition of ER EntityKeyTable and bug fixes #872

Merged
merged 30 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# HDMF Changelog

## HMDF 3.6.2 (Upcoming)

### New features and minor improvements
- Updated `ExternalResources` to have EntityKeyTable with updated tests/documentation and minor bug fix to ObjectKeyTable. @mavaylon1 [#872](https://github.com/hdmf-dev/hdmf/pull/872)

## HMDF 3.6.1 (May 18, 2023)

### Bug fixes
Expand Down
16 changes: 8 additions & 8 deletions docs/gallery/plot_external_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
from hdmf.common import DynamicTable, VectorData
from hdmf import Container, ExternalResourcesManager
from hdmf import Data
from hdmf.testing import remove_test_file
import numpy as np
import os
# Ignore experimental feature warnings in the tutorial to improve rendering
import warnings
warnings.filterwarnings("ignore", category=UserWarning, message="ExternalResources is experimental*")
Expand Down Expand Up @@ -306,17 +306,17 @@ def __init__(self, **kwargs):
###############################################################################
# Write ExternalResources
# ------------------------------------------------------
# :py:class:`~hdmf.common.resources.ExternalResources` is written as a flattened tsv file.
# The user provides the path, which contains the name of the file, to where the tsv
# file will be written.
# :py:class:`~hdmf.common.resources.ExternalResources` is written as a zip file of
# the individual tables written to tsv.
# The user provides the path, which contains the name of the directory.

er.to_flat_tsv(path='./er_example.tsv')
er.to_norm_tsv(path='./')

###############################################################################
# Read ExternalResources
# ------------------------------------------------------
# Users can read :py:class:`~hdmf.common.resources.ExternalResources` from the tsv format
# by providing the path to the file.
# by providing the path to the directory.

er_read = ExternalResources.from_flat_tsv(path='./er_example.tsv')
remove_test_file('./er_example.tsv')
er_read = ExternalResources.from_norm_tsv(path='./')
os.remove('./er.zip')
2 changes: 1 addition & 1 deletion src/hdmf/common/hdmf-common-schema
6 changes: 5 additions & 1 deletion src/hdmf/common/io/resources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .. import register_map
from ..resources import ExternalResources, KeyTable, FileTable, ObjectTable, ObjectKeyTable, EntityTable
from ..resources import ExternalResources, KeyTable, FileTable, ObjectTable, ObjectKeyTable, EntityTable, EntityKeyTable
from ...build import ObjectMapper


Expand Down Expand Up @@ -38,3 +38,7 @@ def objects(self, builder, manager):
@ObjectMapper.constructor_arg('object_keys')
def object_keys(self, builder, manager):
return self.construct_helper('object_keys', builder, ObjectKeyTable, manager)

@ObjectMapper.constructor_arg('entity_keys')
def entity_keys(self, builder, manager):
return self.construct_helper('entity_keys', builder, EntityKeyTable, manager)
Loading