From 3443048546cddf2a8e58788e35c0b7dd336dc69e Mon Sep 17 00:00:00 2001 From: KevinSuh6433 Date: Sat, 24 Jul 2021 17:44:42 -0400 Subject: [PATCH] app/location/ aggregate1 --- app/location/__init__.py | 7 ++++--- app/location/csbs.py | 8 +++++--- app/location/nyt.py | 7 ++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/location/__init__.py b/app/location/__init__.py index 1da5e9e5..4dee91a4 100644 --- a/app/location/__init__.py +++ b/app/location/__init__.py @@ -74,14 +74,14 @@ def serialize(self): } -class TimelinedLocation(Location): +class TimelinedLocation: """ A location with timelines. """ # pylint: disable=too-many-arguments - def __init__(self, id, country, province, coordinates, last_updated, timelines): - super().__init__( + def __init__(self, id, country, province, coordinates, last_updated, timelines, location): + Location.__init__( # General info. id, country, @@ -96,6 +96,7 @@ def __init__(self, id, country, province, coordinates, last_updated, timelines): # Set timelines. self.timelines = timelines + self.location = Location # pylint: disable=arguments-differ def serialize(self, timelines=False): diff --git a/app/location/csbs.py b/app/location/csbs.py index 649e8b22..01770c61 100644 --- a/app/location/csbs.py +++ b/app/location/csbs.py @@ -2,14 +2,14 @@ from . import Location -class CSBSLocation(Location): +class CSBSLocation: """ A CSBS (county) location. """ # pylint: disable=too-many-arguments,redefined-builtin - def __init__(self, id, state, county, coordinates, last_updated, confirmed, deaths): - super().__init__( + def __init__(self, id, state, county, coordinates, last_updated, confirmed, deaths, location): + Location.__init__( # General info. id, "US", @@ -24,6 +24,8 @@ def __init__(self, id, state, county, coordinates, last_updated, confirmed, deat self.state = state self.county = county + self.location = Location + def serialize(self, timelines=False): # pylint: disable=arguments-differ,unused-argument """ diff --git a/app/location/nyt.py b/app/location/nyt.py index ad92212e..f8d2156f 100644 --- a/app/location/nyt.py +++ b/app/location/nyt.py @@ -2,17 +2,18 @@ from . import TimelinedLocation -class NYTLocation(TimelinedLocation): +class NYTLocation: """ A NYT (county) Timelinedlocation. """ # pylint: disable=too-many-arguments,redefined-builtin - def __init__(self, id, state, county, coordinates, last_updated, timelines): - super().__init__(id, "US", state, coordinates, last_updated, timelines) + def __init__(self, id, state, county, coordinates, last_updated, timelines, timelinedLocation): + TimelinedLocation.__init__(id, "US", state, coordinates, last_updated, timelines) self.state = state self.county = county + self.timelinedLocation = TimelinedLocation def serialize(self, timelines=False): # pylint: disable=arguments-differ,unused-argument """