<commit_before>from django.db import models

# Database model
# Author: inkibus (<NAME>.)

''' Commented out as this tables doesn't serve any purpose other than storing its primary key
class session(models.Model):
    # Every time something in the production system is changed, a new Session is stored, to have coherent data
    # Integer of the current session in which a carrier is in the system
    # This cannot be the primary key because the sessionNumber is dependent on the read CSV file
    sessionNumber = models.IntegerField(primary_key=True, unique=True, default=0)

    # Display the session number of this database entry
    def __unicode__(self): # in python 3.3 this is __str__(self):
        return "Session " + str(self.sessionNumber)


class carrier(models.Model):
    # Integer that identifies the carrier
    # This cannot be the primary key because the carrierNumber is dependent on the read CSV file
    carrierNumber = models.IntegerField(primary_key=True, unique=True, default=0)

    # Display the session number of this database entry
    def __unicode__(self):  # in python 3.3 this is __str__(self):
        return "Carrier " + str(self.carrierNumber)

class iteration(models.Model):
    # Integer of the current Iteration in which a carrier is in the system
    # This number can get big so it is initialized as BigIntegerField
    # This cannot be the primary key because the iterationNumber is dependent on the read CSV file
    iterationNumber = models.BigIntegerField(primary_key=True, unique=True, default=0)

    # Display the session number of this database entry
    def __unicode__(self):  # in python 3.3 this is __str__(self):
        return "Iteration " + str(self.iterationNumber)
'''

# This table stores all the relevant data for every data point recorded by the sensors
class timestampdata(models.Model):
    # It is not necessary to explicitly declare a primary key when using django models

    ''' Commented out as these tables don't serve any purpose other than storing their keys
    # The Session that the data is recorded for
    #fid_Session = models.ForeignKey(session, on_delete=models.CASCADE)
    # The Carrier that the data is recorded for
    #fid_Carrier = models.ForeignKey(carrier, on_delete=models.CASCADE)
    # The Iteration that the data is recorded for
    #fid_Iteration = models.ForeignKey(iteration, on_delete=models.CASCADE)
    '''

    # Integer of the current session in which a carrier is in the system
    session = models.IntegerField()
    # Integer that identifies the carrier
    carrier = models.IntegerField()
    # Integer of the current Iteration in which a carrier is in the system
    iteration = models.IntegerField()


    # The time (in ms) from the beginning of the Iteration that the data is recorded
    timeStamp = models.BigIntegerField()
    # The position (relative to the beginning of the current drive, in mm) that the carrier is on
    positionOnDrive = models.FloatField()
    # The absolute position (relative to the beginning of the first drive, in mm) that the carrier is at
    positionAbsolute = models.FloatField()
    # The speed that the carrier has at that timeStamp (derived from the positionAbsolute and the timeStamps)
    speed = models.FloatField()
    # The acceleration that the carrier has at that timeStamp (derived from the positionAbsolute and the timeStamps)
    acceleration = models.FloatField()
    # The total amount of energy consumed by the carrier since the last timeStamp (in W)
    energyConsumption = models.FloatField()

    # Display the session, carrier and iteration and time stamp number of this database entry
    def __unicode__(self):  # in python 3.3 this is __str__(self):
        return "S_" + str(self.fid_Session) + "_C_" + str(self.fid_Carrier) + "_I_" + str(self.fid_Iteration) \<commit_msg>timestampdata no longer saves the positionOnDrive, it rather saves the drive that the carrier currently is on.<commit_after>from django.db import models

# Database model
# Author: inkibus (<NAME>.)

''' Commented out as this tables doesn't serve any purpose other than storing its primary key
class session(models.Model):
    # Every time something in the production system is changed, a new Session is stored, to have coherent data
    # Integer of the current session in which a carrier is in the system
    # This cannot be the primary key because the sessionNumber is dependent on the read CSV file
    sessionNumber = models.IntegerField(primary_key=True, unique=True, default=0)

    # Display the session number of this database entry
    def __unicode__(self): # in python 3.3 this is __str__(self):
        return "Session " + str(self.sessionNumber)


class carrier(models.Model):
    # Integer that identifies the carrier
    # This cannot be the primary key because the carrierNumber is dependent on the read CSV file
    carrierNumber = models.IntegerField(primary_key=True, unique=True, default=0)

    # Display the session number of this database entry
    def __unicode__(self):  # in python 3.3 this is __str__(self):
        return "Carrier " + str(self.carrierNumber)

class iteration(models.Model):
    # Integer of the current Iteration in which a carrier is in the system
    # This number can get big so it is initialized as BigIntegerField
    # This cannot be the primary key because the iterationNumber is dependent on the read CSV file
    iterationNumber = models.BigIntegerField(primary_key=True, unique=True, default=0)

    # Display the session number of this database entry
    def __unicode__(self):  # in python 3.3 this is __str__(self):
        return "Iteration " + str(self.iterationNumber)
'''

# This table stores all the relevant data for every data point recorded by the sensors
class timestampdata(models.Model):
    # It is not necessary to explicitly declare a primary key when using django models

    ''' Commented out as these tables don't serve any purpose other than storing their keys
    # The Session that the data is recorded for
    #fid_Session = models.ForeignKey(session, on_delete=models.CASCADE)
    # The Carrier that the data is recorded for
    #fid_Carrier = models.ForeignKey(carrier, on_delete=models.CASCADE)
    # The Iteration that the data is recorded for
    #fid_Iteration = models.ForeignKey(iteration, on_delete=models.CASCADE)
    '''

    # Integer of the current session in which a carrier is in the system
    session = models.IntegerField()
    # Integer that identifies the carrier
    carrier = models.IntegerField()
    # Integer of the current Iteration in which a carrier is in the system
    iteration = models.IntegerField()


    # The time (in ms) from the beginning of the Iteration that the data is recorded
    timeStamp = models.BigIntegerField()
    # The drive that the carrier was on when this timeStamp was recorded
    drive = models.IntegerField()
    # The absolute position (relative to the beginning of the first drive, in mm) that the carrier is at
    positionAbsolute = models.FloatField()
    # The speed that the carrier has at that timeStamp (derived from the positionAbsolute and the timeStamps)
    speed = models.FloatField()
    # The acceleration that the carrier has at that timeStamp (derived from the positionAbsolute and the timeStamps)
    acceleration = models.FloatField()
    # The total amount of energy consumed by the carrier since the last timeStamp (in W)
    energyConsumption = models.FloatField()

    # Display the session, carrier and iteration and time stamp number of this database entry
    def __unicode__(self):  # in python 3.3 this is __str__(self):
        return "S_" + str(self.fid_Session) + "_C_" + str(self.fid_Carrier) + "_I_" + str(self.fid_Iteration) \
{'fraction_non_alphanumeric': 0.06267769449470147, 'fraction_numerical': 0.002843111915223572, 'mean_word_length': 3.8581293157564343, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6244771', 'n_tokens_mistral': 2039, 'n_tokens_neox': 1959, 'n_words': 937}