Caliper and Initial QC cleanup

I thought it was good practices to try except in python for cases that will
fail, as long as the failing cases are less frequent than the working
cases... did I get that wrong ?

If you want to log every case where the database search is a miss, we are
going to log a lot, and this will only tell us "This project has not gone
through a caliper step". I am not sure that is worth logging.


On Thu, Aug 28, 2014 at 2:08 PM, Phil Ewels <notifications@github.com>
wrote:

> In scilifelab/lims_utils/objectsDB.py:
>
> > @@ -59,6 +59,23 @@ def get_last_first(process_list, last=True):
> >      else:
> >          return None
> >
> > +def get_caliper_img(sample_name, caliper_id):
> > +    caliper_image = None
> > +    try:
> > +        last_caliper = Process(lims,id = caliper_id)
> > +        outarts = last_caliper.all_outputs()
> > +        for out in outarts:
> > +            s_names = [p.name for p in out.samples]
> > +            if (sample_name in s_names and out.type == "ResultFile"):
> > +                files = out.files
> > +                for f in files:
> > +                    if ".png" in f.content_location:
> > +                        caliper_image = f.content_location
> > +    except TypeError:
> > +        #Should happen when no caliper processes are found
>
> Is it possible to log an error somehow here, whilst continuing with the
> pass? Silent passes make me nervous :)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/SciLifeLab/scilifelab/pull/412/files#r16834876>.
>