invalid SOFA files for UTF-8 strings
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by reproducing the issue with the netCDF4 example and inspect sofar's writing and validate paths for string attributes. Confirm how UTF-8 descriptions are written and checked, then verify that the resulting SOFA file uses only allowed NC_CHAR attributes and that validation handles invalid NC_STRING attributes correctly.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Following https://github.com/sofacoustics/SOFAtoolbox/issues/95#event-31983840895
I think there is an issue in sofar.
Writing a UTF-8 string as a SOFA description will produce an NC_STRING attribute [due to a fallback in the netcdf4-python backend](https://github.com/Unidata/netcdf4-python/blob/v1.7.3rel/src/netCDF4/_netCDF4.pyx#L1867-L1874.
For example:
"""Show netCDF4 writing a UTF-8 variable attribute as NC_STRING."""
from pathlib import Path
from netCDF4 import Dataset
filename = Path("test.sofa")
with Dataset(filename, "w", format="NETCDF4") as file:
file.createDimension("S", 1)
variable = file.createVariable("Data.String", "S1", ("S",))
variable.AsciiDescription = "ear"
variable.Utf8Description = "Hörlappen"
ncdump test.sofa gives
netcdf test {
dimensions:
S = 1 ;
variables:
char Data.String(S) ;
Data.String:AsciiDescription = "ear" ;
string Data.String:Utf8Description = "Hörlappen" ;
data:
Data.String = "" ;
}
The SOFA standard only allows NC_CHAR attributes so this would create an invalid file. I think this problem is twofold: one in writing to the file and another in validate because sofar happily validates and reads NC_STRING correctly.
- Lingua principale
- Python
- Stelle
- 37
- Fork
- 4
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pyfar/sofar
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Move sofar-related pyfar functionality to sofarForse di nuovo libera @f-brinkmann l’ha presa 92 giorni fa e non c’è nessuna pull request aperta. Apertafeature
-
[MAINT] Remove restrcition for Numpy 2.5Forse già presa @f-brinkmann l’ha presa 28 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
-
Move to h5netcdfForse di nuovo libera @hoyer-a l’ha presa 127 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Kludex/python-multipart#375 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 11 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
FuRongJun-1999/dsh-memory#1000 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
gcivil-nyu-org/team5-mon-fall26#154 ·
I maintainer di solito rispondono entro 1 giorno