mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 11:48:03 +00:00
measure_station_time_up: Support csv, xlsx, and pickle for file outputs
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -155,6 +155,9 @@ Command example:
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.report_file.split('.')[-1] not in ['pkl','csv','xlsx']:
|
||||||
|
raise NameError('Please make sure your file name ends with either pkl, csv, or xlsx')
|
||||||
|
|
||||||
dictionary = dict()
|
dictionary = dict()
|
||||||
for num_sta in list(filter(lambda x: (x % 2 == 0), [*range(0, args.num_stations)])):
|
for num_sta in list(filter(lambda x: (x % 2 == 0), [*range(0, args.num_stations)])):
|
||||||
print(num_sta)
|
print(num_sta)
|
||||||
@@ -185,7 +188,14 @@ Command example:
|
|||||||
df['duration'] = df['Stations Up'] - df['Start']
|
df['duration'] = df['Stations Up'] - df['Start']
|
||||||
for variable in ['built duration', 'duration']:
|
for variable in ['built duration', 'duration']:
|
||||||
df[variable] = [x.total_seconds() for x in df[variable]]
|
df[variable] = [x.total_seconds() for x in df[variable]]
|
||||||
df.to_pickle(args.report_file)
|
if 'pkl' in args.report_file:
|
||||||
|
df.to_pickle(args.report_file)
|
||||||
|
if 'csv' in args.report_file:
|
||||||
|
df.to_csv(args.report_file)
|
||||||
|
if 'xlsx' in args.report_file:
|
||||||
|
df.to_excel(args.report_file)
|
||||||
|
else:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user