build.py downloads rebuild inputs without DataCache: no atomic write, truncated files fail checksum until deleted
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
- 65/100
Línea de trabajo
Start in orfdata/build.py at prepare_sources and RemoteZip, then read the datacache.fetch_file API to understand its verification and retry options. Run the existing tests and inspect how source and derived files are written. Done means an interrupted download leaves no final-path file, a later run succeeds without manual cleanup, and a test covers the interrupted-download case.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
python -m orfdata.build --prepare-sources downloads the uORF rebuild inputs with its own code in orfdata/build.py (prepare_sources and RemoteZip), not through DataCache. ORFdata already depends on DataCache and uses it for every other download.
What the code does on main (cd1b828):
- Each pinned input is fetched with
urllib.request.urlopenand streamed straight into its final path withtarget.open("wb")(lines 127 and 139). There is no temporary file and no rename, so an interrupted transfer leaves a truncated file under the real name. - The SHA-256 pin is checked only after the file has been written (
verify(target)). On the next run,if not target.exists()skips the download andverifyfails with "Source checksum mismatch". It keeps failing until someone deletes the file by hand. - There are no retries, no resume and no size limit.
datacache.fetch_filehasexpected_sha256,expected_size,max_bytes, retries andresume. - The benchmark CSV is read from a 4.8 GB figshare ZIP through
RemoteZip, a hand-written HTTP-range reader, and then written withwrite_bytes. That write has the same truncation problem. - The derived files (
author-hla-mappings.tsvfrom Rscript andauthor-hla-counts.json) are also written in place and verified afterwards.
Proposal:
- Fetch the URL-pinned inputs with
datacache.fetch_file(url, destination=..., expected_sha256=..., raw=True). DataCache publishes the file only after it is verified, and it retries and can resume. Sizes could be pinned next to the hashes too. - Write each derived file to a temporary path in the same directory, verify it, then rename it into place.
- Keep
RemoteZiponly if DataCache can't read a single ZIP member by byte range. Its output then gets the same write, verify and rename treatment.
Acceptance: an interrupted --prepare-sources run leaves no file under a final name, and running it again completes with no manual cleanup. A test fails a download partway through and checks this.
Related: #156 (resume), #157 (reuse pinned sources) and #159 (the viral stack's own urllib code). Found while reviewing #180.
- 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openvax/orfdata
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
openvax/orfdata#194 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
Todos los issues de openvax/orfdata
Issues similares
-
[Bug]: DoubleMLData.from_arrays checks the treatment d with force_all_x_finite instead of force_all_d_finitePosiblemente ocupada @leninworld la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
DoubleML/doubleml-for-py#471 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
python-pillow/Pillow#10590 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
BUG: ZarrTrace fails in init_trace for models with datetime coordinates (object dtype coord array)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días