Skip to content

[ENH] Add KCNI ID support#265

Merged
DESm1th merged 35 commits intoTIGRLab:masterfrom
DESm1th:kcni
Mar 10, 2020
Merged

[ENH] Add KCNI ID support#265
DESm1th merged 35 commits intoTIGRLab:masterfrom
DESm1th:kcni

Conversation

@DESm1th
Copy link
Copy Markdown
Contributor

@DESm1th DESm1th commented Mar 6, 2020

This updates our core scripts that interact with XNAT (and dm_link) to allow zip files and xnat experiments to use the KCNI conventions.

Note: I did NOT yet update dm_link_shared_ids.py, dm_xnat_project_overview.py, or track_scan_dates.py. The first needs a major overhaul (it still doesnt allow SENDEP linking to work right, and predates the dashboard) that I'd like to spend more time on and none of the three will be affected yet by our initial KCNI XNAT test cases. But I'll push that later since we need to move forward.

For studies and sites that we want to start migrating we'll have to update the settings file to add:

XNAT_CONVENTION: KCNI

and for study / site fields that need to be changed for KCNI we'll have to add an id map that matches this format:

ID_MAP:
STUDY: {KCNI_STUDY: DATMAN_STUDY}
SITE: {
KCNI_SITE1: DM_SITE1,
...
KCNI_SITEN: DM_SITEN
}

- All quotes are double qoutes now (except when nested in double quotes)
- get_project and get_projects are now one function
- get_sessions is now 'get_subject' to match XNAT's nomenclature
- Added docstrings to get_projects and get_subject
@auto-assign auto-assign bot requested review from gabiherman and jskocic March 6, 2020 20:30
@pep8speaks
Copy link
Copy Markdown

pep8speaks commented Mar 6, 2020

Hello @DESm1th, Thank you for updating!

Cheers! There are no style issues detected in this Pull Request. 🍻 To test for issues locally, pip install flake8 and then run flake8 datman.

Comment last updated at 2020-03-10 19:04:47 UTC

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2020

Codecov Report

Merging #265 into master will increase coverage by 2.3%.
The diff coverage is 50.9%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #265     +/-   ##
=========================================
+ Coverage    28.5%   30.81%   +2.3%     
=========================================
  Files          54       54             
  Lines        8099     8396    +297     
=========================================
+ Hits         2309     2587    +278     
- Misses       5790     5809     +19
Flag Coverage Δ
#unittests 30.81% <50.9%> (+2.3%) ⬆️
Impacted Files Coverage Δ
bin/dm_link.py 0% <0%> (ø) ⬆️
bin/dm_xnat_extract.py 0% <0%> (ø) ⬆️
bin/dm_link_project_scans.py 28.94% <0%> (ø) ⬆️
bin/xnat_fetch_sessions.py 0% <0%> (ø) ⬆️
tests/test_dm_xnat_upload.py 100% <100%> (ø) ⬆️
datman/exceptions.py 93.33% <100%> (+1.02%) ⬆️
datman/fs_log_scraper.py 78.52% <100%> (ø) ⬆️
tests/test_datman_scanid.py 100% <100%> (ø) ⬆️
bin/dm_xnat_upload.py 19.54% <11.68%> (-3.23%) ⬇️
datman/xnat.py 29.33% <33.33%> (+0.82%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 757b709...49ac27c. Read the comment docs.

@DESm1th
Copy link
Copy Markdown
Contributor Author

DESm1th commented Mar 6, 2020

I felt like I wrote so many new tests. And then I codecov says +2.31% coverage. Cries internally

JayHennessy
JayHennessy previously approved these changes Mar 9, 2020
Comment thread bin/dm_link.py
Comment thread datman/scanid.py
Comment thread bin/dm_xnat_upload.py
Comment thread datman/xnat.py Outdated
Comment thread datman/xnat.py Outdated
Comment thread datman/xnat.py Outdated
gabiherman
gabiherman previously approved these changes Mar 10, 2020
Comment thread datman/xnat.py
Comment thread datman/xnat.py Outdated
Copy link
Copy Markdown
Contributor

@jerdra jerdra left a comment

Choose a reason for hiding this comment

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

Looks great, some minor modifications/questions.

Also bless your hard working soul for those tests ❤️

@DESm1th DESm1th dismissed stale reviews from gabiherman and JayHennessy via 3a191e9 March 10, 2020 18:34
Comment thread bin/dm_xnat_extract.py Outdated
Comment thread bin/dm_xnat_upload.py Outdated
Comment thread datman/scanid.py
@DESm1th DESm1th requested review from gabiherman and jerdra March 10, 2020 19:29
@DESm1th DESm1th merged commit 835490c into TIGRLab:master Mar 10, 2020
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.

6 participants