-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
While working on another PR I started to add type annotations to the run_long_sequence_gst function in drivers/longsequence.py. I found that argument names could be simplified considerably in the process. For example, the current signature is
def run_long_sequence_gst(data_filename_or_set, target_model_filename_or_object,
prep_fiducial_list_or_filename, meas_fiducial_list_or_filename,
germs_list_or_filename, max_lengths, gauge_opt_params=None,
advanced_options=None, comm=None, mem_limit=None,
output_pkl=None, verbosity=2, checkpoint=None, checkpoint_path=None,
disable_checkpointing=False,
simulator: Optional[ForwardSimulator.Castable]=None,
gauge_opt_suite_name: str = 'stdgaugeopt'):while a type-annotated signature could be
FileName = str # a type alias with clear semantic meaning
def run_long_sequence_gst(
data: Union[FileName, DataSet], target_model: Union[FileName, _Model],
prep_fiducials: Union[FileName, Sequence[Circuit]],
meas_fiducials: Union[FileName, Sequence[Circuit]],
germs: Union[FileName, Sequence[Circuit]],
max_lengths: Sequence[int], gauge_opt_params=None,
advanced_options: Optional[dict[str, Any]]=None, comm=None, mem_limit=None,
output_pkl=None, verbosity=2, checkpoint=None, checkpoint_path=None,
disable_checkpointing=False,
simulator: Optional[ForwardSimulator.Castable]=None,
gauge_opt_suite_name: str = 'stdgaugeopt'):I'm not going to propose these changes in my other PR, since that would complicate reviews. Making it note of this here so we can address it later.
Metadata
Metadata
Assignees
Labels
No labels