Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions DrivingCycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ def rescaleTV(self, constant):

def rescaleVA(self,constant):
'''return scaled VA data, also does not change in place'''
newVAdata = {}
for velocity in self.VAdata:
newVAdata[velocity*constant] = self.VAdata[velocity]*constant
newVAdata = {
velocity * constant: self.VAdata[velocity] * constant
for velocity in self.VAdata
}
Comment on lines -62 to +65
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DrivingSchedule.rescaleVA refactored with the following changes:

  • Convert for loop into dictionary comprehension (dict-comprehension)


def plotTV(self):
'''Should render a TV plot as a line graph over time, might allow
Expand Down