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
[general need] Synchronisation between mia and capsul engine configuration is suboptimal, in V2 #185
Comments
After a private discussion with @LStruber, it was decided :
The Mia's preferences synchronisation with capsul engine configuration works correctly now, but the opposite does not seem to be optimal. So, by commenting on the CAPSUL part, we won't have any more problems on that side. This is only a temporary solution, the best will be to synchronise properly in both directions. |
CAPSUL configuration has been commented in commit 0e8c820. I let the ticket open until the synchronisation is completely fixed. |
Do you have an example / test of bad sync between capsul and mi configs ? |
I'm sorry I left this ticket out, but I'm running out of time. That there are two configurations (capsul config and mia config) in Mia's preferences doesn't bother me at all, I even think it's good. Indeed, since the beginning of the Mia project, I have always put as the most important parameter the simplicity, the ergonomics and the documented character of the things proposed to the user. I have a high regard for capsul and everything that comes from BrainVisa in general, but I think it's generally difficult to access, to use, in short, a little bit elitist. I admit, while I'm not a complete beginner, having a little trouble understanding exactly how the capsul config works (I speak of the GUI that was in the mia preferences). At the risk of looking simple, I just want Mia to be as easy to use and ergonomic as possible. That's why I think both currently have their places in Mia's preferences (to caricature a little, one - mia preference - for clinical use and the other - capsul config - for more experienced users). However, hopefully both should lead to the same result. Anyway, the Mia config is now perfectly synchronised with the capsul config (I know this because I worked quite a bit on a now closed ticket where the goal was to make the mia config working!) and ultimately during the run it is the capsul config that is used! However when I was working on this ticket I noticed that the opposite was not perfect (I change in capsul config and it is not reflected or badly in the config of mia). I could have continued the work in this sense (synchronises capsul config with Mia config) but I admit I didn't have the courage at this time... I don't think it's a big job, but at that moment I got a bit fed up with fix things that didn't work in V2... Now to see what doesn't sync from capsul config to mia config, it's quite simple, just change the capsul config and see the result in the mia config... It's very quick to see, my remember that it works very badly! I can of course help to give "minimum procedure to reproduce", but honestly if I remember correctly, we just have to make a change in capsul config and we quickly see that it does not synchronise in mia's preferences (or badly, in confess that I don't exactly remember). Another solution is for me to make the sync working. It's true that now that V2 is starting to work, I'm less worried about the large number of things that don't work, and i can plane to do it ... |
I take this ticket. |
It's fixed for FSL. |
In fact in capsul/study_config/config_modules/matlab_config.py, matlab_exec is defined as a File trait. So it is not possible actually to give here the path to the MCR (a Dir). So it is not possible to define the MCR path in the GUI of capsul config and it happens elsewhere in populse_mia, under the hood: -> In populse_mia/software_properties.py (line 863):
As it is, it is not possible to synchronise capsul config with mia preferences, and worse, we have to use only mia pref to define the MCR path. This is where I reach the limit of what I can do to close this ticket. I think the capsul config GUI should be able to accept a file or a directory for the "executable" field in the matlab tab. In this case, I'm not sure if "executable" is really suitable in the GUI ("path" would be better?). |
Sorry for not following this earlier... |
Of course! This is exactly what we did in mia pref. There is a matlab_exec and a matlab_standalone. |
For SPM we use in both cases the "directory" field, so it's ok for the file (.sh) or the directory (in fact we add the .sh, under the hood, to the directory, in case of a standalone spm). But for matlab as you want to keep the notion of "executable" it's less obvious (for me we need the directory for the matlab executable and like for spm we could add, under the hood). With this, a "directory" field is enough instead of the "executable" field. But if you have another quick solution, I am interested. |
Why use the same field for matlab executable and the MCR ? If both can be used to run SPM, in a more general way it is not the same at all: you can run matlab alone, you can't run the MCR (I guess); one is a file, the other is a directory. Thus it seems simpler and clearer for me to use two config fields. However if you really want to, we can use the traits.Either type to allow a file or a directory, but I'm not convinced it its the best solution. |
I think that MCR can be used without spm standalone (for example if we want to use compiled matlab codes, I have to look into it as soon as possible because I have matlab codes that I want to use without access to the source codes). But this is not the question. |
I don't think it's a good idea to remove matlab_mcr from mia pref. The idea is to be perfectly synchronised, that is to say to be able to define the same things in mia pref and capsul config .... and for the moment to define the MCR we have to use mia pref, capsul config does not allow it. |
Why not ? Why is it a good thing to duplicate config options ?
that's exactly why I ask if I should add it in capsul config. The reason I insist is, in addition to not liking duplicating things, that, for me MIA GUI should be a graphical interface to run Capsul pipelines, which we should normally be able to run also outside of the GUI, typically to run them on a computing resource, from a script or something else. Capsul may allow extensions like the features of MIAProcesses, databasing and provenance tracking etc. There are many things that were developed inside MIA's GUI (see the pipeline_management_tab.py which is both the GUI and in a large part also processing infrastructure. I would like to separate them, probably not in the short term, but we want, at the end, to be able to run any processing from the commandline |
To tell the truth, if the GUI of capsul config works as well as mia pref, I have no problem to delete mia pref ... The actual problem goes beyond the synchronisation issue ... The problem is that capsul config doesn't work for the MCR. It's mandatory to use mia pref ... That's why we have unplugged the GUI of capsul config in mia pref in master actually ... |
I have added the matlab |
Thanks @denisri ! I will see ASAP how to deal with ... |
Just tested! This is very nice. Just one thing: I had protected it to avoid crashing Mia if a bad parameter is entered (typo, etc ...). For example in caspul config, put an error in the spm path, then do ok -> Mia crash. Then if we change by:
by doing the typo, it doesn't crash anymore and a small message appears for the user in the standard output. Is it possible to protect again the tab.accept() ? |
@servoz synchronization seems to work in both ways for AFNI and ANTS. I also added an AFNI example path in the MIA config window, but not for ANTS since ANTS puts all files in one big folder, that you choose in installation. |
OK, thank you @LStruber ! |
yes, sure. I'm doing it. |
done. |
Thanks @denisri ! |
fixes in sync between capsul and mia avoid using obsolete studyconfig
- Sync from Mia pref to Capsul config: OK
- Sync from Mia pref to Capsul config: OK - typo fix for ANTS
- Sync from Capsul config to Mia pref: OK for ANTS, AFNI and FSL
- Sync from Capsul config to Mia pref: working on matlab/spm. Because there are two parameters for matlab (executable and mcr_directory) if the user defines both, we don't know which one to choose! Here we choose to favour matlab in front of MCR if both are chosen. This is suboptimal
- Sync from Capsul config to Mia pref: MATLAB / SPM OK
- fix wrong checked status if spm/matlab
instead of recreating it without a version. This way we don't lose the SPM version anymore. (#185)
Currently by going to File > Mia preferences it is possible to access the configuration settings for mia but also for capsul engine. In some cases this is completely redundant.
The synchronisation between the two is currently sub-optimal. We are getting there but I think that a simple user would be lost at the moment.
It would be necessary to have a perfect synchronisation (instantaneous) in both directions and that one adds or removes a configuration of module.
Currently it is not all the time easy and faster to do.
In fact we did not invest too much effort in this direction because this duplication should disappear (keep only mia prefrence and a synchronisation invisible to the user would be made at each change, or keep only the display of the capsul engine).
Another alternative, which goes in the direction of a reflection I had started and which I already mentioned, but which we never settled, would be to have a local or a remote mode of operation (soma-workflow does it, but we don't currently have a defined working mode in mia).
In this case, we could keep both.
The mia preferences would be keep for local use (where it is possible to test the validity of the config, which is currently done for spm and fsl) and capsul engine would be keep for remote use (where it may not be possible to check the config at the time of its definition). But this is beyond the scope of this ticket.
The text was updated successfully, but these errors were encountered: