Refactor structure handling within dataobjects?

Abierto
#296 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

Start by perusing the format documentation, then inspect the listed flag-dependent parsing paths in dataobjects: _parse_v2_header, _get_attributes_from_attr_info, _decode_link_info_msg, _decode_link_msg, and determine_data_shape. Done means identifying other unhandled flag-dependent cases and assessing whether a shared wrapper is appropriate; the issue does not specify a particular implementation.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

In PR #295 which fixes #294, there is an expedient bug fix. The question arises as to whether this bug fix is an example of a pattern which should be refactored.

AI surfaced the following candidates for consideration of using a wrapper around unpack_structure_from which uses flags and structure variants.

  • _parse_v2_header conditionally reads timestamps and adjusts the creation-order size based on flag bits (line 167).
  • _get_attributes_from_attr_info skips an optional field and conditionally reads another address (line 250). The file already defines alternate structure descriptions for this message, which suggests this case is a natural candidate (line 914).
  • _decode_link_info_msg chooses between two address layouts based on a flag (line 803); both layouts are already defined (line 1015).
  • _decode_link_msg has several independently optional fields and a flag-selected name-length format (line 702).
    determine_data_shape conditionally reads maximum dimensions based on a flag (line 866).

Rather than rushing into something to handle these cases, it's probably worth a serious perusal of the documentation to see if we can surface other unhandled examples of flag dependent behaviour.

Lenguaje dominante
Python
Estrellas
105
Forks
29
Merge medio
2 d 8 h
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NCAS-CMS/pyfive

Todos los issues de NCAS-CMS/pyfive

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.