Ejemplo n.º 1
0
 def _repr_html_(self): 
     if not has_ipy_table: 
         return "Please install ipy_table."
     if self.is_axis_aligned():
         type = 'axis aligned'
     elif self.is_affine():
         type = 'affine'
     elif self.is_uniform():
         type = 'uniform'
     else: 
         type = ''
     if type!='': 
         type = " (%s)"%type
     s = "Grid%dD %s: "%(int(self.ndim),type)
     def pretty(list):
         return str(['{0:.2f}'.format(flt) for flt in list])
     table_data = [[s,'','','','','',''],
                   ['space','shape','min','max','span','center','spread'],
                   [str(self.space), pretty(self.shape) ,pretty(self.min()) ,pretty(self.max()) ,pretty(self.span()) ,pretty(self.center()) ,pretty(self.mean_dist_from_center())], ] 
     table = ipy_table.make_table(table_data)
     table = ipy_table.apply_theme('basic')
     table = ipy_table.set_cell_style(0,0, column_span=7)
     table = ipy_table.set_cell_style(0,0, align='center') 
     table = ipy_table.set_row_style(1, color='#F7F7F7')
     table = ipy_table.set_row_style(2, color='#F7F7F7')
     table = ipy_table.set_row_style(0,color='#CCFF99')
     table = ipy_table.set_row_style(1, bold = True)
     table = ipy_table.set_row_style(1, align = 'center')
     table = ipy_table.set_global_style(float_format="%3.3f")        
     s = table._repr_html_() 
     return s
Ejemplo n.º 2
0
 def _repr_html_(self): 
     if not has_ipy_table: 
         return "Please install ipy_table."
     if self.is_axis_aligned():
         type = 'axis aligned'
     elif self.is_affine():
         type = 'affine'
     elif self.is_uniform():
         type = 'uniform'
     else: 
         type = ''
     if type!='': 
         type = " (%s)"%type
     s = "Grid%dD %s: "%(int(self.ndim),type)
     def pretty(list):
         return str(['{0:.2f}'.format(flt) for flt in list])
     table_data = [[s,'','','','','',''],
                   ['space','shape','min','max','span','center','spread'],
                   [str(self.space), pretty(self.shape) ,pretty(self.min()) ,pretty(self.max()) ,pretty(self.span()) ,pretty(self.center()) ,pretty(self.mean_dist_from_center())], ] 
     table = ipy_table.make_table(table_data)
     table = ipy_table.apply_theme('basic')
     table = ipy_table.set_cell_style(0,0, column_span=7)
     table = ipy_table.set_cell_style(0,0, align='center') 
     table = ipy_table.set_row_style(1, color='#F7F7F7')
     table = ipy_table.set_row_style(2, color='#F7F7F7')
     table = ipy_table.set_row_style(0,color='#CCFF99')
     table = ipy_table.set_row_style(1, bold = True)
     table = ipy_table.set_row_style(1, align = 'center')
     table = ipy_table.set_global_style(float_format="%3.3f")        
     s = table._repr_html_() 
     return s
Ejemplo n.º 3
0
 def _repr_html_(self):
     if not has_ipy_table: 
         return "Please install ipy_table."
     s = 'Transformation'
     table_data = [[s,'','','','','',''],
                   ['map_from','map_to','determinant','is_rigid','is_6DOF','is_rotation','is_translation'],
                   [self.map_from, self.map_to, str(self.determinant()), self.is_rigid(), self.is_6DOF(), self.is_rotation(), self.is_translation() ], ] 
     table = ipy_table.make_table(table_data)
     table = ipy_table.apply_theme('basic')
     table = ipy_table.set_cell_style(0,0, column_span=7)
     table = ipy_table.set_cell_style(0,0, align='center') 
     table = ipy_table.set_row_style(1, color='#F7F7F7')
     table = ipy_table.set_row_style(2, color='#F7F7F7')
     table = ipy_table.set_row_style(0, color='#FFFF99')
     table = ipy_table.set_row_style(1, bold = True)
     table = ipy_table.set_row_style(1, align = 'center')
     table = ipy_table.set_row_style(1, height = 30)
     table = ipy_table.set_global_style(float_format="%3.3f") 
     table2 = ipy_table.make_table(self.data)
     table3 = ipy_table.make_table(['   '])
     table3 = ipy_table.set_row_style(0, no_border='all')
     s = '<div><style>table {float: left; margin-right:10px;}</style> %s %s %s </div>'%( table._repr_html_(), table3._repr_html_() ,table2._repr_html_() )
     return s
Ejemplo n.º 4
0
 def _repr_html_(self):
     if not has_ipy_table: 
         return "Please install ipy_table."
     s = 'Transformation'
     table_data = [[s,'','','','','',''],
                   ['map_from','map_to','determinant','is_rigid','is_6DOF','is_rotation','is_translation'],
                   [self.map_from, self.map_to, str(self.determinant()), self.is_rigid(), self.is_6DOF(), self.is_rotation(), self.is_translation() ], ] 
     table = ipy_table.make_table(table_data)
     table = ipy_table.apply_theme('basic')
     table = ipy_table.set_cell_style(0,0, column_span=7)
     table = ipy_table.set_cell_style(0,0, align='center') 
     table = ipy_table.set_row_style(1, color='#F7F7F7')
     table = ipy_table.set_row_style(2, color='#F7F7F7')
     table = ipy_table.set_row_style(0, color='#FFFF99')
     table = ipy_table.set_row_style(1, bold = True)
     table = ipy_table.set_row_style(1, align = 'center')
     table = ipy_table.set_row_style(1, height = 30)
     table = ipy_table.set_global_style(float_format="%3.3f") 
     table2 = ipy_table.make_table(self.data)
     table3 = ipy_table.make_table(['   '])
     table3 = ipy_table.set_row_style(0, no_border='all')
     s = '<div><style>table {float: left; margin-right:10px;}</style> %s %s %s </div>'%( table._repr_html_(), table3._repr_html_() ,table2._repr_html_() )
     return s