ePSIC-DLS / epsic_tools

Code for conversion and analysis of Merlin-Medipix data
GNU General Public License v3.0
6 stars 7 forks source link

Update toolbox #29

Closed M0hsend closed 4 years ago

M0hsend commented 4 years ago

First go at cleaning this up a bit. Now by import epsic_tools.api as epsic we can get access to all the functionalities. Removed / merged some of the py files. Next to do:

TomSlater commented 4 years ago

That took me far too many attempts...

M0hsend commented 4 years ago

I have now put everything in ptycho_utils.py and changed the imports accordingly. The example notebook here runs with no problems. These functions can probably be replaced with what I have adde in get_probe_array(file_path) and get_obj_array(file_path)

    get_hdf5_error(h5_file)
    get_hdf5_object_phase(h5_file, params)
    get_hdf5_object_modulus(h5_file, params)
    get_hdf5_probe_phase(h5_file)
    get_hdf5_probe_modulus(h5_file)
    get_hdf5_complex_probe(h5_file)
    get_json_params(h5_file)

But I have not deleted them in case it breaks some of your notebooks @chrisallen80

M0hsend commented 4 years ago

Finally managed to get the tests run and pass! (looking over what you have done @TomSlater in ParticleSpy helped a lot 😄). I have written some tests but can definitely expand more in future. Please have a look @TomSlater and @chrisallen80 and comment / merge.

TomSlater commented 4 years ago

I think the tests look good. We could add some more assert statements for testing but it's probably good at the moment just to check everything runs. I'll add codecov to the repo so that it's easy to see what isn't being tested too.

I'm happy to merge at this point if you are.

codecov-commenter commented 4 years ago

Codecov Report

Merging #29 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #29   +/-   ##
=======================================
  Coverage   34.98%   34.98%           
=======================================
  Files          13       13           
  Lines        1878     1878           
=======================================
  Hits          657      657           
  Misses       1221     1221           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 487e3ba...487e3ba. Read the comment docs.

M0hsend commented 4 years ago

I think the tests look good. We could add some more assert statements for testing but it's probably good at the moment just to check everything runs. I'll add codecov to the repo so that it's easy to see what isn't being tested too.

I'm happy to merge at this point if you are.

Great, thanks Tom. Yes, please go ahead and merge.