This is still wrong.  %(axis)s is never supplied in the c_code below so it can't be used.  It also does not mention %(shape)s which is the shape we should be checking.