mantidproject / vesuvio

Source code for Vesuvio analysis algorithms
0 stars 1 forks source link

Changing user experience #105

Closed GuiMacielPereira closed 7 months ago

GuiMacielPereira commented 8 months ago

Description of work: After meeting with Matthew, it was clear that a different way of interacting with the code was needed, as described in #104. The main changes this PR introduces are the following:

To test:

  1. Create a new conda enviroment: conda create -n mvesuvio-test
  2. Activate environment: conda activate mvesuvio-test
  3. Install mantidworkbench (version needs to be 6.8): mamba install mantidworkbench==6.8
  4. cd into the repository with this PR and install package by running pip install -e .
  5. In the terminal, run the command mvesuvio config to set up default configuration
  6. Go to the default folder, ~/.mvesuvio and copy analysis_inputs.py file
  7. Create a new directory anywhere in your machine and paste analysis_inputs.py file inside it.
  8. Open Mantid workbench from the vesuvio conda environment (command workbench)
  9. Inside workbench, open the analysis_inputs.py file you just pasted.
  10. Run the file.
  11. The file should run without issues and create a new folder with the same name as the file, i.e. check that a folder called analysis_inputs is created alongside the file analysis_inputs.py.
  12. Check the folder contains the outputs of the inputs file.
  13. Copy-and-paste the same analysis_inputs.py file in the same directory but this time rename it to something different
  14. Run this file from inside workbench and check that a new directory with the new name is created.

Fixes #104.

MialLewis commented 8 months ago

We really need to get Matthew using conda, as it’s our primary supported installation method!

The risk with installing the package this way is that there’s no guarantee that pip won’t break the mantid install, or that the mvesuvio package will work correctly.

SilkeSchomann commented 7 months ago

When I run analysis_inputs.py there is a pop-up window in the end asking whether to clean up all the workspaces. Entering n gives the following error message: ``` KeyboardInterrupt: Run of procedure canceled. File "C:/Users/eoc57742/testmvesuvio/copy_analysis_inputs.py", line 173, in mvesuvio.run() File "C:\Users\eoc57742\vesuvio2024\vesuvio.\mvesuvio__init.py", line 53, in run main(run_args) File "C:\Users\eoc57742\vesuvio2024\vesuvio.\mvesuvio\scripts__init.py", line 16, in main run_analysis(args.yes) File "C:\Users\eoc57742\vesuvio2024\vesuvio.\mvesuvio\scripts\init.py", line 92, in run_analysis analysis_runner.run(yes_to_all) File "C:\Users\eoc57742\vesuvio2024\vesuvio.\mvesuvio\analysis_runner.py", line 25, in run runScript( File "C:\Users\eoc57742\vesuvio2024\vesuvio.\mvesuvio\vesuvio_analysis\run_script.py", line 98, in runScript checkUserClearWS(yes_to_all) # Check if user is OK with cleaning all workspaces File "C:\Users\eoc57742\vesuvio2024\vesuvio.\mvesuvio\vesuvio_analysis\run_script.py", line 118, in checkUserClearWS raise KeyboardInterrupt("Run of procedure canceled.")



Is this behaviour intended?
SilkeSchomann commented 7 months ago

The folders are created as expected, by the way, both with the original script and also after renaming.

GuiMacielPereira commented 7 months ago

Ah, yes, this is intended, although I should probably change this in the future. The first time you run the script, the user should go with 'y' and delete the workspaces that were just loaded into mantid. This will reload the same workspaces but from a local path. In general I put this warning so that the user does not overwrite workspaces accidentally but this is an edge case where this warning should probably not be displayed.

SilkeSchomann commented 7 months ago

I've repeated step 6. to 14. with a folder on one drive and it also worked as expected.