fix: Correct reference to Sequence

This commit is contained in:
Victor Engmark 2023-07-26 11:23:28 +12:00
parent 393db776e1
commit c079eb9507
4 changed files with 5 additions and 6 deletions

View File

@ -175,7 +175,7 @@ function.
import collections import collections
... ...
class RideData(collections.Sequence): class RideData(collections.abc.Sequence):
def __init__(self): def __init__(self):
self.routes = [] # Columns self.routes = [] # Columns
self.dates = [] self.dates = []
@ -204,7 +204,7 @@ into 4 separate `append()` operations.
# readrides.py # readrides.py
... ...
class RideData(collections.Sequence): class RideData(collections.abc.Sequence):
def __init__(self): def __init__(self):
# Each value is a list with all of the values (a column) # Each value is a list with all of the values (a column)
self.routes = [] self.routes = []

View File

@ -93,7 +93,7 @@ def read_rides_as_columns(filename):
# The great "fake" # The great "fake"
import collections import collections
class RideData(collections.Sequence): class RideData(collections.abc.Sequence):
def __init__(self): def __init__(self):
# Each value is a list with all of the values (a column) # Each value is a list with all of the values (a column)
self.routes = [] self.routes = []

View File

@ -88,7 +88,7 @@ def read_rides_as_columns(filename):
# The great "fake" # The great "fake"
import collections import collections
class RideData(collections.Sequence): class RideData(collections.abc.Sequence):
def __init__(self): def __init__(self):
# Each value is a list with all of the values (a column) # Each value is a list with all of the values (a column)
self.routes = [] self.routes = []

View File

@ -3,7 +3,7 @@
import collections import collections
import csv import csv
class DataCollection(collections.Sequence): class DataCollection(collections.abc.Sequence):
def __init__(self, columns): def __init__(self, columns):
self.column_names = list(columns) self.column_names = list(columns)
self.column_data = list(columns.values()) self.column_data = list(columns.values())
@ -34,4 +34,3 @@ if __name__ == '__main__':
tracemalloc.start() tracemalloc.start()
data = read_csv_as_columns('../../Data/ctabus.csv', [intern, intern, intern, int]) data = read_csv_as_columns('../../Data/ctabus.csv', [intern, intern, intern, int])
print(tracemalloc.get_traced_memory()) print(tracemalloc.get_traced_memory())