forked from lasicuefs/lasiclucylattes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextrafuns.py
123 lines (96 loc) · 2.71 KB
/
extrafuns.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# ------------------------------------------------------------
# packages
# ------------------------------------------------------------
# ------------------------------------------------------------
import numpy as np
import pandas as pd
import os
import glob
import re
import platform
# ------------------------------------------------------------
# Funcoes gerais
# ------------------------------------------------------------
def ss(x): return str(x)
def ff(x): return float(x)
def iint(x): return int(x)
def fun_result(x):
if x is None:
cc = 'VAZIO'
else:
cc = x.group(1)
return cc
def fun_uppercase(x):
x = x.upper()
return x
def fun_idd_unixwind(psys, lscsv, count):
if psys == 'Windows':
sp = str(lscsv[count].split('_')[1].split('\\')[1])
else:
sp = str(lscsv[count].split('_')[1].split('/')[1])
return sp
# ------------------------------------------------------------
# Funcoes index capes
# ------------------------------------------------------------
# nome ppg
def fun_nomeppg():
# config_file = open('./config.txt', 'r')
config_file = open('./config.txt', 'r', encoding='utf-8')
name_ppg = config_file.readlines()[8].split(':')[1]
name_ppg = name_ppg.rstrip('\n')
name_ppg = name_ppg.strip(' ')
name_ppg = fun_uppercase(name_ppg)
config_file.close()
return name_ppg
# identificando os ppg dos pesquisadores
def fun_ppgs():
df = pd.read_csv('./csv_producao/orientacoes_all.csv',
header=0, sep=',')
df = df.query('NATURE == "Dissertação de mestrado" \
or NATURE == "Tese de doutorado"')
df = df.query('TYPE != "CO_ORIENTADOR"').reset_index(drop=True)
df['COURSE'] = df['COURSE'].apply(fun_uppercase)
ls_ppgs = df['COURSE'].unique()
ls_ppgs.sort()
ls_ppgs = ", ".join(ls_ppgs)
return ls_ppgs
# indori
def fun_peso_defesa(x):
if x == 'Dissertação de mestrado':
pes = 1
elif x == 'Tese de doutorado':
pes = 2
else:
pes = 0
return pes
def fun_indori_classif(x):
if x < 0.15:
classif = 'DEFICIENTE'
elif x >= 0.15 and x <= 0.29:
classif = 'FRACO'
elif x > 0.29 and x <= 0.79:
classif = 'REGULAR'
elif x > 0.79 and x <= 1.19:
classif = 'BOM'
else:
classif = 'MUITO_BOM'
return classif
# indprodart
def fun_indprodart_classif(x):
if x == 'A1':
classif = 1
elif x == 'A2':
classif = 0.85
elif x == 'B1':
classif = 0.7
elif x == 'B2':
classif = 0.55
elif x == 'B3':
classif = 0.4
elif x == 'B4':
classif = 0.25
elif x == 'B5':
classif = 0.1
else:
classif = 0
return classif