wincowgerDEV / OpenSpecy-package

Analyze, Process, Identify, and Share, Raman and (FT)IR Spectra
http://wincowger.com/OpenSpecy-package/
Creative Commons Attribution 4.0 International
23 stars 11 forks source link

[Bug]: Read Zip Issue #159

Open wincowgerDEV opened 8 months ago

wincowgerDEV commented 8 months ago

Guidelines

Project Version

No response

Platform and OS Version

No response

Existing Issues

No response

What happened?

We would expect this zip folder of spc files to read correctly but it returns an error.

10.37.zip

Steps to reproduce

library(OpenSpecy)
file <- "10.37.zip"
check <- read_any(file)

Error in do.call(paste0("read_", tolower(ex)), list(file = file, ...)) : 'what' must be a function or character string

Also if we try to read the files as spc by themselves with read_spc

read_spc("10.8.D.spc")

Error in gsub(rawToChar(replace.nul), "\r\n", log.txt) : 'pattern' is invalid

Somehow the files can be read into OpenSpecy.org though, really a head scratcher.

image

Expected behavior

Read the spc files and/or zip

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

wincowgerDEV commented 7 months ago

A bit more recon on this, the error line seems to be here in read_zip:

lst <- lapply(file.path(tmp, flst$Name), read_any, ...)

wincowgerDEV commented 7 months ago

When it sends back to read_any we can find this line causing the issue os <- do.call(paste0("read_", tolower(ex)), list(file = file, ...))

wincowgerDEV commented 7 months ago

Broke through the first error with https://github.com/wincowgerDEV/OpenSpecy-package/pull/161/commits/313395626442f0f2ed8e21085979e881d59e131d by updating how we extract the extension name.

wincowgerDEV commented 7 months ago

The second error with read.spc is still there. I think it has something to do with file naming but not positive, I tested changing the file name but that didn't work. Will file issue with hyperSpec.