The datasource information utilities in gstlal.datasource
were designed such that optparse
command-line arg parsing was the primary means of initializing a GWDataSourceInfo
object; a necessary step to build any pipeline using mkbasicsrc
. The new api, via DataSourceInfo
has several goals:
This MR touches a lot of scripts, but should preserve existing functionality. The primary changes occur in a single module, gstlal.datasource
, where the GWDataSourceInfo
object and utilities have been deprecated in favor of the DataSourceInfo
object and utilities. Feature-set is preserved but interface is improved, see examples below. Specific changes include:
DataSourceInfo
class with improved interface and backwards compatdatasource.parse_list_to_dict
gstlal.utilities.admin
for:
GWDataSourceInfo
args = [
'--data-source=frames',
'--frame-cache=/path/to/cache',
'--channel-name=H1=CHANNEL',
'--gps-start-time=1234567',
'--gps-end-time=1234568',
]
parser = optparse.OptionParser(description="test legacy mkbasicsrc")
datasource.append_options(parser)
options, filenames = parser.parse_args(args)
info = GWDataSourceInfo(options)
DataSourceInfo
info = DataSourceInfo(data_source='frames',
frame_cache='path/to/cache',
gps_start_time=1234567,
gps_end_time=1234568,
channel_name={'H1': 'CHANNEL'})
What was:
gw_data_source_info = datasource.GWDataSourceInfo(options)
Becomes:
gw_data_source_info = datasource.DataSourceInfo.from_optparse(options)