sxs-collaboration / sxs

Python code for manipulating data from the SXS collaboration
MIT License
25 stars 18 forks source link

Using `sxs.load` with git-annex #84

Closed moble closed 3 months ago

moble commented 6 months ago

@geoffrey4444 ran into a problem much like the one @markscheel fixed in #74. Specifically, sxs.rpdmb.load expands file names, and then looks for a JSON file corresponding to the H5 file. But if the files are in git-annex, the actual files are under crazy symlinks, so the JSON file can't be found. Mark just swapped the order, so that sxs.rpdmb.load looks for the JSON file first, and only then does it expand symlinks. Unfortunately, sxs.load still does the expansion first, before it hands off the path to sxs.rpdmb.load.

The problematic line is here: https://github.com/sxs-collaboration/sxs/blob/8629d01b68fb01cc2cc0f1d0e5be6e1f8f89a8f8/sxs/handlers.py#L192 At least for Geoffrey's desired code path, I think we could just skip that resolve, but make sure that the exists checks look for underlying symlinks.