Ticket #7703 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Migrate some scripts to new api

Reported by: Gesner Passos Owned by: Gesner Passos
Priority: critical Milestone: Release 3.0
Component: Python Keywords:
Cc: Blocked By:
Blocking: #7690 Tester: Mathieu Doucet

Description

Code/Mantid/scripts/Vates/Inelastic_Workflow.py
Code/Mantid/scripts/Inelastic/CommonFunctions.py
Code/Mantid/MantidQt/SliceViewer/test/SliceViewerPythonInterfaceTest.py
Code/Mantid/Framework/MDEvents/scripts/mdevents_optimize.py
Code/Mantid/Framework/MDEvents/scripts/speed_vs_numevents.py
Code/Mantid/Framework/Algorithms/test/NormaliseToUnityTest.py

Change History

comment:1 Changed 7 years ago by Gesner Passos

  • Status changed from new to inprogress

Migrate Vates/Inelastic_Workflow to new API

re #7703

Changeset: d8e9029a32eb9c4aeb9947277e1ad92abb98cfc2

comment:2 Changed 7 years ago by Gesner Passos

Migrate Inelastic/CommonFunctions to new api

re #7703

Changeset: 7bdd6a9f23dec5e1190634406a539de1da7880ed

comment:3 Changed 7 years ago by Gesner Passos

Migrate SliceViewerPythonInterfaceTest.py to new API

re #7703

Changeset: 8a369ed0f2f693e587ce60b5236edcef78ec3a17

comment:4 Changed 7 years ago by Gesner Passos

Migrate MDEvents/scripts/mdevents_optimize.py to new api

re #7703

Changeset: 88d6f5ccaeb608709576567c331cc241281aec7f

comment:5 Changed 7 years ago by Gesner Passos

Migrate speed_vs_numevents.py to new api

re #7703

Changeset: cd46741ebae10c0547345f2dc48778da8f298399

comment:6 Changed 7 years ago by Gesner Passos

Migrate NormaliseToUnitTest.py to new api

re #7703

Changeset: af7f5f717cab234cb5cca6e9ed73c21e135229e4

comment:7 Changed 7 years ago by Gesner Passos

Migrate NormaliseToUnitTest.py to new api

re #7703

Changeset: 3f33eae3802252eaa4abce8e87f53f437bd77cf2

comment:8 Changed 7 years ago by Gesner Passos

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

Tester:

  • No unittest or system tests related to these files may be broken.
  • Code review to check that the migration was done correctly.
  • If you know how to use these scripts, please, use them and check they are working nicely.

comment:9 Changed 7 years ago by Gesner Passos

  • Blocking 7690 added

comment:10 Changed 7 years ago by Mathieu Doucet

  • Status changed from verify to verifying
  • Tester set to Mathieu Doucet

comment:11 Changed 7 years ago by Mathieu Doucet

  • Status changed from verifying to reopened
  • Resolution fixed deleted

In mdevents_optimize.py: mtd["mdew"] raises an exception if there's no workspace named "mdew". It's better to use AnalysisDataService.doesExist('mdew'). There might be other places in the code that uses mtd.

Also, the following is an API v1 syntax that fails with API v2:

        aa = mtd["mdew"]
        a = aa._getHeldObject()

comment:12 Changed 7 years ago by Gesner Passos

  • Status changed from reopened to inprogress

Remove the _getHeldObject from script in MDEvents

re #7703

Changeset: cb94d218edcab3a46a2ba2716c524c928137ad11

comment:13 Changed 7 years ago by Gesner Passos

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

Thanks Mathieu, I've created the ticket #7763 to understand if we need to do anything about the _getHeldObject being used in other places.

comment:14 Changed 7 years ago by Mathieu Doucet

  • Status changed from verify to verifying

comment:15 Changed 7 years ago by Mathieu Doucet

In mdevents_optimize.py, the following is a syntax error:

if mtd.doesExist["mdew"]:

comment:16 Changed 7 years ago by Mathieu Doucet

  • Status changed from verifying to reopened
  • Resolution fixed deleted

In mdevents_optimize.py, the code breaks at line 110:

    these_results = pickle.load(f)
  AttributeError: 'module' object has no attribute 'Params'
  at line 110 in '/home/m2d/git/mantid-develop/Code/Mantid/Framework/MDEvents/scripts/mdevents_optimize.py'
  caused by line 1370 in '/usr/lib64/python2.6/pickle.py'
  caused by line 858 in '/usr/lib64/python2.6/pickle.py'
  caused by line 1069 in '/usr/lib64/python2.6/pickle.py'
  caused by line 1126 in '/usr/lib64/python2.6/pickle.py'

comment:17 Changed 7 years ago by Gesner Passos

  • Status changed from reopened to inprogress

Correct the syntax error doesExist

re #7703

Changeset: 4db21cd03a00375f33eaf1a4a6159ba9f3c1ed15

comment:18 Changed 7 years ago by Gesner Passos

Remove scripts that are not used anymore

These scripts were created when building MDEventWorkspace in order to profile the options available. Now, they are not used anymore.

re #7703

Changeset: b3f0a4776ec18a13e772236864afcf3cf5f53485

comment:19 Changed 7 years ago by Gesner Passos

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

I've followed the suggestion from Mathieu and Martyn to remove these two files (mdevents_optimize.py and speed_vs_numevents.py) because they are not used anymore.

comment:20 Changed 7 years ago by Gesner Passos

  • Priority changed from major to critical

Change priority of (testing) to critical. This and #7760 block us to switch off old API.

comment:21 Changed 7 years ago by Mathieu Doucet

  • Status changed from verify to verifying

comment:22 Changed 7 years ago by Mathieu Doucet

  • Status changed from verifying to closed

The tests pass, and the updated code looks OK.

comment:23 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8548

Note: See TracTickets for help on using tickets.