Ticket #9476 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Deprecate Unused Code

Reported by: Peter Parker Owned by: Peter Parker
Priority: major Milestone: Release 3.2
Component: SANS Keywords: Maintenance
Cc: Blocked By:
Blocking: Tester: Jay Rainey

Description

There are quite a lot of unused functions within the ISIS SANS reduction code. When wading through the files to see what's going on it would help if we could mark these as deprecated, move them to the bottom of their respective files, and then at some later date delete them.

I'm going to time-box this to the rest of today.

Change History

comment:1 Changed 6 years ago by Peter Parker

Refs #9476 - While we're here, use new logger.

Changeset: 4ffb2941ab50b8f41147dc7023442a042c39660c

comment:2 Changed 6 years ago by Peter Parker

Refs #9476 - Add "deprecated" function/class decorator.

Changeset: 9bf2a36f2f4003dedb52c989dea1c1427abeea5b

comment:3 Changed 6 years ago by Peter Parker

Refs #9476 - Clean up ISISCommandInterface.

Changeset: e009bb178cf71befb1b373f8069da2739dda3bde

comment:4 Changed 6 years ago by Peter Parker

Refs #9476 - Clean up SANSUtility.

Changeset: f2b00538e02179cc0e0bf95d9b9f4fdd3b158ffa

comment:5 Changed 6 years ago by Peter Parker

Refs #9476 - Get rid of "START/END OF REMOVED" comments.

Version control should be used to see what was changed, when, and by whom.

Changeset: 9498df8b94a94c7d349a03b313776f6669fa3be9

comment:6 Changed 6 years ago by Peter Parker

  • Status changed from new to assigned

comment:7 Changed 6 years ago by Peter Parker

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

To test:

Use the following script to see the messages that users of the deprecated functions/classes will see:

import SANSUtility as su
import ISISCommandInterface as ici

# Test a class.
su.WorkspaceDetails(name="test", run_number=1234)

# Will throw since we have not set up the reducer, but that's fine; all
# we want to test is whether or not the deprecated message is shown for
# functions.
ici.displayGeometry()

Apart from that, a code inspection is about all you can do. If you really want you can do a grep for the one's I've deprecated.

comment:8 Changed 6 years ago by Jay Rainey

  • Status changed from verify to verifying
  • Tester set to Jay Rainey

comment:9 Changed 6 years ago by Jay Rainey

  • Status changed from verifying to closed

The log messages are output if any methods are used that have been @deprecated. Code changes made are sensible. Nice use of a decorator & recursion to solve this issue. Closing.

Last edited 6 years ago by Jay Rainey (previous) (diff)

comment:10 Changed 6 years ago by Jay Rainey

Merge remote-tracking branch 'origin/feature/9476_deprecate_unused_code'

Full changeset: b6fd3e2c937b46ee056ce6594dbdbd342ddc2f2d

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10319

Note: See TracTickets for help on using tickets.