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

Warning for links #891

Merged
merged 4 commits into from
Jul 3, 2023
Merged

Warning for links #891

merged 4 commits into from
Jul 3, 2023

Conversation

mavaylon1
Copy link
Contributor

@mavaylon1 mavaylon1 commented Jul 3, 2023

Motivation

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

Create a warning if linked objects are not already present in a parent when the original container's parent is set, stemming from the fact when objects that have links are added to containers (NWBFiles), the links are not added.

The Fix: Add a warning in the parent setter to search through the children of the original object for DynamicTableRegion and check the target table for a parent. If the parent is not set, raise a warning.

Original issue: NeurodataWithoutBorders/pynwb#1701

How to test the behavior?

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

Run tests for container.py

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.

@mavaylon1 mavaylon1 changed the title warning: Warning for links Jul 3, 2023
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5269c1f) 88.20% compared to head (2873115) 88.21%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #891   +/-   ##
=======================================
  Coverage   88.20%   88.21%           
=======================================
  Files          44       44           
  Lines        9070     9076    +6     
  Branches     2596     2599    +3     
=======================================
+ Hits         8000     8006    +6     
  Misses        756      756           
  Partials      314      314           
Impacted Files Coverage Δ
src/hdmf/container.py 90.98% <100.00%> (+0.06%) ⬆️

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

@mavaylon1 mavaylon1 marked this pull request as ready for review July 3, 2023 19:04
@mavaylon1 mavaylon1 self-assigned this Jul 3, 2023
@mavaylon1 mavaylon1 requested review from rly and oruebel July 3, 2023 19:04
@mavaylon1
Copy link
Contributor Author

Fix #885

Co-authored-by: Oliver Ruebel <[email protected]>
@oruebel
Copy link
Contributor

oruebel commented Jul 3, 2023

@mavaylon1 in general for PR's it would be useful it you could fill in out the PR form to clarify the reasoning for the PR , checklist etc.

@mavaylon1 mavaylon1 requested a review from oruebel July 3, 2023 19:39
@mavaylon1 mavaylon1 requested a review from oruebel July 3, 2023 20:22
@mavaylon1 mavaylon1 merged commit 82baf69 into dev Jul 3, 2023
@rly rly deleted the link_warning branch July 10, 2023 23:45
@rly rly mentioned this pull request Jul 25, 2023
6 tasks
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.

2 participants