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

Create basic (lower) level interface for attributes (for new feature #920) #921

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Fixed docstring complaint spelling about "tids"
J007X committed Mar 31, 2023
commit e8750493a3c00af21fe12dc485a725d909dc5377
16 changes: 8 additions & 8 deletions forte/data/data_store.py
Original file line number Diff line number Diff line change
@@ -1517,26 +1517,26 @@ def get_attributes_of_tid(self, tid: int, attr_names: List[str]) -> dict:
return attrs

def get_attributes_of_tids(
self, tids: List[int], attr_names: List[str]
self, list_of_tid: List[int], attr_names: List[str]
) -> List[Any]:
r"""This function returns the value of attributes listed in
``attr_names`` for entries in listed in the ``tids``. It locates
the entries data with ``tid`` and put attributes listed in
``attr_name`` in a dict for each entry (tid).
``attr_names`` for entries in listed in the ``list_of_tid``.
It locates the entries data with ``tid`` and put attributes
listed in ``attr_name`` in a dict for each entry (tid).

Args:
tids: List of unique ids (tids) of the entry.
list_of_tid: List of unique ids of the entry.
attr_names: List of name of the attribute.

Returns:
A list of dict with ``attr_name`` as key for atrributes
of the entries listed in``tids``.
A list of dict with ``attr_name`` as key for attributes
of the entries listed in``list_of_tid``.

Raises:
KeyError: when ``tid`` or ``attr_name`` is not found.
"""
tids_attrs = []
for tid in tids:
for tid in list_of_tid:
entry, entry_type = self.get_entry(tid)
attrs: dict = {}
for attr_name in attr_names: