<commit_before>#
#  DIALS viewer
#
#  Copyright (C) 2014 Diamond Light Source
#
#  Author: <NAME> (Luiso)
#
#  This code is distributed under the BSD license, a copy of which is
#  included in the root directory of this package."
#
#
from __future__ import division
import wx
from dials.viewer.viewer_frame import ReflectionFrame

class viewer_App(wx.App):
  def OnInit(self):
    self.frame = ReflectionFrame(None, -1, "DIALS Reflections Viewer"
    , wx.DefaultPosition,(550,200))

    self.SetTopWindow(self.frame)
    self.frame.Show(True)
    return True

  def table_in(self, loc_tabl):
    self.frame.tabl_to_frame(loc_tabl)


def next_gen_viewer_test(table):
  print "table(ptr) =", table
  from dials.viewer.next_gen_viewer.multi_3D_slice_viewer import show_3d
  print "Here Yes"


  table_row = table[8037]
  data_flex = table_row['shoebox'].data
  show_3d(data_flex)

  #lst_nm = [8034, 8036, 8037, 8141, 8240, 8243, 9356, 9504]
  lst_nm = range(9)
  lst_flex_dat = []
  for nm in lst_nm:
    #table_row = table[nm]
    lst_flex_dat.append(table[nm]['shoebox'].data)
    lst_flex_dat.append(table[nm]['shoebox'].mask)

  show_3d(lst_flex_dat)


if __name__ == "__main__":

  import cPickle as pickle
  import sys
  from dials.array_family import flex
  table = flex.reflection_table.from_pickle(sys.argv[1])

  app = viewer_App(redirect=False)
  app.table_in(table)
  app.MainLoop()

  next_gen_viewer_test(table)
<commit_msg>playing with a test 2<commit_after>#
#  DIALS viewer
#
#  Copyright (C) 2014 Diamond Light Source
#
#  Author: <NAME> (Luiso)
#
#  This code is distributed under the BSD license, a copy of which is
#  included in the root directory of this package."
#
#
from __future__ import division
import wx
from dials.viewer.viewer_frame import ReflectionFrame

class viewer_App(wx.App):
  def OnInit(self):
    self.frame = ReflectionFrame(None, -1, "DIALS Reflections Viewer"
    , wx.DefaultPosition,(550,200))

    self.SetTopWindow(self.frame)
    self.frame.Show(True)
    return True

  def table_in(self, loc_tabl):
    self.frame.tabl_to_frame(loc_tabl)


def next_gen_viewer_test(table):
  print "table(ptr) =", table
  from dials.viewer.next_gen_viewer.multi_3D_slice_viewer import show_3d
  print "Here Yes"


  table_row = table[8037]
  data_flex = table_row['shoebox'].data
  show_3d(data_flex)


  lst_flex_dat = []
  for nm in range(9):
    lst_flex_dat.append(table[nm]['shoebox'].data)
    lst_flex_dat.append(table[nm]['shoebox'].mask)

  show_3d(lst_flex_dat)


if __name__ == "__main__":

  import cPickle as pickle
  import sys
  from dials.array_family import flex
  table = flex.reflection_table.from_pickle(sys.argv[1])

  app = viewer_App(redirect=False)
  app.table_in(table)
  app.MainLoop()

  next_gen_viewer_test(table)

{'fraction_non_alphanumeric': 0.10875045012603529, 'fraction_numerical': 0.02700756211739287, 'mean_word_length': 4.383720930232558, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '482968', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1036, 'n_words': 231}