diff --git a/docs/.buildinfo b/docs/.buildinfo index 3fbb62b..8ca18ff 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: a0485ab5aa21ddde156875505b9df3e6 +config: 30541112c5c64755b831f359f99dc274 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/Makefile b/docs/Makefile index b08a3da..98726b7 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,9 +3,9 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = python -msphinx +SPHINXBUILD = sphinx-build SPHINXPROJ = pywindow -SOURCEDIR = source +SOURCEDIR = ./source/ BUILDDIR = .. # Put it first so that "make" without argument is like "make help". diff --git a/docs/_modules/index.html b/docs/_modules/index.html index 3ec21e5..737011e 100644 --- a/docs/_modules/index.html +++ b/docs/_modules/index.html @@ -153,7 +153,7 @@
- © Copyright 2018, Marcin Miklitz. + © Copyright 2017, Marcin Miklitz, Jelfs Materials Group.
self.message = message
-[docs]class Input(object):
+[docs]class Input(object):
"""Class used to load and process input files."""
def __init__(self):
@@ -183,7 +183,7 @@ Source code for pywindow.io_tools
'.mol': self._read_mol,
}
-[docs] def load_file(self, filepath):
+[docs] def load_file(self, filepath):
"""
This function opens any type of a readable file and decompose
the file object into a list, for each line, of lists containing
@@ -213,7 +213,7 @@ Source code for pywindow.io_tools
return (self._load_funcs[self.file_type]())
-[docs] def load_rdkit_mol(self, mol):
+[docs] def load_rdkit_mol(self, mol):
"""
Return molecular data from :class:`rdkit.Chem.rdchem.Mol` object.
@@ -321,7 +321,7 @@ Source code for pywindow.io_tools
return self.system
-[docs]class Output(object):
+[docs]class Output(object):
"""Class used to process and save output files."""
def __init__(self):
@@ -331,7 +331,7 @@ Source code for pywindow.io_tools
'pdb': self._save_pdb,
}
-[docs] def dump2json(self, obj, filepath, override=False, **kwargs):
+[docs] def dump2json(self, obj, filepath, override=False, **kwargs):
"""
Dump a dictionary into a JSON dictionary.
@@ -371,7 +371,7 @@ Source code for pywindow.io_tools
with open(filepath, 'w+') as json_file:
json.dump(obj, json_file, **kwargs)
-[docs] def dump2file(self, obj, filepath, override=False, **kwargs):
+[docs] def dump2file(self, obj, filepath, override=False, **kwargs):
"""
Dump a dictionary into a file. (Extensions: XYZ or PDB)
@@ -545,7 +545,7 @@ Source code for pywindow.io_tools
- © Copyright 2018, Marcin Miklitz.
+ © Copyright 2017, Marcin Miklitz, Jelfs Materials Group.
@@ -578,7 +578,6 @@ Source code for pywindow.io_tools
-
diff --git a/docs/_modules/pywindow/molecular.html b/docs/_modules/pywindow/molecular.html
index 1a35d8e..797dbc7 100644
--- a/docs/_modules/pywindow/molecular.html
+++ b/docs/_modules/pywindow/molecular.html
@@ -380,7 +380,7 @@ Source code for pywindow.molecular
return self.convexhull
-[docs]class Molecule(_Shape):
+[docs]class Molecule(_Shape):
"""
Container for a single molecule.
@@ -475,7 +475,7 @@ Source code for pywindow.molecular
"""
return cls(Input().load_rdkit_mol(mol), system_name, mol_id)
-[docs] def full_analysis(self, ncpus=1, **kwargs):
+[docs] def full_analysis(self, ncpus=1, **kwargs):
"""
Perform a full structural analysis of a molecule.
@@ -555,7 +555,7 @@ Source code for pywindow.molecular
else:
return None
-[docs] def calculate_centre_of_mass(self):
+[docs] def calculate_centre_of_mass(self):
"""
Return the xyz coordinates of the centre of mass of a molecule.
@@ -569,7 +569,7 @@ Source code for pywindow.molecular
self.properties['centre_of_mass'] = self.centre_of_mass
return self.centre_of_mass
-[docs] def calculate_maximum_diameter(self):
+[docs] def calculate_maximum_diameter(self):
"""
Return the maximum diamension of a molecule.
@@ -588,7 +588,7 @@ Source code for pywindow.molecular
}
return self.maximum_diameter
-[docs] def calculate_average_diameter(self, **kwargs):
+[docs] def calculate_average_diameter(self, **kwargs):
"""
Return the average diamension of a molecule.
@@ -602,7 +602,7 @@ Source code for pywindow.molecular
self.elements, self.coordinates, **kwargs)
return self.average_diameter
-[docs] def calculate_pore_diameter(self):
+[docs] def calculate_pore_diameter(self):
"""
Return the intrinsic pore diameter.
@@ -620,7 +620,7 @@ Source code for pywindow.molecular
}
return self.pore_diameter
-[docs] def calculate_pore_volume(self):
+[docs] def calculate_pore_volume(self):
"""
Return the intrinsic pore volume.
@@ -634,7 +634,7 @@ Source code for pywindow.molecular
self.properties['pore_volume'] = self.pore_volume
return self.pore_volume
-[docs] def calculate_pore_diameter_opt(self, **kwargs):
+[docs] def calculate_pore_diameter_opt(self, **kwargs):
"""
Return the intrinsic pore diameter (for the optimised pore centre).
@@ -658,7 +658,7 @@ Source code for pywindow.molecular
}
return self.pore_diameter_opt
-[docs] def calculate_pore_volume_opt(self, **kwargs):
+[docs] def calculate_pore_volume_opt(self, **kwargs):
"""
Return the intrinsic pore volume (for the optimised pore centre).
@@ -683,7 +683,7 @@ Source code for pywindow.molecular
Output()._save_xyz(shape_obj, filepath)
return 1
-[docs] def calculate_windows(self, **kwargs):
+[docs] def calculate_windows(self, **kwargs):
"""
Return the diameters of all windows in a molecule.
@@ -715,7 +715,7 @@ Source code for pywindow.molecular
)
return None
-[docs] def shift_to_origin(self, **kwargs):
+[docs] def shift_to_origin(self, **kwargs):
"""
Shift a molecule to Origin.
@@ -731,7 +731,7 @@ Source code for pywindow.molecular
self.coordinates = shift_com(self.elements, self.coordinates, **kwargs)
self._update()
-[docs] def molecular_weight(self):
+[docs] def molecular_weight(self):
"""
Return the molecular weight of a molecule.
@@ -744,7 +744,7 @@ Source code for pywindow.molecular
self.MW = molecular_weight(self.elements)
return self.MW
-[docs] def dump_properties_json(self, filepath=None, molecular=False, **kwargs):
+[docs] def dump_properties_json(self, filepath=None, molecular=False, **kwargs):
"""
Dump content of :attr:`Molecule.properties` to a JSON dictionary.
@@ -778,7 +778,7 @@ Source code for pywindow.molecular
# Dump the dictionary to json file.
self._Output.dump2json(dict_obj, filepath, default=to_list, **kwargs)
-[docs] def dump_molecule(self, filepath=None, include_coms=False, **kwargs):
+[docs] def dump_molecule(self, filepath=None, include_coms=False, **kwargs):
"""
Dump a :class:`Molecule` to a file (PDB or XYZ).
@@ -895,7 +895,7 @@ Source code for pywindow.molecular
return windows
-[docs]class MolecularSystem:
+[docs]class MolecularSystem:
"""
Container for the molecular system.
@@ -943,7 +943,7 @@ Source code for pywindow.molecular
self._Output = Output()
self.system_id = 0
-[docs] @classmethod
+[docs] @classmethod
def load_file(cls, filepath):
"""
Create a :class:`MolecularSystem` from an input file.
@@ -968,7 +968,7 @@ Source code for pywindow.molecular
obj.name, ext = os.path.splitext(obj.filename)
return obj
-[docs] @classmethod
+[docs] @classmethod
def load_rdkit_mol(cls, mol):
"""
Create a :class:`MolecularSystem` from :class:`rdkit.Chem.rdchem.Mol`.
@@ -988,7 +988,7 @@ Source code for pywindow.molecular
obj.system = obj._Input.load_rdkit_mol(mol)
return obj
-[docs] @classmethod
+[docs] @classmethod
def load_system(cls, dict_, system_id='system'):
"""
Create a :class:`MolecularSystem` from a python :class:`dict`.
@@ -1018,7 +1018,7 @@ Source code for pywindow.molecular
obj.system_id = system_id
return obj
-[docs] def rebuild_system(self, override=False, **kwargs):
+[docs] def rebuild_system(self, override=False, **kwargs):
"""
Rebuild molecules in molecular system.
@@ -1060,7 +1060,7 @@ Source code for pywindow.molecular
else:
return self.load_system(rebuild_system)
-[docs] def swap_atom_keys(self, swap_dict, dict_key='atom_ids'):
+[docs] def swap_atom_keys(self, swap_dict, dict_key='atom_ids'):
"""
Swap a force field atom id for another user-defined value.
@@ -1101,7 +1101,7 @@ Source code for pywindow.molecular
if self.system[dict_key][atom_key] == key:
self.system[dict_key][atom_key] = swap_dict[key]
-[docs] def decipher_atom_keys(self, forcefield='DLF', dict_key='atom_ids'):
+[docs] def decipher_atom_keys(self, forcefield='DLF', dict_key='atom_ids'):
"""
Decipher force field atom ids.
@@ -1149,7 +1149,7 @@ Source code for pywindow.molecular
temp[element], forcefield=forcefield))
self.system['elements'] = temp
-[docs] def make_modular(self, rebuild=False):
+[docs] def make_modular(self, rebuild=False):
"""
Find and return all :class:`Molecule` s in :class:`MolecularSystem`.
@@ -1176,7 +1176,7 @@ Source code for pywindow.molecular
for i in range(len(dis)):
self.molecules[i] = Molecule(dis[i], self.system_id, i)
-[docs] def system_to_molecule(self):
+[docs] def system_to_molecule(self):
"""
Return :class:`MolecularSystem` as a :class:`Molecule` directly.
@@ -1201,7 +1201,7 @@ Source code for pywindow.molecular
com=point))
return pores
-[docs] def dump_system(self, filepath=None, modular=False, **kwargs):
+[docs] def dump_system(self, filepath=None, modular=False, **kwargs):
"""
Dump a :class:`MolecularSystem` to a file (PDB or XYZ).
@@ -1254,7 +1254,7 @@ Source code for pywindow.molecular
self._Output.dump2file(
system_dict, filepath, atom_ids=atom_ids, **kwargs)
-[docs] def dump_system_json(self, filepath=None, modular=False, **kwargs):
+[docs] def dump_system_json(self, filepath=None, modular=False, **kwargs):
"""
Dump a :class:`MolecularSystem` to a JSON dictionary.
@@ -1314,7 +1314,7 @@ Source code for pywindow.molecular
- © Copyright 2018, Marcin Miklitz.
+ © Copyright 2017, Marcin Miklitz, Jelfs Materials Group.
@@ -1347,7 +1347,6 @@ Source code for pywindow.molecular
-
diff --git a/docs/_modules/pywindow/trajectory.html b/docs/_modules/pywindow/trajectory.html
index 6d7384e..4c0f22f 100644
--- a/docs/_modules/pywindow/trajectory.html
+++ b/docs/_modules/pywindow/trajectory.html
@@ -174,13 +174,13 @@ Source code for pywindow.trajectory
self.message = message
-[docs]def make_supercell(system, matrix, supercell=[1, 1, 1]):
+[docs]def make_supercell(system, matrix, supercell=[1, 1, 1]):
user_supercell = [[1, supercell[0]], [1, supercell[1]], [1, supercell[1]]]
system = create_supercell(system, matrix, supercell=user_supercell)
return MolecularSystem.load_system(system)
-[docs]class DLPOLY(object):
+[docs]class DLPOLY(object):
def __init__(self, filepath):
# Image conventions - periodic boundary key.
self._imcon = {
@@ -270,7 +270,7 @@ Source code for pywindow.trajectory
self.no_of_atoms = header[2]
return header
-[docs] def get_frames(self, frames, override=False, **kwargs):
+[docs] def get_frames(self, frames, override=False, **kwargs):
if override is True:
self.frames = {}
if isinstance(frames, int):
@@ -379,7 +379,7 @@ Source code for pywindow.trajectory
frame_data['forces'] = np.array(forces, dtype=float)
return frame_data
-[docs] def analysis(
+[docs] def analysis(
self, frames='all', ncpus=1, _ncpus=1, override=False, **kwargs
):
""" """
@@ -616,7 +616,7 @@ Source code for pywindow.trajectory
)
raise _TrajectoryError(error)
-[docs] def save_analysis(self, filepath=None, **kwargs):
+[docs] def save_analysis(self, filepath=None, **kwargs):
# We pass a copy of the analysis attribute dictionary.
dict_obj = deepcopy(self.analysis_output)
# If no filepath is provided we create one.
@@ -629,7 +629,7 @@ Source code for pywindow.trajectory
Output().dump2json(dict_obj, filepath, default=to_list, **kwargs)
return
-[docs] def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs):
+[docs] def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs):
settings = {
"pdb": Output()._save_pdb,
"xyz": Output()._save_xyz,
@@ -681,7 +681,7 @@ Source code for pywindow.trajectory
kwargs)
-[docs]class XYZ(object):
+[docs]class XYZ(object):
def __init__(self, filepath):
self.filepath = filepath
self.filename = os.path.basename(filepath)
@@ -726,7 +726,7 @@ Source code for pywindow.trajectory
progress = progress + len(bline)
self.no_of_frames = frame + 1
-[docs] def get_frames(self, frames, override=False, **kwargs):
+[docs] def get_frames(self, frames, override=False, **kwargs):
if override is True:
self.frames = {}
if isinstance(frames, int):
@@ -799,7 +799,7 @@ Source code for pywindow.trajectory
frame_data['coordinates'] = np.array(coordinates, dtype=float)
return frame_data
-[docs] def analysis(self, frames='all', ncpus=1, override=False, **kwargs):
+[docs] def analysis(self, frames='all', ncpus=1, override=False, **kwargs):
if override is True:
self.analysis_output = {}
if isinstance(frames, int):
@@ -931,7 +931,7 @@ Source code for pywindow.trajectory
pool.terminate()
raise _ParallelAnalysisError("Parallel analysis failed.")
-[docs] def save_analysis(self, filepath=None, **kwargs):
+[docs] def save_analysis(self, filepath=None, **kwargs):
# We pass a copy of the analysis attribute dictionary.
dict_obj = deepcopy(self.analysis_output)
# If no filepath is provided we create one.
@@ -945,7 +945,7 @@ Source code for pywindow.trajectory
return
-[docs]class PDB(object):
+[docs]class PDB(object):
def __init__(self, filepath):
self.filepath = filepath
self.filename = os.path.basename(filepath)
@@ -992,7 +992,7 @@ Source code for pywindow.trajectory
progress = progress + len(bline)
self.no_of_frames = frame
-[docs] def get_frames(self, frames, override=False, **kwargs):
+[docs] def get_frames(self, frames, override=False, **kwargs):
if override is True:
self.frames = {}
if isinstance(frames, int):
@@ -1072,7 +1072,7 @@ Source code for pywindow.trajectory
frame_data['coordinates'] = np.array(coordinates, dtype=float)
return frame_data
-[docs] def analysis(self, frames='all', ncpus=1, override=False, **kwargs):
+[docs] def analysis(self, frames='all', ncpus=1, override=False, **kwargs):
if override is True:
self.analysis_output = {}
if isinstance(frames, int):
@@ -1204,7 +1204,7 @@ Source code for pywindow.trajectory
pool.terminate()
raise _ParallelAnalysisError("Parallel analysis failed.")
-[docs] def save_analysis(self, filepath=None, **kwargs):
+[docs] def save_analysis(self, filepath=None, **kwargs):
# We pass a copy of the analysis attribute dictionary.
dict_obj = deepcopy(self.analysis_output)
# If no filepath is provided we create one.
@@ -1228,7 +1228,7 @@ Source code for pywindow.trajectory
- © Copyright 2018, Marcin Miklitz.
+ © Copyright 2017, Marcin Miklitz, Jelfs Materials Group.
@@ -1261,7 +1261,6 @@ Source code for pywindow.trajectory
-
diff --git a/docs/_modules/pywindow/utilities.html b/docs/_modules/pywindow/utilities.html
index 44ee636..a402963 100644
--- a/docs/_modules/pywindow/utilities.html
+++ b/docs/_modules/pywindow/utilities.html
@@ -209,7 +209,7 @@ Source code for pywindow.utilities
self.message = message
-[docs]def is_number(number):
+[docs]def is_number(number):
"""
Return True if an object is a number - can be converted into a float.
@@ -230,7 +230,7 @@ Source code for pywindow.utilities
return False
-[docs]def unique(input_list):
+[docs]def unique(input_list):
"""
Return a list of unique items (similar to set functionality).
@@ -252,14 +252,14 @@ Source code for pywindow.utilities
return output
-[docs]def to_list(obj):
+[docs]def to_list(obj):
""" """
if isinstance(obj, np.ndarray):
return obj.tolist()
raise TypeError('Not serializable')
-[docs]def distance(a, b):
+[docs]def distance(a, b):
"""
Return the distance between two vectors (points) a and b.
@@ -279,7 +279,7 @@ Source code for pywindow.utilities
return (np.sum((a - b)**2))**0.5
-[docs]def molecular_weight(elements):
+[docs]def molecular_weight(elements):
"""
Return molecular weight of a molecule.
@@ -297,7 +297,7 @@ Source code for pywindow.utilities
return (np.array([atomic_mass[i.upper()] for i in elements]).sum())
-[docs]def center_of_coor(coordinates):
+[docs]def center_of_coor(coordinates):
"""
Return the centre of coordinates.
@@ -316,7 +316,7 @@ Source code for pywindow.utilities
return (np.sum(coordinates, axis=0) / coordinates.shape[0])
-[docs]def center_of_mass(elements, coordinates):
+[docs]def center_of_mass(elements, coordinates):
"""
Return the centre of mass (COM).
@@ -341,7 +341,7 @@ Source code for pywindow.utilities
return (np.sum(mass_coordinates, axis=0) / np.array([mass, mass, mass]))
-[docs]def compose_atom_list(*args):
+[docs]def compose_atom_list(*args):
"""
Return an `atom list` from elements and/or atom ids and coordinates.
@@ -407,7 +407,7 @@ Source code for pywindow.utilities
return atom_list
-[docs]def decompose_atom_list(atom_list):
+[docs]def decompose_atom_list(atom_list):
"""
Return elements and/or atom ids and coordinates from an `atom list`.
@@ -454,7 +454,7 @@ Source code for pywindow.utilities
" with only 4 or 5 items per sublist.")
-[docs]def dlf_notation(atom_key):
+[docs]def dlf_notation(atom_key):
"""Return element for atom key using DL_F notation."""
split = list(atom_key)
element = ''
@@ -476,7 +476,7 @@ Source code for pywindow.utilities
return element
-[docs]def opls_notation(atom_key):
+[docs]def opls_notation(atom_key):
"""Return element for OPLS forcefield atom key."""
# warning for Ne, He, Na types overlap
conflicts = ['ne', 'he', 'na']
@@ -495,7 +495,7 @@ Source code for pywindow.utilities
atom_key))
-[docs]def decipher_atom_key(atom_key, forcefield):
+[docs]def decipher_atom_key(atom_key, forcefield):
"""
Return element for deciphered atom key.
@@ -535,7 +535,7 @@ Source code for pywindow.utilities
).format(forcefield))
-[docs]def shift_com(elements, coordinates, com_adjust=np.zeros(3)):
+[docs]def shift_com(elements, coordinates, com_adjust=np.zeros(3)):
"""
Return coordinates translated by some vector.
@@ -560,7 +560,7 @@ Source code for pywindow.utilities
return coordinates - com
-[docs]def max_dim(elements, coordinates):
+[docs]def max_dim(elements, coordinates):
"""
Return the maximum diameter of a molecule.
@@ -589,7 +589,7 @@ Source code for pywindow.utilities
return i1, i2, maxdim
-[docs]def pore_diameter(elements, coordinates, com=None):
+[docs]def pore_diameter(elements, coordinates, com=None):
"""Return pore diameter of a molecule."""
if com is None:
com = center_of_mass(elements, coordinates)
@@ -601,13 +601,13 @@ Source code for pywindow.utilities
return (pored, index)
-[docs]def correct_pore_diameter(com, *params):
+[docs]def correct_pore_diameter(com, *params):
"""Return negative of a pore diameter. (optimisation function)."""
elements, coordinates = params
return (-pore_diameter(elements, coordinates, com)[0])
-[docs]def opt_pore_diameter(elements, coordinates, bounds=None, com=None, **kwargs):
+[docs]def opt_pore_diameter(elements, coordinates, bounds=None, com=None, **kwargs):
"""Return optimised pore diameter and it's COM."""
args = elements, coordinates
if com is not None:
@@ -627,32 +627,32 @@ Source code for pywindow.utilities
return (pored[0], pored[1], minimisation.x)
-[docs]def sphere_volume(sphere_radius):
+[docs]def sphere_volume(sphere_radius):
"""Return volume of a sphere."""
return (4 / 3 * np.pi * sphere_radius**3)
-[docs]def asphericity(S):
+
-[docs]def acylidricity(S):
+
-[docs]def relative_shape_anisotropy(S):
+[docs]def relative_shape_anisotropy(S):
return (1 - 3 * (
(S[0] * S[1] + S[0] * S[2] + S[1] * S[2]) / (np.sum(S))**2))
-[docs]def get_tensor_eigenvalues(T, sort=False):
+[docs]def get_tensor_eigenvalues(T, sort=False):
if sort:
return (sorted(np.linalg.eigvals(T), reverse=True))
else:
return (np.linalg.eigvals(T))
-[docs]def get_gyration_tensor(elements, coordinates):
+[docs]def get_gyration_tensor(elements, coordinates):
"""
Return the gyration tensor of a molecule.
@@ -689,7 +689,7 @@ Source code for pywindow.utilities
return (S)
-[docs]def get_inertia_tensor(elements, coordinates):
+[docs]def get_inertia_tensor(elements, coordinates):
"""
Return the tensor of inertia a molecule.
@@ -724,11 +724,11 @@ Source code for pywindow.utilities
return (inertia_tensor)
-[docs]def principal_axes(elements, coordinates):
+[docs]def principal_axes(elements, coordinates):
return (np.linalg.eig(get_inertia_tensor(elements, coordinates))[1].T)
-[docs]def normalize_vector(vector):
+[docs]def normalize_vector(vector):
"""
Normalize a vector.
@@ -749,7 +749,7 @@ Source code for pywindow.utilities
return np.round(v, decimals=4)
-[docs]def rotation_matrix_arbitrary_axis(angle, axis):
+[docs]def rotation_matrix_arbitrary_axis(angle, axis):
"""
Return a rotation matrix of `angle` radians about `axis`.
@@ -788,7 +788,7 @@ Source code for pywindow.utilities
return np.array([[e11, e12, e13], [e21, e22, e23], [e31, e32, e33]])
-[docs]def align_principal_ax(elements, coordinates):
+[docs]def align_principal_ax(elements, coordinates):
""" """
coor = deepcopy(coordinates)
new_coor = []
@@ -813,25 +813,25 @@ Source code for pywindow.utilities
return (coor, rot)
-[docs]def calc_asphericity(elements, coordinates):
+[docs]def calc_asphericity(elements, coordinates):
inertia_tensor = get_inertia_tensor(elements, coordinates)
tensor_eigenvalues = get_tensor_eigenvalues(inertia_tensor, sort=True)
return asphericity(tensor_eigenvalues)
-[docs]def calc_acylidricity(elements, coordinates):
+[docs]def calc_acylidricity(elements, coordinates):
inertia_tensor = get_inertia_tensor(elements, coordinates)
tensor_eigenvalues = get_tensor_eigenvalues(inertia_tensor, sort=True)
return acylidricity(tensor_eigenvalues)
-[docs]def calc_relative_shape_anisotropy(elements, coordinates):
+[docs]def calc_relative_shape_anisotropy(elements, coordinates):
inertia_tensor = get_inertia_tensor(elements, coordinates)
tensor_eigenvalues = get_tensor_eigenvalues(inertia_tensor, sort=True)
return relative_shape_anisotropy(tensor_eigenvalues)
-[docs]def unit_cell_to_lattice_array(cryst):
+[docs]def unit_cell_to_lattice_array(cryst):
"""Return parallelpiped unit cell lattice matrix."""
a_, b_, c_, alpha, beta, gamma = cryst
# Convert angles from degrees to radians.
@@ -858,7 +858,7 @@ Source code for pywindow.utilities
return lattice_array
-[docs]def lattice_array_to_unit_cell(lattice_array):
+[docs]def lattice_array_to_unit_cell(lattice_array):
"""Return crystallographic param. from unit cell lattice matrix."""
cell_lengths = np.sqrt(np.sum(lattice_array**2, axis=0))
gamma_r = np.arccos(lattice_array[0][1] / cell_lengths[1])
@@ -873,31 +873,31 @@ Source code for pywindow.utilities
return np.append(cell_lengths, cell_angles)
-[docs]def volume_from_lattice_array(lattice_array):
+[docs]def volume_from_lattice_array(lattice_array):
"""Return unit cell's volume from lattice matrix."""
return np.linalg.det(lattice_array)
-[docs]def volume_from_cell_parameters(cryst):
+[docs]def volume_from_cell_parameters(cryst):
"""Return unit cell's volume from crystallographic parameters."""
return volume_from_lattice_array(unit_cell_to_lattice_array(cryst))
-[docs]def fractional_from_cartesian(coordinate, lattice_array):
+[docs]def fractional_from_cartesian(coordinate, lattice_array):
"""Return a fractional coordinate from a cartesian one."""
deorthogonalisation_M = np.matrix(np.linalg.inv(lattice_array))
fractional = deorthogonalisation_M * coordinate.reshape(-1, 1)
return np.array(fractional.reshape(1, -1))
-[docs]def cartisian_from_fractional(coordinate, lattice_array):
+[docs]def cartisian_from_fractional(coordinate, lattice_array):
"""Return cartesian coordinate from a fractional one."""
orthogonalisation_M = np.matrix(lattice_array)
orthogonal = orthogonalisation_M * coordinate.reshape(-1, 1)
return np.array(orthogonal.reshape(1, -1))
-[docs]def cart2frac_all(coordinates, lattice_array):
+[docs]def cart2frac_all(coordinates, lattice_array):
"""Convert all cartesian coordinates to fractional."""
frac_coordinates = deepcopy(coordinates)
for coord in range(frac_coordinates.shape[0]):
@@ -906,7 +906,7 @@ Source code for pywindow.utilities
return frac_coordinates
-[docs]def frac2cart_all(frac_coordinates, lattice_array):
+[docs]def frac2cart_all(frac_coordinates, lattice_array):
"""Convert all fractional coordinates to cartesian."""
coordinates = deepcopy(frac_coordinates)
for coord in range(coordinates.shape[0]):
@@ -915,7 +915,7 @@ Source code for pywindow.utilities
return coordinates
-[docs]def create_supercell(system, supercell=[[-1, 1], [-1, 1], [-1, 1]]):
+[docs]def create_supercell(system, supercell=[[-1, 1], [-1, 1], [-1, 1]]):
"""Create a supercell."""
if 'lattice' not in system.keys():
matrix = unit_cell_to_lattice_array(system['unit_cell'])
@@ -955,7 +955,7 @@ Source code for pywindow.utilities
return supercell_system
-[docs]def is_inside_polyhedron(point, polyhedron):
+[docs]def is_inside_polyhedron(point, polyhedron):
if polyhedron.shape == (1, 6):
matrix = unit_cell_to_lattice_array(polyhedron)
if polyhedron.shape == (3, 3):
@@ -970,12 +970,12 @@ Source code for pywindow.utilities
return False
-[docs]def normal_vector(origin, vectors):
+[docs]def normal_vector(origin, vectors):
"""Return normal vector for two vectors with same origin."""
return np.cross(vectors[0] - origin, vectors[1] - origin)
-[docs]def discrete_molecules(system, rebuild=None, tol=0.4):
+[docs]def discrete_molecules(system, rebuild=None, tol=0.4):
"""
Decompose molecular system into individual discreet molecules.
@@ -1224,7 +1224,7 @@ Source code for pywindow.utilities
return molecules
-[docs]def angle_between_vectors(x, y):
+[docs]def angle_between_vectors(x, y):
"""Calculate the angle between two vectors x and y."""
first_step = abs(x[0] * y[0] + x[1] * y[1] + x[2] * y[2]) / (
np.sqrt(x[0]**2 + x[1]**2 + x[2]**2) *
@@ -1233,7 +1233,7 @@ Source code for pywindow.utilities
return (second_step)
-[docs]def vector_analysis(vector, coordinates, elements_vdw, increment=1.0):
+[docs]def vector_analysis(vector, coordinates, elements_vdw, increment=1.0):
"""Analyse a sampling vector's path for window analysis purpose."""
# Calculate number of chunks if vector length is divided by increment.
chunks = int(np.linalg.norm(vector) // increment)
@@ -1254,7 +1254,7 @@ Source code for pywindow.utilities
[dist, analysed_vector[pos] * 2, *chunk * pos, *vector])
-[docs]def vector_preanalysis(vector, coordinates, elements_vdw, increment=1.0):
+[docs]def vector_preanalysis(vector, coordinates, elements_vdw, increment=1.0):
norm_vec = vector/np.linalg.norm(vector)
intersections = []
origin = center_of_coor(coordinates)
@@ -1280,21 +1280,21 @@ Source code for pywindow.utilities
return vector_analysis(vector, coordinates, elements_vdw, increment)
-[docs]def optimise_xy(xy, *args):
+[docs]def optimise_xy(xy, *args):
"""Return negative pore diameter for x and y coordinates optimisation."""
z, elements, coordinates = args
window_com = np.array([xy[0], xy[1], z])
return -pore_diameter(elements, coordinates, com=window_com)[0]
-[docs]def optimise_z(z, *args):
+[docs]def optimise_z(z, *args):
"""Return pore diameter for coordinates optimisation in z direction."""
x, y, elements, coordinates = args
window_com = np.array([x, y, z])
return pore_diameter(elements, coordinates, com=window_com)[0]
-[docs]def window_analysis(window,
+[docs]def window_analysis(window,
elements,
coordinates,
elements_vdw,
@@ -1444,7 +1444,7 @@ Source code for pywindow.utilities
return (window_diameter, window_com)
-[docs]def find_windows(elements,
+[docs]def find_windows(elements,
coordinates,
processes=None,
mol_size=None,
@@ -1613,7 +1613,7 @@ Source code for pywindow.utilities
return (windows, windows_coms)
-[docs]def window_shape(window,
+[docs]def window_shape(window,
elements,
coordinates,
increment2=0.1,
@@ -1771,7 +1771,7 @@ Source code for pywindow.utilities
return XY_plane
-[docs]def find_windows_new(elements,
+[docs]def find_windows_new(elements,
coordinates,
processes=None,
mol_size=None,
@@ -1892,7 +1892,7 @@ Source code for pywindow.utilities
return clustered_results, elements, coordinates, initial_com
-[docs]def calculate_window_diameter(window, elements, coordinates, **kwargs):
+[docs]def calculate_window_diameter(window, elements, coordinates, **kwargs):
elements_vdw = np.array(
[[atomic_vdw_radius[x.upper()]] for x in elements]
)
@@ -1907,7 +1907,7 @@ Source code for pywindow.utilities
return None
-[docs]def get_window_com(window, elements, coordinates, initial_com, **kwargs):
+[docs]def get_window_com(window, elements, coordinates, initial_com, **kwargs):
elements_vdw = np.array(
[[atomic_vdw_radius[x.upper()]] for x in elements]
)
@@ -1923,7 +1923,7 @@ Source code for pywindow.utilities
return None
-[docs]def vector_analysis_reversed(vector, coordinates, elements_vdw):
+[docs]def vector_analysis_reversed(vector, coordinates, elements_vdw):
norm_vec = vector/np.linalg.norm(vector)
intersections = []
origin = center_of_coor(coordinates)
@@ -1948,7 +1948,7 @@ Source code for pywindow.utilities
return [dist_origin, intersection]
-[docs]def find_average_diameter(elements, coordinates, adjust=1, increment=0.1,
+[docs]def find_average_diameter(elements, coordinates, adjust=1, increment=0.1,
processes=None, **kwargs):
"""Return average diameter for a molecule."""
# Copy the coordinates as will perform many opertaions on them
@@ -2009,7 +2009,7 @@ Source code for pywindow.utilities
return np.mean(results_cleaned)*2
-[docs]def vector_analysis_pore_shape(vector, coordinates, elements_vdw):
+[docs]def vector_analysis_pore_shape(vector, coordinates, elements_vdw):
norm_vec = vector/np.linalg.norm(vector)
intersections = []
origin = center_of_coor(coordinates)
@@ -2033,7 +2033,7 @@ Source code for pywindow.utilities
return sorted(intersections)[0][1]
-[docs]def calculate_pore_shape(elements, coordinates, adjust=1, increment=0.1,
+[docs]def calculate_pore_shape(elements, coordinates, adjust=1, increment=0.1,
**kwargs):
"""Return average diameter for a molecule."""
# Copy the coordinates as will perform many opertaions on them
@@ -2097,7 +2097,7 @@ Source code for pywindow.utilities
return coor
-[docs]def circumcircle_window(coordinates, atom_set):
+[docs]def circumcircle_window(coordinates, atom_set):
# Calculating circumcircle
A = np.array(coordinates[int(atom_set[0])])
B = np.array(coordinates[int(atom_set[1])])
@@ -2120,7 +2120,7 @@ Source code for pywindow.utilities
return R, COM
-[docs]def circumcircle(coordinates, atom_sets):
+[docs]def circumcircle(coordinates, atom_sets):
pld_diameter_list = []
pld_com_list = []
iter_ = 0
@@ -2142,7 +2142,7 @@ Source code for pywindow.utilities
- © Copyright 2018, Marcin Miklitz.
+ © Copyright 2017, Marcin Miklitz, Jelfs Materials Group.
@@ -2175,7 +2175,6 @@ Source code for pywindow.utilities
-
diff --git a/docs/_sources/pywindow.io_tools.rst.txt b/docs/_sources/pywindow.io_tools.rst.txt
deleted file mode 100644
index f5b6346..0000000
--- a/docs/_sources/pywindow.io_tools.rst.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-pywindow\.io\_tools module
-==========================
-
-.. automodule:: pywindow.io_tools
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/docs/_sources/pywindow.molecular.rst.txt b/docs/_sources/pywindow.molecular.rst.txt
deleted file mode 100644
index c34545c..0000000
--- a/docs/_sources/pywindow.molecular.rst.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-pywindow\.molecular module
-==========================
-
-.. automodule:: pywindow.molecular
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/docs/_sources/pywindow.rst.txt b/docs/_sources/pywindow.rst.txt
index 60121a5..880d1d5 100644
--- a/docs/_sources/pywindow.rst.txt
+++ b/docs/_sources/pywindow.rst.txt
@@ -4,13 +4,46 @@ pywindow package
Submodules
----------
-.. toctree::
+pywindow.io\_tools module
+-------------------------
+
+.. automodule:: pywindow.io_tools
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+pywindow.molecular module
+-------------------------
+
+.. automodule:: pywindow.molecular
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+pywindow.tables module
+----------------------
+
+.. automodule:: pywindow.tables
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+pywindow.trajectory module
+--------------------------
+
+.. automodule:: pywindow.trajectory
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+pywindow.utilities module
+-------------------------
+
+.. automodule:: pywindow.utilities
+ :members:
+ :undoc-members:
+ :show-inheritance:
- pywindow.io_tools
- pywindow.molecular
- pywindow.tables
- pywindow.trajectory
- pywindow.utilities
Module contents
---------------
diff --git a/docs/_sources/pywindow.tables.rst.txt b/docs/_sources/pywindow.tables.rst.txt
deleted file mode 100644
index ad01f51..0000000
--- a/docs/_sources/pywindow.tables.rst.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-pywindow\.tables module
-=======================
-
-.. automodule:: pywindow.tables
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/docs/_sources/pywindow.trajectory.rst.txt b/docs/_sources/pywindow.trajectory.rst.txt
deleted file mode 100644
index e0271aa..0000000
--- a/docs/_sources/pywindow.trajectory.rst.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-pywindow\.trajectory module
-===========================
-
-.. automodule:: pywindow.trajectory
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/docs/_sources/pywindow.utilities.rst.txt b/docs/_sources/pywindow.utilities.rst.txt
deleted file mode 100644
index 83d8324..0000000
--- a/docs/_sources/pywindow.utilities.rst.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-pywindow\.utilities module
-==========================
-
-.. automodule:: pywindow.utilities
- :members:
- :undoc-members:
- :show-inheritance:
diff --git a/docs/_static/fonts/Inconsolata-Bold.ttf b/docs/_static/fonts/Inconsolata-Bold.ttf
deleted file mode 100644
index 58c9fef..0000000
Binary files a/docs/_static/fonts/Inconsolata-Bold.ttf and /dev/null differ
diff --git a/docs/_static/fonts/Inconsolata-Regular.ttf b/docs/_static/fonts/Inconsolata-Regular.ttf
deleted file mode 100644
index a87ffba..0000000
Binary files a/docs/_static/fonts/Inconsolata-Regular.ttf and /dev/null differ
diff --git a/docs/_static/fonts/Lato-Bold.ttf b/docs/_static/fonts/Lato-Bold.ttf
deleted file mode 100644
index 7434369..0000000
Binary files a/docs/_static/fonts/Lato-Bold.ttf and /dev/null differ
diff --git a/docs/_static/fonts/Lato-Regular.ttf b/docs/_static/fonts/Lato-Regular.ttf
deleted file mode 100644
index 04ea8ef..0000000
Binary files a/docs/_static/fonts/Lato-Regular.ttf and /dev/null differ
diff --git a/docs/_static/fonts/RobotoSlab-Bold.ttf b/docs/_static/fonts/RobotoSlab-Bold.ttf
deleted file mode 100644
index df5d1df..0000000
Binary files a/docs/_static/fonts/RobotoSlab-Bold.ttf and /dev/null differ
diff --git a/docs/_static/fonts/RobotoSlab-Regular.ttf b/docs/_static/fonts/RobotoSlab-Regular.ttf
deleted file mode 100644
index eb52a79..0000000
Binary files a/docs/_static/fonts/RobotoSlab-Regular.ttf and /dev/null differ
diff --git a/docs/_static/jquery-3.1.0.js b/docs/_static/jquery-3.1.0.js
deleted file mode 100644
index f2fc274..0000000
--- a/docs/_static/jquery-3.1.0.js
+++ /dev/null
@@ -1,10074 +0,0 @@
-/*eslint-disable no-unused-vars*/
-/*!
- * jQuery JavaScript Library v3.1.0
- * https://jquery.com/
- *
- * Includes Sizzle.js
- * https://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license
- * https://jquery.org/license
- *
- * Date: 2016-07-07T21:44Z
- */
-( function( global, factory ) {
-
- "use strict";
-
- if ( typeof module === "object" && typeof module.exports === "object" ) {
-
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get jQuery.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
- module.exports = global.document ?
- factory( global, true ) :
- function( w ) {
- if ( !w.document ) {
- throw new Error( "jQuery requires a window with a document" );
- }
- return factory( w );
- };
- } else {
- factory( global );
- }
-
-// Pass this if window is not defined yet
-} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-
-// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
-// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
-// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
-// enough that all such attempts are guarded in a try block.
-"use strict";
-
-var arr = [];
-
-var document = window.document;
-
-var getProto = Object.getPrototypeOf;
-
-var slice = arr.slice;
-
-var concat = arr.concat;
-
-var push = arr.push;
-
-var indexOf = arr.indexOf;
-
-var class2type = {};
-
-var toString = class2type.toString;
-
-var hasOwn = class2type.hasOwnProperty;
-
-var fnToString = hasOwn.toString;
-
-var ObjectFunctionString = fnToString.call( Object );
-
-var support = {};
-
-
-
- function DOMEval( code, doc ) {
- doc = doc || document;
-
- var script = doc.createElement( "script" );
-
- script.text = code;
- doc.head.appendChild( script ).parentNode.removeChild( script );
- }
-/* global Symbol */
-// Defining this global in .eslintrc would create a danger of using the global
-// unguarded in another place, it seems safer to define global only for this module
-
-
-
-var
- version = "3.1.0",
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
-
- // The jQuery object is actually just the init constructor 'enhanced'
- // Need init if jQuery is called (just allow error to be thrown if not included)
- return new jQuery.fn.init( selector, context );
- },
-
- // Support: Android <=4.0 only
- // Make sure we trim BOM and NBSP
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // Matches dashed string for camelizing
- rmsPrefix = /^-ms-/,
- rdashAlpha = /-([a-z])/g,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
-
-jQuery.fn = jQuery.prototype = {
-
- // The current version of jQuery being used
- jquery: version,
-
- constructor: jQuery,
-
- // The default length of a jQuery object is 0
- length: 0,
-
- toArray: function() {
- return slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num != null ?
-
- // Return just the one element from the set
- ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
-
- // Return all the elements in a clean array
- slice.call( this );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- each: function( callback ) {
- return jQuery.each( this, callback );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map( this, function( elem, i ) {
- return callback.call( elem, i, elem );
- } ) );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ) );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- eq: function( i ) {
- var len = this.length,
- j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
- },
-
- end: function() {
- return this.prevObject || this.constructor();
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: arr.sort,
- splice: arr.splice
-};
-
-jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[ 0 ] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
-
- // Skip the boolean and the target
- target = arguments[ i ] || {};
- i++;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
- target = {};
- }
-
- // Extend jQuery itself if only one argument is passed
- if ( i === length ) {
- target = this;
- i--;
- }
-
- for ( ; i < length; i++ ) {
-
- // Only deal with non-null/undefined values
- if ( ( options = arguments[ i ] ) != null ) {
-
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
- ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
-
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray( src ) ? src : [];
-
- } else {
- clone = src && jQuery.isPlainObject( src ) ? src : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
-};
-
-jQuery.extend( {
-
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
- // Assume jQuery is ready without the ready module
- isReady: true,
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- noop: function() {},
-
- isFunction: function( obj ) {
- return jQuery.type( obj ) === "function";
- },
-
- isArray: Array.isArray,
-
- isWindow: function( obj ) {
- return obj != null && obj === obj.window;
- },
-
- isNumeric: function( obj ) {
-
- // As of jQuery 3.0, isNumeric is limited to
- // strings and numbers (primitives or objects)
- // that can be coerced to finite numbers (gh-2662)
- var type = jQuery.type( obj );
- return ( type === "number" || type === "string" ) &&
-
- // parseFloat NaNs numeric-cast false positives ("")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- !isNaN( obj - parseFloat( obj ) );
- },
-
- isPlainObject: function( obj ) {
- var proto, Ctor;
-
- // Detect obvious negatives
- // Use toString instead of jQuery.type to catch host objects
- if ( !obj || toString.call( obj ) !== "[object Object]" ) {
- return false;
- }
-
- proto = getProto( obj );
-
- // Objects with no prototype (e.g., `Object.create( null )`) are plain
- if ( !proto ) {
- return true;
- }
-
- // Objects with prototype are plain iff they were constructed by a global Object function
- Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
- return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
- },
-
- isEmptyObject: function( obj ) {
-
- /* eslint-disable no-unused-vars */
- // See https://github.com/eslint/eslint/issues/6125
- var name;
-
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- type: function( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
-
- // Support: Android <=2.3 only (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call( obj ) ] || "object" :
- typeof obj;
- },
-
- // Evaluates a script in a global context
- globalEval: function( code ) {
- DOMEval( code );
- },
-
- // Convert dashed to camelCase; used by the css and data modules
- // Support: IE <=9 - 11, Edge 12 - 13
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
- each: function( obj, callback ) {
- var length, i = 0;
-
- if ( isArrayLike( obj ) ) {
- length = obj.length;
- for ( ; i < length; i++ ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- }
-
- return obj;
- },
-
- // Support: Android <=4.0 only
- trim: function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var ret = results || [];
-
- if ( arr != null ) {
- if ( isArrayLike( Object( arr ) ) ) {
- jQuery.merge( ret,
- typeof arr === "string" ?
- [ arr ] : arr
- );
- } else {
- push.call( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- return arr == null ? -1 : indexOf.call( arr, elem, i );
- },
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- merge: function( first, second ) {
- var len = +second.length,
- j = 0,
- i = first.length;
-
- for ( ; j < len; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, invert ) {
- var callbackInverse,
- matches = [],
- i = 0,
- length = elems.length,
- callbackExpect = !invert;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- callbackInverse = !callback( elems[ i ], i );
- if ( callbackInverse !== callbackExpect ) {
- matches.push( elems[ i ] );
- }
- }
-
- return matches;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var length, value,
- i = 0,
- ret = [];
-
- // Go through the array, translating each of the items to their new values
- if ( isArrayLike( elems ) ) {
- length = elems.length;
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( i in elems ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
- }
-
- // Flatten any nested arrays
- return concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- },
-
- now: Date.now,
-
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support: support
-} );
-
-if ( typeof Symbol === "function" ) {
- jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
-}
-
-// Populate the class2type map
-jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
-function( i, name ) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-} );
-
-function isArrayLike( obj ) {
-
- // Support: real iOS 8.2 only (not reproducible in simulator)
- // `in` check used to prevent JIT error (gh-2145)
- // hasOwn isn't used here due to false negatives
- // regarding Nodelist length in IE
- var length = !!obj && "length" in obj && obj.length,
- type = jQuery.type( obj );
-
- if ( type === "function" || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- return type === "array" || length === 0 ||
- typeof length === "number" && length > 0 && ( length - 1 ) in obj;
-}
-var Sizzle =
-/*!
- * Sizzle CSS Selector Engine v2.3.0
- * https://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2016-01-04
- */
-(function( window ) {
-
-var i,
- support,
- Expr,
- getText,
- isXML,
- tokenize,
- compile,
- select,
- outermostContext,
- sortInput,
- hasDuplicate,
-
- // Local document vars
- setDocument,
- document,
- docElem,
- documentIsHTML,
- rbuggyQSA,
- rbuggyMatches,
- matches,
- contains,
-
- // Instance-specific data
- expando = "sizzle" + 1 * new Date(),
- preferredDoc = window.document,
- dirruns = 0,
- done = 0,
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- }
- return 0;
- },
-
- // Instance methods
- hasOwn = ({}).hasOwnProperty,
- arr = [],
- pop = arr.pop,
- push_native = arr.push,
- push = arr.push,
- slice = arr.slice,
- // Use a stripped-down indexOf as it's faster than native
- // https://jsperf.com/thor-indexof-vs-for/5
- indexOf = function( list, elem ) {
- var i = 0,
- len = list.length;
- for ( ; i < len; i++ ) {
- if ( list[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
- // Regular expressions
-
- // http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
-
- // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
-
- // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
- attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
- // Operator (capture 2)
- "*([*^$|!~]?=)" + whitespace +
- // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
- "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
- "*\\]",
-
- pseudos = ":(" + identifier + ")(?:\\((" +
- // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
- // 1. quoted (capture 3; capture 4 or capture 5)
- "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
- // 2. simple (capture 6)
- "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
- // 3. anything else (capture 2)
- ".*" +
- ")\\)|)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rwhitespace = new RegExp( whitespace + "+", "g" ),
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
- rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
-
- rpseudo = new RegExp( pseudos ),
- ridentifier = new RegExp( "^" + identifier + "$" ),
-
- matchExpr = {
- "ID": new RegExp( "^#(" + identifier + ")" ),
- "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
- "TAG": new RegExp( "^(" + identifier + "|[*])" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
- },
-
- rinputs = /^(?:input|select|textarea|button)$/i,
- rheader = /^h\d$/i,
-
- rnative = /^[^{]+\{\s*\[native \w/,
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
- rsibling = /[+~]/,
-
- // CSS escapes
- // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
- runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
- funescape = function( _, escaped, escapedWhitespace ) {
- var high = "0x" + escaped - 0x10000;
- // NaN means non-codepoint
- // Support: Firefox<24
- // Workaround erroneous numeric interpretation of +"0x"
- return high !== high || escapedWhitespace ?
- escaped :
- high < 0 ?
- // BMP codepoint
- String.fromCharCode( high + 0x10000 ) :
- // Supplemental Plane codepoint (surrogate pair)
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
- },
-
- // CSS string/identifier serialization
- // https://drafts.csswg.org/cssom/#common-serializing-idioms
- rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,
- fcssescape = function( ch, asCodePoint ) {
- if ( asCodePoint ) {
-
- // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
- if ( ch === "\0" ) {
- return "\uFFFD";
- }
-
- // Control characters and (dependent upon position) numbers get escaped as code points
- return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
- }
-
- // Other potentially-special ASCII characters get backslash-escaped
- return "\\" + ch;
- },
-
- // Used for iframes
- // See setDocument()
- // Removing the function wrapper causes a "Permission Denied"
- // error in IE
- unloadHandler = function() {
- setDocument();
- },
-
- disabledAncestor = addCombinator(
- function( elem ) {
- return elem.disabled === true;
- },
- { dir: "parentNode", next: "legend" }
- );
-
-// Optimize for push.apply( _, NodeList )
-try {
- push.apply(
- (arr = slice.call( preferredDoc.childNodes )),
- preferredDoc.childNodes
- );
- // Support: Android<4.0
- // Detect silently failing push.apply
- arr[ preferredDoc.childNodes.length ].nodeType;
-} catch ( e ) {
- push = { apply: arr.length ?
-
- // Leverage slice if possible
- function( target, els ) {
- push_native.apply( target, slice.call(els) );
- } :
-
- // Support: IE<9
- // Otherwise append directly
- function( target, els ) {
- var j = target.length,
- i = 0;
- // Can't trust NodeList.length
- while ( (target[j++] = els[i++]) ) {}
- target.length = j - 1;
- }
- };
-}
-
-function Sizzle( selector, context, results, seed ) {
- var m, i, elem, nid, match, groups, newSelector,
- newContext = context && context.ownerDocument,
-
- // nodeType defaults to 9, since context defaults to document
- nodeType = context ? context.nodeType : 9;
-
- results = results || [];
-
- // Return early from calls with invalid selector or context
- if ( typeof selector !== "string" || !selector ||
- nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
- return results;
- }
-
- // Try to shortcut find operations (as opposed to filters) in HTML documents
- if ( !seed ) {
-
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
- setDocument( context );
- }
- context = context || document;
-
- if ( documentIsHTML ) {
-
- // If the selector is sufficiently simple, try using a "get*By*" DOM method
- // (excepting DocumentFragment context, where the methods don't exist)
- if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
-
- // ID selector
- if ( (m = match[1]) ) {
-
- // Document context
- if ( nodeType === 9 ) {
- if ( (elem = context.getElementById( m )) ) {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
-
- // Element context
- } else {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( newContext && (elem = newContext.getElementById( m )) &&
- contains( context, elem ) &&
- elem.id === m ) {
-
- results.push( elem );
- return results;
- }
- }
-
- // Type selector
- } else if ( match[2] ) {
- push.apply( results, context.getElementsByTagName( selector ) );
- return results;
-
- // Class selector
- } else if ( (m = match[3]) && support.getElementsByClassName &&
- context.getElementsByClassName ) {
-
- push.apply( results, context.getElementsByClassName( m ) );
- return results;
- }
- }
-
- // Take advantage of querySelectorAll
- if ( support.qsa &&
- !compilerCache[ selector + " " ] &&
- (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
-
- if ( nodeType !== 1 ) {
- newContext = context;
- newSelector = selector;
-
- // qSA looks outside Element context, which is not what we want
- // Thanks to Andrew Dupont for this workaround technique
- // Support: IE <=8
- // Exclude object elements
- } else if ( context.nodeName.toLowerCase() !== "object" ) {
-
- // Capture the context ID, setting it first if necessary
- if ( (nid = context.getAttribute( "id" )) ) {
- nid = nid.replace( rcssescape, fcssescape );
- } else {
- context.setAttribute( "id", (nid = expando) );
- }
-
- // Prefix every selector in the list
- groups = tokenize( selector );
- i = groups.length;
- while ( i-- ) {
- groups[i] = "#" + nid + " " + toSelector( groups[i] );
- }
- newSelector = groups.join( "," );
-
- // Expand context for sibling selectors
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
- context;
- }
-
- if ( newSelector ) {
- try {
- push.apply( results,
- newContext.querySelectorAll( newSelector )
- );
- return results;
- } catch ( qsaError ) {
- } finally {
- if ( nid === expando ) {
- context.removeAttribute( "id" );
- }
- }
- }
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
-}
-
-/**
- * Create key-value caches of limited size
- * @returns {function(string, object)} Returns the Object data after storing it on itself with
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- * deleting the oldest entry
- */
-function createCache() {
- var keys = [];
-
- function cache( key, value ) {
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
- if ( keys.push( key + " " ) > Expr.cacheLength ) {
- // Only keep the most recent entries
- delete cache[ keys.shift() ];
- }
- return (cache[ key + " " ] = value);
- }
- return cache;
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
- fn[ expando ] = true;
- return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created element and returns a boolean result
- */
-function assert( fn ) {
- var el = document.createElement("fieldset");
-
- try {
- return !!fn( el );
- } catch (e) {
- return false;
- } finally {
- // Remove from its parent by default
- if ( el.parentNode ) {
- el.parentNode.removeChild( el );
- }
- // release memory in IE
- el = null;
- }
-}
-
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
- var arr = attrs.split("|"),
- i = arr.length;
-
- while ( i-- ) {
- Expr.attrHandle[ arr[i] ] = handler;
- }
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
- var cur = b && a,
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- a.sourceIndex - b.sourceIndex;
-
- // Use IE sourceIndex if available on both nodes
- if ( diff ) {
- return diff;
- }
-
- // Check if b follows a
- if ( cur ) {
- while ( (cur = cur.nextSibling) ) {
- if ( cur === b ) {
- return -1;
- }
- }
- }
-
- return a ? 1 : -1;
-}
-
-/**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
-function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
-}
-
-/**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
-function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && elem.type === type;
- };
-}
-
-/**
- * Returns a function to use in pseudos for :enabled/:disabled
- * @param {Boolean} disabled true for :disabled; false for :enabled
- */
-function createDisabledPseudo( disabled ) {
- // Known :disabled false positives:
- // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset)
- // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
- return function( elem ) {
-
- // Check form elements and option elements for explicit disabling
- return "label" in elem && elem.disabled === disabled ||
- "form" in elem && elem.disabled === disabled ||
-
- // Check non-disabled form elements for fieldset[disabled] ancestors
- "form" in elem && elem.disabled === false && (
- // Support: IE6-11+
- // Ancestry is covered for us
- elem.isDisabled === disabled ||
-
- // Otherwise, assume any non-