Skip to content

feat(hidr): support f64 (832-byte) format with size auto-detection#92

Merged
rjmalves merged 1 commit into
mainfrom
feat/hidr-f64
Jun 10, 2026
Merged

feat(hidr): support f64 (832-byte) format with size auto-detection#92
rjmalves merged 1 commit into
mainfrom
feat/hidr-f64

Conversation

@rjmalves

@rjmalves rjmalves commented Jun 9, 2026

Copy link
Copy Markdown
Owner

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), além de corrigir lacunas no histórico de versões.

Funcionalidade

  • Novo registro RegistroUHEHidrF64 (832 bytes) para os coeficientes em 64 bits.
  • Hidr detecta 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 com version="f32" / version="f64".
  • Propriedade tamanho_registro e método converte_tamanho_registro para inspecionar e converter entre os formatos (a conversão f64→f32 perde precisão nos polinômios).

Documentação

  • Backfill da entrada 1.10.0 ausente no CHANGELOG (correção de precisão decimal nos FloatField do dadger).
  • Bump de versão para 1.11.0.

Testes

  • pytest ./tests327 testes (incluindo cobertura das 4 combinações 320/600 × f32/f64 e do tamanho não reconhecido).
  • ruff check, ruff format --check, mypy ./idecomp (strict, 97 arquivos) — sem problemas.

🤖 Generated with Claude Code

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.

Also backfill the missing 1.10.0 CHANGELOG entry and bump the version
to 1.11.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.82%. Comparing base (d7cab9a) to head (6cdff7c).

Files with missing lines Patch % Lines
idecomp/decomp/hidr.py 94.11% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #92      +/-   ##
==========================================
+ Coverage   92.80%   92.82%   +0.01%     
==========================================
  Files          93       93              
  Lines        8396     8442      +46     
==========================================
+ Hits         7792     7836      +44     
- Misses        604      606       +2     
Flag Coverage Δ
unittests 92.82% <94.73%> (+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.

@rjmalves rjmalves merged commit ef7f8e0 into main Jun 10, 2026
10 checks 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.

1 participant