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

Addition of ER EntityKeyTable and bug fixes #872

merged 30 commits into from Jun 22, 2023

Conversation

mavaylon1
Copy link
Contributor

@mavaylon1 mavaylon1 commented Jun 3, 2023

Motivation

What was the reasoning behind this change? Please explain the changes briefly.

  1. Addition of EntityKeyTable and related methods/tests
  2. Fixed bug where reusing a key object wouldn't be recorded in ObjectKeyTable

How to test the behavior?

Show how to reproduce the new behavior (can be a bug fix or a new feature)

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 ruff 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.

@codecov
Copy link

codecov bot commented Jun 3, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (f81537c) 88.19% compared to head (07a42c2) 88.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #872      +/-   ##
==========================================
+ Coverage   88.19%   88.20%   +0.01%     
==========================================
  Files          44       44              
  Lines        9022     9032      +10     
  Branches     2577     2587      +10     
==========================================
+ Hits         7957     7967      +10     
+ Misses        753      752       -1     
- Partials      312      313       +1     
Impacted Files Coverage Δ
src/hdmf/common/io/resources.py 100.00% <100.00%> (ø)
src/hdmf/common/resources.py 97.23% <100.00%> (-0.47%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mavaylon1 mavaylon1 self-assigned this Jun 7, 2023
@mavaylon1 mavaylon1 marked this pull request as ready for review June 21, 2023 18:43
@mavaylon1 mavaylon1 requested a review from rly June 21, 2023 21:50
src/hdmf/common/resources.py Outdated Show resolved Hide resolved
src/hdmf/common/resources.py Outdated Show resolved Hide resolved
@mavaylon1 mavaylon1 requested a review from rly June 22, 2023 18:22
src/hdmf/common/resources.py Outdated Show resolved Hide resolved
src/hdmf/common/resources.py Outdated Show resolved Hide resolved
src/hdmf/common/resources.py Outdated Show resolved Hide resolved
mavaylon1 and others added 3 commits June 22, 2023 13:47
Co-authored-by: Ryan Ly <rly@lbl.gov>
Co-authored-by: Ryan Ly <rly@lbl.gov>
Co-authored-by: Ryan Ly <rly@lbl.gov>
src/hdmf/common/resources.py Outdated Show resolved Hide resolved
@@ -753,130 +846,17 @@ def from_norm_tsv(cls, **kwargs):
msg = "Key Index out of range in ObjectKeyTable. Please check for alterations."
raise ValueError(msg)

keys_idx = entity_keys['keys_idx']
for idx in keys_idx:
if not int(idx) < keys.__len__():
Copy link
Contributor

@rly rly Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not int(idx) < keys.__len__():
if int(idx) >= len(keys):

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for this and the other uses of len above (sorry I didn't catch these earlier)

Copy link
Contributor

@rly rly Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you update the other three uses of __len__ in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

mavaylon1 and others added 4 commits June 22, 2023 13:50
Co-authored-by: Ryan Ly <rly@lbl.gov>
Co-authored-by: Ryan Ly <rly@lbl.gov>
@mavaylon1 mavaylon1 requested a review from rly June 22, 2023 23:00
@mavaylon1 mavaylon1 merged commit 2f9ec56 into dev Jun 22, 2023
29 of 30 checks passed
@oruebel
Copy link
Contributor

oruebel commented Jun 23, 2023

@mavaylon1 there are a few places in the plot_external_resources.py tutorial that should be updated to also list the new table:

@rly rly deleted the entity_keys branch July 10, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants