Ticket #6639 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

Add deprecated Python commands for old API

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: blocker Milestone: Release 2.5
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Michael Reuter

Description

The old Python API had some commands that didn't follow their C++ names. Make sure they exist on the new API and add a deprecation warning when they are called for the following:

  • Unit::name;
  • MatrixWorkspace::getNumberBins;
  • MatrixWorkspace::getSampleDetails

Change History

comment:1 Changed 8 years ago by Martyn Gigg

  • Status changed from new to accepted

comment:2 Changed 8 years ago by Martyn Gigg

Set Python DeprecationWarnings to default. Refs #6639

In 2.7 they are ignored by default, which is not that useful.

Changeset: 4a2dd310356368c61e60a648c69ec6d5f01aea86

comment:3 Changed 8 years ago by Martyn Gigg

Fix doxygen errors in Python Axis.cpp. Refs #6639

Changeset: 20e3ba9e4ecbb661bd6e1ee21f36c4155e0360da

comment:4 Changed 8 years ago by Martyn Gigg

Add deprecated functions to new API to aid in transition. Refs #6639

Changeset: cc4cbb5ac2a6b5fa946ad5efc696bc266489a294

comment:5 Changed 8 years ago by Martyn Gigg

Merge branch 'feature/6639_deprecated_python_cmds' into develop.

Refs #6639

Conflicts:

Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp

Changeset: c14acdb064f2a908e7248b71217490c965fad5ef

comment:6 Changed 8 years ago by Martyn Gigg

Update Axis to remove createSpectraAxis method. Refs #6639

Changeset: 556d95d6d89a3977906f062877597c6dffd51117

comment:7 Changed 8 years ago by Martyn Gigg

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

Tester:

Branch name: feature/6639_deprecated_python_cmds

The methods list above should now exist when using the new API. The script below, when executed, should produce a deprecation message each time one of the methods is called. The caption call shows that the same output is produced but without the message.

The corresponding new functions are:

  • Unit.name -> Unit.caption
  • MatrixWorkspace.getNumberBins -> MatrixWorkspace.blocksize
  • MatrixWorkspace.getSampleDetails -> MatrixWorkspace.getRun
w = Load('IRS21360.raw')
print w.getNumberBins()
print w.getSampleDetails()
u = w.getAxis(0).getUnit()
print u.name()
print u.caption()
print u.name()

comment:8 Changed 8 years ago by Michael Reuter

  • Status changed from verify to verifying
  • Tester set to Michael Reuter

comment:9 Changed 8 years ago by Michael Reuter

  • Status changed from verifying to closed

The deprecated messages appear at the correct locations.

comment:10 Changed 8 years ago by Martyn Gigg

Set Python DeprecationWarnings to default. Refs #6639

In 2.7 they are ignored by default, which is not that useful.

Changeset: 4a2dd310356368c61e60a648c69ec6d5f01aea86

comment:11 Changed 8 years ago by Martyn Gigg

Fix doxygen errors in Python Axis.cpp. Refs #6639

Changeset: 20e3ba9e4ecbb661bd6e1ee21f36c4155e0360da

comment:12 Changed 8 years ago by Martyn Gigg

Add deprecated functions to new API to aid in transition. Refs #6639

Changeset: cc4cbb5ac2a6b5fa946ad5efc696bc266489a294

comment:13 Changed 8 years ago by Martyn Gigg

Update Axis to remove createSpectraAxis method. Refs #6639

Changeset: 556d95d6d89a3977906f062877597c6dffd51117

comment:14 Changed 8 years ago by Martyn Gigg

Set Python DeprecationWarnings to default. Refs #6639

In 2.7 they are ignored by default, which is not that useful.

Changeset: 4a2dd310356368c61e60a648c69ec6d5f01aea86

comment:15 Changed 8 years ago by Martyn Gigg

Fix doxygen errors in Python Axis.cpp. Refs #6639

