zakodium-oss / react-science

React components and tools to build scientific applications.
https://react-science.pages.dev
MIT License
2 stars 6 forks source link

Drag / drop IR also creates IV ???? #222

Closed lpatiny closed 1 year ago

lpatiny commented 2 years ago

There is a bug somewhere because if you simply drag / drop a single ir spectrum the IV tab is also created.

ir.jdx.zip

image

ghost commented 2 years ago

Because it is an "IV" it comes from the biologic-parser, I commented it out from this line and the problem disappears.

I think this could actually be an error in the parser rather than the Loader (I am not sure yet):

export async function convert(fileList: PartialFileList): Promise<BioLogic[]> {
  const dirs = groupFiles(fileList);
  let results: BioLogic[] = [];

  /* can not use `forEach` and pass `async` functions */
  for (const dir of dirs) {
    let result: BioLogic = {};
    result.dir = dir.key;

It may return a result even when it does not parse anything, something like this:

[{dir:"..."}, {dir:"..."}]

Maybe we shouldn't load it yet? I am not sure so I didn't PR anything.

lpatiny commented 2 years ago

Ok thanks for the analysis. I think you could fix the parser so that if there is nothing the array is empty. We can quickly make a release of the biologic parser to fix this issue.

ghost commented 2 years ago

I think this issue was closed at biologic-parser, but we may need to update the dependencies.

This one is closed as well with the new biologic, #246. @lpatiny

targos commented 1 year ago

Fixed