Preserve signal names upon conversion to discrete-time by sawyerbfuller · Pull Request #797 · python-control/python-control

I suggest following the conventions used in linearize():

  • Use copy keyword to control whether signal names are copied (default can be True, although for linearize it is False for some reason).
  • Use name keyword to set the system name. If name is not specified and if copy is False, a generic name <sys[id]> is generated with a unique integer id. If copy is True, the new system name is determined by adding the prefix and suffix strings in config.defaults['iosys.linearized_system_name_prefix'] and config.defaults['iosys.linearized_system_name_suffix'], with the default being to add the suffix '$linearized'.

Doing this for sample(), the default name of the new system could be the old system with $sampled appended (and overridable via something like iosys.sample_system_name_prefix and iosys.sample_system_name_suffix.

Also, we might want to override the sample() method in LinearIOSystem so that sampling a linear input/output system gives a linear input/output system (rather than just a StateSpace system). This won't matter much since StateSpace is converted to LinearIOSystem if it is connected to anything, but would be a bit cleaner (and points to the fact that we should probably merge StateSpace and LinearIOSystem at some point, as pointed out already in issue #786).