Skip to content

Commit

Permalink
Update rounding functions
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresLaverdeMarin committed Feb 22, 2021
1 parent 454a614 commit 706243f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3190,7 +3190,7 @@ def generate_gears(
"CalculatedGearsOutput": np.vstack(
(TraceTimes[GearSequenceStarts], GearNames)
).T,
"AverageGearOutput": np.round(AverageGear * 10000) / 10000,
"AverageGearOutput": np.round(AverageGear, 4),
"PowerCurveOutput": FullPowerCurve,
"AdjustedMax95EngineSpeed": Max95EngineSpeedFinal,
"TraceTimesOutput": TraceTimes,
Expand All @@ -3214,7 +3214,7 @@ def generate_gears(
"ClutchUndefinedOutput": ClutchUndefinedFinal.astype(int),
"ClutchHSTOutput": ClutchHST,
"GearCorrectionsOutput": CorrectionsCells,
"ChecksumVxGearOutput": np.round(ChecksumVxGear * 10000) / 10000,
"ChecksumVxGearOutput": np.round(ChecksumVxGear, 4),
}

return shift_points
10 changes: 4 additions & 6 deletions gearshift/core/model/scaleTrace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,14 +826,12 @@ def generate_speed_trace(

speed_trace = {
"RequiredToRatedPowerRatio": requiredToRatedPowerRatio,
"calculatedDownscalingFactor": np.round(
(calculatedDownscalingFactor * 1000)) / 1000
"calculatedDownscalingFactor": np.round(calculatedDownscalingFactor, 3)
,
"CalculatedDownscalingPercentage": (np.round(
(calculatedDownscalingFactor * 1000)) / 1000) * 100,
"TotalChecksum": np.round(np.sum(originalVehicleSpeeds) * 10) / 10,
"CalculatedDownscalingPercentage": (np.round(calculatedDownscalingFactor, 3)) * 100,
"TotalChecksum": np.round(np.sum(originalVehicleSpeeds), 1),
"MaxVehicleSpeed": format(np.max(compensatedVehicleSpeeds), '.1f'),
"TotalDistance": np.round(np.sum(compensatedVehicleSpeeds / 3.6) * 10) / 10,
"TotalDistance": np.round(np.sum(compensatedVehicleSpeeds / 3.6), 1),
"DistanceCompensatedPhaseLengths": np.add(
PhaseLengths, additionalSamples
).astype(int),
Expand Down

0 comments on commit 706243f

Please sign in to comment.