rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
print "%s%s" % (prefix, labels[i_seq]) | print >> f, "%s%s" % (prefix, labels[i_seq]) | def show_sorted_by_residual(self, sites_cart, labels=None, f=None, prefix="", max_lines=None): assert labels is None or len(labels) == sites_cart.size() if (self.size() == 0): return if (f is None): f = sys.stdout residuals = dihedral_residuals( sites_cart=sites_cart, proxies=self) i_proxies_sorted = flex.sort_permutat... |
fixed_seq, | def run(args): phil_objects = [] argument_interpreter = libtbx.phil.command_line.argument_interpreter( master_params=master_params, home_scope="supper") for arg in args: command_line_params = None arg_is_processed = False if (os.path.isfile(arg)): try: command_line_params = iotbx.phil.parse(file_name=arg) if command_... | |
if (env["CXX"].lower() == "cl"): return "/I" + path return "-I" + path | return env["INCPREFIX"] + path | def prepend_include_switch(self, env, path): assert isinstance(path, str) if (env["CXX"].lower() == "cl"): return "/I" + path return "-I" + path |
def as_miller_arrays(self, crystal_symmetry=None, force_symmetry=False): | def as_miller_arrays(self, crystal_symmetry=None, force_symmetry=False, info_prefix=None): | def as_miller_arrays(self, crystal_symmetry=None, force_symmetry=False): if (self.file_type() is None): return [] if (self.file_type() == "cctbx.miller.array"): return self.file_content() info_prefix = self.file_name() + ":" if (info_prefix.startswith("./") or info_prefix.startswith(".\\")): info_prefix = info_prefix[2... |
info_prefix = self.file_name() + ":" if (info_prefix.startswith("./") or info_prefix.startswith(".\\")): info_prefix = info_prefix[2:] | if (info_prefix is None): info_prefix = self.file_name() + ":" if (info_prefix.startswith("./") or info_prefix.startswith(".\\")): info_prefix = info_prefix[2:] | def as_miller_arrays(self, crystal_symmetry=None, force_symmetry=False): if (self.file_type() is None): return [] if (self.file_type() == "cctbx.miller.array"): return self.file_content() info_prefix = self.file_name() + ":" if (info_prefix.startswith("./") or info_prefix.startswith(".\\")): info_prefix = info_prefix[2... |
"$D/cctbx/regression/tst_pointgroup_tools.py" | "$D/cctbx/sgtbx/tst_pointgroup_tools.py" | def run(): tst_list = ( "$D/math/boost_python/tst_math.py", "$D/array_family/boost_python/tst_flex.py", "$D/uctbx/boost_python/tst_uctbx.py", "$D/sgtbx/boost_python/tst_sgtbx.py", "$D/sgtbx/boost_python/tst_N_fold_rot.py", "$D/include/cctbx/crystal/tst_ext.py", "$D/adptbx/boost_python/tst_adptbx.py", "$D/miller/boost_p... |
self.frac_ac_lt_1 = n_z_less_then_one_ac/normalised_acentric.data().size() | self.frac_ac_lt_1 = 0 if normalised_acentric.data().size()>0: self.frac_ac_lt_1 = n_z_less_then_one_ac/normalised_acentric.data().size() | def __init__(self, normalised_acentric, normalised_centric, out=None,verbose=0): if out is None: out = sys.stdout |
x = x0 | x = x0.deep_copy() | def __init__(self, function, x0, xtol=None, gtol=None, ftol=None, stpmin=None, stpmax=None, eps_1=1.e-16, eps_2=1.e-16, k_max=1000): self.function = function x = x0 f_x = function.f(x=x) number_of_function_evaluations = 1 self.f_x0 = f_x fp = function.gradients(x=x, f_x=f_x) number_of_gradient_evaluations = 1 number_of... |
if (not hasattr(rt, "make_boost_int_2")): if (verbose): print 'SKIPPED' return | def exercise_to_tuple(verbose=0): if (verbose): print 'Checking to_tuple conversions' if (not hasattr(rt, "make_boost_int_2")): # XXX if (verbose): print 'SKIPPED' return assert rt.make_boost_int_2(3, 5) == (3, 5) assert rt.make_boost_int_2(3) == (3, 2) assert rt.make_boost_int_2() == (7, 2) if (verbose): print 'OK' | |
print self.miller.indices().size() | def __init__(self, miller, n_bins=15, isigi_cut=3.0, completeness_cut=0.85, resolution_at_least=3.5): self.miller = miller.deep_copy().set_observation_type(miller) #check to see if we have intensities if self.miller.is_real_array(): if self.miller.is_xray_amplitude_array(): self.miller=self.miller.f_as_f_sq() assert se... | |
measurability = tmp_miller.measurability(use_binning=True,return_fail=0) self.meas_data = flex.double( measurability.data[1:len( measurability.data)-1]) smooth_meas_approx = chebyshev_lsq_fit.chebyshev_lsq_fit( int(self.d_star_sq_ori.size()/10) +3, self.d_star_sq_ori, self.meas_data ) smooth_meas_approx = chebyshev_po... | if tmp_miller.sigmas() is not None: measurability = tmp_miller.measurability(use_binning=True,return_fail=0) self.meas_data = flex.double( measurability.data[1:len( measurability.data)-1]) smooth_meas_approx = chebyshev_lsq_fit.chebyshev_lsq_fit( int(self.d_star_sq_ori.size()/10) +3, self.d_star_sq_ori, self.meas_data... | def __init__(self, miller_array, p_scale, u_star_tensor, scat_info, out=None, out_plot=None, verbose=0): |
("tolerance", "1.0"), | ("tolerance", "3.0"), | def interpret_form_data(form): inp = cgi_utils.inp_from_form(form, (("ucparams_1", ""), ("sgsymbol_1", ""), ("convention_1", ""), ("format_1", None), ("coor_type_1", None), ("skip_columns_1", 0), ("ucparams_2", ""), ("sgsymbol_2", ""), ("convention_2", ""), ("format_2", None), ("coor_type_2", None), ("skip_columns_2", ... |
"H": atom_info("H", 0, "H'"), | "H": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H83": atom_info("H", 0, "H'"), "H82": atom_info("H", 0, "H'"), "H81": atom_info("H", 0, "H'"), | "H83": atom_info("H", 0, "H"), "H82": atom_info("H", 0, "H"), "H81": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H2": atom_info("H", 0, "H'"), "H3": atom_info("H", 0, "H'"), "H1": atom_info("H", 0, "H'"), "H4": atom_info("H", 0, "H'"), "H5": atom_info("H", 0, "H'"), "HO6": atom_info("H", 0, "H'"), "HO4": atom_info("H", 0, "H'"), "HN2": atom_info("H", 0, "H'"), "HO3": atom_info("H", 0, "H'"), "HO1": atom_info("H", 0, "H'"), | "H2": atom_info("H", 0, "H"), "H3": atom_info("H", 0, "H"), "H1": atom_info("H", 0, "H"), "H4": atom_info("H", 0, "H"), "H5": atom_info("H", 0, "H"), "HO6": atom_info("H", 0, "H"), "HO4": atom_info("H", 0, "H"), "HN2": atom_info("H", 0, "H"), "HO3": atom_info("H", 0, "H"), "HO1": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H61": atom_info("H", 0, "H'"), | "H61": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H62": atom_info("H", 0, "H'"), | "H62": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H": atom_info("H", 0, "H'"), "HE22": atom_info("H", 0, "H'"), "HE21": atom_info("H", 0, "H'"), | "H": atom_info("H", 0, "H"), "HE22": atom_info("H", 0, "H"), "HE21": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H2": atom_info("H", 0, "H'"), "H3": atom_info("H", 0, "H'"), "H1": atom_info("H", 0, "H'"), "H4": atom_info("H", 0, "H'"), "H5": atom_info("H", 0, "H'"), "HO6": atom_info("H", 0, "H'"), "HO4": atom_info("H", 0, "H'"), "HO2": atom_info("H", 0, "H'"), "HO3": atom_info("H", 0, "H'"), "HO1": atom_info("H", 0, "H'"), "H61"... | "H2": atom_info("H", 0, "H"), "H3": atom_info("H", 0, "H"), "H1": atom_info("H", 0, "H"), "H4": atom_info("H", 0, "H"), "H5": atom_info("H", 0, "H"), "HO6": atom_info("H", 0, "H"), "HO4": atom_info("H", 0, "H"), "HO2": atom_info("H", 0, "H"), "HO3": atom_info("H", 0, "H"), "HO1": atom_info("H", 0, "H"), "H61": atom_inf... | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H2": atom_info("H", 0, "H'"), "H1": atom_info("H", 0, "H'"), | "H2": atom_info("H", 0, "H"), "H1": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H5": atom_info("H", 0, "H'"), | "H5": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H91": atom_info("H", 0, "H'"), "H92": atom_info("H", 0, "H'"), | "H91": atom_info("H", 0, "H"), "H92": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H8": atom_info("H", 0, "H'"), | "H8": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H112": atom_info("H", 0, "H'"), "H113": atom_info("H", 0, "H'"), "H111": atom_info("H", 0, "H'"), "H6": atom_info("H", 0, "H'"), "H7": atom_info("H", 0, "H'"), "H4": atom_info("H", 0, "H'"), "O2": atom_info("O", 0, "O"), "H32": atom_info("H", 0, "H'"), "HO7": atom_info("H", 0, "H'"), "HO4": atom_info("H", 0, "H'"), "H... | "H112": atom_info("H", 0, "H"), "H113": atom_info("H", 0, "H"), "H111": atom_info("H", 0, "H"), "H6": atom_info("H", 0, "H"), "H7": atom_info("H", 0, "H"), "H4": atom_info("H", 0, "H"), "O2": atom_info("O", 0, "O"), "H32": atom_info("H", 0, "H"), "HO7": atom_info("H", 0, "H"), "HO4": atom_info("H", 0, "H"), "H31": atom... | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HN5": atom_info("H", 0, "H'"), | "HN5": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HO9": atom_info("H", 0, "H'"), | "HO9": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HZ1": atom_info("H", 0, "H'"), "O": atom_info("O", 0, "O"), "HZ3": atom_info("H", 0, "H'"), "HZ2": atom_info("H", 0, "H'"), | "HZ1": atom_info("H", 0, "H"), "O": atom_info("O", 0, "O"), "HZ3": atom_info("H", 0, "H"), "HZ2": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HD22": atom_info("H", 0, "H'"), "HD21": atom_info("H", 0, "H'"), | "HD22": atom_info("H", 0, "H"), "HD21": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H2'": atom_info("H", 0, "H'"), | "H2'": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H3": atom_info("H", 0, "H'"), | "H3": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H2": atom_info("H", 0, "H'"), "H3": atom_info("H", 0, "H'"), "H1": atom_info("H", 0, "H'"), "H4": atom_info("H", 0, "H'"), "HO3": atom_info("H", 0, "H'"), "C5": atom_info("C", 0, "C"), "HO4": atom_info("H", 0, "H'"), | "H2": atom_info("H", 0, "H"), "H3": atom_info("H", 0, "H"), "H1": atom_info("H", 0, "H"), "H4": atom_info("H", 0, "H"), "HO3": atom_info("H", 0, "H"), "C5": atom_info("C", 0, "C"), "HO4": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HO2": atom_info("H", 0, "H'"), "H51": atom_info("H", 0, "H'"), "H52": atom_info("H", 0, "H'"), "HO1": atom_info("H", 0, "H'"), | "HO2": atom_info("H", 0, "H"), "H51": atom_info("H", 0, "H"), "H52": atom_info("H", 0, "H"), "HO1": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H21": atom_info("H", 0, "H'"), | "H21": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H22": atom_info("H", 0, "H'"), | "H22": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H1": atom_info("H", 0, "H'"), | "H1": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H63": atom_info("H", 0, "H'"), | "H63": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H2": atom_info("H", 0, "H'"), "H3": atom_info("H", 0, "H'"), "H1": atom_info("H", 0, "H'"), "H4": atom_info("H", 0, "H'"), "H5": atom_info("H", 0, "H'"), "HO4": atom_info("H", 0, "H'"), "HO2": atom_info("H", 0, "H'"), "HO3": atom_info("H", 0, "H'"), "HO1": atom_info("H", 0, "H'"), "H61": atom_info("H", 0, "H'"), | "H2": atom_info("H", 0, "H"), "H3": atom_info("H", 0, "H"), "H1": atom_info("H", 0, "H"), "H4": atom_info("H", 0, "H"), "H5": atom_info("H", 0, "H"), "HO4": atom_info("H", 0, "H"), "HO2": atom_info("H", 0, "H"), "HO3": atom_info("H", 0, "H"), "HO1": atom_info("H", 0, "H"), "H61": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HE2": atom_info("H", 0, "H'"), | "HE2": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HD1": atom_info("H", 0, "H'"), | "HD1": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H41": atom_info("H", 0, "H'"), "C2": atom_info("C", 0, "C"), "H42": atom_info("H", 0, "H'"), | "H41": atom_info("H", 0, "H"), "C2": atom_info("C", 0, "C"), "H42": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HG1": atom_info("H", 0, "H'"), | "HG1": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HE1": atom_info("H", 0, "H'"), | "HE1": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"H": atom_info("H", 0, "H'"), "CA": atom_info("C", 0, "C"), "HG": atom_info("H", 0, "H'"), | "H": atom_info("H", 0, "H"), "CA": atom_info("C", 0, "C"), "HG": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HH": atom_info("H", 0, "H'"), | "HH": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HH22": atom_info("H", 0, "H'"), | "HH22": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HH21": atom_info("H", 0, "H'"), | "HH21": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HH12": atom_info("H", 0, "H'"), "HH11": atom_info("H", 0, "H'"), | "HH12": atom_info("H", 0, "H"), "HH11": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
"HE": atom_info("H", 0, "H'"), | "HE": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") |
self.order+1) | self.order) | def __init__(self, xs_a, xs_b, max_delta=2.0, out=None, relative_length_tolerance=0.05, absolute_angle_tolerance=10.0, order=1): |
tmp_sol = (mat,cb_op,tmp_xs[2]) | tmp_sol = (mat,cb_op,tmp_xs[2].change_basis( cb_op ) , tmp_xs[3]) | def __init__(self, xs_a, xs_b, max_delta=2.0, out=None, relative_length_tolerance=0.05, absolute_angle_tolerance=10.0, order=1): |
print >> self.out, "matrix : |%4i %4i %4i | "%(mat[1][0],mat[1][1],mat[1][2]) | print >> self.out, "matrix : M = |%4i %4i %4i | "%(mat[1][0],mat[1][1],mat[1][2]) | def show_solution(self, sol_entry): mat = sol_entry[0].as_list_of_lists() print >> self.out, "--------------------------------------------------------------" print >> self.out, "Target unit cell : %5.1f %5.1f %5.1f %5.1f %5.1f %5.1f"%(self.xs_b_n.unit_cell().parameters()[0], self.xs_b_n.unit_cell().parameters()[1],... |
print >> self.out, "Additional affine transform: ", sol_entry[1].as_xyz() print >> self.out | print >> self.out, "Additional Niggli transform: ", sol_entry[3].as_xyz() print >> self.out, "Additional similarity transform: ", sol_entry[1].as_xyz() | def show_solution(self, sol_entry): mat = sol_entry[0].as_list_of_lists() print >> self.out, "--------------------------------------------------------------" print >> self.out, "Target unit cell : %5.1f %5.1f %5.1f %5.1f %5.1f %5.1f"%(self.xs_b_n.unit_cell().parameters()[0], self.xs_b_n.unit_cell().parameters()[1],... |
return( (new_uc,lattice_group,xs_new) ) | return( (new_uc,lattice_group,xs_new,extra_cb_op) ) | def make_new_cell_and_symmetry(self, mat): # make new lattice new_basis = self.basis_a*mat.as_float() new_uc = uctbx.unit_cell( orthogonalization_matrix = new_basis ) # get the niggli cell please new_uc = new_uc.niggli_cell() # get the lattice symmetry please lattice_group = sgtbx.lattice_symmetry.group(new_uc,self.ma... |
normalize = True) | normalize = True, collect = False) | def exercise_pair_tables(): d = crystal.pair_sym_dict() assert len(d) == 0 sym_ops = sgtbx.space_group("P 41").all_ops() for i,j_sym in enumerate([10,18,13]): d[j_sym] = crystal.pair_sym_ops(sym_ops[:i]) assert len(d) == i+1 assert len(d[j_sym]) == i assert [str(s) for s in sym_ops[:i]] == [str(s) for s in d[j_sym]] d[... |
result += self.left_term_weight * math.exp(arg1) + \ self.right_term_weight * (1. / math.exp(arg2)) | if(arg1 > self.overflow_limit): term1 = math.exp(700) else: term1 = math.exp(arg1) if(arg2 > self.overflow_limit): term2 = math.exp(700) else: term2 = math.exp(arg2) result += self.left_term_weight * term1 + \ self.right_term_weight * (1. / term2) | def functional(self, u_isos): result = 0.0 for u in u_isos: arg1 = self.shape_factor_left * (self.u_min - u) arg2 = self.shape_factor_right * (self.u_max - u) if(u > self.right_limit or u < self.left_limit): result += self.left_term_weight * math.exp(arg1) + \ self.right_term_weight * (1. / math.exp(arg2)) return res... |
-self.left_term_weight * self.shape_factor_left*math.exp(arg1)+ \ self.right_term_weight* self.shape_factor_right*(1/math.exp(arg2))) | -self.left_term_weight * self.shape_factor_left * term1 + \ self.right_term_weight * self.shape_factor_right * (1. / term2)) | def gradient(self, u_isos): result = flex.double() for u in u_isos: arg1 = self.shape_factor_left * (self.u_min - u) arg2 = self.shape_factor_right * (self.u_max - u) if(u > self.right_limit or u < self.left_limit): result.append( -self.left_term_weight * self.shape_factor_left*math.exp(arg1)+ \ self.right_term_weight*... |
if (miller_array.is_xray_intensity_array()): | if (miller_array.is_complex_array() and miller_array.sigmas() is None): assert not miller_array.is_xray_intensity_array() if (miller_array.anomalous_flag()): result = "GP" else: result = "FP" elif (miller_array.is_xray_intensity_array()): | def default_column_types(miller_array): result = None if (miller_array.is_xray_intensity_array()): if (miller_array.anomalous_flags()): result = "K" if (miller_array.sigmas() is not None): result += "M" else: result = "J" if (miller_array.sigmas() is not None): result += "Q" elif (miller_array.is_xray_amplitude_array()... |
elif (miller_array.is_complex_array() and miller_array.sigmas() is None): if (miller_array.anomalous_flag()): result = "GP" else: result = "FP" | def default_column_types(miller_array): result = None if (miller_array.is_xray_intensity_array()): if (miller_array.anomalous_flags()): result = "K" if (miller_array.sigmas() is not None): result += "M" else: result = "J" if (miller_array.sigmas() is not None): result += "Q" elif (miller_array.is_xray_amplitude_array()... | |
action="fix", segid="SITE", group=""): | action=None, segid=None, group=None): if (action is None): action = "refine" if (segid is None): segid = "SITE" if (group is None): group = "" | def write_scatterer(s, running_index, scatterer, action="fix", segid="SITE", group=""): assert running_index > 0 assert not scatterer.anisotropic_flag assert action in ("refine", "fix", "ignore") i = running_index print >> s, """\ |
self.cryst1_record = state.raw_record self.crystal_symmetry = pdb.cryst1_interpretation.crystal_symmetry( cryst1_record=state.raw_record, line_number=state.line_number) | if (self.cryst1_record is None): self.cryst1_record = state.raw_record if (self.crystal_symmetry is None): self.crystal_symmetry = pdb.cryst1_interpretation.crystal_symmetry( cryst1_record=state.raw_record, line_number=state.line_number) | def __init__(self, file_name=None, raw_records=None): assert [file_name, raw_records].count(None) == 1 if (raw_records is None): raw_records = open(file_name) columns_73_76_eval = pdb.parser.columns_73_76_evaluator( raw_records=raw_records) raw_records = columns_73_76_eval.raw_records self.ignore_columns_73_and_followi... |
assert self.crystal_symmetry is not None or crystal_symmetry is not None or special_position_settings is not None | if ( self.crystal_symmetry is None and crystal_symmetry is None and special_position_settings is None): return None | def get_special_position_settings(self, special_position_settings=None, crystal_symmetry=None, force_symmetry=False): assert special_position_settings is None or crystal_symmetry is None assert self.crystal_symmetry is not None or crystal_symmetry is not None or special_position_settings is not None if (crystal_symmetr... |
assert crystal_symmetry.unit_cell() is not None assert crystal_symmetry.space_group_info() is not None | if (crystal_symmetry.unit_cell() is None): return None if (crystal_symmetry.space_group_info() is None): return None | def get_special_position_settings(self, special_position_settings=None, crystal_symmetry=None, force_symmetry=False): assert special_position_settings is None or crystal_symmetry is None assert self.crystal_symmetry is not None or crystal_symmetry is not None or special_position_settings is not None if (crystal_symmetr... |
=special_position_settings.min_distance_sym_equiv, | =special_position_settings.min_distance_sym_equiv(), | def get_special_position_settings(self, special_position_settings=None, crystal_symmetry=None, force_symmetry=False): assert special_position_settings is None or crystal_symmetry is None assert self.crystal_symmetry is not None or crystal_symmetry is not None or special_position_settings is not None if (crystal_symmetr... |
=special_position_settings.u_star_tolerance, | =special_position_settings.u_star_tolerance(), | def get_special_position_settings(self, special_position_settings=None, crystal_symmetry=None, force_symmetry=False): assert special_position_settings is None or crystal_symmetry is None assert self.crystal_symmetry is not None or crystal_symmetry is not None or special_position_settings is not None if (crystal_symmetr... |
=special_position_settings.assert_is_positive_definite) | =special_position_settings.assert_is_positive_definite()) | def get_special_position_settings(self, special_position_settings=None, crystal_symmetry=None, force_symmetry=False): assert special_position_settings is None or crystal_symmetry is None assert self.crystal_symmetry is not None or crystal_symmetry is not None or special_position_settings is not None if (crystal_symmetr... |
special_position_settings=self.get_special_position_settings( special_position_settings=special_position_settings, crystal_symmetry=crystal_symmetry, force_symmetry=force_symmetry)) | special_position_settings=special_position_settings) | def extract_xray_structure(self, special_position_settings=None, crystal_symmetry=None, force_symmetry=False, discard_atoms_with_unknown_scattering_type=False, sites_cart=None, sites_frac=None, scattering_types=None): assert sites_cart is None or sites_frac is None result = xray.structure( special_position_settings=sel... |
sites_frac = result.unit_cell().orthogonalization_matrix() * sites_cart | sites_frac = result.unit_cell().fractionalization_matrix() * sites_cart | def extract_xray_structure(self, special_position_settings=None, crystal_symmetry=None, force_symmetry=False, discard_atoms_with_unknown_scattering_type=False, sites_cart=None, sites_frac=None, scattering_types=None): assert sites_cart is None or sites_frac is None result = xray.structure( special_position_settings=sel... |
else: | elif (self.crystal_symmetry is not None): crystal_symmetry = self.crystal_symmetry if (crystal_symmetry is not None): | def write_modified(self, out, new_sites_cart, crystal_symmetry=None): assert new_sites_cart.size() == len(self.atom_attributes_list) if (crystal_symmetry is None): if (self.cryst1_record is not None): print >> out, self.cryst1_record.rstrip() else: print >> out, pdb.format_cryst1_record( crystal_symmetry=crystal_symmet... |
if (miller_array.anomalous_flags()): | if (miller_array.anomalous_flag()): | def default_column_types(miller_array): result = None if (miller_array.is_complex_array() and miller_array.sigmas() is None): assert not miller_array.is_xray_intensity_array() if (miller_array.anomalous_flag()): result = "GP" else: result = "FP" elif (miller_array.is_xray_intensity_array()): if (miller_array.anomalous_... |
elif (default_col_types == "F"): | elif (default_col_types in ["F", "J"]): | def add_miller_array(self, miller_array, column_root_label, column_types=None, label_decorator=None): if (label_decorator is None): label_decorator = globals()["label_decorator"]() default_col_types = default_column_types(miller_array=miller_array) if (default_col_types is None): raise RuntimeError( "Conversion of give... |
elif (default_col_types == "G"): | elif (default_col_types in ["G", "K"]): | def add_miller_array(self, miller_array, column_root_label, column_types=None, label_decorator=None): if (label_decorator is None): label_decorator = globals()["label_decorator"]() default_col_types = default_column_types(miller_array=miller_array) if (default_col_types is None): raise RuntimeError( "Conversion of give... |
force=force_symmetry)).set_info(info)) | force=force_symmetry)) .set_info(info) .set_observation_type(miller_array.observation_type())) | def as_miller_arrays(self, crystal_symmetry=None, force_symmetry=False, merge_equivalents=True, base_array_info=None): if (self._file_type is None): return [] info_source = self._file_name if (info_source.startswith("./") or info_source.startswith(".\\")): info_source = info_source[2:] if (base_array_info is None): bas... |
free_flags = free_flags.common_set( miller_array ) | def run(command_name, args): if len(args)==0: print_help() elif ( "--help" in args ): print_help() elif ( "--h" in args ): print_help() elif ("-h" in args ): print_help() else: log = multi_out() if (not "--quiet" in args): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plo... | |
data = flex.bool( free_flags.data()== 1 )) free_flags = free_flags.common_set( miller_array ).map_to_asu() free_flags, miller_array = free_flags.common_sets( miller_array ) | data = flex.bool( free_flags.data() == 1 )) free_flags = free_flags.map_to_asu() free_flags = free_flags.common_set( miller_array ) | def run(command_name, args): if len(args)==0: print_help() elif ( "--help" in args ): print_help() elif ( "--h" in args ): print_help() elif ("-h" in args ): print_help() else: log = multi_out() if (not "--quiet" in args): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plo... |
if(macro_cycle == 1 or macro_cycle == 3 and bss is not None): | if((macro_cycle == 1 or macro_cycle == 3) and bss is not None): | def __init__(self, fmodel, selections = None, refine_r = True, refine_t = True, r_initial = None, t_initial = None, nref_min = 1000, max_iterations = 50, convergence_test = True, convergence_delta = 0.00001, use_... |
minimized.show(text = "lbfgs minimization", out = out) | minimized.collector.show(text = "lbfgs minimization", out = out) | def manager(simulated_annealing_params, bulk_solvent_parameters, refinement_parameters, alpha_beta_parameters, mask_parameters, target_weights, macro_cycle, wxnc_scale, tan_b_iso_max, monitor, fmodel, model, out = None): if(out is None): out = sys.stdout print_statistics.make_header("simulated annealing refinement", ou... |
cmd = "%(path_zip)s -q -r -z %(zip_file_name)s" \ + " %(bundle_prefix)s_sources" \ + " %(bundle_prefix)s_build" \ + " %(bundle_prefix)s_install_script.bat" % vars() | cmd = ("%(path_zip)s -q -r -z %(zip_file_name)s" + " %(bundle_prefix)s_sources" + " %(bundle_prefix)s_build" + " %(bundle_prefix)s_install_script.bat") % vars() | def run(args): "usage: libtbx.bundle_up bundle_prefix platform_string [addl_files...]" if (len(args) < 2): print run.__doc__ return path_zip = libtbx.config.full_path(command="zip.exe", search_first=["."]) if (path_zip is None): raise RuntimeError("Fatal: zip executable not found.") bundle_prefix = args[0] platform_str... |
ilego_block = other_xs | lego_block = other_xs | def ehms( args ): command_line = ( iotbx_option_parser( usage="iotbx.explore_metric_symmetry [options]", description="Explore Metric Symmetry. A list of possible unit cells and spacegroups is given for the given specified unit cell and spacegroup combination. If a second unit cell is given, linear combinations of the b... |
b_cart = b_cart) | b_cart = b_cart, mask_params = mask_params()) | def exercise(space_group_info, n_elements = 10, sf_cos_sin_table = False, sf_algorithm = "direct", table = "wk1995", d_min = 2.0, k_sol = 0.35, b_sol = 45.0, b_cart = None): xray_structure = random_structure.xray_structure( space_group_info = space_g... |
description="Example: python distance_ls.py strudat --tag=SOD") | description="Example: iotbx.distance_least_squares strudat --tag=SOD") | def run(distance_cutoff=3.5, nonbonded_distance_cutoff=5): command_line = (iotbx_option_parser( usage="iotbx.distance_least_squares [options] studat_file [...]", description="Example: python distance_ls.py strudat --tag=SOD") .option(None, "--tag", action="store", type="string", dest="tag", help="tag as it appears in t... |
self.order_check_array = [self.order_check( unit_cell, fixed )] | self.order_check_array = [self.order_check( unit_cell, fixed_element )] | def __init__(self, unit_cell, space_group, assume_incomming_is_in_reference_setting=False): from cctbx import crystal |
for order, cb_op, ii in zip( self.order_check_array, self.allowed_cb_ops, range( len(self.allowed_cb_ops) ) ): | for order in self.order_check_array: | def find_it(self): # check how many trues we have n_true = ( self.order_check_array ).count(True) best_index = None if n_true == 1: # there is only one solution best_index = self.order_check_array.index( True ) else: # there is more then one possible solution, use the first solution one encounters for order, cb_op, ii ... |
if (file_name_during_write is None): | if (file_name_during_write is None and self.file_name is not None): | def __init__(self, file_name, file_name_during_write=None): self.file_name = file_name if (file_name_during_write is None): self.file_name_during_write = self.file_name + ".new" else: self.file_name_during_write = self.file_name_during_write if (self.file_name is None or not os.path.exists(self.file_name)): self.pair_i... |
self.file_name_during_write = self.file_name_during_write | self.file_name_during_write = file_name_during_write | def __init__(self, file_name, file_name_during_write=None): self.file_name = file_name if (file_name_during_write is None): self.file_name_during_write = self.file_name + ".new" else: self.file_name_during_write = self.file_name_during_write if (self.file_name is None or not os.path.exists(self.file_name)): self.pair_i... |
""" for item in range( len(self.twin_laws) ): print >> out, " Twin law : %s"%( self.twin_laws[item] ) print >> out, " Given the specified spacegroup, the twin law is", if self.twin_law_type[item]==" PM": print >> out, "pseudo merohedral." if self.twin_law_type[item]==" M": print >> out, "merohedral." | if self.patterson_height is not None: | def show(self,out=None): if out is None: out = sys.stdout print >> out print >> out print >> out print >> out print >> out, "-------------------------------------------------------------------------------" print >> out, "Twinning and intensity statistics summary (acentric data):" print >> out print >> out, "Statistics ... |
print >> out, " Estimates of twin fraction: " print >> out, " - Britton analyses alpha : %4.3f"%(self.britton_alpha[item]) print >> out, " - H analyses alpha : %4.3f"%(self.h_alpha[item]) print >> out, " R-values of twin related intensities" print >> out, " - R_twin observed data : %4.3f"%(self.r... | print >> out, "Patterson analyses" print >> out, " - Largest peak height : %5.3f"%(self.patterson_height) print >> out, " (correpsonding p value : %8.3e)"%(self.patterson_p_value) | def show(self,out=None): if out is None: out = sys.stdout print >> out print >> out print >> out print >> out print >> out, "-------------------------------------------------------------------------------" print >> out, "Twinning and intensity statistics summary (acentric data):" print >> out print >> out, "Statistics ... |
""" print >> out print >> out, "Patterson analyses" print >> out, " - Largest peak height : %5.3f"%(self.patterson_height) print >> out, " (correpsonding p value : %8.3e)"%(self.patterson_p_value) print >> out | def show(self,out=None): if out is None: out = sys.stdout print >> out print >> out print >> out print >> out print >> out, "-------------------------------------------------------------------------------" print >> out, "Twinning and intensity statistics summary (acentric data):" print >> out print >> out, "Statistics ... | |
except: pass else: raise AssertionError, "No exception." | except RuntimeError, e: assert str(e) == "Array must be 0-based 1-dimensional." else: raise AssertionError, "No exception or wrong exception." | def exercise_exceptions(): f = flex.double(flex.grid((2,3))) try: f.assign(1, 0) except: pass else: raise AssertionError, "No exception." try: f.push_back(0) except: pass else: raise AssertionError, "No exception." try: f[(2,0)] except: pass else: raise AssertionError, "No exception." |
except: pass else: raise AssertionError, "No exception." | except IndexError, e: assert str(e) == "Index out of range." else: raise AssertionError, "No exception or wrong exception." | def exercise_exceptions(): f = flex.double(flex.grid((2,3))) try: f.assign(1, 0) except: pass else: raise AssertionError, "No exception." try: f.push_back(0) except: pass else: raise AssertionError, "No exception." try: f[(2,0)] except: pass else: raise AssertionError, "No exception." |
def outlier_utils(args): | def run(command_name, args): | def outlier_utils(args): if len(args)==0: print_help() elif ( "--help" in args ): print_help() elif ( "--h" in args ): print_help() elif ("-h" in args ): print_help() else: log = multi_out() if (not "--quiet" in args): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plots =... |
if miller_array.anomalous_flag(): free_flags = free_flags.miller_array.average_bijvoet_mates() merged_anomalous=True | if free_flags.anomalous_flag(): free_flags = free_flags.average_bijvoet_mates() merged_anomalous=True | def outlier_utils(args): if len(args)==0: print_help() elif ( "--help" in args ): print_help() elif ( "--h" in args ): print_help() elif ("-h" in args ): print_help() else: log = multi_out() if (not "--quiet" in args): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plots =... |
assert approx_equal(flex.mean(flex.abs(sfweight.fb())), 1.22050766588) assert approx_equal(flex.mean(flex.abs(sfweight.fd())), 1.61219832101) assert approx_equal(flex.mean(sfweight.centroid_phases()), -0.0339791322512) assert approx_equal(flex.mean(sfweight.figures_of_merit()), 0.109790067028) | assert approx_equal(flex.mean(flex.abs(sfweight.fb())), 2.5329658) assert approx_equal(flex.mean(flex.abs(sfweight.fd())), 0.7792442) assert approx_equal(flex.mean(sfweight.centroid_phases()), -0.033979132) assert approx_equal(flex.mean(sfweight.figures_of_merit()), 0.55824836) | def exercise_with_fixed_structure(): structure = xray.structure( crystal_symmetry=crystal.symmetry( unit_cell=(46.7058, 46.7058, 79.3998, 90, 90, 120), space_group_symbol="P 31"), scatterers=flex.xray_scatterer( [xray.scatterer(scattering_type="const", site=site) for site in [ (0.0169, 0.8953, 0.1115), (0.9395, 0.1282,... |
if(tan_b_iso_max != 0): | if(tan_b_iso_max is not None and tan_b_iso_max != 0): | def energies_adp_iso(self, xray_structure, parameters, wilson_b=None, compute_gradients=False, tan_b_iso_max=None, mean_displacements=None, gradients=None): result = scitbx.restraints.energies( compute_gradients=compute_gradients, gradients=gradients, gradients_size=xray_structure.scatterers().size(), gradients_factory... |
for key in (("sgsymbol", "P1"), | for key in (("sgsymbol", ""), | def GetFormData(): form = cgi.FieldStorage() inp = Empty() for key in (("sgsymbol", "P1"), ("convention", "")): if (form.has_key(key[0])): inp.__dict__[key[0]] = string.strip(form[key[0]].value) else: inp.__dict__[key[0]] = key[1] inp.symxyz = [] if (form.has_key("symxyz")): lines = string.split(form["symxyz"].value, "... |
data=flex.hendrickson_lattman(miller_set.indices().size())) | data=flex.hendrickson_lattman(miller_set.indices().size(), (0,0,0,0))) | def exercise_get_experimental_phases(): crystal_symmetry = crystal.symmetry( unit_cell=(30,31,32,85,95,100), space_group_symbol="P 1") miller_set = miller.build_set( crystal_symmetry=crystal_symmetry, anomalous_flag=False, d_min=3) input_array = miller_set.array( data=flex.hendrickson_lattman(miller_set.indices().size(... |
self.set_space_group_info(space_group_info=space_group_info) | self.set_space_group_info(space_group_info=new_space_group_info) | def change_basis_in_place(self, cb_op, new_space_group_info=None): # force update if column_type_legend is changed assert len(column_type_legend) == 16 # programmer alert for column_type in self.column_types(): if (column_type == "P"): raise RuntimeError( "In-place transformation of phase angles not implemented.") if (... |
self.write_dispatcher_in_bin( source_file=self.python_exe, target_file=module_name+".python") | def write_python_and_show_path_duplicates(self): module_names = {} for file_name in os.listdir(self.bin_path): if (file_name.startswith(".")): continue file_name_lower = file_name.lower() if (file_name_lower.startswith("libtbx.")): continue if ( file_name_lower == "python" or file_name_lower.startswith("python.")): c... | |
if (ext.traditional_convergence_test(n)(x, g)): | if (x is not None and g is not None and ext.traditional_convergence_test(n)(x, g)): | def filter(self, msg, n, x, g): if (not msg.startswith("lbfgs error")): return 1 if (msg.find("Rounding errors prevent further progress.") >= 0): if (self.ignore_line_search_failed_rounding_errors): return 0 elif (msg.find("The step is at the lower bound stpmax().") >= 0): if (ext.traditional_convergence_test(n)(x, g))... |
x = None | x, f, g = None, None, None | def run_c_plus_plus(target_evaluator, termination_params=None, core_params=None, exception_handling_params=None): if (termination_params is None): termination_params = termination_parameters() if (core_params is None): core_params = core_parameters() if (exception_handling_params is None): exception_handling_params = e... |
results.append(self.select(sel).measurability()) | results.append(self.select(sel).measurability(cutoff=cutoff)) | def measurability(self, use_binning=False, cutoff=3.0): ## Peter Zwart 3/4/2005 """\ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.