from __future__ import absolute_import, division, print_function import cctbx.eltbx.fp_fdp # import dependency import boost_adaptbx.boost.python as bp ext = bp.import_ext("cctbx_eltbx_sasaki_ext") from cctbx_eltbx_sasaki_ext import * bp.inject(ext.table_iterator, bp.py3_make_iterator)
def standard_deviation(self): return ext.standard_deviation(self) def variance(self): return ext.variance(self) def kurtosis(self): return ext.kurtosis(self) def skewness(self): return ext.skewness(self) def pdf(self, x): return ext.pdf(self, x) def cdf(self, x): return ext.cdf(self, x) def quantile(self, p): return ext.quantile(self, p) def quantiles(self, n): return ext.quantiles(self, n) bp.inject(normal_distribution, __distribution_mixin) if (hasattr(ext, "students_t_distribution")): bp.inject(students_t_distribution, __distribution_mixin)
from __future__ import absolute_import, division, print_function import boost_adaptbx.boost.python as bp ext = bp.import_ext("cctbx_eltbx_wavelengths_ext") from cctbx_eltbx_wavelengths_ext import * bp.inject(ext.characteristic_iterator, bp.py3_make_iterator)
from __future__ import absolute_import, division, print_function import boost_adaptbx.boost.python as bp ext = bp.import_ext("cctbx_eltbx_neutron_ext") from cctbx_eltbx_neutron_ext import * bp.inject(ext.neutron_news_1992_table_iterator, bp.py3_make_iterator)
SN SB TE I XE CS BA LA CE PR ND PM SM EU GD TB DY HO ER TM YB LU HF TA W RE OS IR PT AU HG TL PB BI PO AT RN FR RA AC TH PA U NP PU""".split() def get_element_and_charge_symbols(scattering_type, exact=True): sl = get_standard_label(label=scattering_type, exact=exact, optional=True) if (sl is None): return "", "" if (sl == "Hiso"): return "H", "" if (sl == "Cval"): return "C", "" if (sl == "Sival"): return "Si", "" if (sl[-1] in ["+", "-"]): return sl[:-2], sl[-2:] return sl, "" bp.inject(ext.it1992_iterator, bp.py3_make_iterator) bp.inject(ext.wk1995_iterator, bp.py3_make_iterator) @bp.inject_into(ext.gaussian) class _(): def show(self, f=None, format=None): if (f is None): f = sys.stdout if (format is None): format = "%.8g" for l, v in (("a:", self.array_of_a()), ("b:", self.array_of_b())): print(l, " ".join([format % x for x in v]), file=f) print("c:", format % self.c(), file=f) return self def electron_density(self, r, b_iso): from math import pi, exp
return None f2 = s.focus() == o.focus() f3 = s.origin() == o.origin() f4 = s.all() == o.all() if ([f1, f2, f3, f4].count(False) > 0): return False else: return True def grid_unit_cell(self): """ This is a unit cell describing one pixel of the map. It is used in maptbx.non_crystallographic_eight_point_interpolation. This grid_unit_cell is the original unit cell divided by the original grid size. """ from cctbx import uctbx a = self.unit_cell_parameters[0] / self.unit_cell_grid[0] b = self.unit_cell_parameters[1] / self.unit_cell_grid[1] c = self.unit_cell_parameters[2] / self.unit_cell_grid[2] alpha, beta, gamma = self.unit_cell_parameters[3:6] return uctbx.unit_cell((a, b, c, alpha, beta, gamma)) bp.inject(ext.map_reader, utils) # A way to access these @bp.inject_into(ext.map_reader) # A way to access these class _(): def dummy(self): pass # don't do anything
"R -3", "R 3 2", "R 3 m", "R 3 c", "R -3 m", "R -3 c"] class empty: pass from cctbx.array_family import flex from scitbx import matrix from boost_adaptbx.boost import rational import random import sys bp.inject(ext.space_group_symbol_iterator, bp.py3_make_iterator) def vec3_rat_from_str(s): flds = s.split(",") assert len(flds) == 3 result = [] for fld in flds: slash_count = fld.count("/") assert slash_count < 2 if (slash_count == 0): n, d = int(fld), 1 else: n, d = [int(t) for t in fld.split("/")] result.append(rational.int(n, d)) return result