[BUG]: Storage URI in yaml config does not behave as I would expect. #127
No reviewers
Labels
No labels
CRITICAL
Stale
WIP
bug
concept
coordinate
dataset
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
maintenance
maps
marker
mask
on hold
parcellation
preprocess
question
ready
storage
template-space
triage
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
juaml/junifer!127
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/127"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is there an existing issue for this?
Current Behavior
I use this yaml file:
I would expect that the storage uri is interpreted relative from the directory where I run
junifer queue, but it is interpreted relative to the cwd of the process.Expected Behavior
I think it will be more intuitive to interpret relative from the directory where i run the
junifer queue, i.e. my "perceived working directory".Steps To Reproduce
Install junifer.
Use this yaml file and run
junifer queueEnvironment
We just decided with @synchon that the relative paths of the storage URI should be kept relative to the location of the YAML file and not to the CWD. @LeSasse what do you think?
Yes, i think always relative from the YAML file will work. But I partly see this is as part of a larger issue of relative paths issues, for example when registering parcellations, coordinates, masks etc. Perhaps it could be good to have a specific section in the docs addressing relative paths in different types of situation, and how junifer interprets them (so like a summary of different relative path situations, where if one doesnt quite remember about a specific situation, one can quickly go and have a look).
That is true and the goal would be to have
withandstorage.uriblocks be relative to original YAML and explicitly put it in docs.Relatives paths are tricky. For the
withsection, the only one that makes sense is to have it relative to the location of the YAML file. For example, you can use the juni-farm repository as a submodule in a repo with your YAML files.That's why we decided to keep it consistent and always use relative paths in the same way.
About parcellations and masks, you are right. We need to be cristal clear. Also, in this case, the user is creating a python file. So the user can also compute the absolute path relative to the file. I think that it will even make more sense to prevent registering a mask/parcellation that relies on a relative file. There's actually no reason for this to be available as a feature.
The problem with the registering is that the relation from the file to the parcellation/data ressource changes from when the user creates the python file. That is, if the user doesnt get that it will be relative from junifer's working directory (because junifer copies it over to the other directory) and supposes that it will be relative from their python file, computing the absolute path also won't work.
The problem from a user perspective is, that most will not like having to actually put absolute paths, for reproducibility and portability reasons of a pipeline (myself included). I want my paths in a project to be relative within a project directory.
True. Masks/parcellations are not copied. Let's open an issue to see how we can tackle this.
Update on this one: It is way too complicated to keep the storage URI relative in the "queue" function.
For the
runfunction to work, we need to compute the absolute path on the YAML. This can be done after parsing the YAML.However, for the
queuefunction to run, we are creating a new YAML in$(CWD)/junifer_jobs/jobname. So in order to keep the path relative, we need to compute the relative relation between the CWD and the location of the yaml and add../../.I find this complicated and confusing.
So I'm going for the easy solution: in the yaml parser, compute the absolute path for any relative URI.
Codecov Report
100.00% <ø> (ø)93.62% <100.00%> (+0.08%)Flags with carried forward coverage won't be shown. Click here to find out more.
95.00% <100.00%> (+6.42%)... and 4 files with indirect coverage changes
@fraimondo Coverage seems to be causing issue.
This should be 100% now.