Example #1
0
 def from_words(self, words, master):
     s = libtbx.phil.str_from_words(words=words)
     if s is None:
         return None
     regex = r"^\s*([\w\.]+)\s*(<=|!=|==|>=|<|>|&)\s*(.+)\s*$"
     matches = re.findall(regex, s)
     if len(matches) == 0:
         raise RuntimeError("%s is not a valid selection" % s)
     elif len(matches) > 1:
         raise RuntimeError("%s is not a single selection" % s)
     else:
         match = matches[0]
     assert len(match) == 3
     col, op, value = match
     return flex.reflection_table_selector(col, op, value)
Example #2
0
 def from_string(self, s):
   from dials.array_family import flex
   if s is None:
     return None
   import re
   regex = r"^\s*([\w\.]+)\s*(<=|!=|==|>=|<|>|&)\s*(.+)\s*$"
   matches = re.findall(regex, s)
   if len(matches) == 0:
     raise RuntimeError('%s is not a valid selection' % s)
   elif len(matches) > 1:
     raise RuntimeError('%s is not a single selection' % s)
   else:
     match = matches[0]
   assert(len(match) == 3)
   col, op, value = match
   return flex.reflection_table_selector(col, op, value)
Example #3
0
File: phil.py Project: dials/dials
 def from_string(self, s):
   from dials.array_family import flex
   if s is None:
     return None
   import re
   regex = r"^\s*([\w\.]+)\s*(<=|!=|==|>=|<|>|&)\s*(.+)\s*$"
   matches = re.findall(regex, s)
   if len(matches) == 0:
     raise RuntimeError('%s is not a valid selection' % s)
   elif len(matches) > 1:
     raise RuntimeError('%s is not a single selection' % s)
   else:
     match = matches[0]
   assert(len(match) == 3)
   col, op, value = match
   return flex.reflection_table_selector(col, op, value)