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

feat: update how related regions are fetched #582

Merged
merged 10 commits into from
Apr 22, 2024
Merged

Conversation

xgui3783
Copy link
Member

@xgui3783 xgui3783 commented Mar 14, 2024

see FZJ-INM1-BDA/siibra-configurations#44

This PR is the companion PR for updating the SANDS reference within siibra.

Rather than relying on SANDS references of parcellation entity version, it is updated to use parcellation entity, which semantically more closely models SANDS model.

n.b. as this PR requires a specific branch of siibra configuration to function properly, this PR also aims to introduce the mechanism, by which, based on commit message, custom ref of siibra-configuration will be used.

These changes are not yet pushed, in order to follow the Red/Green light approach for TDD

@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 28.88889% with 32 lines in your changes are missing coverage. Please review.

Project coverage is 49.50%. Comparing base (5a0e6b3) to head (e1cff22).
Report is 477 commits behind head on main.

Files Patch % Lines
siibra/core/region.py 28.88% 32 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #582       +/-   ##
===========================================
+ Coverage   36.81%   49.50%   +12.68%     
===========================================
  Files          61       74       +13     
  Lines        5421     6961     +1540     
===========================================
+ Hits         1996     3446     +1450     
- Misses       3425     3515       +90     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xgui3783 xgui3783 marked this pull request as draft March 14, 2024 11:44
@xgui3783
Copy link
Member Author

xgui3783 commented Mar 14, 2024

Expecting e2e tests to fail (specifically e2e/core/test_regions.py)

fix: allow use of custom siibra config for test
fix scfg checkout path
@xgui3783
Copy link
Member Author

Tests should pass.

@xgui3783 xgui3783 marked this pull request as ready for review March 14, 2024 14:48
@xgui3783 xgui3783 requested a review from AhmetNSimsek March 14, 2024 15:52
@xgui3783
Copy link
Member Author

@AhmetNSimsek can you please take a look at this?

I have also managed to pull in the changes that allow a custom ref of siibra-configuration to be used with [ci:usecfg]<refname>

Copy link
Collaborator

@AhmetNSimsek AhmetNSimsek left a comment

Choose a reason for hiding this comment

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

LGTM.
Could you add docstrings to RegionRelationAssessments members?

Also, thank you for implementing running tests with custom ref of siibra-configuration based on the commit message.

siibra/core/region.py Outdated Show resolved Hide resolved
@xgui3783
Copy link
Member Author

@AhmetNSimsek can you take a look? I added docstring as you requested.

Copy link
Collaborator

@AhmetNSimsek AhmetNSimsek left a comment

Choose a reason for hiding this comment

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

Thanks, looks good.

For future reference, would you mind using numpy style as in

"""
Find regions that match the given region specification in the subtree
headed by this region.
Parameters
----------
regionspec: str, regex, int, Region
- a string with a possibly inexact name (matched both against the name and the identifier key)
- a string in '/pattern/flags' format to use regex search (acceptable flags: aiLmsux, see at https://docs.python.org/3/library/re.html#flags)
- a regex applied to region names
- a Region object
filter_children : bool, default: False
If True, children of matched parents will not be returned
find_topmost : bool, default: True
If True (requires `filter_children=True`), will return parent
structures if all children are matched, even though the parent
itself might not match the specification.
Returns
-------
list[Region]
list of regions matching to the regionspec
Tip
---
See example 01-003, find regions.
"""

This should also work but better to have a unified style. Please don't waste time on it now tho. There are more urgent things atm.

@xgui3783
Copy link
Member Author

Thanks, looks good.

For future reference, would you mind using numpy style as in

"""
Find regions that match the given region specification in the subtree
headed by this region.
Parameters
----------
regionspec: str, regex, int, Region
- a string with a possibly inexact name (matched both against the name and the identifier key)
- a string in '/pattern/flags' format to use regex search (acceptable flags: aiLmsux, see at https://docs.python.org/3/library/re.html#flags)
- a regex applied to region names
- a Region object
filter_children : bool, default: False
If True, children of matched parents will not be returned
find_topmost : bool, default: True
If True (requires `filter_children=True`), will return parent
structures if all children are matched, even though the parent
itself might not match the specification.
Returns
-------
list[Region]
list of regions matching to the regionspec
Tip
---
See example 01-003, find regions.
"""

This should also work but better to have a unified style. Please don't waste time on it now tho. There are more urgent things atm.

Apologies, I have a lot on my plate right now.

Do you mind taking over the reformatting for me?

@AhmetNSimsek

@AhmetNSimsek
Copy link
Collaborator

Since the config branch had been merged and tagged, bumped the version (3b2d9fa) to test with the correct config.

@AhmetNSimsek AhmetNSimsek merged commit f25eaae into main Apr 22, 2024
37 of 38 checks passed
@AhmetNSimsek AhmetNSimsek deleted the feat_otherRegion branch April 22, 2024 10:28
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.

3 participants