Ticket #10876 (assigned)

Opened 6 years ago

Last modified 6 years ago

Investigate using factory pattern

Reported by: MarcusNoble Owned by: Lottie Greenwood
Priority: minor Milestone: Backlog
Component: Tools Keywords: AUTOREDUCTION
Cc: Alex.Buts@… Blocked By:
Blocking: Tester:

Description

For user's scripts, look into the possibility of using a factory pattern to enforce variable names and method names.

Change History

comment:1 Changed 6 years ago by Alex Buts

Hi, Marcus,

If you doing this, the example of the implementation of this pattern in Mantid is in https://github.com/mantidproject/scripts/blob/master/test/runIndividualFromGUI.py

Row 45 has to be modified to check the users directory for the files user put into.

Rows 67-80 -- modified to identify the children of your interface class (e.g. have the methods you need)

and then rows 82-85 will run your interface commands.

comment:2 Changed 6 years ago by MarcusNoble

  • Status changed from new to assigned

comment:3 Changed 6 years ago by MarcusNoble

Notes from chat with Alex:

  • Factory pattern
  • Add a location on autoreduce for mask files etc. Add this location to the Mantid datasearch.
  • Look at Mantid defaultsave.directory and setdatasearchdirs
  • WB could possibly be a different cycle (but mantid file opened should handle this)
  • Specify paths (for masks etc.) in factory class's init?
  • Specify in factory class that it is being run from WS (boolean flag)

comment:4 Changed 6 years ago by Alex Buts

And I've analysed the way of running a factory methods if mantid is not available and it is easy as soon as Mantid imports are in try: except blocks. The only question is where to place the interface file to be available both for the server and for a Mantid user.

Minor edit is needed for my reduction wrapper decorators

Last edited 6 years ago by Alex Buts (previous) (diff)

comment:5 Changed 6 years ago by Lottie Greenwood

  • Owner changed from MarcusNoble to Lottie Greenwood
Note: See TracTickets for help on using tickets.