Skip to content

fix para leitura de geração térmica por submercado/patamar no forward - #121

Merged
rjmalves merged 2 commits into
rjmalves:mainfrom
beralbdom:fix/geracao-termica-agrupada-submercado
Jul 1, 2026
Merged

fix para leitura de geração térmica por submercado/patamar no forward#121
rjmalves merged 2 commits into
rjmalves:mainfrom
beralbdom:fix/geracao-termica-agrupada-submercado

Conversation

@beralbdom

Copy link
Copy Markdown
Contributor

o nw grava a geração térmica em blocos por submercado, com o patamar variando dentro de cada bloco (para as classes daquele submercado). __converte_array_ute_patamar montava os rótulos assumindo o patamar variando sobre todas as classes de uma vez.

adicionado o teste test_geracao_termica_agrupada_por_submercado em tests/newave/test_forward.py

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.07%. Comparing base (798724b) to head (715cf69).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #121   +/-   ##
=======================================
  Coverage   91.06%   91.07%           
=======================================
  Files         526      526           
  Lines       18938    18948   +10     
=======================================
+ Hits        17246    17256   +10     
  Misses       1692     1692           
Flag Coverage Δ
unittests 91.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread inewave/newave/modelos/forward.py Outdated
indice = estagio * numero_forwards + serie
offset = tamanho_registro * indice
# offset = tamanho_registro * indice
offset = int(tamanho_registro) * int(indice)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acabei deixando passar isso, é um fix potencial pra overflow lendo todos os estagios de uma vez, mas não tem a ver com a leitura da gter

indice = estagio * numero_forwards + serie
# offset = tamanho_registro * indice
offset = int(tamanho_registro) * int(indice)
offset = tamanho_registro * indice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revertido

@rjmalves

rjmalves commented Jul 1, 2026

Copy link
Copy Markdown
Owner

perfeito! a implementação anterior contava com uma certa ordenação nos dados de entrada (que convenientemente existia nos casos testados), mas não era garantida

@rjmalves
rjmalves merged commit 386be3b into rjmalves:main Jul 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants