Sage-Bionetworks / mhealthx

mhealthx is a software pipeline that automates feature extraction from mobile health data saved as a Synapse project (synapse.org).
http://sage-bionetworks.github.io/mhealthx/
Other
13 stars 11 forks source link

Python 2/3 compatibility and gait enhancements #6

Open telferm57 opened 6 years ago

telferm57 commented 6 years ago

Objectives

1 Make code python 2 and 3 complaint

2 Enhance gait algorithms a)autocorrelation used to detect features incorrectly - get this working b) walk direction seems flakey at the moment - investigate and correct of necessary c) introduce new 'feature output' of type pd.DataFrame - this is so I can call the gait analysis functionality from other packages and get the results back d) make the plot test functionality more consistent (sometimes the plot test variable that causes test plots to be run is passed through to sub functions, sometimes not)

binarybottle commented 6 years ago

@telferm57 --

(1) What is the following function in mhealth.py?:

DO YOUR THING, CHRIS!!!

testing github desktop update

def do0(): return 0

(2) Instead of using old_div(), why not just use?

telferm57 commented 6 years ago

1) 'Do your thing chris!' is in the original code

I was just checking that github desktop was working , so created a do-nothing function and reverted it, hence the trail

2) the old_div and other bits and pieces were inserted by factorize, which I used to try to ensure I picked up all changes necessary to port to 3.x while keeping it compatible with 2.7 ..... didn't want to crawl the codebase by hand and miss something.

binarybottle commented 6 years ago

Got it. Great! Would you like for me to pull the code as is, or would you like to make it 2 or 3 ready by replacing the automated portions? Have you tried out the revised version?

I put tests in the docstrings, but because I initialized with random data I didn't specify outputs. If you would like to replace the input data with fixed values and include the appropriate output, then the circleci.com continuous integration will always check to make sure the functions function every time we push to the repo...

telferm57 commented 6 years ago

I haven't actually made the gait change yet! I'd rather leave the automated 2/3 compatibility solutions in for the moment. I'll add the gait enhancements over the next few days .. rather slowly, first time I've contributed to an open source project!Then I'll check they still work in the synapse context

telferm57 commented 6 years ago

Delays caused by trying to get the mhealthx script working under windows .... looks like opensmile doesn't work under windows, so will need to switch to unix to run full suite for testing purposes. I can test the gait code indiviually using my own data and mjff data to ensure the results are the same then would circleCI use existing tests to ensure the 2->3 changes work OK ?

Arno, I don't get how the testing works - does circleci pick them up from the doc strings ? Any docs you can point me too ?

satra commented 6 years ago

@telferm57 - i think it would be useful to create a docker container for mhealthx that contains all the necessary dependencies. also unless there is an explicit need to maintain code for python 2 and 3, i would suggest dropping 2 completely and focusing on 3.

telferm57 commented 6 years ago

That's a great idea, I'll look into it 

Sent from Yahoo Mail on Android

On Fri, 16 Mar 2018 at 15:22, Satrajit Ghoshnotifications@github.com wrote:
@telferm57 - i think it would be useful to create a docker container for mhealthx that contains all the necessary dependencies. also unless there is an explicit need to maintain code for python 2 and 3, i would suggest dropping 2 completely and focusing on 3.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.