-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] First draft #3
Conversation
* open zip, find the relevant xml * parse the xml * extract some of the metadata and the pattern still need to see how general all this is (how many patterns can be in one file ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great thanks !
const data = readFileSync(join(__dirname, '../../data/test.brml')); | ||
|
||
it('check the output dictionary', async () => { | ||
let result = await readBRML(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also check some values. At worse you can use https://jestjs.io/docs/en/snapshot-testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests on values added in da0378d.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will also move them to the refactored version (https://github.com/kjappelbaum/xrd/tree/spectrum_class).
src/reader/reader.js
Outdated
* @param {} options={} | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
export function readBRML(binary, options = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use rather async / await syntax. We find the code easier to read. It looks like sync code while still being async.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully a bit clearer in da0378d.
Thanks for the review and the time, I hope I fixed the issues. |
This is a first draft, I will still need to work on parsing some more metadata (like the specs of the instrument).
Sorry for the delay, just got my MacBook back from repair last week.