Skip to content

Commit

Permalink
changes to fix the filter period in report.py, check logs for further…
Browse files Browse the repository at this point in the history
… details
  • Loading branch information
rafatieppo committed Aug 11, 2024
1 parent 9ae45fb commit cb8c0ea
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 164 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ Agora selecione as opções disponíveis, clique em `Gravar configurações`, e
## Logs
<a name="logss"></a>

### Sun 2024-08-11 09:14:53 -04
- On `report.py` had an error to filter projetcts, paper, etc. It was because the `report.py` was reading `config.txt` instead `config_tk.txt.` The issues has been solved with a new functions in `support_functions.py`: `yearlimit_forfilter_tk()` , and some changes in `read_set_config.py` class: `configSetup`. The next step is to fix filter in `report.py`.

### Sat 2024-08-10 09:33:11 -04
- On Windows OS there ware a error from `report_resch_advi_runn_each` function and others functions that generates tables from advising data. The error was in `np.select`. For some reason, `np.select` could not find a math between `cond` and `choice` lists in those functions. I guess the error was a character error, because `cond` list has character like: `ç ã í`. To solve it, in `np.select` the default exit was replaced by `-99`

Expand Down
7 changes: 5 additions & 2 deletions app_lucyLattes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def set_configs_tk():
tk.messagebox.showwarning(title='Atencao',
message='Qualis nao selecionado')
else:
ls_descrip = ['ano inicial:', 'ano final:', 'qualis:',
'pg:', 'apagar csv_producao:',
'calcular indcapes:', 'calcular hwebsci:']
ls_configs = [str(var_yi.get()), str(var_yf.get()),
str(var_qls.rstrip()), str(var_pg.get()),
str(var_rm_csv.get()),
Expand All @@ -111,8 +114,8 @@ def set_configs_tk():
tk.messagebox.showinfo(message=msg_vars,
title='Confirme:')
with open('./config_tk.txt', 'w', encoding='UTF-8') as f:
for tt in ls_configs:
f.write(tt + '\n')
for idz in range(len(ls_configs)):
f.write(ls_descrip[idz] + ls_configs[idz] + '\n')
f.close()
return ls_configs

Expand Down
14 changes: 7 additions & 7 deletions config_tk.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
2010
2020
qualis_interdic_periodicos_2020.csv
Ambiente e Sistemas de Produção Agrícola
1
0
0
ano inicial:2013
ano final:2023
qualis:qualis_agrarias_periodicos_2020.csv
pg:Ambiente e Sistemas de Produção Agrícola
apagar csv_producao:1
calcular indcapes:0
calcular hwebsci:0
Binary file modified relatorio/figures/books_byyear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified relatorio/figures/chapters_byyear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified relatorio/figures/grapho_paper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified relatorio/figures/papers_byqualis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified relatorio/figures/papers_byyear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
296 changes: 148 additions & 148 deletions relatorio/relatorio_producao.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions resources/read_set_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ def __init__(self):
config_file = open('./config_tk.txt', 'r', encoding='UTF-8')
config_lines = list(config_file.readlines())
config_file.close()
self.run_hwebsci = config_lines[6] # .split(':')[1]
self.run_indcapes = config_lines[5] # .split(':')[1]
self.qf = config_lines[2] #.split(':')[1]
self.run_rmcsvfiles = config_lines[4] #.split(':')[1]
self.run_hwebsci = config_lines[6].split(':')[1]
self.run_indcapes = config_lines[5].split(':')[1]
self.qf = config_lines[2].split(':')[1]
self.run_rmcsvfiles = config_lines[4].split(':')[1]

def run_capes_index(self):
"""Return 1 or 0 from config.txt to run or not capes index."""
Expand Down
4 changes: 2 additions & 2 deletions resources/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from tabulate import tabulate
# from resources.support_functions import qualis_file
from resources.support_functions import pg_name
from resources.support_functions import yearlimit_forfilter
from resources.support_functions import yearlimit_forfilter_tk
from resources.support_functions import report_resch_teach
from resources.support_functions import report_resch_books
from resources.support_functions import report_resch_chapters
Expand Down Expand Up @@ -34,7 +34,7 @@ def report_write(qf):
"""Generate a report file with tables and plots."""
# qualqualis = qualis_file()
qualqualis = qf
lsyear_limits = yearlimit_forfilter()
lsyear_limits = yearlimit_forfilter_tk()
yyi, yyf = lsyear_limits[0], lsyear_limits[1]
with open('./relatorio/report_setup.json', 'r') as jfile:
rep_setup_file = json.load(jfile)
Expand Down
21 changes: 20 additions & 1 deletion resources/support_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def list_append_proj_members(team, idw, nn, nn_id, nn_coord):


def yearlimit_forfilter():
"""Return a list with initial and end year to filter data."""
"""Return a list with init and end year to filter data from confirg.txt"""
# config_file = open('./config.txt', 'r')
config_file = open('./config.txt', 'r', encoding='utf-8')
yearini = config_file.readlines()[5].split(':')[1]
Expand All @@ -178,6 +178,25 @@ def yearlimit_forfilter():
return ls_year_iniend


def yearlimit_forfilter_tk():
"""Return a list with init and end year to filter data from config_tk.txt"""
config_file = open('./config_tk.txt', 'r', encoding='utf-8')
yearini = config_file.readlines()[0].split(':')[1]
yearini = yearini.rstrip('\n')
yearini = yearini.strip(' ')
yearini = int(yearini)
config_file.close()
# config_file = open('./config.txt', 'r')
config_file = open('./config_tk.txt', 'r', encoding='utf-8')
yearend = config_file.readlines()[1].split(':')[1]
yearend = yearend.rstrip('\n')
yearend = yearend.strip(' ')
yearend = int(yearend)
config_file.close()
ls_year_iniend = [yearini, yearend]
return ls_year_iniend


# def run_capes_index():
# """Return 1 or 0 from config.txt to run or not capes index."""
# config_file = open('./config.txt', 'r', encoding='utf-8')
Expand Down

0 comments on commit cb8c0ea

Please sign in to comment.