Assertions in python are things that you "assume" are true and that your code will work only and only if that condition is met. These statements are useful to debug and diagnose problems i. e. usually the messages.

In this case I think the assertion is useful because we are "blindly" removing the two last characters; for the code to reach that point, you have to have met the condition stated in the assertion.

If the assertion is not met the program will be halted with that comment as the error message.


On Oct 14, 2013, at 6:01 PM, Jackson <notifications@github.com> wrote:

> In emperor/format.py:
> 
> > @@ -368,7 +368,7 @@ def format_comparison_bars_to_js(coords_data, coords_headers, clones,
> >          # coords to create the javascript object with the coordinates
> >          for index in xrange(0, headers_length, clones):
> >              # 1st object must have _0 as a suffix, trim it reveal the sample id
> > -            sample_id = coords_headers[index].rstrip('_0')
> > +            sample_id = coords_headers[index].replace('_0','')
> One question, why do we need the assertion?
> 
> —
> Reply to this email directly or view it on GitHub.
>