From 67b1e5fd40a88d0514f6e391332e998532067e07 Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Tue, 16 Sep 2025 11:14:15 -0500 Subject: [PATCH] Reformat source code --- test/fixtures/boat_example.jl | 41 ++++++++++++++--------------------- test/src/RELOGT.jl | 1 + test/src/model/dist_test.jl | 16 ++++++++++++-- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/test/fixtures/boat_example.jl b/test/fixtures/boat_example.jl index e059bfb..1b01b2e 100644 --- a/test/fixtures/boat_example.jl +++ b/test/fixtures/boat_example.jl @@ -121,10 +121,8 @@ function run_boat_example() "initial capacity (tonne)" => 0, ) - lat_lon_dict(city_location) = dict( - "latitude (deg)" => city_location[1], - "longitude (deg)" => city_location[2], - ) + lat_lon_dict(city_location) = + dict("latitude (deg)" => city_location[1], "longitude (deg)" => city_location[2]) data = dict( "parameters" => parameters, @@ -132,36 +130,29 @@ function run_boat_example() dict("Nail" => prod, "Wood" => prod, "NewBoat" => prod, "UsedBoat" => prod), "centers" => merge( dict( - "NailFactory ($city_name)" => merge( - nail_factory, - lat_lon_dict(city_location) - ) for (city_name, city_location) in cities_b + "NailFactory ($city_name)" => + merge(nail_factory, lat_lon_dict(city_location)) for + (city_name, city_location) in cities_b ), dict( - "Forest ($city_name)" => merge( - forest, - lat_lon_dict(city_location) - ) for (city_name, city_location) in cities_b + "Forest ($city_name)" => merge(forest, lat_lon_dict(city_location)) + for (city_name, city_location) in cities_b ), dict( - "Retail ($city_name)" => merge( - retail, - lat_lon_dict(city_location) - ) for (city_name, city_location) in cities_a + "Retail ($city_name)" => merge(retail, lat_lon_dict(city_location)) + for (city_name, city_location) in cities_a ), ), "plants" => merge( dict( - "BoatFactory ($city_name)" => merge( - boat_factory, - lat_lon_dict(city_location) - ) for (city_name, city_location) in cities_a + "BoatFactory ($city_name)" => + merge(boat_factory, lat_lon_dict(city_location)) for + (city_name, city_location) in cities_a ), dict( - "RecyclingPlant ($city_name)" => merge( - recycling_plant, - lat_lon_dict(city_location) - ) for (city_name, city_location) in cities_a + "RecyclingPlant ($city_name)" => + merge(recycling_plant, lat_lon_dict(city_location)) for + (city_name, city_location) in cities_a ), ), ) @@ -186,4 +177,4 @@ function run_boat_example() RELOG.write_transportation_report(model, fixture("boat_example/transportation.csv")) return -end \ No newline at end of file +end diff --git a/test/src/RELOGT.jl b/test/src/RELOGT.jl index d61a7db..f1ac80b 100644 --- a/test/src/RELOGT.jl +++ b/test/src/RELOGT.jl @@ -24,6 +24,7 @@ function runtests() model_dist_test() report_tests() end + return end function format() diff --git a/test/src/model/dist_test.jl b/test/src/model/dist_test.jl index fb545bd..c0b6e75 100644 --- a/test/src/model/dist_test.jl +++ b/test/src/model/dist_test.jl @@ -6,8 +6,20 @@ using RELOG function model_dist_test() # Euclidean distance between Chicago and Indianapolis - @test RELOG._calculate_distance(41.866, -87.656, 39.764, -86.148, RELOG.EuclideanDistance()) == 265.818 + @test RELOG._calculate_distance( + 41.866, + -87.656, + 39.764, + -86.148, + RELOG.EuclideanDistance(), + ) == 265.818 # Driving distance between Chicago and Indianapolis - @test RELOG._calculate_distance(41.866, -87.656, 39.764, -86.148, RELOG.KnnDrivingDistance()) == 316.43 + @test RELOG._calculate_distance( + 41.866, + -87.656, + 39.764, + -86.148, + RELOG.KnnDrivingDistance(), + ) == 316.43 end