Record-model and measurement helpers are private but imported across modules (_species, _contig, _Record)

Abierto
#193 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Start with the cited helpers in orfdata/model.py, orfdata/measurements.py, and the listed source adapter modules at revision d8ab958; trace their imports across the package. The issue suggests public names and documentation for shared helpers, plus consolidating GTF exon grouping. Done means shared helpers no longer rely on cross-module private imports, with tests covering the affected public behavior; the issue does not name specific tests.

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

Descripción

Problem

Core ORFdata helpers are written as _private functions and then imported across the package: 50 distinct _names at 91 import sites in 27 modules. #161 covers the resource-kind modules (viral_panel, liftover, genomes, catalog._BUNDLED/_installed/_plan), and #180 moves datasets._datacache/_digest/_installed_path into a public orfdata.cache. This issue covers the rest, mostly the record model and the measurement records, which no open issue or PR touches. Because of the underscore, these shared contracts carry no stability promise, and several (_species, _identifier, _metadata) have no docstring. One of them, _species, only aliases a public function.

Evidence

Read at d8ab958.

  • orfdata/model.py:227-228 _species(value) is return canonical_species(value), an alias of a public function. It is imported by catalog.py:28, genomes.py:43, liftover.py:238,322 and proteome.py:2135. liftover.py:172 imports a _species from catalog instead, which is the same object re-exported.
  • orfdata/model.py:219 _contig (contig comparison key) is imported by six modules: catalog.py:28, proteome.py:28, rna.py:189, _structure.py:131, liftover.py:75,128 and sources/riborf_native.py:11.
  • model._id_forms, _versioned, _exon_layout, _layout_offset, _same_assembly, _merge, _rna_layout, _layout_blocks and _transcript_match are imported by catalog.py, proteome.py and rna.py.
  • orfdata/measurements.py:72 class _Record supplies to_dict/from_dict for 13 public classes, including SourceAsset, DatasetManifest and Measurement in measurements.py, CatalogManifest (catalog_manifest.py:12), SearchReferenceSpec (search_reference.py:17), ReferenceMapping (reference_mapping.py:19) and AssayPair (pairing.py:49). measurements._identifier (:47) and _metadata (:52) are imported, between them, by catalog_manifest.py, reference_mapping.py, search_reference.py, pairing.py and dataset.py.
  • Source adapters import each other's internals: sources/riborf.py:48 imports ncorf_mammals._blocks and _transcripts, and sources/riborf_native.py:15-16 imports ncorf_mammals._ATTRIBUTE, _blocks, riborf._parsed and _rows.

Suggested fix

  • Replace _species with direct calls to canonical_species, and delete the alias.
  • Make _Record, _identifier and _metadata public and documented, for example orfdata.measurements.Record, require_identifier and freeze_metadata, or move them into a small orfdata.records module.
  • Give the shared transcript-layout helpers in model.py (_contig, _exon_layout, _layout_offset, _versioned, _id_forms) public names and numpy docstrings.
  • Move the GTF exon grouping that riborf, riborf_native and ncorf_mammals share into one public helper (see the GTF reader issue).

https://claude.ai/code/session_01JHJhwj29oDqoeu7TYd34Pi

Lenguaje dominante
Python
Estrellas
1
Forks
1
Merge medio
10 h 11 min
PR fusionados (30 d)
51

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 openvax/orfdata

Todos los issues de openvax/orfdata

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.