AdventureData / radicl

Command line interface & API for using the Lyte probe. Users can take measurements, configure and update the probe with this software
https://adventuredata.com/
Other
3 stars 0 forks source link

Read data fixes #10

Closed micahjohnson150 closed 4 years ago

micahjohnson150 commented 4 years ago

Hey @arothenbuhler this isn't quite complete but I would love to have you take a look at it.

Currently I have tried to reduce the amount of repeat code. There were a few places that I had some copy and pasted bugs so I decide it was good to reduce as best as possible.

Keep in mind most of this is my interpretation of how the Probe API is behaving so its is extremely likely that I rewrote something and messed it up.

It turns out that I checked in a line ending change so the specific changes are completely obscured. I am sorry about that.

Here is where you should look.

  1. probe.py _readData(buffer_id). I attempted to rewrite the retry in a loop. It seemed to fix a lot of the errors i was seeing but perhaps I am just not detecting them now.

  2. Look at readRawSensorData, I have attempted to move a bunch of the data integrity checking to one function. This area is a little fuzzy for me but the goal would be to move all data functions this way.

Plug in your probe and run python -m unittest tests/test_probe_data.py to test the data pulling. Its crude but its a simple test.

micahjohnson150 commented 4 years ago

ok I have added the changes I think i need based on your comments in basecamp. Thanks for those.

Tenatively it seems I have RawSensor and RawAccelerationw working but not FilteredDepthData. Wanna take a look?

micahjohnson150 commented 4 years ago

Ok @arothenbuhler . I have implemented all the fixes I would like for this.

Please take a look at:

probe._readData probe.read_check_data_integrity probe.readRawSensorData probe.readFiltereddepthData probe.readDepthCorrectedSensor (used to be ComboDepthSensorData)

I have rewritten those to use few copy and paste lines. The data reading appears more stable but I want to make sure you don't think I am missing some horribly misunderstood thing. Also I have added in tests for check if the probe is working with radicl. I believe this will be useful to simply testing FW too. It currently checks the datasets above, and checks all the settings.

Let me know your thoughts. We can get on the phone too and go over it.