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

ENH: organize - show files with conflicts requiring adding _obj- #1490

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Aug 20, 2024

Logging check is currently not really functioning since IIRC we do enable logging into a file at higher level than INFO. So we might need to tune decision making here

Should provide UX side to partially address:

example:

❯ dandi organize --dandiset-path /tmp/outds /home/yoh/proj/dandi/dandisets/000004/sub-P53CS/*nwb /home/yoh/proj/dandi/dandisets/000004/sub-P54CS/*nwb
...
2024-08-19 20:03:17,448 [    INFO] Symlink support autodetected; setting files_mode='symlink'
2024-08-19 20:03:17,452 [    INFO] 2 out of 5 paths are not unique.
 2 paths 'compete' for the path 'sub-P53CS/sub-P53CS_ses-20171101_ecephys+image.nwb':
  /home/yoh/proj/dandi/dandisets/000004/sub-P53CS/sub-P53CS_ses-20171101_obj-108aqix_ecephys+image.nwb
  /home/yoh/proj/dandi/dandisets/000004/sub-P53CS/sub-P53CS_ses-20171101_obj-lj04dr_ecephys+image.nwb
 3 paths 'compete' for the path 'sub-P54CS/sub-P54CS_ses-20180101_ecephys+image.nwb':
  /home/yoh/proj/dandi/dandisets/000004/sub-P54CS/sub-P54CS_ses-20180101_obj-1ru98u8_ecephys+image.nwb
  /home/yoh/proj/dandi/dandisets/000004/sub-P54CS/sub-P54CS_ses-20180101_obj-1ukzk61_ecephys+image.nwb
  /home/yoh/proj/dandi/dandisets/000004/sub-P54CS/sub-P54CS_ses-20180101_obj-1vx1a5w_ecephys+image.nwb
 We will try adding _obj- based on crc32 of object_id

TODOs

  • check what leads to tests failing ATM
  • extend test covering this code to have multiple groups requiring _obj

dandi/organize.py Outdated Show resolved Hide resolved
Logging check is currently not really functioning since IIRC we
do enable logging into a file at higher level than INFO. So we
might need to tune decision making here
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 88.60%. Comparing base (44e097f) to head (e456ebb).

Files Patch % Lines
dandi/organize.py 66.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1490      +/-   ##
==========================================
+ Coverage   88.55%   88.60%   +0.04%     
==========================================
  Files          77       77              
  Lines       10568    10581      +13     
==========================================
+ Hits         9359     9375      +16     
+ Misses       1209     1206       -3     
Flag Coverage Δ
unittests 88.60% <66.66%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

dandi/organize.py Outdated Show resolved Hide resolved
dandi/organize.py Outdated Show resolved Hide resolved
dandi/organize.py Outdated Show resolved Hide resolved
yarikoptic and others added 2 commits August 20, 2024 10:00
Co-authored-by: John T. Wodder II <jwodder@users.noreply.github.com>
…s at DEBUG

With this change logging looks like

    2024-08-21 09:42:39,718 [    INFO] 2 out of 5 paths are not unique.
     2 paths 'compete' for the path 'sub-P53CS/sub-P53CS_ses-20171101_ecephys+image.nwb':
      /home/yoh/proj/dandi/dandisets/000004/sub-P53CS/sub-P53CS_ses-20171101_obj-108aqix_ecephys+image.nwb
      /home/yoh/proj/dandi/dandisets/000004/sub-P53CS/sub-P53CS_ses-20171101_obj-lj04dr_ecephys+image.nwb
     1 more case(s) are listed at DEBUG level.
    2024-08-21 09:42:39,718 [   DEBUG] Additional non-unique paths:
     3 paths 'compete' for the path 'sub-P54CS/sub-P54CS_ses-20180101_ecephys+image.nwb':
      /home/yoh/proj/dandi/dandisets/000004/sub-P54CS/sub-P54CS_ses-20180101_obj-1ru98u8_ecephys+image.nwb
      /home/yoh/proj/dandi/dandisets/000004/sub-P54CS/sub-P54CS_ses-20180101_obj-1ukzk61_ecephys+image.nwb
      /home/yoh/proj/dandi/dandisets/000004/sub-P54CS/sub-P54CS_ses-20180101_obj-1vx1a5w_ecephys+image.nwb
    2024-08-21 09:42:39,718 [    INFO] We will try adding _obj- based on crc32 of object_id
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