Add transform table parsing and function with tests #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partial PR as the A2B tests don't pass.
This is picking up the work from #3 and parses mft1 and mft2 tags (
B2A
,A2B
andgamt
). It also creates transform functions for each of the tables by taking an input array (expecting normalised values between 0 and 1) and returning an another array (with values normalised between 0 and 1).E.g:
profile.B2A0.transform([0, 0, 0])
returns[1, 0, 0, 0]
for the Probev1 profile.For testing the tables are excluded from the equality test as discussed in #2 and the transforms are used to check the output based on the probe profile.
Right now, the
A2B0
transform is the only one that doesn't behave according to spec and makes the test fail. It returns0.61
instead of a value between0.7
and1
as expected.