Skip to content

files to test phase wrap between matlab and python#10

Closed
kuziekj wants to merge 2 commits intoimportBOXYfrom
py_mat_tests
Closed

files to test phase wrap between matlab and python#10
kuziekj wants to merge 2 commits intoimportBOXYfrom
py_mat_tests

Conversation

@kuziekj
Copy link
Collaborator

@kuziekj kuziekj commented Jun 1, 2020

Created files to help test phase wrap output between Matlab and python.

Can just run 'test_phase_wrap.py' and messages will be printed depending on the success or failure of each step. If the outputs between matlab and python are the same to 8 decimal places (can be changed in the code), then the comparison is successful.

Currently tests:

-phase wrap
-detrending phase
-subtract mean
-removing outliers
-converting phase to pico seconds

Data is taken from the 'anc' data set. Once the data was loaded and parsed in python (without any changes made to phase data), the data was saved as a .mat file and then loaded into Matlab 2019b. All of the above preprocessing steps were run on the data, taken from p-pod 10.6.3 (b-norm.m), and the data was saved in a separate file after each step. The same preprocessing steps are then run in python and compared to the saved matlab data.

@@ -0,0 +1,131 @@
import os
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait so I think this test has copied in the commands from the functions, which is dangerous, what if those functions change, I think it would be a better test if it called the actual boxy.py function , so the same code doesn't repeat there and here

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but in the bigger scheme this is just a side test on this preprocessing step, and you already confirmed it works, so no need to worry about this

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry realized I never posted these comments
this test was successful, but no need to merge it into our submission to the toolbox, keep it as a branch for further testing, but see comment above about using the real functions instead of copied in ones

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay sounds good.

Yeah I thought calling boxy.py would be the better way to implement these tests, but since we want to test each of the individual phase pre-processing steps, I wasn't sure how to best go about that.

I suppose it would be better to have the same code in matlab and python, we could then just compare the output directly rather than comparing each individual step.

@kuziekj
Copy link
Collaborator Author

kuziekj commented Jun 23, 2020

Combined these tests with a different branch/PR :#21

@kuziekj kuziekj closed this Jun 23, 2020
@kuziekj kuziekj deleted the py_mat_tests branch July 8, 2020 17:41
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