Repository navigation
build(types): mypy en connections/ con anotaciones completas - #192
Merged
Merged
Conversation
Segunda etapa de tipos del plan de calidad: mypy revisa connections/ con check_untyped_defs y exige anotaciones en todas sus funciones. Los 327 avisos eran casi todos bloques opcionales del modelo usados sin comprobar (end_plate, web, top, bottom, bolt, shear_lug, embedded_base). - core/model.required(valor, nombre) devuelve el bloque o da ValueError; reemplaza las lecturas directas donde la verificación ya suponía que el bloque existe. - shear/check.py: isinstance en cada rama del despacho por tipo. - Las llamadas a bolt_bearing/bolt_tearout pasan deformation_considered sin el diccionario **kw; panel_zone tipa su diccionario. - _bolted y _welded (momento) declaran que devuelven (resultados, P); check_envelope (placa base) declara que el gobernante puede ser None. Los resultados de los ejemplos no cambian. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014sGf7Ft5MPnvkqUgRxRwbg Signed-off-by: Claude <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.
Resumen
PR I.2 del plan de calidad, la segunda etapa de tipos. mypy revisa ahora
connections/concheck_untyped_defsy exige anotaciones en todas sus funciones (disallow_untyped_defs).Había 327 avisos. Casi todos venían de bloques opcionales del modelo que se usaban sin comprobar:
end_plate,web,top,bottomybolten momento, yshear_lugyembedded_baseen placa base.core/model.required(valor, nombre): devuelve el bloque o daValueErrorcon su nombre. Reemplaza las lecturas directas donde la verificación ya suponía que el bloque existe. Con datos válidos el resultado es el mismo; con un bloque ausente, el error dice cuál falta en lugar de unAttributeErrordeNone.shear/check.py: unisinstanceen cada rama del despacho por tipo de conexión.bolt_bearingybolt_tearoutpasandeformation_considereddirectamente, sin el diccionario**kw.panel_zonetipa su diccionario._boltedy_weldeddeclarabanlist[CheckResult]pero devuelven(resultados, P).check_envelopedeclara que el gobernante puede serNone.cope_reinforcement,optimize,single_plate,stiffened_seat,spliceydouble_angle_axialque no tenían.No cambia ningún cálculo. Falta
io/, la última etapa.Validación
python -m mypy: sin errores en 51 archivos.ruff check src testsypython -m pytest: 1163 pruebas pasan.Lista de verificación
ruff check src testsypython -m pytestpasan.CONTRIBUTING.mdydocs/tecnico/02-convenciones.md: Tipos yrequired).git commit -s.main.Generated by Claude Code