<commit_before>from django.db import models
from syn.io import load_net
from synweb.settings import DB_DIR


class Network(models.Model):
    name = models.CharField(max_length=200)
    nodes = models.PositiveIntegerField(default=0)
    edges = models.PositiveIntegerField(default=0)
    notes = models.TextField()

    def getnet(self):
        net_path = '%s/net_%d' % (DB_DIR, self.id)
        net = load_net(net_path)
        return net


class DRMap(models.Model):
    net = models.ForeignKey('Network')
    bins = models.PositiveIntegerField()
    data = models.TextField()
    image = models.TextField()
    min_hor = models.FloatField()
    max_hor = models.FloatField()
    min_ver = models.FloatField()
    max_ver = models.FloatField()
<commit_msg>changing relation between net and drmap models, andding steps to drmap<commit_after>from django.db import models
from syn.io import load_net
from synweb.settings import DB_DIR


class Network(models.Model):
    name = models.CharField(max_length=200)
    nodes = models.PositiveIntegerField(default=0)
    edges = models.PositiveIntegerField(default=0)
    notes = models.TextField()
    drmap = models.ForeignKey('DRMap', related_name='+', null=True, blank=True)

    def getnet(self):
        net_path = '%s/net_%d' % (DB_DIR, self.id)
        net = load_net(net_path)
        return net


class DRMap(models.Model):
    net = models.ForeignKey('Network', related_name='+')
    bins = models.PositiveIntegerField()
    steps = models.PositiveIntegerField()
    data = models.TextField()
    min_hor = models.FloatField()
    max_hor = models.FloatField()
    min_ver = models.FloatField()
    max_ver = models.FloatField()

{'fraction_non_alphanumeric': 0.11223277909738717, 'fraction_numerical': 0.0059382422802850355, 'mean_word_length': 3.773371104815864, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3184644', 'n_tokens_mistral': 535, 'n_tokens_neox': 515, 'n_words': 116}