@@ -55,12 +55,14 @@ def _comment_loader(str_or_path: str) -> str:
5555 type = str ,
5656 help = "either a comment string or file path prefixed with @ (e.g. @README.txt)" ,
5757)
58- def convert_exchange (exchange_path , out_path , check_flag , precision_source , comments ):
58+ def convert_exchange (
59+ exchange_path , out_path , check_flag : bool , precision_source , comments
60+ ):
5961 setup_logging ("DEBUG" )
6062 log .info ("Loading read_exchange" )
61- from .exchange import read_exchange
63+ from .exchange import CheckOptions , read_exchange
6264
63- checks = {"flags" : check_flag }
65+ checks : CheckOptions = {"flags" : check_flag }
6466
6567 ex = read_exchange (exchange_path , checks = checks , precision_source = precision_source )
6668 log .info ("Saving to netCDF" )
@@ -91,9 +93,9 @@ def convert_exchange(exchange_path, out_path, check_flag, precision_source, comm
9193def convert_csv (csv_path , out_path , ftype , check_flag , precision_source , comments ):
9294 setup_logging ("DEBUG" )
9395 log .info ("Loading read_exchange" )
94- from .exchange import read_csv
96+ from .exchange import CheckOptions , read_csv
9597
96- checks = {"flags" : check_flag }
98+ checks : CheckOptions = {"flags" : check_flag }
9799
98100 ex = read_csv (
99101 csv_path , ftype = ftype , checks = checks , precision_source = precision_source
@@ -134,9 +136,11 @@ def edit_comments(expocode, dtype):
134136 extant_ids = cruise_file_ids & files .keys ()
135137 edit_files = list (
136138 filter (
137- lambda x : x ["role" ] == "dataset"
138- and x ["data_format" ] == "cf_netcdf"
139- and x ["data_type" ] == dtype ,
139+ lambda x : (
140+ x ["role" ] == "dataset"
141+ and x ["data_format" ] == "cf_netcdf"
142+ and x ["data_type" ] == dtype
143+ ),
140144 (files [id ] for id in extant_ids ),
141145 )
142146 )
0 commit comments