Skip to content

Allow reading Unspecified type files in WiREReader#848

Open
borondics wants to merge 3 commits intoQuasars:masterfrom
borondics:read-wdf-Unspecified
Open

Allow reading Unspecified type files in WiREReader#848
borondics wants to merge 3 commits intoQuasars:masterfrom
borondics:read-wdf-Unspecified

Conversation

@borondics
Copy link
Member

Added the Unspecified option to the WiREReaders that allows for readi…ng a file with a single spectrum.

No testing yet.

…ng a file with a single spectrum. No testing yet.
@borondics
Copy link
Member Author

The problem (I think) is that the unspecified category could be anything.

Should I try to extend this to try all the readers? With several tries or a nested try-try-try?

@markotoplak
Copy link
Collaborator

No, don't speculate, just handle what we know there is... So just this for now, and if there is a file where the reader handles and error, well, then we handle that.

…nt type anymore, just goes through all readers.
@borondics
Copy link
Member Author

So, I found another "unspecified" file that fails for another reason - it seems we have no control over what is in those files. Therefore I came up with this new solution to loop through all readers and check if they can return the structure we expect (at least in case of the single_file for now) or raise some meaningful errors.

@markotoplak
Copy link
Collaborator

It is great that you found the file, but still I'd look only use the loop when the type is undefined. Relying on exceptions could be potentially problematic.

I'd have a dict { measurement_type: reading function }, and if the type is defined, just take the correct one, otherwise loop through the values of that dict, as you've done, with exceptions. This would make the could short.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants