Ticket #7103 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Migrate pythonalgorithms.directories values automatically

Reported by: Nick Draper Owned by: Martyn Gigg
Priority: critical Milestone: Release 2.5.3
Component: Mantid Keywords: PatchCandidate,Released
Cc: Blocked By:
Blocking: Tester: Gesner Passos

Description

From Spencer:

I get this on starting up

Welcome to Mantid - Manipulation and Analysis Toolkit for Instrument Data
The Python algorithms key 'pythonalgorithms.directories' in 'C:\MantidInstall\bin\Mantid.user.properties' has been deprecated. Please add 'C:/MantidInstall/plugins/python/algorithms' to the 'user.python.plugins.directories' key instead. Future release will not check the old key.

I don’t understand what to do – so I don’t know what a user will think of it!
Sp

Change History

comment:1 Changed 7 years ago by Nick Draper

I suggest we add code to do this automatically on startup.

comment:2 Changed 7 years ago by Martyn Gigg

  • Status changed from new to accepted

comment:3 Changed 7 years ago by Martyn Gigg

Merge deprecated 'pythonalgorithms.directories' key with new key...

automatically and add old plugin location to base python.plugins key. Avoids users seeing confusing warnings. Refs #7103

Changeset: 2876f29d972e08a0377f3192b724d906d6025552

comment:4 Changed 7 years ago by Martyn Gigg

Point ConfigDialog at user.python.plugins.directories instead of...

deprecated pythonalgorithms.directories key. The other code changes simple update the variable names to say plugin rather than algorithm.

Refs #7103

Changeset: 48a5ed9952b6e31635db273d1996b7032a604da8

comment:5 Changed 7 years ago by Martyn Gigg

Merge deprecated 'pythonalgorithms.directories' key with new key...

automatically and add old plugin location to base python.plugins key. Avoids users seeing confusing warnings. Refs #7103

Changeset: 2876f29d972e08a0377f3192b724d906d6025552

comment:6 Changed 7 years ago by Martyn Gigg

Point ConfigDialog at user.python.plugins.directories instead of...

deprecated pythonalgorithms.directories key. The other code changes simple update the variable names to say plugin rather than algorithm.

Refs #7103

Changeset: 48a5ed9952b6e31635db273d1996b7032a604da8

comment:7 Changed 7 years ago by Martyn Gigg

  • Status changed from accepted to verify
  • Resolution set to fixed

Branch: feature/7103_migrate_pyalgs_prop_key

Tester: There are a few things to test.

  • Download the attached algorithm to new directory (so that we can test whether it loads or not)
  • Open your Mantid.user.properties and delete any pythonalgorithms.directories * user.python.plugins.directories keys.
  • Start MantidPlot and check that the SNSPowerReduction algorithm is present but the PyClone algorithm is not. Close down mantid.
  • Add pythonalgorithms.directories=PATH TO DIRECTORY WHERE ATTACHMENT DOWNLOADED
  • Start MantidPlot and check that the PyClone algorithm is now loaded. Close down MantidPlot.
  • Reload the Mantid.user.properties and check that the pythonalgorithms.directories key is now blank and the directory that was there has been added to the user.python.plugins.directories key
  • Restart MantidPlot and check that the PyClone algorithm is still there after the properties rewrite. Close MantidPlot
  • In the Mantid.user.properties file add back the directory to the pythonalgorithms.directories key and restart MantidPlot. Reopening the user properties file should show that the pythonalgorithms.directories key has been blanked but on the single entry remains in the new user.python.plugins key.

The ConfigDialog (View->Preferences) was also updated to point at the new key rather than the deprecated one.

  • Open MantidPlot and go to View->Preferences. Select the Mantid section and click the 'Directories' tab. The Python extensions box should now have the entry that you added to the properties file in it. Try adding and removing directories and restarting MantidPlot to check you get what you expect.

comment:8 Changed 7 years ago by Martyn Gigg

Drop a fairly useless warning message to debug. Refs #7103

The package build throws this warning with the PythonAlgs directory.

Changeset: 21665fced771720739a741d2c4456f2ac9b4d9c4

comment:9 Changed 7 years ago by Martyn Gigg

Drop a fairly useless warning message to debug. Refs #7103

The package build throws this warning with the PythonAlgs directory.

Changeset: 21665fced771720739a741d2c4456f2ac9b4d9c4

comment:10 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying
  • Tester set to Gesner Passos

comment:11 Changed 7 years ago by Martyn Gigg

Merge deprecated 'pythonalgorithms.directories' key with new key...

automatically and add old plugin location to base python.plugins key. Avoids users seeing confusing warnings. Refs #7103

Changeset: 2876f29d972e08a0377f3192b724d906d6025552

comment:12 Changed 7 years ago by Martyn Gigg

Point ConfigDialog at user.python.plugins.directories instead of...

deprecated pythonalgorithms.directories key. The other code changes simple update the variable names to say plugin rather than algorithm.

Refs #7103

Changeset: 48a5ed9952b6e31635db273d1996b7032a604da8

comment:13 Changed 7 years ago by Martyn Gigg

Drop a fairly useless warning message to debug. Refs #7103

The package build throws this warning with the PythonAlgs directory.

Changeset: 21665fced771720739a741d2c4456f2ac9b4d9c4

comment:14 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to closed

Everything is working well. My only concern is that if the users changes through MantidPlot and go to View->Preferences, he would expect his algorithm would be available, doesn't him? So, or we should warn him that the algorithms in that folder will be available after restarting MantidPlot, or we have to load the algorithms in that place.

It is not directly related to this ticket, and I'm not quite sure we have to do it. But, my thoughts.

comment:15 Changed 7 years ago by Martyn Gigg

Merge deprecated 'pythonalgorithms.directories' key with new key...

automatically and add old plugin location to base python.plugins key. Avoids users seeing confusing warnings. Refs #7103

Changeset: a5098449c12e13068c27588bc86910cdef8fd90f

comment:16 Changed 7 years ago by Martyn Gigg

Point ConfigDialog at user.python.plugins.directories instead of...

deprecated pythonalgorithms.directories key. The other code changes simple update the variable names to say plugin rather than algorithm.

Refs #7103

Changeset: 87a4bc0e8ec49426ba36268eac5795b1e1829b60

comment:17 Changed 7 years ago by Martyn Gigg

Drop a fairly useless warning message to debug. Refs #7103

The package build throws this warning with the PythonAlgs directory.

Changeset: e9d31461caa08bdf0651f273c7b08fd07abff010

comment:18 Changed 7 years ago by Martyn Gigg

Merge deprecated 'pythonalgorithms.directories' key with new key...

automatically and add old plugin location to base python.plugins key. Avoids users seeing confusing warnings. Refs #7103

Changeset: b1ce1d7eb564422544cc93ed593000956cd837b6

comment:19 Changed 7 years ago by Martyn Gigg

Point ConfigDialog at user.python.plugins.directories instead of...

deprecated pythonalgorithms.directories key. The other code changes simple update the variable names to say plugin rather than algorithm.

Refs #7103

Changeset: 84f80c6ad07cf87e2a7c30d6027c80c303429ed9

comment:20 Changed 7 years ago by Martyn Gigg

Drop a fairly useless warning message to debug. Refs #7103

The package build throws this warning with the PythonAlgs directory.

Changeset: 068c9f74fea05f0819d7daa4cfed6d595e960946

comment:21 Changed 7 years ago by Nick Draper

  • Keywords PatchCandidate,Released added; PatchCandidate removed

comment:22 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7949

Note: See TracTickets for help on using tickets.