コード例 #1
0
    def __init__(self, type_of_car: str, model: str, name: str, **kwargs):
        """Constructor"""

        Car.__init__(self, type_of_car, model, name,
                     kwargs['amount_of_passengers'],
                     kwargs['amount_of_wheels'])
        Electricity.__init__(self, kwargs['voltage'], kwargs['amperage'])
コード例 #2
0
class ElectricityTest(unittest.TestCase):

    # Setup method
    def setUp(self):
        # Initiate class
        self.thisElec = Electricity()

    # Test for the list to csv
    def testReadAll(self):

        # check for the right execution
        self.assertTrue(self.thisElec.readAll())
コード例 #3
0
class ElectricityTest(unittest.TestCase):

    # Setup method
    def setUp(self):
        # Initiate class
        self.thisElec = Electricity()

    # Test for the list to csv
    def testConvrtLstToCSV(self):
        # Define a list
        testList = ["a", "b", "c"]

        # Pass the list
        testCSV = self.thisElec.convrtLstToCSV(testList)

        # check for the right execution
        self.assertEqual(testCSV, "a,b,c")
コード例 #4
0
ファイル: data.py プロジェクト: 3amMcspicy/nycbuildings
    def __init__(self, *args, **kwargs):
        self.power = ""
        # get data and merge on 'tds'
        if "Electricity" in args:
            self.power = "Electricity"
            self.data = Electricity().get_data(**kwargs)
        else:
            self.power = "Water"
            self.data = Water().get_data(**kwargs)
        self.coords = Coords().get_all_data()

        # cleanup the data
        self.merge_coords()
        self.add_year_column()
        self.set_dtypes()

        # compute df of mean consumption by (tds x year)
        self.tds_by_year = None
        self.get_by_year_data()

        # add other pre-computed dataframes here
        # ...
        self.tds_sum_year = None
        self.get_aggregate_data()
コード例 #5
0
 def setUp(self):
     # Initiate class
     self.thisElec = Electricity()
コード例 #6
0
ファイル: main.py プロジェクト: vgutin/project-1
def get_electricity_counter(counter_id):
    elect = Electricity()
    return elect.get_counter(counter_id)
コード例 #7
0
ファイル: main.py プロジェクト: vgutin/project-1
def get_electricity():
    elect = Electricity()
    return elect.get_all()