Changeset: 20e3ba9e4ecbb661bd6e1ee21f36c4155e0360da

comment:16 Changed 8 years ago by Martyn Gigg

Add deprecated functions to new API to aid in transition. Refs #6639

Changeset: cc4cbb5ac2a6b5fa946ad5efc696bc266489a294

comment:17 Changed 8 years ago by Martyn Gigg

Update Axis to remove createSpectraAxis method. Refs #6639

Changeset: 556d95d6d89a3977906f062877597c6dffd51117

comment:18 Changed 8 years ago by Martyn Gigg

Set Python DeprecationWarnings to default. Refs #6639

In 2.7 they are ignored by default, which is not that useful.

Changeset: 4a2dd310356368c61e60a648c69ec6d5f01aea86

comment:19 Changed 8 years ago by Martyn Gigg

Fix doxygen errors in Python Axis.cpp. Refs #6639

Changeset: 20e3ba9e4ecbb661bd6e1ee21f36c4155e0360da

comment:20 Changed 8 years ago by Martyn Gigg

Add deprecated functions to new API to aid in transition. Refs #6639

Changeset: cc4cbb5ac2a6b5fa946ad5efc696bc266489a294

comment:21 Changed 8 years ago by Martyn Gigg

Update Axis to remove createSpectraAxis method. Refs #6639

Changeset: 556d95d6d89a3977906f062877597c6dffd51117

comment:22 Changed 8 years ago by Martyn Gigg

Set Python DeprecationWarnings to default. Refs #6639

In 2.7 they are ignored by default, which is not that useful.

Changeset: ac890a772263db7712fd005286f43abd22747c7b

comment:23 Changed 8 years ago by Martyn Gigg

Add deprecated functions to new API to aid in transition. Refs #6639

Changeset: 75923fac9e92457cc5cb73c199491fe5bde8c978

comment:24 Changed 8 years ago by Martyn Gigg

Set Python DeprecationWarnings to default. Refs #6639

In 2.7 they are ignored by default, which is not that useful.

Changeset: 4a2dd310356368c61e60a648c69ec6d5f01aea86

comment:25 Changed 8 years ago by Martyn Gigg

Fix doxygen errors in Python Axis.cpp. Refs #6639

Changeset: 20e3ba9e4ecbb661bd6e1ee21f36c4155e0360da

comment:26 Changed 8 years ago by Martyn Gigg

Add deprecated functions to new API to aid in transition. Refs #6639

Changeset: cc4cbb5ac2a6b5fa946ad5efc696bc266489a294

comment:27 Changed 8 years ago by Martyn Gigg

Update Axis to remove createSpectraAxis method. Refs #6639

Changeset: 556d95d6d89a3977906f062877597c6dffd51117

comment:28 Changed 8 years ago by Martyn Gigg

Set Python DeprecationWarnings to default. Refs #6639

In 2.7 they are ignored by default, which is not that useful.

Changeset: 4a2dd310356368c61e60a648c69ec6d5f01aea86

comment:29 Changed 8 years ago by Martyn Gigg

Fix doxygen errors in Python Axis.cpp. Refs #6639

Changeset: 20e3ba9e4ecbb661bd6e1ee21f36c4155e0360da

comment:30 Changed 8 years ago by Martyn Gigg

Add deprecated functions to new API to aid in transition. Refs #6639

Changeset: cc4cbb5ac2a6b5fa946ad5efc696bc266489a294

comment:31 Changed 8 years ago by Martyn Gigg

Update Axis to remove createSpectraAxis method. Refs #6639

Changeset: 556d95d6d89a3977906f062877597c6dffd51117

comment:32 Changed 7 years ago by Martyn Gigg

Merge branch 'feature/6639_deprecated_python_cmds' into develop.

Refs #6639

Conflicts:

Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Axis.cpp

Changeset: c14acdb064f2a908e7248b71217490c965fad5ef

comment:33 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7485

Note: See TracTickets for help on using tickets.