Skip to content

Commit dca9280

Browse files
authored
CIM Data Container Abstraction (#361)
* add read data loader and data container for cim * update for lint issues * update for lint issues * add support for loading from binary files in CimRealDataLoader, and corresponding meta files * update for lint issue * add seed setting for cim real data mode * add cim data container abstraction * update to fix lint issues * update to fix lint issues * update test data for cim data field renaming * update cim data collection naming, remove vessel period from real data loader * update README header format * update convert command * update the README * update data field name in cim test data
1 parent cc71e23 commit dca9280

66 files changed

Lines changed: 1675 additions & 1199 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎maro/__misc__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
__version__ = "0.2.2a3"
66

7-
__data_version__ = "0.1"
7+
__data_version__ = "0.2"

‎maro/cli/maro_real_time_vis/back_end/nginx/static/config.json‎

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -294,299 +294,299 @@
294294
"routes": {
295295
"a3s": [
296296
{
297-
"distance": 320,
297+
"distance_to_next_port": 320,
298298
"port_name": "yantian_chn"
299299
},
300300
{
301-
"distance": 240,
301+
"distance_to_next_port": 240,
302302
"port_name": "sydney_aus"
303303
},
304304
{
305-
"distance": 80,
305+
"distance_to_next_port": 80,
306306
"port_name": "melbourne_aus"
307307
}
308308
],
309309
"asa": [
310310
{
311-
"distance": 320,
311+
"distance_to_next_port": 320,
312312
"port_name": "singapore_sgp"
313313
},
314314
{
315-
"distance": 260,
315+
"distance_to_next_port": 260,
316316
"port_name": "sydney_aus"
317317
},
318318
{
319-
"distance": 60,
319+
"distance_to_next_port": 60,
320320
"port_name": "melbourne_aus"
321321
}
322322
],
323323
"ate1": [
324324
{
325-
"distance": 160,
325+
"distance_to_next_port": 160,
326326
"port_name": "newYork_usa"
327327
},
328328
{
329-
"distance": 240,
329+
"distance_to_next_port": 240,
330330
"port_name": "bremerhaven_ger"
331331
},
332332
{
333-
"distance": 40,
333+
"distance_to_next_port": 40,
334334
"port_name": "leHavre_fra"
335335
}
336336
],
337337
"gex1": [
338338
{
339-
"distance": 220,
339+
"distance_to_next_port": 220,
340340
"port_name": "montreal_can"
341341
},
342342
{
343-
"distance": 220,
343+
"distance_to_next_port": 220,
344344
"port_name": "bremerhaven_ger"
345345
},
346346
{
347-
"distance": 40,
347+
"distance_to_next_port": 40,
348348
"port_name": "leHavre_fra"
349349
}
350350
],
351351
"ktx5": [
352352
{
353-
"distance": 240,
353+
"distance_to_next_port": 240,
354354
"port_name": "singapore_sgp"
355355
},
356356
{
357-
"distance": 80,
357+
"distance_to_next_port": 80,
358358
"port_name": "yantian_chn"
359359
},
360360
{
361-
"distance": 140,
361+
"distance_to_next_port": 140,
362362
"port_name": "yokohama_jpn"
363363
}
364364
],
365365
"ll4": [
366366
{
367-
"distance": 80,
367+
"distance_to_next_port": 80,
368368
"port_name": "shanghai_chn"
369369
},
370370
{
371-
"distance": 60,
371+
"distance_to_next_port": 60,
372372
"port_name": "yantian_chn"
373373
},
374374
{
375-
"distance": 80,
375+
"distance_to_next_port": 80,
376376
"port_name": "singapore_sgp"
377377
},
378378
{
379-
"distance": 380,
379+
"distance_to_next_port": 380,
380380
"port_name": "leHavre_fra"
381381
},
382382
{
383-
"distance": 80,
383+
"distance_to_next_port": 80,
384384
"port_name": "bremerhaven_ger"
385385
},
386386
{
387-
"distance": 420,
387+
"distance_to_next_port": 420,
388388
"port_name": "singapore_sgp"
389389
},
390390
{
391-
"distance": 200,
391+
"distance_to_next_port": 200,
392392
"port_name": "qingdao_chn"
393393
},
394394
{
395-
"distance": 80,
395+
"distance_to_next_port": 80,
396396
"port_name": "pusan_kor"
397397
}
398398
],
399399
"pcc1": [
400400
{
401-
"distance": 240,
401+
"distance_to_next_port": 240,
402402
"port_name": "qingdao_chn"
403403
},
404404
{
405-
"distance": 40,
405+
"distance_to_next_port": 40,
406406
"port_name": "shanghai_chn"
407407
},
408408
{
409-
"distance": 240,
409+
"distance_to_next_port": 240,
410410
"port_name": "princeRupert_can"
411411
},
412412
{
413-
"distance": 120,
413+
"distance_to_next_port": 120,
414414
"port_name": "losAngeles_usa"
415415
},
416416
{
417-
"distance": 100,
417+
"distance_to_next_port": 100,
418418
"port_name": "oakland_usa"
419419
}
420420
],
421421
"pcc2": [
422422
{
423-
"distance": 80,
423+
"distance_to_next_port": 80,
424424
"port_name": "shanghai_chn"
425425
},
426426
{
427-
"distance": 280,
427+
"distance_to_next_port": 280,
428428
"port_name": "losAngeles_usa"
429429
},
430430
{
431-
"distance": 160,
431+
"distance_to_next_port": 160,
432432
"port_name": "seattle_usa"
433433
},
434434
{
435-
"distance": 280,
435+
"distance_to_next_port": 280,
436436
"port_name": "qingdao_chn"
437437
}
438438
],
439439
"pnw1": [
440440
{
441-
"distance": 80,
441+
"distance_to_next_port": 80,
442442
"port_name": "yantian_chn"
443443
},
444444
{
445-
"distance": 260,
445+
"distance_to_next_port": 260,
446446
"port_name": "vancouver_can"
447447
},
448448
{
449-
"distance": 80,
449+
"distance_to_next_port": 80,
450450
"port_name": "seattle_usa"
451451
},
452452
{
453-
"distance": 320,
453+
"distance_to_next_port": 320,
454454
"port_name": "pusan_kor"
455455
}
456456
],
457457
"pnw2": [
458458
{
459-
"distance": 200,
459+
"distance_to_next_port": 200,
460460
"port_name": "singapore_sgp"
461461
},
462462
{
463-
"distance": 120,
463+
"distance_to_next_port": 120,
464464
"port_name": "yantian_chn"
465465
},
466466
{
467-
"distance": 80,
467+
"distance_to_next_port": 80,
468468
"port_name": "shanghai_chn"
469469
},
470470
{
471-
"distance": 60,
471+
"distance_to_next_port": 60,
472472
"port_name": "pusan_kor"
473473
},
474474
{
475-
"distance": 200,
475+
"distance_to_next_port": 200,
476476
"port_name": "seattle_usa"
477477
},
478478
{
479-
"distance": 40,
479+
"distance_to_next_port": 40,
480480
"port_name": "vancouver_can"
481481
},
482482
{
483-
"distance": 520,
483+
"distance_to_next_port": 520,
484484
"port_name": "qingdao_chn"
485485
},
486486
{
487-
"distance": 60,
487+
"distance_to_next_port": 60,
488488
"port_name": "shanghai_chn"
489489
}
490490
],
491491
"saf3": [
492492
{
493-
"distance": 80,
493+
"distance_to_next_port": 80,
494494
"port_name": "qingdao_chn"
495495
},
496496
{
497-
"distance": 40,
497+
"distance_to_next_port": 40,
498498
"port_name": "shanghai_chn"
499499
},
500500
{
501-
"distance": 60,
501+
"distance_to_next_port": 60,
502502
"port_name": "yantian_chn"
503503
},
504504
{
505-
"distance": 80,
505+
"distance_to_next_port": 80,
506506
"port_name": "singapore_sgp"
507507
},
508508
{
509-
"distance": 260,
509+
"distance_to_next_port": 260,
510510
"port_name": "durban_sau"
511511
},
512512
{
513-
"distance": 360,
513+
"distance_to_next_port": 360,
514514
"port_name": "yantian_chn"
515515
}
516516
],
517517
"tla2": [
518518
{
519-
"distance": 60,
519+
"distance_to_next_port": 60,
520520
"port_name": "qingdao_chn"
521521
},
522522
{
523-
"distance": 60,
523+
"distance_to_next_port": 60,
524524
"port_name": "shanghai_chn"
525525
},
526526
{
527-
"distance": 80,
527+
"distance_to_next_port": 80,
528528
"port_name": "yantian_chn"
529529
},
530530
{
531-
"distance": 100,
531+
"distance_to_next_port": 100,
532532
"port_name": "singapore_sgp"
533533
},
534534
{
535-
"distance": 460,
535+
"distance_to_next_port": 460,
536536
"port_name": "itagual_bra"
537537
},
538538
{
539-
"distance": 20,
539+
"distance_to_next_port": 20,
540540
"port_name": "santos_bra"
541541
},
542542
{
543-
"distance": 580,
543+
"distance_to_next_port": 580,
544544
"port_name": "singapore_sgp"
545545
},
546546
{
547-
"distance": 140,
547+
"distance_to_next_port": 140,
548548
"port_name": "yantian_chn"
549549
},
550550
{
551-
"distance": 80,
551+
"distance_to_next_port": 80,
552552
"port_name": "shanghai_chn"
553553
}
554554
],
555555
"tlp1": [
556556
{
557-
"distance": 100,
557+
"distance_to_next_port": 100,
558558
"port_name": "yantian_chn"
559559
},
560560
{
561-
"distance": 60,
561+
"distance_to_next_port": 60,
562562
"port_name": "shanghai_chn"
563563
},
564564
{
565-
"distance": 60,
565+
"distance_to_next_port": 60,
566566
"port_name": "qingdao_chn"
567567
},
568568
{
569-
"distance": 40,
569+
"distance_to_next_port": 40,
570570
"port_name": "pusan_kor"
571571
},
572572
{
573-
"distance": 260,
573+
"distance_to_next_port": 260,
574574
"port_name": "manzanillo_mex"
575575
},
576576
{
577-
"distance": 140,
577+
"distance_to_next_port": 140,
578578
"port_name": "sanAntonio_par"
579579
},
580580
{
581-
"distance": 180,
581+
"distance_to_next_port": 180,
582582
"port_name": "manzanillo_mex"
583583
},
584584
{
585-
"distance": 260,
585+
"distance_to_next_port": 260,
586586
"port_name": "yokohama_jpn"
587587
},
588588
{
589-
"distance": 60,
589+
"distance_to_next_port": 60,
590590
"port_name": "shanghai_chn"
591591
}
592592
]

‎maro/cli/maro_real_time_vis/back_end/vis_app/data_process/request/request_vessel.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ def process_vessel_data(db_vessel_data: json, start_tick: str) -> json:
8787
route_distance = cim_information["routes"][item]
8888
route_distance_length = len(route_distance)
8989
prev = 0
90-
route_distance[0]["distance"] = 0
90+
route_distance[0]["distance_to_next_port"] = 0
9191
for index in range(1, route_distance_length):
92-
route_distance[index]["distance"] = route_distance[index]["distance"] + prev
93-
prev = route_distance[index]["distance"]
92+
route_distance[index]["distance_to_next_port"] = route_distance[index]["distance_to_next_port"] + prev
93+
prev = route_distance[index]["distance_to_next_port"]
9494
original_vessel_data = get_data_in_format(db_vessel_data)
9595

9696
frame_index_num = len(original_vessel_data["tick"].unique())
@@ -165,7 +165,7 @@ def get_single_snapshot_vessel_data(
165165
route_distance_info = cim_information["routes"][item]
166166
for dis in route_distance_info:
167167
if dis["port_name"] == start_port:
168-
vessel["start"] = dis["distance"]
168+
vessel["start"] = dis["distance_to_next_port"]
169169
vessel_in_output.append(vessel)
170170
output.append({"name": item, "vessel": vessel_in_output})
171171

0 commit comments

Comments
 (0)