@@ -313,7 +313,7 @@ def scaling_needed(self):
313313 data are within range of the output type, return False
314314 * Otherwise return True
315315 """
316- if not super (SlopeArrayWriter , self ).scaling_needed ():
316+ if not super ().scaling_needed ():
317317 return False
318318 mn , mx = self .finite_range () # this is cached
319319 # No finite data - no scaling needed
@@ -428,7 +428,7 @@ def _range_scale(self, in_min, in_max):
428428 # not lose precision because min/max are of fp type.
429429 out_min , out_max = np .array ((out_min , out_max ), dtype = big_float )
430430 else : # (u)int
431- out_min , out_max = [ int_to_float (v , big_float ) for v in (out_min , out_max )]
431+ out_min , out_max = ( int_to_float (v , big_float ) for v in (out_min , out_max ))
432432 if self ._out_dtype .kind == 'u' :
433433 if in_min < 0 and in_max > 0 :
434434 raise WriterError (
@@ -507,13 +507,11 @@ def __init__(self, array, out_dtype=None, calc_scale=True, scaler_dtype=np.float
507507 >>> (aw.slope, aw.inter) == (1.0, 128)
508508 True
509509 """
510- super (SlopeInterArrayWriter , self ).__init__ (
511- array , out_dtype , calc_scale , scaler_dtype , ** kwargs
512- )
510+ super ().__init__ (array , out_dtype , calc_scale , scaler_dtype , ** kwargs )
513511
514512 def reset (self ):
515513 """Set object to values before any scaling calculation"""
516- super (SlopeInterArrayWriter , self ).reset ()
514+ super ().reset ()
517515 self .inter = 0.0
518516
519517 def _get_inter (self ):
@@ -549,14 +547,14 @@ def to_fileobj(self, fileobj, order='F'):
549547
550548 def _iu2iu (self ):
551549 # (u)int to (u)int
552- mn , mx = [ as_int (v ) for v in self .finite_range ()]
550+ mn , mx = ( as_int (v ) for v in self .finite_range ())
553551 # range may be greater than the largest integer for this type.
554552 # as_int needed to work round numpy 1.4.1 int casting bug
555553 out_dtype = self ._out_dtype
556554 # Options in this method are scaling using intercept only. These will
557555 # have to pass through ``self.scaler_dtype`` (because the intercept is
558556 # in this type).
559- o_min , o_max = [ as_int (v ) for v in shared_range (self .scaler_dtype , out_dtype )]
557+ o_min , o_max = ( as_int (v ) for v in shared_range (self .scaler_dtype , out_dtype ))
560558 type_range = o_max - o_min
561559 mn2mx = mx - mn
562560 if mn2mx <= type_range : # might offset be enough?
@@ -579,7 +577,7 @@ def _iu2iu(self):
579577 self .inter = inter
580578 return
581579 # Try slope options (sign flip) and then range scaling
582- super (SlopeInterArrayWriter , self )._iu2iu ()
580+ super ()._iu2iu ()
583581
584582 def _range_scale (self , in_min , in_max ):
585583 """Calculate scaling, intercept based on data range and output type"""
@@ -604,7 +602,7 @@ def _range_scale(self, in_min, in_max):
604602 in_min , in_max = as_int (in_min ), as_int (in_max )
605603 in_range = int_to_float (in_max - in_min , big_float )
606604 # Cast to float for later processing.
607- in_min , in_max = [ int_to_float (v , big_float ) for v in (in_min , in_max )]
605+ in_min , in_max = ( int_to_float (v , big_float ) for v in (in_min , in_max ))
608606 if out_dtype .kind == 'f' :
609607 # Type range, these are also floats
610608 info = type_info (out_dtype )
0 commit comments