<commit_before># -*- coding:Utf-8 -*-

import os
import pdb
import sys
import pandas as pd
import numpy as np
import numpy.ma as ma
import scipy.io as io
from pylayers.util.project import *
from pylayers.mobility.ban.body import *
from pylayers.gis.layout import *

from moviepy.editor import *
from skimage import img_as_ubyte
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable


class CorSer(PyLayers):
    """ Hikob data handling from CORMORAN measurement campaign 11/06/2014

    """

    def __init__(self,serie=6,day=11,source='UR1'):

        try:
            self.rootdir =os.environ['CORMORAN']
        except:
            raise NameError('Please add a CORMORAN environement variable \
                            pointing to the data')

        # infos
        self.serie = serie
        self.day = day
        self.loadlog()

        # Measures

        if day==11:
            self.stcr = [1,2,3,4,10,11,12,32,33,34,35,9,17,18,19,20,25,26]
            self.shkb = [5,6,13,14,15,16,21,22,23,24,27,28,29,30,31,32,33,34,35]
            self.sbs  = [5,6,7,8,13,14,15,16,21,22,23,24,27,28,29,30,31,32,33,34,35]
            self.mocap = [5,6,7,8,17,21,22,23,24,34]

        if day==12:
            stcr = []
            shkb = []
            sbs  = []

        if serie in self.shkb:
            self.loadhkb(serie=serie,day=day,source=source)

        if serie in self.stcr:
            self.loadTCR(serie=serie,day=day)

        if serie in self.sbs:
            self.loadBS(serie=serie,day=day)

        if self.typ=='FULL':
            self._filename = 'Sc' + self.scenario + '_S' + str(self.serie) + '_R' + str(self.run) + '_' + self.typ.capitalize()
        else:
            self._filename = 'Sc' + self.scenario + '_S' + str(self.serie) + '_R' + str(self.run) + '_' + self.typ


        # Layout
        self.L= Layout(self.rootdir+'/POST-TREATED/MOCAP.ini')

        # Infrastructure Nodes
        self.loadinfranodes()

        # BODY
        self.subject = [str(self.log['Subject'].values[0])]
        if serie in self.mocap :
            self.loadbody(serie=serie,day=day)
            self._distancematrix()

        self.title1 = 'Scenario:'+str(self.scenario)+' Serie:'+str(self.serie)+' Run:'+str(self.run)
        self.title2 = 'Type:'+str(self.typ)+ ' Subject:'+str(self.subject[0])

    def __repr__(self):
        st = ''
        st = st + 'Day : '+ str(self.day)+'/07/2014'+'\n'
        st = st + 'Serie : '+ str(self.serie)+'\n'
        st = st + 'Scenario : '+str(self.scenario)+'\n'
        st = st + 'Run : '+ str(self.run)+'\n'
        st = st + 'Type : '+ str(self.typ)+'\n'
        st = st + 'Original Video Id : '+ str(self.video)+'\n'
        st = st + 'Subject(s) : '

        for k in self.subject:<commit_msg>bug fix in loading MOCAP.ini<commit_after># -*- coding:Utf-8 -*-

import os
import pdb
import sys
import pandas as pd
import numpy as np
import numpy.ma as ma
import scipy.io as io
from pylayers.util.project import *
from pylayers.mobility.ban.body import *
from pylayers.gis.layout import *

from moviepy.editor import *
from skimage import img_as_ubyte
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable


class CorSer(PyLayers):
    """ Hikob data handling from CORMORAN measurement campaign 11/06/2014

    """

    def __init__(self,serie=6,day=11,source='UR1'):

        try:
            self.rootdir =os.environ['CORMORAN']
        except:
            raise NameError('Please add a CORMORAN environement variable \
                            pointing to the data')

        # infos
        self.serie = serie
        self.day = day
        self.loadlog()

        # Measures

        if day==11:
            self.stcr = [1,2,3,4,10,11,12,32,33,34,35,9,17,18,19,20,25,26]
            self.shkb = [5,6,13,14,15,16,21,22,23,24,27,28,29,30,31,32,33,34,35]
            self.sbs  = [5,6,7,8,13,14,15,16,21,22,23,24,27,28,29,30,31,32,33,34,35]
            self.mocap = [5,6,7,8,17,21,22,23,24,34]

        if day==12:
            stcr = []
            shkb = []
            sbs  = []

        if serie in self.shkb:
            self.loadhkb(serie=serie,day=day,source=source)

        if serie in self.stcr:
            self.loadTCR(serie=serie,day=day)

        if serie in self.sbs:
            self.loadBS(serie=serie,day=day)

        if self.typ=='FULL':
            self._filename = 'Sc' + self.scenario + '_S' + str(self.serie) + '_R' + str(self.run) + '_' + self.typ.capitalize()
        else:
            self._filename = 'Sc' + self.scenario + '_S' + str(self.serie) + '_R' + str(self.run) + '_' + self.typ


        # Layout
        self.L= Layout('MOCAP.ini')

        # Infrastructure Nodes
        self.loadinfranodes()

        # BODY
        self.subject = [str(self.log['Subject'].values[0])]
        if serie in self.mocap :
            self.loadbody(serie=serie,day=day)
            self._distancematrix()

        self.title1 = 'Scenario:'+str(self.scenario)+' Serie:'+str(self.serie)+' Run:'+str(self.run)
        self.title2 = 'Type:'+str(self.typ)+ ' Subject:'+str(self.subject[0])

    def __repr__(self):
        st = ''
        st = st + 'Day : '+ str(self.day)+'/07/2014'+'\n'
        st = st + 'Serie : '+ str(self.serie)+'\n'
        st = st + 'Scenario : '+str(self.scenario)+'\n'
        st = st + 'Run : '+ str(self.run)+'\n'
        st = st + 'Type : '+ str(self.typ)+'\n'
        st = st + 'Original Video Id : '+ str(self.video)+'\n'
        st = st + 'Subject(s) : '

        for k in self.subject:
{'fraction_non_alphanumeric': 0.15730741540676746, 'fraction_numerical': 0.05363570914326854, 'mean_word_length': 2.2121387283236995, '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': '6933854', 'n_tokens_mistral': 2196, 'n_tokens_neox': 2034, 'n_words': 381}