Skip to content

Commit

Permalink
more fixes for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruchon, Matthew authored and Bruchon, Matthew committed Jan 13, 2025
1 parent 1ca7827 commit 615f8e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/altrios/train_planner/schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def generate_dispatch_details(
schedule = (demand
.select(pl.exclude("Number_of_Trains").repeat_by("Number_of_Trains").explode())
.pipe(utilities.allocateItems, target = "Number_of_Cars_Loaded", grouping_vars = grouping_vars)
.drop("Percent_Within_Group")
.drop("Percent_Within_Group_Cumulative")
.pipe(utilities.allocateItems, target = "Number_of_Cars_Empty", grouping_vars = grouping_vars)
.group_by(pl.exclude("Number_of_Cars_Empty", "Number_of_Cars_Loaded"))
.agg(pl.col("Number_of_Cars_Empty", "Number_of_Cars_Loaded"))
Expand All @@ -514,7 +514,7 @@ def generate_dispatch_details(
pl.col("HP_Required_Per_Ton_Empty").mul("Tons_Per_Car_Empty").mul("Number_of_Cars_Empty")
).alias("HP_Required")
)
.sort("Origin", "Destination", "Percent_Within_Group", "Train_Type")
.sort("Origin", "Destination", "Percent_Within_Group_Cumulative", "Train_Type")
.with_columns(
(hours * 1.0 / pl.len().over("Origin", "Destination")).alias("Interval")
)
Expand Down

0 comments on commit 615f8e0

Please sign in to comment.