feat(hidr): suporte ao formato f64 (832 bytes) com detecção automática#93
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
==========================================
+ Coverage 95.93% 95.94% +0.01%
==========================================
Files 103 103
Lines 7740 7786 +46
==========================================
+ Hits 7425 7470 +45
- Misses 315 316 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add RegistroUHEHidrF64 for hidr.dat files that store the volume-cota and cota-area polynomial coefficients in double precision (832-byte records). Hidr auto-detects the format from the file size, recognizing cadastros of 320 or 600 usinas in 792- or 832-byte records, and can convert between precisions via converte_tamanho_registro. Adds a real f64 hidr.dat fixture (320 usinas, full double precision). Also vectorize the cadastro DataFrame construction (build in bulk instead of row-by-row), matching idecomp and substantially speeding up hidr.dat reads; integer columns now use the nullable Int64 dtype. Releases as 1.3.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumo
Adiciona suporte ao formato estendido do arquivo
hidr.dat, em que os coeficientes dos polinômios volume-cota e cota-área são armazenados em precisão dupla (registros de 832 bytes). Paridade com a funcionalidade equivalente doidecomp.Funcionalidade
RegistroUHEHidrF64(832 bytes) para os coeficientes em 64 bits.Hidrdetecta o formato automaticamente pelo tamanho do arquivo, reconhecendo cadastros de 320 ou 600 usinas em registros de 792 ou 832 bytes. Tamanhos não reconhecidos geram aviso e assumem o formato f32. A detecção pode ser forçada comversion="f32"/version="f64".tamanho_registroe métodoconverte_tamanho_registropara inspecionar e converter entre os formatos (a conversão f64→f32 perde precisão nos polinômios).Versão
CHANGELOG.md.Notas
cfinterface>=1.9.0(o recurso não depende do modocompact).Testes
pytest ./tests— 579 testes (16 novos para ohidr, cobrindo as 4 combinações 320/600 × f32/f64, conversões e o tamanho não reconhecido).ruff check,ruff format --check,mypy ./idessem(strict, 108 arquivos) — sem problemas.🤖 Generated with Claude Code