Refactor structure handling within dataobjects?

Aperta
#296 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
105
Fork
29
Merge medio
2g 8h
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NCAS-CMS/pyfive

Tutte le issue di NCAS-CMS/pyfive

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.