Update DataSourceInfo API
Compare changes
Files
24+ 1
− 1
@@ -223,7 +223,7 @@ def parse_command_line():
Maintenance will be performed on git.ligo.org, containers.ligo.org, and docs.ligo.org on Tuesday 22 April 2025 starting at approximately 9am PDT. It is expected to take around 30 minutes and there will be several periods of downtime throughout the maintenance. Please address any comments, concerns, or questions to the helpdesk. This maintenance will be upgrading the GitLab database in order to be ready for the migration.
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)