Digraphs icon indicating copy to clipboard operation
Digraphs copied to clipboard

System for marking obsolete methods

Open mtorpey opened this issue 11 months ago • 4 comments

As mentioned in #730 we want to be able to mark something in the main branch as obsolete/deprecated, so it should print a warning that it will be removed soon.

We could do something like Semigroups with its obsolete.gi file, but we should think about how to do this in a nice way with synonyms.

mtorpey avatar Feb 19 '25 16:02 mtorpey

This should probably be a function called something like DIGRAPHS_DeclareObsoleteSynonym that installs a new global function with the desired name that prints a warning and then simply calls the existing thing.

mtorpey avatar Feb 26 '25 14:02 mtorpey

@mtorpey @james-d-mitchell I had a suggestion on how to implement https://github.com/digraphs/Digraphs/issues/735 as well (as an extension to https://github.com/digraphs/Digraphs/pull/730):

  1. We could define a helper function DeclareDeprecatedSynonym which creates something like a wrapper that prints the warning and uses the Apply fucntion of GAP to forward the arbitrary number of arguments to the new function.
  2. We can then bind this wrapper to the name DigraphDijkstra (a string as can be seen in DeclareSynonym) using a DeclareDeprecatedSynonym. This way every call to DigraphDijkstra triggers the warning before executing DigraphShortestPaths and then can run the updated function name which is DigraphShortestPaths in this case.

devansh2605 avatar Feb 26 '25 15:02 devansh2605

@devansh2605 is going to ty this!

mtorpey avatar Feb 26 '25 15:02 mtorpey

@mtorpey @james-d-mitchell This is also complete can we pls move this to under review?

devansh2605 avatar Apr 16 '25 13:04 devansh2605