When using the dolfyn.read function, anytime there is an error in one of the read subroutines (i.e., read_nortek, read_signature, or read_rdi) the try...catch block of the dolfyn.read function turns this into the error defined there. This really creates headaches for debugging read issues.
Previously I'd defined a WrongFileType Exception that was the first error to be raised when one of those functions tried to read a file that didn't match what it expected. This wasn't the most elegant solution for many reasons, but it was better than what we have now.
The other simple fix would be to map file-extensions to a reader (e.g., {read_signature: ['.ad2cp'], read_rdi: ['.pd0', '.###', ], ...}) but that has the problems of: a) needing to parse RDI .### file names somehow, and b) needing to maintain the list of file-extensions as it evolves.
When using the
dolfyn.read
function, anytime there is an error in one of the read subroutines (i.e.,read_nortek
,read_signature
, orread_rdi
) thetry...catch
block of thedolfyn.read
function turns this into the error defined there. This really creates headaches for debugging read issues.Previously I'd defined a
WrongFileType
Exception that was the first error to be raised when one of those functions tried to read a file that didn't match what it expected. This wasn't the most elegant solution for many reasons, but it was better than what we have now.The other simple fix would be to map file-extensions to a reader (e.g.,
{read_signature: ['.ad2cp'], read_rdi: ['.pd0', '.###', ], ...}
) but that has the problems of: a) needing to parse RDI.###
file names somehow, and b) needing to maintain the list of file-extensions as it evolves.@jmcvey3 - thoughts on how to deal with this?