From 35da10027d17d7d369cafaf9575dfb8ce680b315 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Sat, 7 Jun 2025 15:26:49 +0200 Subject: [PATCH 1/8] Move to internal, has issues. --- src/pywindow/__init__.py | 27 ++++++++++++++-------- src/pywindow/_internal/__init__.py | 1 + src/pywindow/{ => _internal}/io_tools.py | 0 src/pywindow/{ => _internal}/molecular.py | 0 src/pywindow/{ => _internal}/tables.py | 0 src/pywindow/{ => _internal}/trajectory.py | 0 src/pywindow/{ => _internal}/utilities.py | 0 src/pywindow/py.typed | 0 8 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 src/pywindow/_internal/__init__.py rename src/pywindow/{ => _internal}/io_tools.py (100%) rename src/pywindow/{ => _internal}/molecular.py (100%) rename src/pywindow/{ => _internal}/tables.py (100%) rename src/pywindow/{ => _internal}/trajectory.py (100%) rename src/pywindow/{ => _internal}/utilities.py (100%) create mode 100644 src/pywindow/py.typed diff --git a/src/pywindow/__init__.py b/src/pywindow/__init__.py index 7f83b2b..290a66a 100644 --- a/src/pywindow/__init__.py +++ b/src/pywindow/__init__.py @@ -1,10 +1,19 @@ -#!/usr/bin/env python3 -from .tables import * -from .io_tools import * -from .utilities import * -from .molecular import * -from .trajectory import * -# from .postprocess import * -# from .shape import * +"""pywindow module.""" -name = 'pywindow' +from pywindow._internal.io_tools import Input +from pywindow._internal.molecular import MolecularSystem, Molecule +from pywindow._internal.tables import periodic_table +from pywindow._internal.trajectory import DLPOLY, PDB, XYZ, make_supercell +from pywindow._internal.utilities import compare_properties_dict + +__all__ = [ + "DLPOLY", + "PDB", + "XYZ", + "Input", + "MolecularSystem", + "Molecule", + "compare_properties_dict", + "make_supercell", + "periodic_table", +] diff --git a/src/pywindow/_internal/__init__.py b/src/pywindow/_internal/__init__.py new file mode 100644 index 0000000..7c576cb --- /dev/null +++ b/src/pywindow/_internal/__init__.py @@ -0,0 +1 @@ +"""pywindow module.""" diff --git a/src/pywindow/io_tools.py b/src/pywindow/_internal/io_tools.py similarity index 100% rename from src/pywindow/io_tools.py rename to src/pywindow/_internal/io_tools.py diff --git a/src/pywindow/molecular.py b/src/pywindow/_internal/molecular.py similarity index 100% rename from src/pywindow/molecular.py rename to src/pywindow/_internal/molecular.py diff --git a/src/pywindow/tables.py b/src/pywindow/_internal/tables.py similarity index 100% rename from src/pywindow/tables.py rename to src/pywindow/_internal/tables.py diff --git a/src/pywindow/trajectory.py b/src/pywindow/_internal/trajectory.py similarity index 100% rename from src/pywindow/trajectory.py rename to src/pywindow/_internal/trajectory.py diff --git a/src/pywindow/utilities.py b/src/pywindow/_internal/utilities.py similarity index 100% rename from src/pywindow/utilities.py rename to src/pywindow/_internal/utilities.py diff --git a/src/pywindow/py.typed b/src/pywindow/py.typed new file mode 100644 index 0000000..e69de29 From 1592960208ffa7ecbf28a5cb6f877f3f8367dba8 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Sat, 7 Jun 2025 15:28:21 +0200 Subject: [PATCH 2/8] Run ruff fix on save on all. --- src/pywindow/_internal/io_tools.py | 295 +++++---- src/pywindow/_internal/molecular.py | 560 ++++++++-------- src/pywindow/_internal/tables.py | 906 +++++++++++++++++--------- src/pywindow/_internal/trajectory.py | 897 ++++++++++++------------- src/pywindow/_internal/utilities.py | 942 +++++++++++++++------------ 5 files changed, 2029 insertions(+), 1571 deletions(-) diff --git a/src/pywindow/_internal/io_tools.py b/src/pywindow/_internal/io_tools.py index ab108ad..cfcebb8 100644 --- a/src/pywindow/_internal/io_tools.py +++ b/src/pywindow/_internal/io_tools.py @@ -1,7 +1,8 @@ """Module contains classes for input/output processing.""" -import os import json +import os + import numpy as np from .utilities import decipher_atom_key, unit_cell_to_lattice_array @@ -32,19 +33,18 @@ def __init__(self, message): self.message = message -class Input(object): +class Input: """Class used to load and process input files.""" def __init__(self): self._load_funcs = { - '.xyz': self._read_xyz, - '.pdb': self._read_pdb, - '.mol': self._read_mol, + ".xyz": self._read_xyz, + ".pdb": self._read_pdb, + ".mol": self._read_mol, } def load_file(self, filepath): - """ - This function opens any type of a readable file and decompose + """This function opens any type of a readable file and decompose the file object into a list, for each line, of lists containing splitted line strings using space as a spacer. @@ -53,7 +53,7 @@ def load_file(self, filepath): filepath : :class:`str` The full path or a relative path to any type of file. - Returns + Returns: ------- :class:`dict` Returns a dictionary containing the molecular information @@ -70,18 +70,17 @@ def load_file(self, filepath): with open(filepath) as ffile: self.file_content = ffile.readlines() - return (self._load_funcs[self.file_type]()) + return self._load_funcs[self.file_type]() def load_rdkit_mol(self, mol): - """ - Return molecular data from :class:`rdkit.Chem.rdchem.Mol` object. + """Return molecular data from :class:`rdkit.Chem.rdchem.Mol` object. Parameters ---------- mol : :class:`rdkit.Chem.rdchem.Mol` A molecule object from RDKit. - Returns + Returns: ------- :class:`dict` A dictionary with ``elements`` and ``coordinates`` as keys @@ -90,16 +89,15 @@ def load_rdkit_mol(self, mol): """ self.system = { - 'elements': np.empty( - mol.GetNumAtoms(), dtype=str), - 'coordinates': np.empty((mol.GetNumAtoms(), 3)) + "elements": np.empty(mol.GetNumAtoms(), dtype=str), + "coordinates": np.empty((mol.GetNumAtoms(), 3)), } for atom in mol.GetAtoms(): atom_id = atom.GetIdx() atom_sym = atom.GetSymbol() x, y, z = mol.GetConformer().GetAtomPosition(atom_id) - self.system['elements'][atom_id] = atom_sym - self.system['coordinates'][atom_id] = x, y, z + self.system["elements"][atom_id] = atom_sym + self.system["coordinates"][atom_id] = x, y, z return self.system def _read_xyz(self): @@ -107,92 +105,114 @@ def _read_xyz(self): try: self.system = dict() self.file_remarks = self.file_content[1] - self.system['elements'] = np.array( - [i.split()[0] for i in self.file_content[2:]]) - self.system['coordinates'] = np.array( - [[float(j[0]), float(j[1]), float(j[2])] - for j in [i.split()[1:] for i in self.file_content[2:]]]) + self.system["elements"] = np.array( + [i.split()[0] for i in self.file_content[2:]] + ) + self.system["coordinates"] = np.array( + [ + [float(j[0]), float(j[1]), float(j[2])] + for j in [i.split()[1:] for i in self.file_content[2:]] + ] + ) return self.system except IndexError: raise _CorruptedXYZFile( "The XYZ file is corrupted in some way. For example, an empty " "line at the end etc. or it is a trajectory. If the latter is " - "the case, please use `trajectory` module, otherwise fix it.") + "the case, please use `trajectory` module, otherwise fix it." + ) def _read_pdb(self): """""" - if sum([i.count('END ') for i in self.file_content]) > 1: + if sum([i.count("END ") for i in self.file_content]) > 1: raise _CorruptedPDBFile( "Multiple 'END' statements were found in this PDB file." "If this is a trajectory, use a trajectory module, " - "Otherwise, fix it.") + "Otherwise, fix it." + ) self.system = dict() - self.system['remarks'] = [ - i for i in self.file_content if i[:6] == 'REMARK' + self.system["remarks"] = [ + i for i in self.file_content if i[:6] == "REMARK" ] - self.system['unit_cell'] = np.array([ - float(x) - for i in self.file_content for x in - [i[6:15], i[15:24], i[24:33], i[33:40], i[40:47], i[47:54]] - if i[:6] == 'CRYST1' - ]) - if self.system['unit_cell'].any(): - self.system['lattice'] = unit_cell_to_lattice_array(self.system[ - 'unit_cell']) - self.system['atom_ids'] = np.array( + self.system["unit_cell"] = np.array( [ - i[12:16].strip() for i in self.file_content - if i[:6] == 'HETATM' or i[:6] == 'ATOM ' + float(x) + for i in self.file_content + for x in [ + i[6:15], + i[15:24], + i[24:33], + i[33:40], + i[40:47], + i[47:54], + ] + if i[:6] == "CRYST1" + ] + ) + if self.system["unit_cell"].any(): + self.system["lattice"] = unit_cell_to_lattice_array( + self.system["unit_cell"] + ) + self.system["atom_ids"] = np.array( + [ + i[12:16].strip() + for i in self.file_content + if i[:6] == "HETATM" or i[:6] == "ATOM " ], - dtype=' 2: - if line[2] == 'END' and line[3] == 'ATOM': + if line[2] == "END" and line[3] == "ATOM": atom_data = False if atom_data is True: elements.append(line[3]) coordinates.append(line[4:7]) - if line[2] == 'BEGIN' and line[3] == 'ATOM': + if line[2] == "BEGIN" and line[3] == "ATOM": atom_data = True - self.system['elements'] = np.array(elements) - self.system['coordinates'] = np.array(coordinates, dtype=float) + self.system["elements"] = np.array(elements) + self.system["coordinates"] = np.array(coordinates, dtype=float) return self.system -class Output(object): +class Output: """Class used to process and save output files.""" def __init__(self): self.cwd = os.getcwd() self._save_funcs = { - 'xyz': self._save_xyz, - 'pdb': self._save_pdb, + "xyz": self._save_xyz, + "pdb": self._save_pdb, } def dump2json(self, obj, filepath, override=False, **kwargs): - """ - Dump a dictionary into a JSON dictionary. + """Dump a dictionary into a JSON dictionary. Uses the json.dump() function. @@ -212,9 +232,10 @@ def dump2json(self, obj, filepath, override=False, **kwargs): pass else: raise _NotADictionary( - "This function only accepts dictionaries as input") + "This function only accepts dictionaries as input" + ) # We check if the filepath has a json extenstion, if not we add it. - if str(filepath[-4:]) == 'json': + if str(filepath[-4:]) == "json": pass else: filepath = ".".join((str(filepath), "json")) @@ -224,15 +245,15 @@ def dump2json(self, obj, filepath, override=False, **kwargs): if override is False: if os.path.isfile(filepath): raise _FileAlreadyExists( - "The file {0} already exists. Use a different filepath, " - "or set the 'override' kwarg to True.".format(filepath)) + f"The file {filepath} already exists. Use a different filepath, " + "or set the 'override' kwarg to True." + ) # We dump the object to the json file. Additional kwargs can be passed. - with open(filepath, 'w+') as json_file: + with open(filepath, "w+") as json_file: json.dump(obj, json_file, **kwargs) def dump2file(self, obj, filepath, override=False, **kwargs): - """ - Dump a dictionary into a file. (Extensions: XYZ or PDB) + """Dump a dictionary into a file. (Extensions: XYZ or PDB) Parameters ---------- @@ -251,94 +272,97 @@ def dump2file(self, obj, filepath, override=False, **kwargs): if override is False: if os.path.isfile(filepath): raise _FileAlreadyExists( - "The file {0} already exists. Use a different filepath, " - "or set the 'override' kwarg to True.".format(filepath)) + f"The file {filepath} already exists. Use a different filepath, " + "or set the 'override' kwarg to True." + ) if str(filepath[-3:]) not in self._save_funcs.keys(): raise _FileTypeError( - "The {0} file extension is " + f"The {filepath[-3:]!s} file extension is " "not supported for dumping a MolecularSystem or a Molecule. " - "Please use XYZ or PDB.".format(str(filepath[-3:]))) + "Please use XYZ or PDB." + ) self._save_funcs[str(filepath[-3:])](obj, filepath, **kwargs) def _save_xyz(self, system, filepath, **kwargs): """""" # Initial settings. settings = { - 'elements': 'elements', - 'coordinates': 'coordinates', - 'remark': " ", - 'decipher': False, - 'forcefield': None, + "elements": "elements", + "coordinates": "coordinates", + "remark": " ", + "decipher": False, + "forcefield": None, } settings.update(kwargs) # Extract neccessary data. - elements = system['elements'] - coordinates = system['coordinates'] - if settings['decipher'] is True: - elements = np.array([ - decipher_atom_key( - key, forcefield=settings['forcefield']) for key in elements - ]) - string = '{0:0d}\n{1}\n'.format(len(elements), str(settings['remark'])) + elements = system["elements"] + coordinates = system["coordinates"] + if settings["decipher"] is True: + elements = np.array( + [ + decipher_atom_key(key, forcefield=settings["forcefield"]) + for key in elements + ] + ) + string = "{0:0d}\n{1}\n".format(len(elements), str(settings["remark"])) for i, j in zip(elements, coordinates): - string += '{0} {1:.2f} {2:.2f} {3:.2f}\n'.format(i, *j) - with open(filepath, 'w+') as file_: + string += "{0} {1:.2f} {2:.2f} {3:.2f}\n".format(i, *j) + with open(filepath, "w+") as file_: file_.write(string) def _save_pdb(self, system, filepath, **kwargs): """""" settings = { - 'atom_ids': 'atom_ids', - 'elements': 'elements', - 'coordinates': 'coordinates', - 'cryst': 'unit_cell', - 'connect': None, - 'remarks': None, - 'space_group': None, - 'resName': "MOL", - 'chainID': 'A', - 'resSeq': 1, - 'decipher': False, - 'forcefield': None, + "atom_ids": "atom_ids", + "elements": "elements", + "coordinates": "coordinates", + "cryst": "unit_cell", + "connect": None, + "remarks": None, + "space_group": None, + "resName": "MOL", + "chainID": "A", + "resSeq": 1, + "decipher": False, + "forcefield": None, } settings.update(kwargs) # We create initial string that we will gradually extend while we # process the data and in the end it will be written into a pdb file. string = "REMARK File generated using pyWINDOW." # Number of items (atoms) in the provided system. - len_ = system[settings['atom_ids']].shape[0] + len_ = system[settings["atom_ids"]].shape[0] # We process the remarks, if any, given by the user (optional). - if isinstance(settings['remarks'], (list, tuple)): + if isinstance(settings["remarks"], (list, tuple)): # If a list or tuple of remarks each is written at a new line # with the REMARK prefix not to have to long remark line. - for remark in settings['remarks']: - string = "\n".join([string, 'REMARK {0}'.format(remark)]) - else: - # Otherwise if it's a single string or an int/float we just write - # it under single remark line, otherwise nothing happens. - if isinstance(settings['remarks'], (str, int, float)): - remark = settings['remarks'] - string = "\n".join([string, 'REMARK {0}'.format(remark)]) + for remark in settings["remarks"]: + string = "\n".join([string, f"REMARK {remark}"]) + # Otherwise if it's a single string or an int/float we just write + # it under single remark line, otherwise nothing happens. + elif isinstance(settings["remarks"], (str, int, float)): + remark = settings["remarks"] + string = "\n".join([string, f"REMARK {remark}"]) # If there is a unit cell (crystal data) provided we need to add it. - if settings['cryst'] in system.keys(): - if system[settings['cryst']].any(): + if settings["cryst"] in system.keys(): + if system[settings["cryst"]].any(): cryst_line = "CRYST1" - cryst = system[settings['cryst']] + cryst = system[settings["cryst"]] # The user have to provide the crystal data as a list/array # of six items containing unit cell edges lengths a, b and c # in x, y and z directions and three angles, or it can be. # Other options are not allowed for simplicity. It can convert # from the lattice array using function from utilities. for i in cryst[:3]: - cryst_line = "".join([cryst_line, "{0:9.3f}".format(i)]) + cryst_line = "".join([cryst_line, f"{i:9.3f}"]) for i in cryst[3:]: - cryst_line = "".join([cryst_line, "{0:7.2f}".format(i)]) + cryst_line = "".join([cryst_line, f"{i:7.2f}"]) # This is kind of messy, by default the data written in PDB # file should be P1 symmetry group therefore containing all # atom coordinates and not considering symmetry operations. # But, user can still define a space group if he wishes to. - if settings['space_group'] is not None: - space_group = settings['space_group'] + if settings["space_group"] is not None: + space_group = settings["space_group"] else: space_group = "{0}".format("P1") cryst_line = " ".join([cryst_line, space_group]) @@ -354,41 +378,40 @@ def _save_pdb(self, system, filepath, **kwargs): # (chainID) and residue sequence (resSeq) can be controlled by # appropriate parameter keyword passed to this function, Otherwise # the default values from settings dictionary are used. - atom_ids = system[settings['atom_ids']] - elements = system[settings['elements']] + atom_ids = system[settings["atom_ids"]] + elements = system[settings["elements"]] # If the 'elements' array of the system need deciphering atom keys this # is done if the user sets decipher to True. They can also provided # forcefield, otherwise it's None which equals to DLF. - if settings['decipher'] is True: - elements = np.array([ - decipher_atom_key( - key, forcefield=settings['forcefield']) for key in elements - ]) - coordinates = system[settings['coordinates']] + if settings["decipher"] is True: + elements = np.array( + [ + decipher_atom_key(key, forcefield=settings["forcefield"]) + for key in elements + ] + ) + coordinates = system[settings["coordinates"]] for i in range(len_): - atom_line = "ATOM {0:5d}".format(i + 1) - atom_id = "{0:4}".format(atom_ids[i].center(4)) - resName = "{0:3}".format(settings['resName']) - chainID = settings['chainID'] + atom_line = f"ATOM {i + 1:5d}" + atom_id = f"{atom_ids[i].center(4):4}" + resName = "{0:3}".format(settings["resName"]) + chainID = settings["chainID"] atom_line = " ".join([atom_line, atom_id, resName, chainID]) - resSeq = str(settings['resSeq']).rjust(4) + resSeq = str(settings["resSeq"]).rjust(4) atom_line = "".join([atom_line, resSeq]) - coor = "{0:8.3f}{1:8.3f}{2:8.3f}".format( - coordinates[i][0], - coordinates[i][1], - coordinates[i][2], ) + coor = f"{coordinates[i][0]:8.3f}{coordinates[i][1]:8.3f}{coordinates[i][2]:8.3f}" atom_line = " ".join([atom_line, coor]) big_space = "{0}".format(" ".center(22)) - element = "{0:2} ".format(elements[i].rjust(2)) + element = f"{elements[i].rjust(2):2} " atom_line = "".join([atom_line, big_space, element]) string = "\n".join([string, atom_line]) # The connectivity part is to be written after a function calculating # connectivity is finished # "Everything that has a beginning has an end" by Neo. :) - string = "\n".join([string, 'END']) + string = "\n".join([string, "END"]) # Check if .pdb extension is missing from filepath. - if filepath[-4:].lower() != '.pdb': - filepath = ".".join((filepath, 'pdb')) + if filepath[-4:].lower() != ".pdb": + filepath = ".".join((filepath, "pdb")) # Write the string to a a PDB file. - with open(filepath, 'w+') as file: + with open(filepath, "w+") as file: file.write(string) diff --git a/src/pywindow/_internal/molecular.py b/src/pywindow/_internal/molecular.py index ed5cbab..d2e5bd2 100644 --- a/src/pywindow/_internal/molecular.py +++ b/src/pywindow/_internal/molecular.py @@ -1,5 +1,4 @@ -""" -Defines :class:`MolecularSystem` and :class:`Molecule` classes. +"""Defines :class:`MolecularSystem` and :class:`Molecule` classes. This module is the most important part of the ``pywindow`` package, as it is at the frontfront of the interaction with the user. The two main classes @@ -19,37 +18,39 @@ """ import os -import numpy as np from copy import deepcopy + +import numpy as np from scipy.spatial import ConvexHull from .io_tools import Input, Output -from .utilities import (discrete_molecules, - decipher_atom_key, - molecular_weight, - center_of_mass, - max_dim, - pore_diameter, - opt_pore_diameter, - sphere_volume, - find_windows, - shift_com, - create_supercell, - is_inside_polyhedron, - find_average_diameter, - calculate_pore_shape, - circumcircle, - to_list, - align_principal_ax, - get_inertia_tensor, - get_gyration_tensor, - calc_asphericity, - calc_acylidricity, - calc_relative_shape_anisotropy, - find_windows_new, - calculate_window_diameter, - get_window_com, - window_shape) +from .utilities import ( + align_principal_ax, + calc_acylidricity, + calc_asphericity, + calc_relative_shape_anisotropy, + calculate_pore_shape, + calculate_window_diameter, + center_of_mass, + circumcircle, + create_supercell, + decipher_atom_key, + discrete_molecules, + find_average_diameter, + find_windows, + find_windows_new, + get_gyration_tensor, + get_inertia_tensor, + get_window_com, + max_dim, + molecular_weight, + opt_pore_diameter, + pore_diameter, + shift_com, + sphere_volume, + to_list, + window_shape, +) class _MolecularSystemError(Exception): @@ -63,8 +64,7 @@ def __init__(self, message): class _Shape: - """ - Class containing shape descriptors. + """Class containing shape descriptors. This class allows other classes, such as :class:`Pore` and :class:`Molecule`, inherit shape descriptors (applicable to any set of @@ -76,14 +76,13 @@ class _Shape: @property def _asphericity(self): - """ - Return asphericity of a shape. + """Return asphericity of a shape. The asphericity of a shape is weighted by the mass assigned to each coordinate (associated with the element). In case if `elements` is `None`, mass of each element = 1 and this returns a non-weighted value. - Returns + Returns: ------- :class:`float` The asphericity of a shape. @@ -93,14 +92,13 @@ def _asphericity(self): @property def _acylidricity(self): - """ - Return acylidricity of a shape. + """Return acylidricity of a shape. The acylidricity of a shape is weighted by the mass assigned to each coordinate (associated with the element). In case if `elements` is `None`, mass of each element = 1 and this returns a non-weighted value. - Returns + Returns: ------- :class:`float` The acylidricity of a shape. @@ -110,53 +108,46 @@ def _acylidricity(self): @property def _relative_shape_anisotropy(self): - """ - Return relative shape anisotropy of a shape. + """Return relative shape anisotropy of a shape. The relative shape anisotropy of a shape is weighted by the mass assigned to each coordinate (associated with the element). In case if `elements` is `None`, mass of each element = 1 and this returns a non-weighted value. - Returns + Returns: ------- :class:`float` The relative shape anisotropy of a shape. """ - return calc_relative_shape_anisotropy( - self.elements, self.coordinates - ) + return calc_relative_shape_anisotropy(self.elements, self.coordinates) @property def inertia_tensor(self): - """ - Return inertia tensor of a shape. + """Return inertia tensor of a shape. The inertia tensor of a shape is weighted by the mass assigned to each coordinate (associated with the element). In case if `elements` is `None`, mass of each element = 1 and this returns a non-weighted value. - Returns + Returns: ------- :class:`numpy.array` The inertia tensor of a shape. """ - return get_inertia_tensor( - self.elements, self.coordinates - ) + return get_inertia_tensor(self.elements, self.coordinates) @property def gyration_tensor(self): - """ - Return gyration tensor of a shape. + """Return gyration tensor of a shape. The gyration tensor of a shape is weighted by the mass assigned to each coordinate (associated with the element). In case if `elements` is `None`, mass of each element = 1 and this returns a non-weighted value. - Returns + Returns: ------- :class:`numpy.array` The gyration tensor of a shape. @@ -171,21 +162,24 @@ class _Pore(_Shape): def __init__(self, elements, coordinates, shape=False, **kwargs): self._elements, self._coordinates = elements, coordinates self.diameter, self.closest_atom = pore_diameter( - elements, coordinates, **kwargs) + elements, coordinates, **kwargs + ) self.spherical_volume = sphere_volume(self.diameter / 2) - if 'com' in kwargs.keys(): - self.centre_coordinates = kwargs['com'] + if "com" in kwargs: + self.centre_coordinates = kwargs["com"] else: self.centre_coordinates = center_of_mass(elements, coordinates) self.optimised = False def optimise(self, **kwargs): - (self.diameter, self.closest_atom, - self.centre_coordinates) = opt_pore_diameter( - self._elements, - self._coordinates, - com=self.centre_coordinates, - **kwargs) + (self.diameter, self.closest_atom, self.centre_coordinates) = ( + opt_pore_diameter( + self._elements, + self._coordinates, + com=self.centre_coordinates, + **kwargs, + ) + ) self.spherical_volume = sphere_volume(self.diameter / 2) self.optimised = True @@ -216,8 +210,11 @@ def calculate_diameter(self, **kwargs): def calculate_centre_of_mass(self, **kwargs): com = get_window_com( - self.raw_data, self.mol_elements, self.mol_coordinates, - self.com_correction, **kwargs + self.raw_data, + self.mol_elements, + self.mol_coordinates, + self.com_correction, + **kwargs, ) return com @@ -240,8 +237,7 @@ def get_convexhull(self): class Molecule(_Shape): - """ - Container for a single molecule. + """Container for a single molecule. This class is meant for the analysis of single molecules, molecular pores especially. The object passed to this class should therefore be a finite @@ -267,7 +263,7 @@ class Molecule(_Shape): 7. The circular diameter of a window of a molecule. - Attributes + Attributes: ---------- mol : :class:`dict` The :attr:`Molecular.System.system` dictionary passed to the @@ -304,20 +300,19 @@ class Molecule(_Shape): def __init__(self, mol, system_name, mol_id): self._Output = Output() self.mol = mol - self.no_of_atoms = len(mol['elements']) - self.elements = mol['elements'] - if 'atom_ids' in mol.keys(): - self.atom_ids = mol['atom_ids'] - self.coordinates = mol['coordinates'] + self.no_of_atoms = len(mol["elements"]) + self.elements = mol["elements"] + if "atom_ids" in mol.keys(): + self.atom_ids = mol["atom_ids"] + self.coordinates = mol["coordinates"] self.parent_system = system_name self.molecule_id = mol_id - self.properties = {'no_of_atoms': self.no_of_atoms} + self.properties = {"no_of_atoms": self.no_of_atoms} self._windows = None @classmethod - def load_rdkit_mol(cls, mol, system_name='rdkit', mol_id=0): - """ - Create a :class:`Molecule` from :class:`rdkit.Chem.rdchem.Mol`. + def load_rdkit_mol(cls, mol, system_name="rdkit", mol_id=0): + """Create a :class:`Molecule` from :class:`rdkit.Chem.rdchem.Mol`. To be used only by expert users. @@ -326,7 +321,7 @@ def load_rdkit_mol(cls, mol, system_name='rdkit', mol_id=0): mol : :class:`rdkit.Chem.rdchem.Mol` An RDKit molecule object. - Returns + Returns: ------- :class:`pywindow.molecular.Molecule` :class:`Molecule` @@ -335,8 +330,7 @@ def load_rdkit_mol(cls, mol, system_name='rdkit', mol_id=0): return cls(Input().load_rdkit_mol(mol), system_name, mol_id) def full_analysis(self, ncpus=1, **kwargs): - """ - Perform a full structural analysis of a molecule. + """Perform a full structural analysis of a molecule. This invokes other methods: @@ -366,7 +360,7 @@ def full_analysis(self, ncpus=1, **kwargs): Number of CPUs used for the parallelised parts of :func:`pywindow.utilities.find_windows()`. (default=1=serial) - Returns + Returns: ------- :attr:`Molecule.properties` The updated :attr:`Molecule.properties` with returns of all @@ -389,11 +383,11 @@ def _align_to_principal_axes(self, align_molsys=False): if align_molsys: self.coordinates[0] = align_principal_ax_all( self.elements, self.coordinates - ) + ) else: self.coordinates[0] = align_principal_ax( self.elements, self.coordinates - ) + ) self.aligned_to_principal_axes = True def _get_pore(self): @@ -406,150 +400,153 @@ def _get_windows(self, **kwargs): windows = find_windows_new(self.elements, self.coordinates, **kwargs) if windows: self.windows = [ - Window(np.array(windows[0][window]), window, windows[1], - windows[2], windows[3]) - for window in windows[0] if window != -1 + Window( + np.array(windows[0][window]), + window, + windows[1], + windows[2], + windows[3], + ) + for window in windows[0] + if window != -1 ] return self.windows - else: - return None + return None def calculate_centre_of_mass(self): - """ - Return the xyz coordinates of the centre of mass of a molecule. + """Return the xyz coordinates of the centre of mass of a molecule. - Returns + Returns: ------- :class:`numpy.array` The centre of mass of the molecule. """ self.centre_of_mass = center_of_mass(self.elements, self.coordinates) - self.properties['centre_of_mass'] = self.centre_of_mass + self.properties["centre_of_mass"] = self.centre_of_mass return self.centre_of_mass def calculate_maximum_diameter(self): - """ - Return the maximum diamension of a molecule. + """Return the maximum diamension of a molecule. - Returns + Returns: ------- :class:`float` The maximum dimension of the molecule. """ self.maxd_atom_1, self.maxd_atom_2, self.maximum_diameter = max_dim( - self.elements, self.coordinates) - self.properties['maximum_diameter'] = { - 'diameter': self.maximum_diameter, - 'atom_1': int(self.maxd_atom_1), - 'atom_2': int(self.maxd_atom_2), + self.elements, self.coordinates + ) + self.properties["maximum_diameter"] = { + "diameter": self.maximum_diameter, + "atom_1": int(self.maxd_atom_1), + "atom_2": int(self.maxd_atom_2), } return self.maximum_diameter def calculate_average_diameter(self, **kwargs): - """ - Return the average diamension of a molecule. + """Return the average diamension of a molecule. - Returns + Returns: ------- :class:`float` The average dimension of the molecule. """ self.average_diameter = find_average_diameter( - self.elements, self.coordinates, **kwargs) + self.elements, self.coordinates, **kwargs + ) return self.average_diameter def calculate_pore_diameter(self): - """ - Return the intrinsic pore diameter. + """Return the intrinsic pore diameter. - Returns + Returns: ------- :class:`float` The intrinsic pore diameter. """ self.pore_diameter, self.pore_closest_atom = pore_diameter( - self.elements, self.coordinates) - self.properties['pore_diameter'] = { - 'diameter': self.pore_diameter, - 'atom': int(self.pore_closest_atom), + self.elements, self.coordinates + ) + self.properties["pore_diameter"] = { + "diameter": self.pore_diameter, + "atom": int(self.pore_closest_atom), } return self.pore_diameter def calculate_pore_volume(self): - """ - Return the intrinsic pore volume. + """Return the intrinsic pore volume. - Returns + Returns: ------- :class:`float` The intrinsic pore volume. """ self.pore_volume = sphere_volume(self.calculate_pore_diameter() / 2) - self.properties['pore_volume'] = self.pore_volume + self.properties["pore_volume"] = self.pore_volume return self.pore_volume def calculate_pore_diameter_opt(self, **kwargs): - """ - Return the intrinsic pore diameter (for the optimised pore centre). + """Return the intrinsic pore diameter (for the optimised pore centre). Similarly to :func:`calculate_pore_diameter` this method returns the the intrinsic pore diameter, however, first a better approximation of the pore centre is found with optimisation. - Returns + Returns: ------- :class:`float` The intrinsic pore diameter. """ - (self.pore_diameter_opt, self.pore_opt_closest_atom, - self.pore_opt_COM) = opt_pore_diameter(self.elements, - self.coordinates, **kwargs) - self.properties['pore_diameter_opt'] = { - 'diameter': self.pore_diameter_opt, - 'atom_1': int(self.pore_opt_closest_atom), - 'centre_of_mass': self.pore_opt_COM, + ( + self.pore_diameter_opt, + self.pore_opt_closest_atom, + self.pore_opt_COM, + ) = opt_pore_diameter(self.elements, self.coordinates, **kwargs) + self.properties["pore_diameter_opt"] = { + "diameter": self.pore_diameter_opt, + "atom_1": int(self.pore_opt_closest_atom), + "centre_of_mass": self.pore_opt_COM, } return self.pore_diameter_opt def calculate_pore_volume_opt(self, **kwargs): - """ - Return the intrinsic pore volume (for the optimised pore centre). + """Return the intrinsic pore volume (for the optimised pore centre). Similarly to :func:`calculate_pore_volume` this method returns the the volume intrinsic pore diameter, however, for the :func:`calculate_pore_diameter_opt` returned value. - Returns + Returns: ------- :class:`float` The intrinsic pore volume. """ self.pore_volume_opt = sphere_volume( - self.calculate_pore_diameter_opt(**kwargs) / 2) - self.properties['pore_volume_opt'] = self.pore_volume_opt + self.calculate_pore_diameter_opt(**kwargs) / 2 + ) + self.properties["pore_volume_opt"] = self.pore_volume_opt return self.pore_volume_opt - def _calculate_pore_shape(self, filepath='shape.xyz', **kwargs): + def _calculate_pore_shape(self, filepath="shape.xyz", **kwargs): shape = calculate_pore_shape(self.elements, self.coordinates, **kwargs) - shape_obj = {'elements': shape[0], 'coordinates': shape[1]} + shape_obj = {"elements": shape[0], "coordinates": shape[1]} Output()._save_xyz(shape_obj, filepath) return 1 def calculate_windows(self, **kwargs): - """ - Return the diameters of all windows in a molecule. + """Return the diameters of all windows in a molecule. This function first finds and then measures the diameters of all the window in the molecule. - Returns + Returns: ------- :class:`numpy.array` An array of windows' diameters. @@ -562,27 +559,26 @@ def calculate_windows(self, **kwargs): if windows: self.properties.update( { - 'windows': { - 'diameters': windows[0], 'centre_of_mass': windows[1], + "windows": { + "diameters": windows[0], + "centre_of_mass": windows[1], } } ) return windows[0] - else: - self.properties.update( - {'windows': {'diameters': None, 'centre_of_mass': None, }} - ) + self.properties.update( + {"windows": {"diameters": None, "centre_of_mass": None}} + ) return None def shift_to_origin(self, **kwargs): - """ - Shift a molecule to Origin. + """Shift a molecule to Origin. This function takes the molecule's coordinates and adjust them so that the centre of mass of the molecule coincides with the origin of the coordinate system. - Returns + Returns: ------- None : :class:`NoneType` @@ -591,10 +587,9 @@ def shift_to_origin(self, **kwargs): self._update() def molecular_weight(self): - """ - Return the molecular weight of a molecule. + """Return the molecular weight of a molecule. - Returns + Returns: ------- :class:`float` The molecular weight of the molecule. @@ -604,8 +599,7 @@ def molecular_weight(self): return self.MW def dump_properties_json(self, filepath=None, molecular=False, **kwargs): - """ - Dump content of :attr:`Molecule.properties` to a JSON dictionary. + """Dump content of :attr:`Molecule.properties` to a JSON dictionary. Parameters ---------- @@ -618,7 +612,7 @@ def dump_properties_json(self, filepath=None, molecular=False, **kwargs): If False, dump only the content of :attr:`Molecule.properties`, if True, dump all the information about :class:`Molecule`. - Returns + Returns: ------- None : :class:`NoneType` @@ -633,13 +627,12 @@ def dump_properties_json(self, filepath=None, molecular=False, **kwargs): filepath = "_".join( (str(self.parent_system), str(self.molecule_id)) ) - filepath = '/'.join((os.getcwd(), filepath)) + filepath = "/".join((os.getcwd(), filepath)) # Dump the dictionary to json file. self._Output.dump2json(dict_obj, filepath, default=to_list, **kwargs) def dump_molecule(self, filepath=None, include_coms=False, **kwargs): - """ - Dump a :class:`Molecule` to a file (PDB or XYZ). + """Dump a :class:`Molecule` to a file (PDB or XYZ). Kwargs are passed to :func:`pywindow.io_tools.Output.dump2file()`. @@ -663,7 +656,7 @@ def dump_molecule(self, filepath=None, include_coms=False, **kwargs): If True, dump also with an overlay of window centres and COMs. (default=False) - Returns + Returns: ------- None : :class:`NoneType` @@ -671,99 +664,125 @@ def dump_molecule(self, filepath=None, include_coms=False, **kwargs): # If no filepath is provided we create one. if filepath is None: filepath = "_".join( - (str(self.parent_system), str(self.molecule_id))) - filepath = '/'.join((os.getcwd(), filepath)) - filepath = '.'.join((filepath, 'pdb')) + (str(self.parent_system), str(self.molecule_id)) + ) + filepath = "/".join((os.getcwd(), filepath)) + filepath = ".".join((filepath, "pdb")) # Check if there is an 'atom_ids' keyword in the self.mol dict. # Otherwise pass to the dump2file atom_ids='elements'. - if 'atom_ids' not in self.mol.keys(): - atom_ids = 'elements' + if "atom_ids" not in self.mol.keys(): + atom_ids = "elements" else: - atom_ids = 'atom_ids' + atom_ids = "atom_ids" # Dump molecule into a file. # If coms are to be included additional steps are required. # First deepcopy the molecule if include_coms is True: mmol = deepcopy(self.mol) # add centre of mass (centre of not optimised pore) as 'He'. - mmol['elements'] = np.concatenate( - (mmol['elements'], np.array(['He']))) - if 'atom_ids' not in self.mol.keys(): + mmol["elements"] = np.concatenate( + (mmol["elements"], np.array(["He"])) + ) + if "atom_ids" not in self.mol.keys(): pass else: - mmol['atom_ids'] = np.concatenate( - (mmol['atom_ids'], np.array(['He']))) - mmol['coordinates'] = np.concatenate( - (mmol['coordinates'], - np.array([self.properties['centre_of_mass']]))) + mmol["atom_ids"] = np.concatenate( + (mmol["atom_ids"], np.array(["He"])) + ) + mmol["coordinates"] = np.concatenate( + ( + mmol["coordinates"], + np.array([self.properties["centre_of_mass"]]), + ) + ) # add centre of pore optimised as 'Ne'. - mmol['elements'] = np.concatenate( - (mmol['elements'], np.array(['Ne']))) - if 'atom_ids' not in self.mol.keys(): + mmol["elements"] = np.concatenate( + (mmol["elements"], np.array(["Ne"])) + ) + if "atom_ids" not in self.mol.keys(): pass else: - mmol['atom_ids'] = np.concatenate( - (mmol['atom_ids'], np.array(['Ne']))) - mmol['coordinates'] = np.concatenate( - (mmol['coordinates'], np.array( - [self.properties['pore_diameter_opt']['centre_of_mass']]))) + mmol["atom_ids"] = np.concatenate( + (mmol["atom_ids"], np.array(["Ne"])) + ) + mmol["coordinates"] = np.concatenate( + ( + mmol["coordinates"], + np.array( + [ + self.properties["pore_diameter_opt"][ + "centre_of_mass" + ] + ] + ), + ) + ) # add centre of windows as 'Ar'. - if self.properties['windows']['centre_of_mass'] is not None: + if self.properties["windows"]["centre_of_mass"] is not None: range_ = range( - len(self.properties['windows']['centre_of_mass'])) + len(self.properties["windows"]["centre_of_mass"]) + ) for com in range_: - mmol['elements'] = np.concatenate( - (mmol['elements'], np.array(['Ar']))) - if 'atom_ids' not in self.mol.keys(): + mmol["elements"] = np.concatenate( + (mmol["elements"], np.array(["Ar"])) + ) + if "atom_ids" not in self.mol.keys(): pass else: - mmol['atom_ids'] = np.concatenate( - (mmol['atom_ids'], - np.array(['Ar{0}'.format(com + 1)]))) - mmol['coordinates'] = np.concatenate( - (mmol['coordinates'], np.array([ - self.properties['windows']['centre_of_mass'][com] - ]))) + mmol["atom_ids"] = np.concatenate( + (mmol["atom_ids"], np.array([f"Ar{com + 1}"])) + ) + mmol["coordinates"] = np.concatenate( + ( + mmol["coordinates"], + np.array( + [ + self.properties["windows"][ + "centre_of_mass" + ][com] + ] + ), + ) + ) self._Output.dump2file(mmol, filepath, atom_ids=atom_ids, **kwargs) else: self._Output.dump2file( - self.mol, filepath, atom_ids=atom_ids, **kwargs) + self.mol, filepath, atom_ids=atom_ids, **kwargs + ) def _update(self): - self.mol['coordinates'] = self.coordinates + self.mol["coordinates"] = self.coordinates self.calculate_centre_of_mass() self.calculate_pore_diameter_opt() def _circumcircle(self, **kwargs): - windows = circumcircle(self.coordinates, kwargs['atom_sets']) - if 'output' in kwargs: - if kwargs['output'] == 'windows': - self.properties['circumcircle'] = {'diameter': windows, } + windows = circumcircle(self.coordinates, kwargs["atom_sets"]) + if "output" in kwargs: + if kwargs["output"] == "windows": + self.properties["circumcircle"] = {"diameter": windows} + elif windows is not None: + self.properties["circumcircle"] = { + "diameter": windows[0], + "centre_of_mass": windows[1], + } else: - if windows is not None: - self.properties['circumcircle'] = { - 'diameter': windows[0], - 'centre_of_mass': windows[1], - } - else: - self.properties['circumcircle'] = { - 'diameter': None, - 'centre_of_mass': None, - } + self.properties["circumcircle"] = { + "diameter": None, + "centre_of_mass": None, + } return windows class MolecularSystem: - """ - Container for the molecular system. + """Container for the molecular system. To load input and initialise :class:`MolecularSystem`, one of the :class:`MolecularSystem` classmethods (:func:`load_file()`, :func:`load_rdkit_mol()` or :func:`load_system()`) should be used. :class:`MolecularSystem` **should not be initialised by itself.** - Examples + Examples: -------- 1. Using file as an input: @@ -783,7 +802,7 @@ class MolecularSystem: pywindow.molecular.MolecularSystem.load_system({...}) - Attributes + Attributes: ---------- system_id : :class:`str` or :class:`int` The input filename or user defined. @@ -804,8 +823,7 @@ def __init__(self): @classmethod def load_file(cls, filepath): - """ - Create a :class:`MolecularSystem` from an input file. + """Create a :class:`MolecularSystem` from an input file. Recognized input file formats: XYZ, PDB and MOL (V3000). @@ -814,7 +832,7 @@ def load_file(cls, filepath): filepath : :class:`str` The input's filepath. - Returns + Returns: ------- :class:`pywindow.molecular.MolecularSystem` :class:`MolecularSystem` @@ -829,15 +847,14 @@ def load_file(cls, filepath): @classmethod def load_rdkit_mol(cls, mol): - """ - Create a :class:`MolecularSystem` from :class:`rdkit.Chem.rdchem.Mol`. + """Create a :class:`MolecularSystem` from :class:`rdkit.Chem.rdchem.Mol`. Parameters ---------- mol : :class:`rdkit.Chem.rdchem.Mol` An RDKit molecule object. - Returns + Returns: ------- :class:`pywindow.molecular.MolecularSystem` :class:`MolecularSystem` @@ -848,9 +865,8 @@ def load_rdkit_mol(cls, mol): return obj @classmethod - def load_system(cls, dict_, system_id='system'): - """ - Create a :class:`MolecularSystem` from a python :class:`dict`. + def load_system(cls, dict_, system_id="system"): + """Create a :class:`MolecularSystem` from a python :class:`dict`. As the loaded :class:`MolecularSystem` is storred as a :class:`dict` in the :class:`MolecularSystem.system` it can also be loaded directly from @@ -866,7 +882,7 @@ def load_system(cls, dict_, system_id='system'): system_id : :class:`str` or :class:'int', optional Inherited or user defined system id. (default='system') - Returns + Returns: ------- :class:`pywindow.molecular.MolecularSystem` :class:`MolecularSystem` @@ -878,8 +894,7 @@ def load_system(cls, dict_, system_id='system'): return obj def rebuild_system(self, override=False, **kwargs): - """ - Rebuild molecules in molecular system. + """Rebuild molecules in molecular system. Parameters ---------- @@ -904,24 +919,22 @@ def rebuild_system(self, override=False, **kwargs): elements = np.array([]) for i in discrete: coordinates = np.concatenate( - [coordinates, i['coordinates']], axis=0 - ) - atom_ids = np.concatenate([atom_ids, i['atom_ids']], axis=0) - elements = np.concatenate([elements, i['elements']], axis=0) + [coordinates, i["coordinates"]], axis=0 + ) + atom_ids = np.concatenate([atom_ids, i["atom_ids"]], axis=0) + elements = np.concatenate([elements, i["elements"]], axis=0) rebuild_system = { - 'coordinates': coordinates, - 'atom_ids': atom_ids, - 'elements': elements - } + "coordinates": coordinates, + "atom_ids": atom_ids, + "elements": elements, + } if override is True: self.system.update(rebuild_system) return None - else: - return self.load_system(rebuild_system) + return self.load_system(rebuild_system) - def swap_atom_keys(self, swap_dict, dict_key='atom_ids'): - """ - Swap a force field atom id for another user-defined value. + def swap_atom_keys(self, swap_dict, dict_key="atom_ids"): + """Swap a force field atom id for another user-defined value. This modified all values in :attr:`MolecularSystem.system['atom_ids']` that match criteria. @@ -929,7 +942,7 @@ def swap_atom_keys(self, swap_dict, dict_key='atom_ids'): This function can be used to decipher a whole forcefield if an appropriate dictionary is passed to the function. - Example + Example: ------- In this example all atom ids 'he' will be exchanged to 'H'. @@ -947,22 +960,21 @@ def swap_atom_keys(self, swap_dict, dict_key='atom_ids'): A key in :attr:`MolecularSystem.system` dictionary to perform the atom keys swapping operation on. (default='atom_ids') - Returns + Returns: ------- None : :class:`NoneType` """ # Similar situation to the one from decipher_atom_keys function. - if 'atom_ids' not in self.system.keys(): - dict_key = 'elements' + if "atom_ids" not in self.system.keys(): + dict_key = "elements" for atom_key in range(len(self.system[dict_key])): for key in swap_dict.keys(): if self.system[dict_key][atom_key] == key: self.system[dict_key][atom_key] = swap_dict[key] - def decipher_atom_keys(self, forcefield='DLF', dict_key='atom_ids'): - """ - Decipher force field atom ids. + def decipher_atom_keys(self, forcefield="DLF", dict_key="atom_ids"): + """Decipher force field atom ids. This takes all values in :attr:`MolecularSystem.system['atom_ids']` that match force field type criteria and creates @@ -989,7 +1001,7 @@ def decipher_atom_keys(self, forcefield='DLF', dict_key='atom_ids'): The :attr:`MolecularSystem.system` dictionary key to the array containing the force field atom ids. (default='atom_ids') - Returns + Returns: ------- None : :class:`NoneType` @@ -998,19 +1010,18 @@ def decipher_atom_keys(self, forcefield='DLF', dict_key='atom_ids'): # XYZ and MOL files mostly. But, we keep the dict_key keyword for # someone who would want to decipher 'elements' even if 'atom_ids' key # is present in the system's dictionary. - if 'atom_ids' not in self.system.keys(): - dict_key = 'elements' + if "atom_ids" not in self.system.keys(): + dict_key = "elements" # I do it on temporary object so that it only finishes when successful temp = deepcopy(self.system[dict_key]) for element in range(len(temp)): temp[element] = "{0}".format( - decipher_atom_key( - temp[element], forcefield=forcefield)) - self.system['elements'] = temp + decipher_atom_key(temp[element], forcefield=forcefield) + ) + self.system["elements"] = temp def make_modular(self, rebuild=False): - """ - Find and return all :class:`Molecule` s in :class:`MolecularSystem`. + """Find and return all :class:`Molecule` s in :class:`MolecularSystem`. This function populates :attr:`MolecularSystem.molecules` with :class:`Molecule` s. @@ -1020,7 +1031,7 @@ def make_modular(self, rebuild=False): rebuild : :class:`bool` If True, run first the :func:`rebuild_system()`. (default=False) - Returns + Returns: ------- None : :class:`NoneType` @@ -1036,13 +1047,12 @@ def make_modular(self, rebuild=False): self.molecules[i] = Molecule(dis[i], self.system_id, i) def system_to_molecule(self): - """ - Return :class:`MolecularSystem` as a :class:`Molecule` directly. + """Return :class:`MolecularSystem` as a :class:`Molecule` directly. Only to be used conditionally, when the :class:`MolecularSystem` is a discrete molecule and no input pre-processing is required. - Returns + Returns: ------- :class:`pywindow.molecular.Molecule` :class:`Molecule` @@ -1050,19 +1060,20 @@ def system_to_molecule(self): return Molecule(self.system, self.system_id, 0) def _get_pores(self, sampling_points): - """ Under development.""" + """Under development.""" pores = [] for point in sampling_points: pores.append( Pore( - self.system['elements'], - self.system['coordinates'], - com=point)) + self.system["elements"], + self.system["coordinates"], + com=point, + ) + ) return pores def dump_system(self, filepath=None, modular=False, **kwargs): - """ - Dump a :class:`MolecularSystem` to a file (PDB or XYZ). + """Dump a :class:`MolecularSystem` to a file (PDB or XYZ). Kwargs are passed to :func:`pywindow.io_tools.Output.dump2file()`. @@ -1079,15 +1090,15 @@ def dump_system(self, filepath=None, modular=False, **kwargs): :class:`MolecularSystem` as catenated :class:Molecule objects from :attr:`MolecularSystem.molecules` - Returns + Returns: ------- None : :class:`NoneType` """ # If no filepath is provided we create one. if filepath is None: - filepath = '/'.join((os.getcwd(), str(self.system_id))) - filepath = '.'.join((filepath, 'pdb')) + filepath = "/".join((os.getcwd(), str(self.system_id))) + filepath = ".".join((filepath, "pdb")) # If modular is True substitute the molecular data for modular one. system_dict = deepcopy(self.system) if modular is True: @@ -1096,26 +1107,26 @@ def dump_system(self, filepath=None, modular=False, **kwargs): coor = np.array([]).reshape(0, 3) for mol_ in self.molecules: mol = self.molecules[mol_] - elements = np.concatenate((elements, mol.mol['elements'])) - atom_ids = np.concatenate((atom_ids, mol.mol['atom_ids'])) - coor = np.concatenate((coor, mol.mol['coordinates']), axis=0) - system_dict['elements'] = elements - system_dict['atom_ids'] = atom_ids - system_dict['coordinates'] = coor + elements = np.concatenate((elements, mol.mol["elements"])) + atom_ids = np.concatenate((atom_ids, mol.mol["atom_ids"])) + coor = np.concatenate((coor, mol.mol["coordinates"]), axis=0) + system_dict["elements"] = elements + system_dict["atom_ids"] = atom_ids + system_dict["coordinates"] = coor # Check if there is an 'atom_ids' keyword in the self.mol dict. # Otherwise pass to the dump2file atom_ids='elements'. # This is mostly for XYZ files and not deciphered trajectories. - if 'atom_ids' not in system_dict.keys(): - atom_ids = 'elements' + if "atom_ids" not in system_dict.keys(): + atom_ids = "elements" else: - atom_ids = 'atom_ids' + atom_ids = "atom_ids" # Dump system into a file. self._Output.dump2file( - system_dict, filepath, atom_ids=atom_ids, **kwargs) + system_dict, filepath, atom_ids=atom_ids, **kwargs + ) def dump_system_json(self, filepath=None, modular=False, **kwargs): - """ - Dump a :class:`MolecularSystem` to a JSON dictionary. + """Dump a :class:`MolecularSystem` to a JSON dictionary. The dumped JSON dictionary, with :class:`MolecularSystem`, can then be loaded through a JSON loader and then through :func:`load_system()` @@ -1136,7 +1147,7 @@ def dump_system_json(self, filepath=None, modular=False, **kwargs): :class:`MolecularSystem` as catenated :class:Molecule objects from :attr:`MolecularSystem.molecules` - Returns + Returns: ------- None : :class:`NoneType` @@ -1151,13 +1162,14 @@ def dump_system_json(self, filepath=None, modular=False, **kwargs): except AttributeError: raise _NotAModularSystem( "This system is not modular. Please, run first the " - "make_modular() function of this class.") + "make_modular() function of this class." + ) dict_obj = {} for molecule in self.molecules: mol_ = self.molecules[molecule] dict_obj[molecule] = mol_.mol # If no filepath is provided we create one. if filepath is None: - filepath = '/'.join((os.getcwd(), str(self.system_id))) + filepath = "/".join((os.getcwd(), str(self.system_id))) # Dump the dictionary to json file. self._Output.dump2json(dict_obj, filepath, default=to_list, **kwargs) diff --git a/src/pywindow/_internal/tables.py b/src/pywindow/_internal/tables.py index 6446df2..641133c 100644 --- a/src/pywindow/_internal/tables.py +++ b/src/pywindow/_internal/tables.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 -""" -This module containes general-purpose chemical data (aka tables). +"""This module containes general-purpose chemical data (aka tables). Sources: + 1. www.ccdc.cam.ac.uk/Lists/ResourceFileList/Elemental_Radii.xlsx, (access date: 13 Oct 2015) @@ -15,278 +15,276 @@ Elemental_Radii.xlsx (access date: 26 Jul 2017) Note: - Added atomic mass, atomic van der Waals radius and covalent radius, that equals 1, for a dummy atom `X`. This is for the shape descriptors calculations to use with functions for molecular shape descriptors that require mass. """ - # Atomic mass dictionary (in upper case!) atomic_mass = { - 'AL': 26.982, - 'SB': 121.76, - 'AR': 39.948, - 'AS': 74.922, - 'BA': 137.327, - 'BE': 9.012, - 'BI': 208.98, - 'B': 10.811, - 'BR': 79.904, - 'CD': 112.411, - 'CS': 132.905, - 'CA': 40.078, - 'C': 12.011, - 'CE': 140.116, - 'CL': 35.453, - 'CR': 51.996, - 'CO': 58.933, - 'CU': 63.546, - 'DY': 162.5, - 'ER': 167.26, - 'EU': 151.964, - 'F': 18.998, - 'GD': 157.25, - 'GA': 69.723, - 'GE': 72.61, - 'AU': 196.967, - 'HF': 178.49, - 'HE': 4.003, - 'HO': 164.93, - 'H': 1.008, - 'IN': 114.818, - 'I': 126.904, - 'IR': 192.217, - 'FE': 55.845, - 'KR': 83.8, - 'LA': 138.906, - 'PB': 207.2, - 'LI': 6.941, - 'LU': 174.967, - 'MG': 24.305, - 'MN': 54.938, - 'HG': 200.59, - 'MO': 95.94, - 'ND': 144.24, - 'NE': 20.18, - 'NI': 58.693, - 'NB': 92.906, - 'N': 14.007, - 'OS': 190.23, - 'O': 15.999, - 'PD': 106.42, - 'P': 30.974, - 'PT': 195.078, - 'K': 39.098, - 'PR': 140.908, - 'PA': 231.036, - 'RE': 186.207, - 'RH': 102.906, - 'RB': 85.468, - 'RU': 101.07, - 'SM': 150.36, - 'SC': 44.956, - 'SE': 78.96, - 'SI': 28.086, - 'AG': 107.868, - 'NA': 22.991, - 'SR': 87.62, - 'S': 32.066, - 'TA': 180.948, - 'TE': 127.6, - 'TB': 158.925, - 'TL': 204.383, - 'TH': 232.038, - 'TM': 168.934, - 'SN': 118.71, - 'TI': 47.867, - 'W': 183.84, - 'U': 238.029, - 'V': 50.942, - 'XE': 131.29, - 'YB': 173.04, - 'Y': 88.906, - 'ZN': 65.39, - 'ZR': 91.224, - 'X': 1, + "AL": 26.982, + "SB": 121.76, + "AR": 39.948, + "AS": 74.922, + "BA": 137.327, + "BE": 9.012, + "BI": 208.98, + "B": 10.811, + "BR": 79.904, + "CD": 112.411, + "CS": 132.905, + "CA": 40.078, + "C": 12.011, + "CE": 140.116, + "CL": 35.453, + "CR": 51.996, + "CO": 58.933, + "CU": 63.546, + "DY": 162.5, + "ER": 167.26, + "EU": 151.964, + "F": 18.998, + "GD": 157.25, + "GA": 69.723, + "GE": 72.61, + "AU": 196.967, + "HF": 178.49, + "HE": 4.003, + "HO": 164.93, + "H": 1.008, + "IN": 114.818, + "I": 126.904, + "IR": 192.217, + "FE": 55.845, + "KR": 83.8, + "LA": 138.906, + "PB": 207.2, + "LI": 6.941, + "LU": 174.967, + "MG": 24.305, + "MN": 54.938, + "HG": 200.59, + "MO": 95.94, + "ND": 144.24, + "NE": 20.18, + "NI": 58.693, + "NB": 92.906, + "N": 14.007, + "OS": 190.23, + "O": 15.999, + "PD": 106.42, + "P": 30.974, + "PT": 195.078, + "K": 39.098, + "PR": 140.908, + "PA": 231.036, + "RE": 186.207, + "RH": 102.906, + "RB": 85.468, + "RU": 101.07, + "SM": 150.36, + "SC": 44.956, + "SE": 78.96, + "SI": 28.086, + "AG": 107.868, + "NA": 22.991, + "SR": 87.62, + "S": 32.066, + "TA": 180.948, + "TE": 127.6, + "TB": 158.925, + "TL": 204.383, + "TH": 232.038, + "TM": 168.934, + "SN": 118.71, + "TI": 47.867, + "W": 183.84, + "U": 238.029, + "V": 50.942, + "XE": 131.29, + "YB": 173.04, + "Y": 88.906, + "ZN": 65.39, + "ZR": 91.224, + "X": 1, } # Atomic vdW radii dictionary (in upper case!) atomic_vdw_radius = { - 'AL': 2, - 'SB': 2, - 'AR': 1.88, - 'AS': 1.85, - 'BA': 2, - 'BE': 2, - 'BI': 2, - 'B': 2, - 'BR': 1.85, - 'CD': 1.58, - 'CS': 2, - 'CA': 2, - 'C': 1.7, - 'CE': 2, - 'CL': 1.75, - 'CR': 2, - 'CO': 2, - 'CU': 1.4, - 'DY': 2, - 'ER': 2, - 'EU': 2, - 'F': 1.47, - 'GD': 2, - 'GA': 1.87, - 'GE': 2, - 'AU': 1.66, - 'HF': 2, - 'HE': 1.4, - 'HO': 2, - 'H': 1.09, - 'IN': 1.93, - 'I': 1.98, - 'IR': 2, - 'FE': 2, - 'KR': 2.02, - 'LA': 2, - 'PB': 2.02, - 'LI': 1.82, - 'LU': 2, - 'MG': 1.73, - 'MN': 2, - 'HG': 1.55, - 'MO': 2, - 'ND': 2, - 'NE': 1.54, - 'NI': 1.63, - 'NB': 2, - 'N': 1.55, - 'OS': 2, - 'O': 1.52, - 'PD': 1.63, - 'P': 1.8, - 'PT': 1.72, - 'K': 2.75, - 'PR': 2, - 'PA': 2, - 'RE': 2, - 'RH': 2, - 'RB': 2, - 'RU': 2, - 'SM': 2, - 'SC': 2, - 'SE': 1.9, - 'SI': 2.1, - 'AG': 1.72, - 'NA': 2.27, - 'SR': 2, - 'S': 1.8, - 'TA': 2, - 'TE': 2.06, - 'TB': 2, - 'TL': 1.96, - 'TH': 2, - 'TM': 2, - 'SN': 2.17, - 'TI': 2, - 'W': 2, - 'U': 1.86, - 'V': 2, - 'XE': 2.16, - 'YB': 2, - 'Y': 2, - 'ZN': 1.29, - 'ZR': 2, - 'X': 1, + "AL": 2, + "SB": 2, + "AR": 1.88, + "AS": 1.85, + "BA": 2, + "BE": 2, + "BI": 2, + "B": 2, + "BR": 1.85, + "CD": 1.58, + "CS": 2, + "CA": 2, + "C": 1.7, + "CE": 2, + "CL": 1.75, + "CR": 2, + "CO": 2, + "CU": 1.4, + "DY": 2, + "ER": 2, + "EU": 2, + "F": 1.47, + "GD": 2, + "GA": 1.87, + "GE": 2, + "AU": 1.66, + "HF": 2, + "HE": 1.4, + "HO": 2, + "H": 1.09, + "IN": 1.93, + "I": 1.98, + "IR": 2, + "FE": 2, + "KR": 2.02, + "LA": 2, + "PB": 2.02, + "LI": 1.82, + "LU": 2, + "MG": 1.73, + "MN": 2, + "HG": 1.55, + "MO": 2, + "ND": 2, + "NE": 1.54, + "NI": 1.63, + "NB": 2, + "N": 1.55, + "OS": 2, + "O": 1.52, + "PD": 1.63, + "P": 1.8, + "PT": 1.72, + "K": 2.75, + "PR": 2, + "PA": 2, + "RE": 2, + "RH": 2, + "RB": 2, + "RU": 2, + "SM": 2, + "SC": 2, + "SE": 1.9, + "SI": 2.1, + "AG": 1.72, + "NA": 2.27, + "SR": 2, + "S": 1.8, + "TA": 2, + "TE": 2.06, + "TB": 2, + "TL": 1.96, + "TH": 2, + "TM": 2, + "SN": 2.17, + "TI": 2, + "W": 2, + "U": 1.86, + "V": 2, + "XE": 2.16, + "YB": 2, + "Y": 2, + "ZN": 1.29, + "ZR": 2, + "X": 1, } # Atomic covalent radii dictionary (in upper case!) atomic_covalent_radius = { - 'AL': 1.21, - 'SB': 1.39, - 'AR': 1.51, - 'AS': 1.21, - 'BA': 2.15, - 'BE': 0.96, - 'BI': 1.48, - 'B': 0.83, - 'BR': 1.21, - 'CD': 1.54, - 'CS': 2.44, - 'CA': 1.76, - 'C': 0.68, - 'CE': 2.04, - 'CL': 0.99, - 'CR': 1.39, - 'CO': 1.26, - 'CU': 1.32, - 'DY': 1.92, - 'ER': 1.89, - 'EU': 1.98, - 'F': 0.64, - 'GD': 1.96, - 'GA': 1.22, - 'GE': 1.17, - 'AU': 1.36, - 'HF': 1.75, - 'HE': 1.5, - 'HO': 1.92, - 'H': 0.23, - 'IN': 1.42, - 'I': 1.4, - 'IR': 1.41, - 'FE': 1.52, - 'KR': 1.5, - 'LA': 2.07, - 'PB': 1.46, - 'LI': 1.28, - 'LU': 1.87, - 'MG': 1.41, - 'MN': 1.61, - 'HG': 1.32, - 'MO': 1.54, - 'ND': 2.01, - 'NE': 1.5, - 'NI': 1.24, - 'NB': 1.64, - 'N': 0.68, - 'OS': 1.44, - 'O': 0.68, - 'PD': 1.39, - 'P': 1.05, - 'PT': 1.36, - 'K': 2.03, - 'PR': 2.03, - 'PA': 2, - 'RE': 1.51, - 'RH': 1.42, - 'RB': 2.2, - 'RU': 1.46, - 'SM': 1.98, - 'SC': 1.7, - 'SE': 1.22, - 'SI': 1.2, - 'AG': 1.45, - 'NA': 1.66, - 'SR': 1.95, - 'S': 1.02, - 'TA': 1.7, - 'TE': 1.47, - 'TB': 1.94, - 'TL': 1.45, - 'TH': 2.06, - 'TM': 1.9, - 'SN': 1.39, - 'TI': 1.6, - 'W': 1.62, - 'U': 1.96, - 'V': 1.53, - 'XE': 1.5, - 'YB': 1.87, - 'Y': 1.9, - 'ZN': 1.22, - 'ZR': 1.75, - 'X': 1, + "AL": 1.21, + "SB": 1.39, + "AR": 1.51, + "AS": 1.21, + "BA": 2.15, + "BE": 0.96, + "BI": 1.48, + "B": 0.83, + "BR": 1.21, + "CD": 1.54, + "CS": 2.44, + "CA": 1.76, + "C": 0.68, + "CE": 2.04, + "CL": 0.99, + "CR": 1.39, + "CO": 1.26, + "CU": 1.32, + "DY": 1.92, + "ER": 1.89, + "EU": 1.98, + "F": 0.64, + "GD": 1.96, + "GA": 1.22, + "GE": 1.17, + "AU": 1.36, + "HF": 1.75, + "HE": 1.5, + "HO": 1.92, + "H": 0.23, + "IN": 1.42, + "I": 1.4, + "IR": 1.41, + "FE": 1.52, + "KR": 1.5, + "LA": 2.07, + "PB": 1.46, + "LI": 1.28, + "LU": 1.87, + "MG": 1.41, + "MN": 1.61, + "HG": 1.32, + "MO": 1.54, + "ND": 2.01, + "NE": 1.5, + "NI": 1.24, + "NB": 1.64, + "N": 0.68, + "OS": 1.44, + "O": 0.68, + "PD": 1.39, + "P": 1.05, + "PT": 1.36, + "K": 2.03, + "PR": 2.03, + "PA": 2, + "RE": 1.51, + "RH": 1.42, + "RB": 2.2, + "RU": 1.46, + "SM": 1.98, + "SC": 1.7, + "SE": 1.22, + "SI": 1.2, + "AG": 1.45, + "NA": 1.66, + "SR": 1.95, + "S": 1.02, + "TA": 1.7, + "TE": 1.47, + "TB": 1.94, + "TL": 1.45, + "TH": 2.06, + "TM": 1.9, + "SN": 1.39, + "TI": 1.6, + "W": 1.62, + "U": 1.96, + "V": 1.53, + "XE": 1.5, + "YB": 1.87, + "Y": 1.9, + "ZN": 1.22, + "ZR": 1.75, + "X": 1, } # Atom symbols - atom keys pairs for deciphering OPLS force field @@ -299,63 +297,347 @@ # 'Na' - sodium, 'NA' - nitrogen # In case of these there still a warning sould be raised # as 'ne' can be just lower case for 'Ne'. - 'Ar': ['AR', 'Ar', 'ar'], - 'B': ['B', 'b'], - 'Br': ['BR', 'BR-', 'Br', 'br', 'br-'], - 'C': [ - 'CTD', 'CZN', 'C', 'CBO', 'CZB', 'CDS', 'CALK', 'CG', 'CML', 'C5B', - 'CTP', 'CTF', 'C5BC', 'CZA', 'CTS', 'CO', 'C5X', 'CQ', 'CP1', 'CDXR', - 'CANI', 'CRA', 'C4T', 'CHZ', 'CAO', 'CTA', 'CDX', 'CA5', 'CTJ', 'CZ', - 'CO4', 'CTI', 'C5BB', 'CG1', 'C5M', 'CTM', 'CT', 'C5A', 'CN', 'C3M', - 'CB', 'CT1', 'C5N', 'CO3', 'CTQ', 'CTH', 'CTU', 'CTE', 'CTC', 'CTG', - 'C3T', 'CD', 'CME', 'CT_F', 'CA', 'C56B', 'CT1G', 'C56A', 'CM', 'CTNC', - 'CR3', 'ctd', 'czn', 'c', 'cbo', 'czb', 'cds', 'calk', 'cg', 'cml', - 'c5b', 'ctp', 'ctf', 'c5bc', 'cza', 'cts', 'co', 'c5x', 'cq', 'cp1', - 'cdxr', 'cani', 'cra', 'c4t', 'chz', 'cao', 'cta', 'cdx', 'ca5', 'ctj', - 'cz', 'co4', 'cti', 'c5bb', 'cg1', 'c5m', 'ctm', 'ct', 'c5a', 'cn', - 'c3m', 'cb', 'ct1', 'c5n', 'co3', 'ctq', 'cth', 'ctu', 'cte', 'ctc', - 'ctg', 'c3t', 'cd', 'cme', 'ct_f', 'ca', 'c56b', 'ct1g', 'c56a', 'cm', - 'ctnc', 'cr3' + "Ar": ["AR", "Ar", "ar"], + "B": ["B", "b"], + "Br": ["BR", "BR-", "Br", "br", "br-"], + "C": [ + "CTD", + "CZN", + "C", + "CBO", + "CZB", + "CDS", + "CALK", + "CG", + "CML", + "C5B", + "CTP", + "CTF", + "C5BC", + "CZA", + "CTS", + "CO", + "C5X", + "CQ", + "CP1", + "CDXR", + "CANI", + "CRA", + "C4T", + "CHZ", + "CAO", + "CTA", + "CDX", + "CA5", + "CTJ", + "CZ", + "CO4", + "CTI", + "C5BB", + "CG1", + "C5M", + "CTM", + "CT", + "C5A", + "CN", + "C3M", + "CB", + "CT1", + "C5N", + "CO3", + "CTQ", + "CTH", + "CTU", + "CTE", + "CTC", + "CTG", + "C3T", + "CD", + "CME", + "CT_F", + "CA", + "C56B", + "CT1G", + "C56A", + "CM", + "CTNC", + "CR3", + "ctd", + "czn", + "c", + "cbo", + "czb", + "cds", + "calk", + "cg", + "cml", + "c5b", + "ctp", + "ctf", + "c5bc", + "cza", + "cts", + "co", + "c5x", + "cq", + "cp1", + "cdxr", + "cani", + "cra", + "c4t", + "chz", + "cao", + "cta", + "cdx", + "ca5", + "ctj", + "cz", + "co4", + "cti", + "c5bb", + "cg1", + "c5m", + "ctm", + "ct", + "c5a", + "cn", + "c3m", + "cb", + "ct1", + "c5n", + "co3", + "ctq", + "cth", + "ctu", + "cte", + "ctc", + "ctg", + "c3t", + "cd", + "cme", + "ct_f", + "ca", + "c56b", + "ct1g", + "c56a", + "cm", + "ctnc", + "cr3", + ], + "Cl": ["CL", "CL-", "Cl", "cl", "cl-"], + "F": [ + "F", + "FX1", + "FX2", + "FX3", + "FX4", + "FG", + "F-", + "f", + "fx1", + "fx2", + "fx3", + "fx4", + "fg", + "f-", ], - 'Cl': ['CL', 'CL-', 'Cl', 'cl', 'cl-'], - 'F': [ - 'F', 'FX1', 'FX2', 'FX3', 'FX4', 'FG', 'F-', 'f', 'fx1', 'fx2', 'fx3', - 'fx4', 'fg', 'f-' + "H": [ + "HA", + "HAE", + "HS", + "HT3", + "HC", + "HWS", + "H", + "HNP", + "HAM", + "H_OH", + "HP", + "HT4", + "HG", + "HMET", + "HO", + "HANI", + "HY", + "HCG", + "HE", + "ha", + "hae", + "hs", + "ht3", + "hc", + "hws", + "h", + "hnp", + "ham", + "h_oh", + "hp", + "ht4", + "hg", + "hmet", + "ho", + "hani", + "hy", + "hcg", ], - 'H': [ - 'HA', 'HAE', 'HS', 'HT3', 'HC', 'HWS', 'H', 'HNP', 'HAM', 'H_OH', 'HP', - 'HT4', 'HG', 'HMET', 'HO', 'HANI', 'HY', 'HCG', 'HE', 'ha', 'hae', - 'hs', 'ht3', 'hc', 'hws', 'h', 'hnp', 'ham', 'h_oh', 'hp', 'ht4', 'hg', - 'hmet', 'ho', 'hani', 'hy', 'hcg' + "He": ["He"], + "I": ["I", "I-", "i", "i-"], + "Kr": ["Kr", "kr"], + "N": [ + "NAP", + "NN", + "NB", + "N5BB", + "NS", + "NOM", + "NTC", + "NP", + "N", + "NTH2", + "NTH", + "NZC", + "NO", + "N5B", + "NO3", + "NZT", + "NZ", + "NI", + "NTH0", + "NA5B", + "NT", + "NO2", + "NBQ", + "NG", + "NE", + "NZA", + "NA", + "NZB", + "NHZ", + "NO2B", + "NEA", + "NA5", + "NE", + "nap", + "nn", + "nb", + "n5bb", + "ns", + "nom", + "ntc", + "np", + "n", + "nth2", + "nth", + "nzc", + "no", + "n5b", + "no3", + "nzt", + "nz", + "ni", + "nth0", + "na5b", + "nt", + "no2", + "nbq", + "ng", + "nza", + "nzb", + "nhz", + "no2b", + "nea", + "na5", ], - 'He': ['He'], - 'I': ['I', 'I-', 'i', 'i-'], - 'Kr': ['Kr', 'kr'], - 'N': [ - 'NAP', 'NN', 'NB', 'N5BB', 'NS', 'NOM', 'NTC', 'NP', 'N', 'NTH2', - 'NTH', 'NZC', 'NO', 'N5B', 'NO3', 'NZT', 'NZ', 'NI', 'NTH0', 'NA5B', - 'NT', 'NO2', 'NBQ', 'NG', 'NE', 'NZA', 'NA', 'NZB', 'NHZ', 'NO2B', - 'NEA', 'NA5', 'NE', 'nap', 'nn', 'nb', 'n5bb', 'ns', 'nom', 'ntc', - 'np', 'n', 'nth2', 'nth', 'nzc', 'no', 'n5b', 'no3', 'nzt', 'nz', 'ni', - 'nth0', 'na5b', 'nt', 'no2', 'nbq', 'ng', 'nza', 'nzb', 'nhz', 'no2b', - 'nea', 'na5' + "Na": ["Na", "Na+"], + "Ne": ["Ne"], + "O": [ + "OM", + "OAB", + "ONI", + "O2ZP", + "O2Z", + "OHE", + "OES", + "OBS", + "OT4", + "OWS", + "O3T", + "OT3", + "O4T", + "OAL", + "O2", + "OAS", + "OS", + "ON", + "OVE", + "OZ", + "O", + "OHX", + "OY", + "ONA", + "OA", + "OHP", + "OSP", + "OH", + "om", + "oab", + "oni", + "o2zp", + "o2z", + "ohe", + "oes", + "obs", + "ot4", + "ows", + "o3t", + "ot3", + "o4t", + "oal", + "o2", + "oas", + "os", + "on", + "ove", + "oz", + "o", + "ohx", + "oy", + "ona", + "oa", + "ohp", + "osp", + "oh", ], - 'Na': ['Na', 'Na+'], - 'Ne': ['Ne'], - 'O': [ - 'OM', 'OAB', 'ONI', 'O2ZP', 'O2Z', 'OHE', 'OES', 'OBS', 'OT4', 'OWS', - 'O3T', 'OT3', 'O4T', 'OAL', 'O2', 'OAS', 'OS', 'ON', 'OVE', 'OZ', 'O', - 'OHX', 'OY', 'ONA', 'OA', 'OHP', 'OSP', 'OH', 'om', 'oab', 'oni', - 'o2zp', 'o2z', 'ohe', 'oes', 'obs', 'ot4', 'ows', 'o3t', 'ot3', 'o4t', - 'oal', 'o2', 'oas', 'os', 'on', 'ove', 'oz', 'o', 'ohx', 'oy', 'ona', - 'oa', 'ohp', 'osp', 'oh' + "P": [ + "P", + "P1", + "P2", + "P3", + "P4", + "PR", + "p", + "p1", + "p2", + "p3", + "p4", + "pr", ], - 'P': - ['P', 'P1', 'P2', 'P3', 'P4', 'PR', 'p', 'p1', 'p2', 'p3', 'p4', 'pr'], - 'Rn': ['Rn', 'rn'], - 'S': [ - 'S', 'SX6', 'SY', 'SH', 'SA', 'SZ', 'SD', 's', 'sx6', 'sy', 'sh', 'sa', - 'sz', 'sd' + "Rn": ["Rn", "rn"], + "S": [ + "S", + "SX6", + "SY", + "SH", + "SA", + "SZ", + "SD", + "s", + "sx6", + "sy", + "sh", + "sa", + "sz", + "sd", ], - 'Xe': ['Xe', 'xe'] + "Xe": ["Xe", "xe"], } diff --git a/src/pywindow/_internal/trajectory.py b/src/pywindow/_internal/trajectory.py index 12ff3b8..dc8d657 100644 --- a/src/pywindow/_internal/trajectory.py +++ b/src/pywindow/_internal/trajectory.py @@ -1,13 +1,13 @@ -""" -Module intended for the analysis of molecular dynamics trajectories. +"""Module intended for the analysis of molecular dynamics trajectories. The trajectory file (DL_POLY_C:HISTORY, PDB or XYZ) should be loaded with the one of the corresponding classes (DLPOLY, PDB or XYZ, respectively). -Example +Example: ------- In this example a DL_POLY_C HISTORY trajectory file is loaded. + .. code-block:: python pywindow.trajectory.DLPOLY('path/to/HISTORY') @@ -31,18 +31,23 @@ bottleneck. """ + import os -import numpy as np -from copy import deepcopy -from mmap import mmap, ACCESS_READ from contextlib import closing +from copy import deepcopy +from mmap import ACCESS_READ, mmap from multiprocessing import Pool -from .io_tools import Input, Output +import numpy as np + +from .io_tools import Output +from .molecular import MolecularSystem from .utilities import ( - is_number, create_supercell, lattice_array_to_unit_cell, to_list + create_supercell, + is_number, + lattice_array_to_unit_cell, + to_list, ) -from .molecular import MolecularSystem class _ParallelAnalysisError(Exception): @@ -66,8 +71,7 @@ def __init__(self, message): def make_supercell(system, matrix, supercell=[1, 1, 1]): - """ - Return a supercell. + """Return a supercell. This functions takes the input unitcell and creates a supercell of it that is returned as a new :class:`pywindow.molecular.MolecularSystem`. @@ -84,7 +88,7 @@ def make_supercell(system, matrix, supercell=[1, 1, 1]): A list that specifies the size of the supercell in the a, b and c direction. (default=[1, 1, 1]) - Returns + Returns: ------- :class:`pywindow.molecular.MolecularSystem` Returns the created supercell as a new :class:`MolecularSystem`. @@ -95,9 +99,8 @@ def make_supercell(system, matrix, supercell=[1, 1, 1]): return MolecularSystem.load_system(system) -class DLPOLY(object): - """ - A container for a DL_POLY_C type trajectory (HISTORY). +class DLPOLY: + """A container for a DL_POLY_C type trajectory (HISTORY). This function takes a DL_POLY_C trajectory file and maps it for the binary points in the file where each frame starts/ends. This way the @@ -110,7 +113,7 @@ class DLPOLY(object): dumped as PDB or XYZ or JSON (if dumped as a :attr:`pywindow.molecular.MolecularSystem.system`) - Attributes + Attributes: ---------- filepath : :class:`str` The filepath. @@ -125,23 +128,24 @@ class DLPOLY(object): A dictionary that is populated, on the fly, with the analysis output. """ + def __init__(self, filepath): # Image conventions - periodic boundary key. self._imcon = { - 0: 'nonperiodic', - 1: 'cubic', - 2: 'orthorhombic', - 3: 'parallelepiped', - 4: 'truncated octahedral', - 5: 'rhombic dodecahedral', - 6: 'x-y parallelogram', - 7: 'hexagonal prism', + 0: "nonperiodic", + 1: "cubic", + 2: "orthorhombic", + 3: "parallelepiped", + 4: "truncated octahedral", + 5: "rhombic dodecahedral", + 6: "x-y parallelogram", + 7: "hexagonal prism", } # Trajectory key - content type. self._keytrj = { - 0: 'coordinates', - 1: 'coordinates and velocities', - 2: 'coordinates, velocities and forces', + 0: "coordinates", + 1: "coordinates and velocities", + 2: "coordinates, velocities and forces", } self.filepath = filepath self.system_id = os.path.basename(filepath) @@ -155,11 +159,10 @@ def __init__(self, filepath): def _map_HISTORY(self): """ """ self.trajectory_map = {} - with open(self.filepath, 'r') as trajectory_file: + with open(self.filepath) as trajectory_file: with closing( - mmap( - trajectory_file.fileno(), 0, - access=ACCESS_READ)) as mapped_file: + mmap(trajectory_file.fileno(), 0, access=ACCESS_READ) + ) as mapped_file: progress = 0 line = 0 frame = 0 @@ -177,21 +180,23 @@ def _map_HISTORY(self): frame = frame + 1 break # We need to decode byte line into an utf-8 string. - sline = bline.decode("utf-8").strip('\n').split() + sline = bline.decode("utf-8").strip("\n").split() # We extract map's byte coordinates for each frame if header_flag is False: - if sline[0] == 'timestep': + if sline[0] == "timestep": self.trajectory_map[frame] = [ - frame_start, progress + frame_start, + progress, ] frame_start = progress frame = frame + 1 # Here we extract the map's byte coordinates for the header # And also the periodic system type needed for later. if header_flag is True: - if sline[0] == 'timestep': - self.trajectory_map['header'] = self._decode_head( - [0, progress]) + if sline[0] == "timestep": + self.trajectory_map["header"] = self._decode_head( + [0, progress] + ) frame_start = progress header_flag = False progress = progress + len(bline) @@ -199,14 +204,13 @@ def _map_HISTORY(self): def _decode_head(self, header_coordinates): start, end = header_coordinates - with open(self.filepath, 'r') as trajectory_file: + with open(self.filepath) as trajectory_file: with closing( - mmap( - trajectory_file.fileno(), 0, - access=ACCESS_READ)) as mapped_file: + mmap(trajectory_file.fileno(), 0, access=ACCESS_READ) + ) as mapped_file: header = [ i.split() - for i in mapped_file[start:end].decode("utf-8").split('\n') + for i in mapped_file[start:end].decode("utf-8").split("\n") ] header = [int(i) for i in header[1]] self.periodic_boundary = self._imcon[header[1]] @@ -214,9 +218,8 @@ def _decode_head(self, header_coordinates): self.no_of_atoms = header[2] return header - def get_frames(self, frames='all', override=False, **kwargs): - """ - Extract frames from the trajectory file. + def get_frames(self, frames="all", override=False, **kwargs): + """Extract frames from the trajectory file. Depending on the passed parameters a frame, a list of particular frames, a range of frames (from, to), or all frames can be extracted @@ -248,7 +251,7 @@ def get_frames(self, frames='all', override=False, **kwargs): :func:`pywindow.molecular.MolecularSystem.decipher_atom_keys()` will be applied to the extracted frame. - Returns + Returns: ------- :class:`pywindow.molecular.MolecularSystem` If a single frame is extracted. @@ -262,7 +265,8 @@ def get_frames(self, frames='all', override=False, **kwargs): self.frames = {} if isinstance(frames, int): frame = self._get_frame( - self.trajectory_map[frames], frames, **kwargs) + self.trajectory_map[frames], frames, **kwargs + ) if frames not in self.frames.keys(): self.frames[frames] = frame return frame @@ -270,64 +274,63 @@ def get_frames(self, frames='all', override=False, **kwargs): for frame in frames: if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) if isinstance(frames, tuple): for frame in range(frames[0], frames[1]): if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) if isinstance(frames, str): - if frames in ['all', 'everything']: - for frame in range(0, self.no_of_frames): + if frames in ["all", "everything"]: + for frame in range(self.no_of_frames): if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) def _get_frame(self, frame_coordinates, frame_no, **kwargs): - kwargs_ = { - "extract_data": True - } + kwargs_ = {"extract_data": True} kwargs_.update(kwargs) start, end = frame_coordinates - with open(self.filepath, 'r') as trajectory_file: + with open(self.filepath) as trajectory_file: with closing( - mmap( - trajectory_file.fileno(), 0, - access=ACCESS_READ)) as mapped_file: + mmap(trajectory_file.fileno(), 0, access=ACCESS_READ) + ) as mapped_file: if kwargs_["extract_data"] is False: return mapped_file[start:end].decode("utf-8") - else: - # [:-1] because the split results in last list empty. - frame = [ - i.split() - for i in mapped_file[start:end].decode("utf-8").split( - '\n') - ][:-1] - decoded_frame = self._decode_frame(frame) - molsys = MolecularSystem.load_system( - decoded_frame, - "_".join([self.system_id, str(frame_no)])) - if 'swap_atoms' in kwargs: - molsys.swap_atom_keys(kwargs['swap_atoms']) - if 'forcefield' in kwargs: - molsys.decipher_atom_keys(kwargs['forcefield']) - return molsys + # [:-1] because the split results in last list empty. + frame = [ + i.split() + for i in mapped_file[start:end].decode("utf-8").split("\n") + ][:-1] + decoded_frame = self._decode_frame(frame) + molsys = MolecularSystem.load_system( + decoded_frame, "_".join([self.system_id, str(frame_no)]) + ) + if "swap_atoms" in kwargs: + molsys.swap_atom_keys(kwargs["swap_atoms"]) + if "forcefield" in kwargs: + molsys.decipher_atom_keys(kwargs["forcefield"]) + return molsys def _decode_frame(self, frame): frame_data = { - 'frame_info': { - 'nstep': int(frame[0][1]), - 'natms': int(frame[0][2]), - 'keytrj': int(frame[0][3]), - 'imcon': int(frame[0][4]), - 'tstep': float(frame[0][5]) + "frame_info": { + "nstep": int(frame[0][1]), + "natms": int(frame[0][2]), + "keytrj": int(frame[0][3]), + "imcon": int(frame[0][4]), + "tstep": float(frame[0][5]), } } start_line = 1 - if frame_data['frame_info']['imcon'] in [1, 2, 3]: - frame_data['lattice'] = np.array(frame[1:4], dtype=float).T - frame_data['unit_cell'] = lattice_array_to_unit_cell(frame_data[ - 'lattice']) + if frame_data["frame_info"]["imcon"] in [1, 2, 3]: + frame_data["lattice"] = np.array(frame[1:4], dtype=float).T + frame_data["unit_cell"] = lattice_array_to_unit_cell( + frame_data["lattice"] + ) start_line = 4 # Depending on what the trajectory key is (see __init__) we need # to extract every second/ third/ fourth line for elements and coor. @@ -337,19 +340,19 @@ def _decode_frame(self, frame): forces = [] for i in range(len(frame[start_line:])): i_ = i + start_line - if frame_data['frame_info']['keytrj'] == 0: + if frame_data["frame_info"]["keytrj"] == 0: if i % 2 == 0: elements.append(frame[i_][0]) if i % 2 == 1: coordinates.append(frame[i_]) - if frame_data['frame_info']['keytrj'] == 1: + if frame_data["frame_info"]["keytrj"] == 1: if i % 3 == 0: elements.append(frame[i_][0]) if i % 3 == 1: coordinates.append(frame[i_]) if i % 3 == 2: velocities.append(frame[i_]) - if frame_data['frame_info']['keytrj'] == 2: + if frame_data["frame_info"]["keytrj"] == 2: if i % 4 == 0: elements.append(frame[i_][0]) if i % 4 == 1: @@ -358,19 +361,18 @@ def _decode_frame(self, frame): velocities.append(frame[i_]) if i % 4 == 3: forces.append(frame[i_]) - frame_data['atom_ids'] = np.array(elements) - frame_data['coordinates'] = np.array(coordinates, dtype=float) + frame_data["atom_ids"] = np.array(elements) + frame_data["coordinates"] = np.array(coordinates, dtype=float) if velocities: - frame_data['velocities'] = np.array(velocities, dtype=float) + frame_data["velocities"] = np.array(velocities, dtype=float) if forces: - frame_data['forces'] = np.array(forces, dtype=float) + frame_data["forces"] = np.array(forces, dtype=float) return frame_data def analysis( - self, frames='all', ncpus=1, _ncpus=1, override=False, **kwargs - ): - """ - Perform structural analysis on a frame/ set of frames. + self, frames="all", ncpus=1, _ncpus=1, override=False, **kwargs + ): + """Perform structural analysis on a frame/ set of frames. Depending on the passed parameters a frame, a list of particular frames, a range of frames (from, to), or all frames can be analysed @@ -430,7 +432,7 @@ def analysis( specified number of parallel jobs. Otherwise, it runs in serial. (default=1) - Returns + Returns: ------- None : :class:`NoneType` The function returns `None`, the analysis output is @@ -453,14 +455,13 @@ def analysis( if isinstance(frames[0], int) and isinstance(frames[1], int): for frame in range(frames[0], frames[1]): frames_for_analysis.append(frame) - else: - raise _FunctionError( - "The tuple should contain only two integers " - "for the begining and the end of the frames range." - ) + raise _FunctionError( + "The tuple should contain only two integers " + "for the begining and the end of the frames range." + ) if isinstance(frames, str): - if frames in ['all', 'everything']: - for frame in range(0, self.no_of_frames): + if frames in ["all", "everything"]: + for frame in range(self.no_of_frames): frames_for_analysis.append(frame) else: raise _FunctionError( @@ -484,88 +485,94 @@ def analysis( def _analysis_serial(self, frame, _ncpus, **kwargs): settings = { - 'rebuild': False, - 'modular': False, + "rebuild": False, + "modular": False, } settings.update(kwargs) molecular_system = self._get_frame( self.trajectory_map[frame], frame, extract_data=True, **kwargs ) - if settings['modular'] is True: - molecular_system.make_modular(rebuild=settings['rebuild']) + if settings["modular"] is True: + molecular_system.make_modular(rebuild=settings["rebuild"]) molecules = molecular_system.molecules else: - molecules = {'0': molecular_system.system_to_molecule()} + molecules = {"0": molecular_system.system_to_molecule()} results = {} for molecule in molecules: mol = molecules[molecule] - if 'molsize' in settings: - molsize = settings['molsize'] + if "molsize" in settings: + molsize = settings["molsize"] if isinstance(molsize, int): if mol.no_of_atoms == molsize: results[molecule] = mol.full_analysis( - _ncpus=_ncpus, **kwargs) + _ncpus=_ncpus, **kwargs + ) if isinstance(molsize, tuple) and isinstance(molsize[0], str): - if molsize[0] in ['bigger', 'greater', 'larger', 'more']: + if molsize[0] in ["bigger", "greater", "larger", "more"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis( - _ncpus=_ncpus, **kwargs) - if molsize[0] in ['smaller', 'less']: + _ncpus=_ncpus, **kwargs + ) + if molsize[0] in ["smaller", "less"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis( - _ncpus=_ncpus, **kwargs) - if molsize[0] in ['not', 'isnot', 'notequal', 'different']: + _ncpus=_ncpus, **kwargs + ) + if molsize[0] in ["not", "isnot", "notequal", "different"]: if mol.no_of_atoms != molsize[1]: results[molecule] = mol.full_analysis( - _ncpus=_ncpus, **kwargs) - if molsize[0] in ['is', 'equal', 'exactly']: + _ncpus=_ncpus, **kwargs + ) + if molsize[0] in ["is", "equal", "exactly"]: if mol.no_of_atoms == molsize[1]: results[molecule] = mol.full_analysis( - _ncpus=_ncpus, **kwargs) - if molsize[0] in ['between', 'inbetween']: + _ncpus=_ncpus, **kwargs + ) + if molsize[0] in ["between", "inbetween"]: if molsize[1] < mol.no_of_atoms < molsize[2]: results[molecule] = mol.full_analysis( - _ncpus=_ncpus, **kwargs) + _ncpus=_ncpus, **kwargs + ) else: results[molecule] = mol.full_analysis(_ncpus=_ncpus, **kwargs) return results def _analysis_parallel_execute(self, frame, **kwargs): settings = { - 'rebuild': False, - 'modular': False, + "rebuild": False, + "modular": False, } settings.update(kwargs) molecular_system = self._get_frame( self.trajectory_map[frame], frame, extract_data=True, **kwargs ) - if settings['modular'] is True: - molecular_system.make_modular(rebuild=settings['rebuild']) + if settings["modular"] is True: + molecular_system.make_modular(rebuild=settings["rebuild"]) molecules = molecular_system.molecules else: - molecules = {'0': molecular_system.system_to_molecule()} + molecules = {"0": molecular_system.system_to_molecule()} results = {} for molecule in molecules: mol = molecules[molecule] - if 'molsize' in settings: - molsize = settings['molsize'] + if "molsize" in settings: + molsize = settings["molsize"] if isinstance(molsize, int): if mol.no_of_atoms == molsize: results[molecule] = mol.full_analysis(**kwargs) if isinstance(molsize, tuple) and isinstance(molsize[0], str): - if molsize[0] in ['bigger', 'greater', 'larger', 'more']: + if molsize[0] in ["bigger", "greater", "larger", "more"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['smaller', 'less']: + if molsize[0] in ["smaller", "less"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['not', 'isnot', 'notequal', 'different']: + if molsize[0] in ["not", "isnot", "notequal", "different"]: if mol.no_of_atoms != molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['is', 'equal', 'exactly']: + if molsize[0] in ["is", "equal", "exactly"]: if mol.no_of_atoms == molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['between', 'inbetween']: + if molsize[0] in ["between", "inbetween"]: if molsize[1] < mol.no_of_atoms < molsize[2]: results[molecule] = mol.full_analysis(**kwargs) else: @@ -577,9 +584,9 @@ def _analysis_parallel(self, frames, ncpus, **kwargs): pool = Pool(processes=ncpus) parallel = [ pool.apply_async( - self._analysis_parallel_execute, - args=(frame, ), - kwds=kwargs) for frame in frames + self._analysis_parallel_execute, args=(frame,), kwds=kwargs + ) + for frame in frames ] results = [p.get() for p in parallel if p.get()] pool.terminate() @@ -590,13 +597,12 @@ def _analysis_parallel(self, frames, ncpus, **kwargs): raise _ParallelAnalysisError("Parallel analysis failed.") def _check_HISTORY(self): - """ - """ + """ """ self.check_log = "" line = 0 binary_step = 0 timestep = 0 - timestep_flag = 'timestep' + timestep_flag = "timestep" progress = 0 warning_1 = "No comment line is present as the file header.\n" @@ -604,25 +610,24 @@ def _check_HISTORY(self): ( "Second header line is missing from the file", "that contains information on the system's periodicity", - "and the type of the trajectory file.\n" - ) + "and the type of the trajectory file.\n", + ) ) warning_3 = " ".join( ( "Comment line encountered in the middle of", - "the trajectory file.\n" + "the trajectory file.\n", ) ) error_1 = "The trajectory is discontinous.\n" error_2 = "The file contains an empty line.\n" - with open(self.filepath, 'r') as trajectory_file: + with open(self.filepath) as trajectory_file: # We open the HISTORY trajectory file with closing( - mmap( - trajectory_file.fileno(), 0, - access=ACCESS_READ)) as file_binary_map: + mmap(trajectory_file.fileno(), 0, access=ACCESS_READ) + ) as file_binary_map: # We use this binary mapping feature that instead of loading # the full file into memory beforehand it only # maps the content. Especially useful with enormous files @@ -631,25 +636,25 @@ def _check_HISTORY(self): binary_line = file_binary_map.readline() binary_step = binary_step + len(binary_line) progress_old = progress - progress = round(binary_step * 100 / len(file_binary_map), - 0) - string_line = binary_line.decode("utf-8").strip( - '\n').split() + progress = round( + binary_step * 100 / len(file_binary_map), 0 + ) + string_line = ( + binary_line.decode("utf-8").strip("\n").split() + ) # Warning 1 if line == 1: - if string_line[0] != 'DLFIELD': + if string_line[0] != "DLFIELD": self.check_log = " ".join( - (self.check_log, "Line {0}:".format(line), - warning_1) + (self.check_log, f"Line {line}:", warning_1) ) # Warning 2 if line == 2: if len(string_line) != 3: self.check_log = " ".join( - (self.check_log, "Line {0}:".format(line), - warning_2) + (self.check_log, f"Line {line}:", warning_2) ) # Error 1 @@ -658,28 +663,23 @@ def _check_HISTORY(self): old_timestep = timestep timestep = int(string_line[1]) if old_timestep > timestep: - error = " ".join( - "Line {0}:".format(line), error_1 - ) + error = " ".join(f"Line {line}:", error_1) raise _TrajectoryError(error) # Error 2 if len(string_line) == 0: - error = " ".join( - "Line {0}:".format(line), error_2 - ) + error = " ".join(f"Line {line}:", error_2) raise _TrajectoryError(error) def save_analysis(self, filepath=None, **kwargs): - """ - Dump the content of :attr:`analysis_output` as JSON dictionary. + """Dump the content of :attr:`analysis_output` as JSON dictionary. Parameters ---------- filepath : :class:`str` The filepath for the JSON file. - Returns + Returns: ------- None : :class:`NoneType` """ @@ -687,15 +687,12 @@ def save_analysis(self, filepath=None, **kwargs): dict_obj = deepcopy(self.analysis_output) # If no filepath is provided we create one. if filepath is None: - filepath = "_".join( - (str(self.system_id), "pywindow_analysis") - ) - filepath = '/'.join((os.getcwd(), filepath)) + filepath = "_".join((str(self.system_id), "pywindow_analysis")) + filepath = "/".join((os.getcwd(), filepath)) # Dump the dictionary to json file. Output().dump2json(dict_obj, filepath, default=to_list, **kwargs) - return - def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): + def save_frames(self, frames, filepath=None, filetype="pdb", **kwargs): settings = { "pdb": Output()._save_pdb, "xyz": Output()._save_xyz, @@ -703,9 +700,10 @@ def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): "forcefield": None, } settings.update(kwargs) - if filetype.lower() not in settings.keys(): - raise _FormatError("The '{0}' file format is not supported".format( - filetype)) + if filetype.lower() not in settings: + raise _FormatError( + f"The '{filetype}' file format is not supported" + ) frames_to_get = [] if isinstance(frames, int): frames_to_get.append(frames) @@ -715,41 +713,45 @@ def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): for frame in range(frames[0], frames[1]): frames_to_get.append(frame) if isinstance(frames, str): - if frames in ['all', 'everything']: - for frame in range(0, self.no_of_frames): + if frames in ["all", "everything"]: + for frame in range(self.no_of_frames): frames_to_get.append(frame) for frame in frames_to_get: if frame not in self.frames.keys(): _ = self.get_frames(frame) # If no filepath is provided we create one. if filepath is None: - filepath = '/'.join((os.getcwd(), str(self.system_id))) + filepath = "/".join((os.getcwd(), str(self.system_id))) for frame in frames_to_get: frame_molsys = self.frames[frame] - if settings[ - 'decipher'] is True and settings['forcefield'] is not None: - if "swap_atoms" in settings.keys(): + if ( + settings["decipher"] is True + and settings["forcefield"] is not None + ): + if "swap_atoms" in settings: if isinstance(settings["swap_atoms"], dict): frame_molsys.swap_atom_keys(settings["swap_atoms"]) else: raise _FunctionError( "The swap_atom_keys function only accepts " - "'swap_atoms' argument in form of a dictionary.") + "'swap_atoms' argument in form of a dictionary." + ) frame_molsys.decipher_atom_keys(settings["forcefield"]) - ffilepath = '_'.join((filepath, str(frame))) - if 'elements' not in frame_molsys.system.keys(): + ffilepath = "_".join((filepath, str(frame))) + if "elements" not in frame_molsys.system.keys(): raise _FunctionError( "The frame (MolecularSystem object) needs to have " "'elements' attribute within the system dictionary. " "It is, therefore, neccessary that you set a decipher " - "keyword to True. (see manual)") - settings[filetype.lower()](frame_molsys.system, ffilepath, ** - kwargs) + "keyword to True. (see manual)" + ) + settings[filetype.lower()]( + frame_molsys.system, ffilepath, **kwargs + ) -class XYZ(object): - """ - A container for an XYZ type trajectory. +class XYZ: + """A container for an XYZ type trajectory. This function takes an XYZ trajectory file and maps it for the binary points in the file where each frame starts/ends. This way the @@ -762,7 +764,7 @@ class XYZ(object): dumped as PDB or XYZ or JSON (if dumped as a :attr:`pywindow.molecular.MolecularSystem.system`) - Attributes + Attributes: ---------- filepath : :class:`str` The filepath. @@ -780,6 +782,7 @@ class XYZ(object): A dictionary that is populated, on the fly, with the analysis output. """ + def __init__(self, filepath): self.filepath = filepath self.filename = os.path.basename(filepath) @@ -790,13 +793,12 @@ def __init__(self, filepath): self._map_trajectory() def _map_trajectory(self): - """ Return filepath as a class attribute""" + """Return filepath as a class attribute""" self.trajectory_map = {} - with open(self.filepath, 'r') as trajectory_file: + with open(self.filepath) as trajectory_file: with closing( - mmap( - trajectory_file.fileno(), 0, - access=ACCESS_READ)) as mapped_file: + mmap(trajectory_file.fileno(), 0, access=ACCESS_READ) + ) as mapped_file: progress = 0 line = 0 frame = -1 @@ -812,10 +814,13 @@ def _map_trajectory(self): self.trajectory_map[frame] = [frame_start, progress] break # We need to decode byte line into an utf-8 string. - sline = bline.decode("utf-8").strip('\n').split() + sline = bline.decode("utf-8").strip("\n").split() # We extract map's byte coordinates for each frame - if (len(sline) == 1 and is_number(sline[0]) and - progress > 0): + if ( + len(sline) == 1 + and is_number(sline[0]) + and progress > 0 + ): frame = frame + 1 self.trajectory_map[frame] = [frame_start, progress] frame_start = progress @@ -824,9 +829,8 @@ def _map_trajectory(self): progress = progress + len(bline) self.no_of_frames = frame + 1 - def get_frames(self, frames='all', override=False, **kwargs): - """ - Extract frames from the trajectory file. + def get_frames(self, frames="all", override=False, **kwargs): + """Extract frames from the trajectory file. Depending on the passed parameters a frame, a list of particular frames, a range of frames (from, to), or all frames can be extracted @@ -858,7 +862,7 @@ def get_frames(self, frames='all', override=False, **kwargs): :func:`pywindow.molecular.MolecularSystem.decipher_atom_keys()` will be applied to the extracted frame. - Returns + Returns: ------- :class:`pywindow.molecular.MolecularSystem` If a single frame is extracted. @@ -872,7 +876,8 @@ def get_frames(self, frames='all', override=False, **kwargs): self.frames = {} if isinstance(frames, int): frame = self._get_frame( - self.trajectory_map[frames], frames, **kwargs) + self.trajectory_map[frames], frames, **kwargs + ) if frames not in self.frames.keys(): self.frames[frames] = frame return frame @@ -880,54 +885,54 @@ def get_frames(self, frames='all', override=False, **kwargs): for frame in frames: if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) if isinstance(frames, tuple): for frame in range(frames[0], frames[1]): if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) if isinstance(frames, str): - if frames in ['all', 'everything']: - for frame in range(0, self.no_of_frames): + if frames in ["all", "everything"]: + for frame in range(self.no_of_frames): if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) def _get_frame(self, frame_coordinates, frame_no, **kwargs): kwargs_ = { "extract_data": True, - } + } kwargs_.update(kwargs) start, end = frame_coordinates - with open(self.filepath, 'r') as trajectory_file: + with open(self.filepath) as trajectory_file: with closing( - mmap( - trajectory_file.fileno(), 0, - access=ACCESS_READ)) as mapped_file: + mmap(trajectory_file.fileno(), 0, access=ACCESS_READ) + ) as mapped_file: if kwargs_["extract_data"] is False: return mapped_file[start:end].decode("utf-8") - else: - # [:-1] because the split results in last list empty. - frame = [ - i.split() - for i in mapped_file[start:end].decode("utf-8").split( - '\n') - ][:-1] - decoded_frame = self._decode_frame(frame) - molsys = MolecularSystem.load_system( - decoded_frame, - "_".join([self.system_id, str(frame_no)])) - if 'swap_atoms' in kwargs: - molsys.swap_atom_keys(kwargs['swap_atoms']) - if 'forcefield' in kwargs: - molsys.decipher_atom_keys(kwargs['forcefield']) - return molsys + # [:-1] because the split results in last list empty. + frame = [ + i.split() + for i in mapped_file[start:end].decode("utf-8").split("\n") + ][:-1] + decoded_frame = self._decode_frame(frame) + molsys = MolecularSystem.load_system( + decoded_frame, "_".join([self.system_id, str(frame_no)]) + ) + if "swap_atoms" in kwargs: + molsys.swap_atom_keys(kwargs["swap_atoms"]) + if "forcefield" in kwargs: + molsys.decipher_atom_keys(kwargs["forcefield"]) + return molsys def _decode_frame(self, frame): frame_data = { - 'frame_info': { - 'natms': int(frame[0][0]), - 'remarks': " ".join([*frame[1]]), + "frame_info": { + "natms": int(frame[0][0]), + "remarks": " ".join([*frame[1]]), } } start_line = 2 @@ -936,13 +941,12 @@ def _decode_frame(self, frame): for i in range(start_line, len(frame)): elements.append(frame[i][0]) coordinates.append(frame[i][1:]) - frame_data['atom_ids'] = np.array(elements) - frame_data['coordinates'] = np.array(coordinates, dtype=float) + frame_data["atom_ids"] = np.array(elements) + frame_data["coordinates"] = np.array(coordinates, dtype=float) return frame_data - def analysis(self, frames='all', ncpus=1, override=False, **kwargs): - """ - Perform structural analysis on a frame/ set of frames. + def analysis(self, frames="all", ncpus=1, override=False, **kwargs): + """Perform structural analysis on a frame/ set of frames. Depending on the passed parameters a frame, a list of particular frames, a range of frames (from, to), or all frames can be analysed @@ -1002,7 +1006,7 @@ def analysis(self, frames='all', ncpus=1, override=False, **kwargs): specified number of parallel jobs. Otherwise, it runs in serial. (default=1) - Returns + Returns: ------- None : :class:`NoneType` The function returns `None`, the analysis output is @@ -1016,107 +1020,112 @@ def analysis(self, frames='all', ncpus=1, override=False, **kwargs): if frames not in self.analysis_output.keys(): self.analysis_output[frames] = analysed_frame return analysed_frame - else: - frames_for_analysis = [] - if isinstance(frames, list): - for frame in frames: - if frame not in self.analysis_output.keys(): - frames_for_analysis.append(frame) - if isinstance(frames, tuple): - for frame in range(frames[0], frames[1]): + frames_for_analysis = [] + if isinstance(frames, list): + for frame in frames: + if frame not in self.analysis_output.keys(): + frames_for_analysis.append(frame) + if isinstance(frames, tuple): + for frame in range(frames[0], frames[1]): + if frame not in self.analysis_output.keys(): + frames_for_analysis.append(frame) + if isinstance(frames, str): + if frames in ["all", "everything"]: + for frame in range(self.no_of_frames): if frame not in self.analysis_output.keys(): frames_for_analysis.append(frame) - if isinstance(frames, str): - if frames in ['all', 'everything']: - for frame in range(0, self.no_of_frames): - if frame not in self.analysis_output.keys(): - frames_for_analysis.append(frame) - self._analysis_parallel(frames_for_analysis, ncpus, **kwargs) + self._analysis_parallel(frames_for_analysis, ncpus, **kwargs) def _analysis_serial(self, frame, ncpus, **kwargs): settings = { - 'rebuild': False, - 'modular': False, + "rebuild": False, + "modular": False, } settings.update(kwargs) molecular_system = self._get_frame( self.trajectory_map[frame], frame, extract_data=True, **kwargs ) - if settings['modular'] is True: - molecular_system.make_modular(rebuild=settings['rebuild']) + if settings["modular"] is True: + molecular_system.make_modular(rebuild=settings["rebuild"]) molecules = molecular_system.molecules else: - molecules = {'0': molecular_system.system_to_molecule()} + molecules = {"0": molecular_system.system_to_molecule()} results = {} for molecule in molecules: mol = molecules[molecule] - if 'molsize' in settings: - molsize = settings['molsize'] + if "molsize" in settings: + molsize = settings["molsize"] if isinstance(molsize, int): if mol.no_of_atoms == molsize: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) + ncpus=ncpus, **kwargs + ) if isinstance(molsize, tuple) and isinstance(molsize[0], str): - if molsize[0] in ['bigger', 'greater', 'larger', 'more']: + if molsize[0] in ["bigger", "greater", "larger", "more"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) - if molsize[0] in ['smaller', 'less']: + ncpus=ncpus, **kwargs + ) + if molsize[0] in ["smaller", "less"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) - if molsize[0] in ['not', 'isnot', 'notequal', 'different']: + ncpus=ncpus, **kwargs + ) + if molsize[0] in ["not", "isnot", "notequal", "different"]: if mol.no_of_atoms != molsize[1]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) - if molsize[0] in ['is', 'equal', 'exactly']: + ncpus=ncpus, **kwargs + ) + if molsize[0] in ["is", "equal", "exactly"]: if mol.no_of_atoms == molsize[1]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) - if molsize[0] in ['between', 'inbetween']: + ncpus=ncpus, **kwargs + ) + if molsize[0] in ["between", "inbetween"]: if molsize[1] < mol.no_of_atoms < molsize[2]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) + ncpus=ncpus, **kwargs + ) else: results[molecule] = mol.full_analysis(ncpus=ncpus, **kwargs) return results def _analysis_parallel_execute(self, frame, **kwargs): settings = { - 'rebuild': False, - 'modular': False, + "rebuild": False, + "modular": False, } settings.update(kwargs) molecular_system = self._get_frame( self.trajectory_map[frame], frame, extract_data=True, **kwargs ) - if settings['modular'] is True: - molecular_system.make_modular(rebuild=settings['rebuild']) + if settings["modular"] is True: + molecular_system.make_modular(rebuild=settings["rebuild"]) molecules = molecular_system.molecules else: - molecules = {'0': molecular_system.system_to_molecule()} + molecules = {"0": molecular_system.system_to_molecule()} results = {} for molecule in molecules: mol = molecules[molecule] - if 'molsize' in settings: - molsize = settings['molsize'] + if "molsize" in settings: + molsize = settings["molsize"] if isinstance(molsize, int): if mol.no_of_atoms == molsize: results[molecule] = mol.full_analysis(**kwargs) if isinstance(molsize, tuple) and isinstance(molsize[0], str): - if molsize[0] in ['bigger', 'greater', 'larger', 'more']: + if molsize[0] in ["bigger", "greater", "larger", "more"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['smaller', 'less']: + if molsize[0] in ["smaller", "less"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['not', 'isnot', 'notequal', 'different']: + if molsize[0] in ["not", "isnot", "notequal", "different"]: if mol.no_of_atoms != molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['is', 'equal', 'exactly']: + if molsize[0] in ["is", "equal", "exactly"]: if mol.no_of_atoms == molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['between', 'inbetween']: + if molsize[0] in ["between", "inbetween"]: if molsize[1] < mol.no_of_atoms < molsize[2]: results[molecule] = mol.full_analysis(**kwargs) else: @@ -1128,9 +1137,9 @@ def _analysis_parallel(self, frames, ncpus, **kwargs): pool = Pool(processes=ncpus) parallel = [ pool.apply_async( - self._analysis_parallel_execute, - args=(frame, ), - kwds=kwargs) for frame in frames + self._analysis_parallel_execute, args=(frame,), kwds=kwargs + ) + for frame in frames ] results = [p.get() for p in parallel if p.get()[1] is not None] pool.terminate() @@ -1141,15 +1150,14 @@ def _analysis_parallel(self, frames, ncpus, **kwargs): raise _ParallelAnalysisError("Parallel analysis failed.") def save_analysis(self, filepath=None, **kwargs): - """ - Dump the content of :attr:`analysis_output` as JSON dictionary. + """Dump the content of :attr:`analysis_output` as JSON dictionary. Parameters ---------- filepath : :class:`str` The filepath for the JSON file. - Returns + Returns: ------- None : :class:`NoneType` """ @@ -1157,15 +1165,12 @@ def save_analysis(self, filepath=None, **kwargs): dict_obj = deepcopy(self.analysis_output) # If no filepath is provided we create one. if filepath is None: - filepath = "_".join( - (str(self.system_id), "pywindow_analysis") - ) - filepath = '/'.join((os.getcwd(), filepath)) + filepath = "_".join((str(self.system_id), "pywindow_analysis")) + filepath = "/".join((os.getcwd(), filepath)) # Dump the dictionary to json file. Output().dump2json(dict_obj, filepath, default=to_list, **kwargs) - return - def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): + def save_frames(self, frames, filepath=None, filetype="pdb", **kwargs): settings = { "pdb": Output()._save_pdb, "xyz": Output()._save_xyz, @@ -1173,9 +1178,10 @@ def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): "forcefield": None, } settings.update(kwargs) - if filetype.lower() not in settings.keys(): - raise _FormatError("The '{0}' file format is not supported".format( - filetype)) + if filetype.lower() not in settings: + raise _FormatError( + f"The '{filetype}' file format is not supported" + ) frames_to_get = [] if isinstance(frames, int): frames_to_get.append(frames) @@ -1185,42 +1191,46 @@ def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): for frame in range(frames[0], frames[1]): frames_to_get.append(frame) if isinstance(frames, str): - if frames in ['all', 'everything']: - for frame in range(0, self.no_of_frames): + if frames in ["all", "everything"]: + for frame in range(self.no_of_frames): frames_to_get.append(frame) for frame in frames_to_get: if frame not in self.frames.keys(): _ = self.get_frames(frame) # If no filepath is provided we create one. if filepath is None: - filepath = '/'.join((os.getcwd(), str(self.system_id))) + filepath = "/".join((os.getcwd(), str(self.system_id))) for frame in frames_to_get: frame_molsys = self.frames[frame] - if settings[ - 'decipher'] is True and settings['forcefield'] is not None: - if "swap_atoms" in settings.keys(): + if ( + settings["decipher"] is True + and settings["forcefield"] is not None + ): + if "swap_atoms" in settings: if isinstance(settings["swap_atoms"], dict): frame_molsys.swap_atom_keys(settings["swap_atoms"]) else: raise _FunctionError( "The swap_atom_keys function only accepts " - "'swap_atoms' argument in form of a dictionary.") + "'swap_atoms' argument in form of a dictionary." + ) frame_molsys.decipher_atom_keys(settings["forcefield"]) - ffilepath = '_'.join((filepath, str(frame))) - if 'elements' not in frame_molsys.system.keys(): + ffilepath = "_".join((filepath, str(frame))) + if "elements" not in frame_molsys.system.keys(): raise _FunctionError( "The frame (MolecularSystem object) needs to have " "'elements' attribute within the system dictionary. " "It is, therefore, neccessary that you set a decipher " - "keyword to True. (see manual)") - settings[filetype.lower()](frame_molsys.system, ffilepath, ** - kwargs) + "keyword to True. (see manual)" + ) + settings[filetype.lower()]( + frame_molsys.system, ffilepath, **kwargs + ) -class PDB(object): +class PDB: def __init__(self, filepath): - """ - A container for an PDB type trajectory. + """A container for an PDB type trajectory. This function takes an PDB trajectory file and maps it for the binary points in the file where each frame starts/ends. This way the @@ -1233,7 +1243,7 @@ def __init__(self, filepath): dumped as PDB or XYZ or JSON (if dumped as a :attr:`pywindow.molecular.MolecularSystem.system`) - Attributes + Attributes: ---------- filepath : :class:`str` The filepath. @@ -1260,13 +1270,12 @@ def __init__(self, filepath): self._map_trajectory() def _map_trajectory(self): - """ Return filepath as a class attribute""" + """Return filepath as a class attribute""" self.trajectory_map = {} - with open(self.filepath, 'r') as trajectory_file: + with open(self.filepath) as trajectory_file: with closing( - mmap( - trajectory_file.fileno(), 0, - access=ACCESS_READ)) as mapped_file: + mmap(trajectory_file.fileno(), 0, access=ACCESS_READ) + ) as mapped_file: progress = 0 line = 0 frame = -1 @@ -1281,13 +1290,14 @@ def _map_trajectory(self): frame = frame + 1 if progress - frame_start > 10: self.trajectory_map[frame] = [ - frame_start, progress + frame_start, + progress, ] break # We need to decode byte line into an utf-8 string. - sline = bline.decode("utf-8").strip('\n').split() + sline = bline.decode("utf-8").strip("\n").split() # We extract map's byte coordinates for each frame - if len(sline) == 1 and sline[0] == 'END': + if len(sline) == 1 and sline[0] == "END": frame = frame + 1 self.trajectory_map[frame] = [frame_start, progress] frame_start = progress @@ -1296,9 +1306,8 @@ def _map_trajectory(self): progress = progress + len(bline) self.no_of_frames = frame - def get_frames(self, frames='all', override=False, **kwargs): - """ - Extract frames from the trajectory file. + def get_frames(self, frames="all", override=False, **kwargs): + """Extract frames from the trajectory file. Depending on the passed parameters a frame, a list of particular frames, a range of frames (from, to), or all frames can be extracted @@ -1330,7 +1339,7 @@ def get_frames(self, frames='all', override=False, **kwargs): :func:`pywindow.molecular.MolecularSystem.decipher_atom_keys()` will be applied to the extracted frame. - Returns + Returns: ------- :class:`pywindow.molecular.MolecularSystem` If a single frame is extracted. @@ -1344,7 +1353,8 @@ def get_frames(self, frames='all', override=False, **kwargs): self.frames = {} if isinstance(frames, int): frame = self._get_frame( - self.trajectory_map[frames], frames, **kwargs) + self.trajectory_map[frames], frames, **kwargs + ) if frames not in self.frames.keys(): self.frames[frames] = frame return frame @@ -1352,76 +1362,80 @@ def get_frames(self, frames='all', override=False, **kwargs): for frame in frames: if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) if isinstance(frames, tuple): for frame in range(frames[0], frames[1]): if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) if isinstance(frames, str): - if frames in ['all', 'everything']: - for frame in range(0, self.no_of_frames): + if frames in ["all", "everything"]: + for frame in range(self.no_of_frames): if frame not in self.frames.keys(): self.frames[frame] = self._get_frame( - self.trajectory_map[frame], frame, **kwargs) + self.trajectory_map[frame], frame, **kwargs + ) def _get_frame(self, frame_coordinates, frame_no, **kwargs): - kwargs_ = { - "extract_data": True - } + kwargs_ = {"extract_data": True} kwargs_.update(kwargs) start, end = frame_coordinates - with open(self.filepath, 'r') as trajectory_file: + with open(self.filepath) as trajectory_file: with closing( - mmap( - trajectory_file.fileno(), 0, - access=ACCESS_READ)) as mapped_file: + mmap(trajectory_file.fileno(), 0, access=ACCESS_READ) + ) as mapped_file: if kwargs_["extract_data"] is False: return mapped_file[start:end].decode("utf-8") - else: - # In case of PDB we do not split lines! - frame = mapped_file[start:end].decode("utf-8").split('\n') - decoded_frame = self._decode_frame(frame) - molsys = MolecularSystem.load_system( - decoded_frame, - "_".join([self.system_id, str(frame_no)])) - if 'swap_atoms' in kwargs: - molsys.swap_atom_keys(kwargs['swap_atoms']) - if 'forcefield' in kwargs: - molsys.decipher_atom_keys(kwargs['forcefield']) - return molsys + # In case of PDB we do not split lines! + frame = mapped_file[start:end].decode("utf-8").split("\n") + decoded_frame = self._decode_frame(frame) + molsys = MolecularSystem.load_system( + decoded_frame, "_".join([self.system_id, str(frame_no)]) + ) + if "swap_atoms" in kwargs: + molsys.swap_atom_keys(kwargs["swap_atoms"]) + if "forcefield" in kwargs: + molsys.decipher_atom_keys(kwargs["forcefield"]) + return molsys def _decode_frame(self, frame): frame_data = {} elements = [] coordinates = [] for i in range(len(frame)): - if frame[i][:6] == 'REMARK': - if 'REMARKS' not in frame_data.keys(): - frame_data['REMARKS'] = [] - frame_data['REMARKS'].append(frame[i][6:]) - if frame[i][:6] == 'CRYST1': + if frame[i][:6] == "REMARK": + if "REMARKS" not in frame_data: + frame_data["REMARKS"] = [] + frame_data["REMARKS"].append(frame[i][6:]) + if frame[i][:6] == "CRYST1": cryst = np.array( [ - frame[i][6:15], frame[i][15:24], frame[i][24:33], - frame[i][33:40], frame[i][40:47], frame[i][47:54] + frame[i][6:15], + frame[i][15:24], + frame[i][24:33], + frame[i][33:40], + frame[i][40:47], + frame[i][47:54], ], - dtype=float) + dtype=float, + ) # This is in case of nonperiodic systems, often they have # a,b,c unit cell parameters as 0,0,0. if sum(cryst[0:3]) != 0: - frame_data['CRYST1'] = cryst - if frame[i][:6] in ['HETATM', 'ATOM ']: + frame_data["CRYST1"] = cryst + if frame[i][:6] in ["HETATM", "ATOM "]: elements.append(frame[i][12:16].strip()) coordinates.append( - [frame[i][30:38], frame[i][38:46], frame[i][46:54]]) - frame_data['atom_ids'] = np.array(elements, dtype=' molsize[1]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) - if molsize[0] in ['smaller', 'less']: + ncpus=ncpus, **kwargs + ) + if molsize[0] in ["smaller", "less"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) - if molsize[0] in ['not', 'isnot', 'notequal', 'different']: + ncpus=ncpus, **kwargs + ) + if molsize[0] in ["not", "isnot", "notequal", "different"]: if mol.no_of_atoms != molsize[1]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) - if molsize[0] in ['is', 'equal', 'exactly']: + ncpus=ncpus, **kwargs + ) + if molsize[0] in ["is", "equal", "exactly"]: if mol.no_of_atoms == molsize[1]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) - if molsize[0] in ['between', 'inbetween']: + ncpus=ncpus, **kwargs + ) + if molsize[0] in ["between", "inbetween"]: if molsize[1] < mol.no_of_atoms < molsize[2]: results[molecule] = mol.full_analysis( - ncpus=ncpus, **kwargs) + ncpus=ncpus, **kwargs + ) else: results[molecule] = mol.full_analysis(ncpus=ncpus, **kwargs) return results def _analysis_parallel_execute(self, frame, **kwargs): settings = { - 'rebuild': False, - 'modular': False, + "rebuild": False, + "modular": False, } settings.update(kwargs) molecular_system = self._get_frame( self.trajectory_map[frame], frame, extract_data=True, **kwargs ) - if settings['modular'] is True: - molecular_system.make_modular(rebuild=settings['rebuild']) + if settings["modular"] is True: + molecular_system.make_modular(rebuild=settings["rebuild"]) molecules = molecular_system.molecules else: - molecules = {'0': molecular_system.system_to_molecule()} + molecules = {"0": molecular_system.system_to_molecule()} results = {} for molecule in molecules: mol = molecules[molecule] - if 'molsize' in settings: - molsize = settings['molsize'] + if "molsize" in settings: + molsize = settings["molsize"] if isinstance(molsize, int): if mol.no_of_atoms == molsize: results[molecule] = mol.full_analysis(**kwargs) if isinstance(molsize, tuple) and isinstance(molsize[0], str): - if molsize[0] in ['bigger', 'greater', 'larger', 'more']: + if molsize[0] in ["bigger", "greater", "larger", "more"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['smaller', 'less']: + if molsize[0] in ["smaller", "less"]: if mol.no_of_atoms > molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['not', 'isnot', 'notequal', 'different']: + if molsize[0] in ["not", "isnot", "notequal", "different"]: if mol.no_of_atoms != molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['is', 'equal', 'exactly']: + if molsize[0] in ["is", "equal", "exactly"]: if mol.no_of_atoms == molsize[1]: results[molecule] = mol.full_analysis(**kwargs) - if molsize[0] in ['between', 'inbetween']: + if molsize[0] in ["between", "inbetween"]: if molsize[1] < mol.no_of_atoms < molsize[2]: results[molecule] = mol.full_analysis(**kwargs) else: @@ -1607,9 +1626,9 @@ def _analysis_parallel(self, frames, ncpus, **kwargs): pool = Pool(processes=ncpus) parallel = [ pool.apply_async( - self._analysis_parallel_execute, - args=(frame, ), - kwds=kwargs) for frame in frames + self._analysis_parallel_execute, args=(frame,), kwds=kwargs + ) + for frame in frames ] results = [p.get() for p in parallel if p.get()[1] is not None] pool.terminate() @@ -1620,15 +1639,14 @@ def _analysis_parallel(self, frames, ncpus, **kwargs): raise _ParallelAnalysisError("Parallel analysis failed.") def save_analysis(self, filepath=None, **kwargs): - """ - Dump the content of :attr:`analysis_output` as JSON dictionary. + """Dump the content of :attr:`analysis_output` as JSON dictionary. Parameters ---------- filepath : :class:`str` The filepath for the JSON file. - Returns + Returns: ------- None : :class:`NoneType` """ @@ -1636,15 +1654,12 @@ def save_analysis(self, filepath=None, **kwargs): dict_obj = deepcopy(self.analysis_output) # If no filepath is provided we create one. if filepath is None: - filepath = "_".join( - (str(self.system_id), "pywindow_analysis") - ) - filepath = '/'.join((os.getcwd(), filepath)) + filepath = "_".join((str(self.system_id), "pywindow_analysis")) + filepath = "/".join((os.getcwd(), filepath)) # Dump the dictionary to json file. Output().dump2json(dict_obj, filepath, default=to_list, **kwargs) - return - def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): + def save_frames(self, frames, filepath=None, filetype="pdb", **kwargs): settings = { "pdb": Output()._save_pdb, "xyz": Output()._save_xyz, @@ -1652,9 +1667,10 @@ def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): "forcefield": None, } settings.update(kwargs) - if filetype.lower() not in settings.keys(): - raise _FormatError("The '{0}' file format is not supported".format( - filetype)) + if filetype.lower() not in settings: + raise _FormatError( + f"The '{filetype}' file format is not supported" + ) frames_to_get = [] if isinstance(frames, int): frames_to_get.append(frames) @@ -1664,33 +1680,38 @@ def save_frames(self, frames, filepath=None, filetype='pdb', **kwargs): for frame in range(frames[0], frames[1]): frames_to_get.append(frame) if isinstance(frames, str): - if frames in ['all', 'everything']: - for frame in range(0, self.no_of_frames): + if frames in ["all", "everything"]: + for frame in range(self.no_of_frames): frames_to_get.append(frame) for frame in frames_to_get: if frame not in self.frames.keys(): _ = self.get_frames(frame) # If no filepath is provided we create one. if filepath is None: - filepath = '/'.join((os.getcwd(), str(self.system_id))) + filepath = "/".join((os.getcwd(), str(self.system_id))) for frame in frames_to_get: frame_molsys = self.frames[frame] - if settings[ - 'decipher'] is True and settings['forcefield'] is not None: - if "swap_atoms" in settings.keys(): + if ( + settings["decipher"] is True + and settings["forcefield"] is not None + ): + if "swap_atoms" in settings: if isinstance(settings["swap_atoms"], dict): frame_molsys.swap_atom_keys(settings["swap_atoms"]) else: raise _FunctionError( "The swap_atom_keys function only accepts " - "'swap_atoms' argument in form of a dictionary.") + "'swap_atoms' argument in form of a dictionary." + ) frame_molsys.decipher_atom_keys(settings["forcefield"]) - ffilepath = '_'.join((filepath, str(frame))) - if 'elements' not in frame_molsys.system.keys(): + ffilepath = "_".join((filepath, str(frame))) + if "elements" not in frame_molsys.system.keys(): raise _FunctionError( "The frame (MolecularSystem object) needs to have " "'elements' attribute within the system dictionary. " "It is, therefore, neccessary that you set a decipher " - "keyword to True. (see manual)") - settings[filetype.lower()](frame_molsys.system, ffilepath, ** - kwargs) + "keyword to True. (see manual)" + ) + settings[filetype.lower()]( + frame_molsys.system, ffilepath, **kwargs + ) diff --git a/src/pywindow/_internal/utilities.py b/src/pywindow/_internal/utilities.py index 8c85196..1af9665 100644 --- a/src/pywindow/_internal/utilities.py +++ b/src/pywindow/_internal/utilities.py @@ -1,11 +1,11 @@ -""" -Module containing all general purpose functions shared by other modules. +"""Module containing all general purpose functions shared by other modules. This module is not intended for the direct use by a User. Therefore, I will only docstring functions if I see fit to do so. LOG --- + 11/07/18 Changed the way vector path is analysed. Now, the initial analysis is done with the geometrical formula for line-sphere intersection. Only @@ -35,17 +35,21 @@ increase in size of the sampling sphere. (validate this with the MongoDB) """ -import numpy as np from copy import deepcopy from multiprocessing import Pool + +import numpy as np from scipy.optimize import brute, fmin, minimize from sklearn.cluster import DBSCAN from sklearn.metrics.pairwise import euclidean_distances from sklearn.neighbors import KDTree from .tables import ( - atomic_mass, atomic_vdw_radius, opls_atom_keys, atomic_covalent_radius - ) + atomic_covalent_radius, + atomic_mass, + atomic_vdw_radius, + opls_atom_keys, +) class _AtomKeyError(Exception): @@ -69,14 +73,13 @@ def __init__(self, message): def is_number(number): - """ - Return True if an object is a number - can be converted into a float. + """Return True if an object is a number - can be converted into a float. Parameters ---------- number : any - Returns + Returns: ------- bool True if input is a float convertable (a number), False otherwise. @@ -90,15 +93,14 @@ def is_number(number): def unique(input_list): - """ - Return a list of unique items (similar to set functionality). + """Return a list of unique items (similar to set functionality). Parameters ---------- input_list : list A list containg some items that can occur more than once. - Returns + Returns: ------- list A list with only unique occurances of an item. @@ -115,12 +117,11 @@ def to_list(obj): """ """ if isinstance(obj, np.ndarray): return obj.tolist() - raise TypeError('Not serializable') + raise TypeError("Not serializable") def distance(a, b): - """ - Return the distance between two vectors (points) a and b. + """Return the distance between two vectors (points) a and b. Parameters ---------- @@ -129,55 +130,52 @@ def distance(a, b): b : numpy.ndarray Second vector. - Returns + Returns: ------- numpy.float64 A distance between two vectors (points). """ - return (np.sum((a - b)**2))**0.5 + return (np.sum((a - b) ** 2)) ** 0.5 def molecular_weight(elements): - """ - Return molecular weight of a molecule. + """Return molecular weight of a molecule. Parameters ---------- elements : numpy.ndarray An array of all elements (type: str) in a molecule. - Returns + Returns: ------- numpy.float64 A molecular weight of a molecule. """ - return (np.array([atomic_mass[i.upper()] for i in elements]).sum()) + return np.array([atomic_mass[i.upper()] for i in elements]).sum() def center_of_coor(coordinates): - """ - Return the centre of coordinates. + """Return the centre of coordinates. Parameters ---------- coordinates : numpy.ndarray An array containing molecule's coordinates. - Returns + Returns: ------- numpy.ndarray An 1d array with coordinates of the centre of coordinates excluding elements' masses. """ - return (np.sum(coordinates, axis=0) / coordinates.shape[0]) + return np.sum(coordinates, axis=0) / coordinates.shape[0] def center_of_mass(elements, coordinates): - """ - Return the centre of mass (COM). + """Return the centre of mass (COM). Parameters ---------- @@ -187,7 +185,7 @@ def center_of_mass(elements, coordinates): coordinates : numpy.ndarray An array containing molecule's coordinates. - Returns + Returns: ------- numpy.ndarray An 1d array with coordinates of the centre of mass including elements' @@ -197,12 +195,11 @@ def center_of_mass(elements, coordinates): mass = molecular_weight(elements) mass_array = np.array([[atomic_mass[i.upper()]] * 3 for i in elements]) mass_coordinates = coordinates * mass_array - return (np.sum(mass_coordinates, axis=0) / np.array([mass, mass, mass])) + return np.sum(mass_coordinates, axis=0) / np.array([mass, mass, mass]) def compose_atom_list(*args): - """ - Return an `atom list` from elements and/or atom ids and coordinates. + """Return an `atom list` from elements and/or atom ids and coordinates. An `atom list` is a special object that some pywindowfunctions uses. It is a nested list of lists with each individual list containing: @@ -226,25 +223,27 @@ def compose_atom_list(*args): An array of all forcfield dependent atom keys (type:str) in a molecule. - Returns + Returns: ------- list Version 1 or version 2 atom list depending on input parameters. - Raises + Raises: ------ _FunctionError : :class:`Exception` Raised when wrong number of parameters is passed to the function. """ if len(args) == 2: - atom_list = [[ - i[0], - round(float(i[1]), 8), - round(float(i[2]), 8), - round(float(i[3]), 8), - ] for i in np.concatenate( - (args[0].reshape(-1, 1), args[1]), axis=1)] + atom_list = [ + [ + i[0], + round(float(i[1]), 8), + round(float(i[2]), 8), + round(float(i[3]), 8), + ] + for i in np.concatenate((args[0].reshape(-1, 1), args[1]), axis=1) + ] elif len(args) == 3: atom_list = [ [ @@ -255,20 +254,25 @@ def compose_atom_list(*args): round(float(i[4]), 8), ] for i in np.concatenate( - (np.concatenate( - (args[0].reshape(-1, 1), args[1].reshape(-1, 1) - ), axis=1), args[2]), - axis=1) + ( + np.concatenate( + (args[0].reshape(-1, 1), args[1].reshape(-1, 1)), + axis=1, + ), + args[2], + ), + axis=1, + ) ] else: raise _FunctionError( - "The compose_atom_list() function accepts only 2 or 3 arguments.") + "The compose_atom_list() function accepts only 2 or 3 arguments." + ) return atom_list def decompose_atom_list(atom_list): - """ - Return elements and/or atom ids and coordinates from an `atom list`. + """Return elements and/or atom ids and coordinates from an `atom list`. Depending on input type of an atom list (version 1 or 2) @@ -282,7 +286,7 @@ def decompose_atom_list(atom_list): atom_list : list A nested list of lists (version 1 or 2) - Returns + Returns: ------- touple A touple of elements and coordinates arrays, or if input contained @@ -298,7 +302,7 @@ def decompose_atom_list(atom_list): array_ab = np.concatenate((array_a, array_b), axis=1) coordinates = np.concatenate((array_ab, array_c), axis=1) return elements, coordinates - elif len(transpose) == 5: + if len(transpose) == 5: elements = np.array(transpose[0]) atom_ids = np.array(transpose[1]) array_a = np.array(transpose[2]).reshape(-1, 1) @@ -307,16 +311,16 @@ def decompose_atom_list(atom_list): array_ab = np.concatenate((array_a, array_b), axis=1) coordinates = np.concatenate((array_ab, array_c), axis=1) return elements, atom_ids, coordinates - else: - raise _FunctionError( - "The decompose_atom_list() function accepts only list of lists " - " with only 4 or 5 items per sublist.") + raise _FunctionError( + "The decompose_atom_list() function accepts only list of lists " + " with only 4 or 5 items per sublist." + ) def dlf_notation(atom_key): """Return element for atom key using DL_F notation.""" split = list(atom_key) - element = '' + element = "" number = False count = 0 while number is False: @@ -331,32 +335,32 @@ def dlf_notation(atom_key): # will not affect the functionality towards it. # EDIT2: also the '?' atoms, you can delete them manually or somewhere else element = "".join(i for i in element if not is_number(i)) - element = "".join(i for i in element if i != '?') + element = "".join(i for i in element if i != "?") return element def opls_notation(atom_key): """Return element for OPLS forcefield atom key.""" # warning for Ne, He, Na types overlap - conflicts = ['ne', 'he', 'na'] + conflicts = ["ne", "he", "na"] if atom_key in conflicts: - raise _AtomKeyConflict(( + raise _AtomKeyConflict( "One of the OPLS conflicting " - "atom_keys has occured '{0}'. " + f"atom_keys has occured '{atom_key}'. " "For how to solve this issue see the manual or " - "MolecularSystem._atom_key_swap() doc string.").format(atom_key)) + "MolecularSystem._atom_key_swap() doc string." + ) for element in opls_atom_keys: if atom_key in opls_atom_keys[element]: return element # In case if atom_key was not found in the OPLS keys dictionary - raise _AtomKeyError(( - "OPLS atom key {0} was not found in OPLS keys dictionary.").format( - atom_key)) + raise _AtomKeyError( + f"OPLS atom key {atom_key} was not found in OPLS keys dictionary." + ) def decipher_atom_key(atom_key, forcefield): - """ - Return element for deciphered atom key. + """Return element for deciphered atom key. This functions checks if the forcfield specified by user is supported and passes the atom key to the appropriate function for deciphering. @@ -369,7 +373,7 @@ def decipher_atom_key(atom_key, forcefield): forcefield : str The forcefield to which the atom key belongs to. - Returns + Returns: ------- str A string that is the periodic table element equvalent of forcefield @@ -377,26 +381,24 @@ def decipher_atom_key(atom_key, forcefield): """ load_funcs = { - 'DLF': dlf_notation, - 'DL_F': dlf_notation, - 'OPLS': opls_notation, - 'OPLSAA': opls_notation, - 'OPLS2005': opls_notation, - 'OPLS3': opls_notation, + "DLF": dlf_notation, + "DL_F": dlf_notation, + "OPLS": opls_notation, + "OPLSAA": opls_notation, + "OPLS2005": opls_notation, + "OPLS3": opls_notation, } - if forcefield.upper() in load_funcs.keys(): + if forcefield.upper() in load_funcs: return load_funcs[forcefield.upper()](atom_key) - else: - raise _ForceFieldError( - ("Unfortunetely, '{0}' forcefield is not supported by pyWINDOW." - " For list of supported forcefields see User's Manual or " - "MolecularSystem._decipher_atom_keys() function doc string." - ).format(forcefield)) + raise _ForceFieldError( + f"Unfortunetely, '{forcefield}' forcefield is not supported by pyWINDOW." + " For list of supported forcefields see User's Manual or " + "MolecularSystem._decipher_atom_keys() function doc string." + ) def shift_com(elements, coordinates, com_adjust=np.zeros(3)): - """ - Return coordinates translated by some vector. + """Return coordinates translated by some vector. Parameters ---------- @@ -408,7 +410,7 @@ def shift_com(elements, coordinates, com_adjust=np.zeros(3)): com_adjust : numpy.ndarray (default = [0, 0, 0]) - Returns + Returns: ------- numpy.ndarray Translated array of molecule's coordinates. @@ -420,8 +422,7 @@ def shift_com(elements, coordinates, com_adjust=np.zeros(3)): def max_dim(elements, coordinates): - """ - Return the maximum diameter of a molecule. + """Return the maximum diameter of a molecule. Parameters ---------- @@ -431,14 +432,16 @@ def max_dim(elements, coordinates): coordinates : numpy.ndarray An array containing molecule's coordinates. - Returns + Returns: ------- """ atom_vdw_vertical = np.matrix( - [[atomic_vdw_radius[i.upper()]] for i in elements]) + [[atomic_vdw_radius[i.upper()]] for i in elements] + ) atom_vdw_horizontal = np.matrix( - [atomic_vdw_radius[i.upper()] for i in elements]) + [atomic_vdw_radius[i.upper()] for i in elements] + ) dist_matrix = euclidean_distances(coordinates, coordinates) vdw_matrix = atom_vdw_vertical + atom_vdw_horizontal re_dist_matrix = dist_matrix + vdw_matrix @@ -463,7 +466,7 @@ def pore_diameter(elements, coordinates, com=None): def correct_pore_diameter(com, *params): """Return negative of a pore diameter. (optimisation function).""" elements, coordinates = params - return (-pore_diameter(elements, coordinates, com)[0]) + return -pore_diameter(elements, coordinates, com)[0] def opt_pore_diameter(elements, coordinates, bounds=None, com=None, **kwargs): @@ -476,44 +479,44 @@ def opt_pore_diameter(elements, coordinates, bounds=None, com=None, **kwargs): if bounds is None: pore_r = pore_diameter(elements, coordinates, com=com)[0] / 2 bounds = ( - (com[0]-pore_r, com[0]+pore_r), - (com[1]-pore_r, com[1]+pore_r), - (com[2]-pore_r, com[2]+pore_r) + (com[0] - pore_r, com[0] + pore_r), + (com[1] - pore_r, com[1] + pore_r), + (com[2] - pore_r, com[2] + pore_r), ) minimisation = minimize( - correct_pore_diameter, x0=com, args=args, bounds=bounds) + correct_pore_diameter, x0=com, args=args, bounds=bounds + ) pored = pore_diameter(elements, coordinates, com=minimisation.x) return (pored[0], pored[1], minimisation.x) def sphere_volume(sphere_radius): """Return volume of a sphere.""" - return (4 / 3 * np.pi * sphere_radius**3) + return 4 / 3 * np.pi * sphere_radius**3 def asphericity(S): - return (S[0] - (S[1] + S[2]) / 2) + return S[0] - (S[1] + S[2]) / 2 def acylidricity(S): - return (S[1] - S[2]) + return S[1] - S[2] def relative_shape_anisotropy(S): - return (1 - 3 * ( - (S[0] * S[1] + S[0] * S[2] + S[1] * S[2]) / (np.sum(S))**2)) + return 1 - 3 * ( + (S[0] * S[1] + S[0] * S[2] + S[1] * S[2]) / (np.sum(S)) ** 2 + ) def get_tensor_eigenvalues(T, sort=False): if sort: - return (sorted(np.linalg.eigvals(T), reverse=True)) - else: - return (np.linalg.eigvals(T)) + return sorted(np.linalg.eigvals(T), reverse=True) + return np.linalg.eigvals(T) def get_gyration_tensor(elements, coordinates): - """ - Return the gyration tensor of a molecule. + """Return the gyration tensor of a molecule. The gyration tensor should be invariant to the molecule's position. The known formulas for the gyration tensor have the correction for the @@ -528,7 +531,7 @@ def get_gyration_tensor(elements, coordinates): coordinates : numpy.ndarray The array containing the Cartesian coordinates of the molecule. - Returns + Returns: ------- numpy.ndarray The gyration tensor of a molecule invariant to the molecule's position. @@ -543,14 +546,15 @@ def get_gyration_tensor(elements, coordinates): xy = np.sum(coordinates[:, 0] * coordinates[:, 1]) xz = np.sum(coordinates[:, 0] * coordinates[:, 2]) yz = np.sum(coordinates[:, 1] * coordinates[:, 2]) - S = np.array([[diag[0], xy, xz], [xy, diag[1], yz], - [xz, yz, diag[2]]]) / coordinates.shape[0] - return (S) + S = ( + np.array([[diag[0], xy, xz], [xy, diag[1], yz], [xz, yz, diag[2]]]) + / coordinates.shape[0] + ) + return S def get_inertia_tensor(elements, coordinates): - """ - Return the tensor of inertia a molecule. + """Return the tensor of inertia a molecule. Parameters ---------- @@ -560,15 +564,14 @@ def get_inertia_tensor(elements, coordinates): coordinates : numpy.ndarray The array containing the Cartesian coordinates of the molecule. - Returns + Returns: ------- numpy.ndarray The tensor of inertia of a molecule. """ pow2 = coordinates**2 - molecular_weight = np.array( - [[atomic_mass[e.upper()]] for e in elements]) + molecular_weight = np.array([[atomic_mass[e.upper()]] for e in elements]) diag_1 = np.sum(molecular_weight * (pow2[:, 1] + pow2[:, 2])) diag_2 = np.sum(molecular_weight * (pow2[:, 0] + pow2[:, 2])) @@ -578,18 +581,19 @@ def get_inertia_tensor(elements, coordinates): mxz = np.sum(-molecular_weight * coordinates[:, 0] * coordinates[:, 2]) myz = np.sum(-molecular_weight * coordinates[:, 1] * coordinates[:, 2]) - inertia_tensor = np.array([[diag_1, mxy, mxz], [mxy, diag_2, myz], - [mxz, myz, diag_3]]) / coordinates.shape[0] - return (inertia_tensor) + inertia_tensor = ( + np.array([[diag_1, mxy, mxz], [mxy, diag_2, myz], [mxz, myz, diag_3]]) + / coordinates.shape[0] + ) + return inertia_tensor def principal_axes(elements, coordinates): - return (np.linalg.eig(get_inertia_tensor(elements, coordinates))[1].T) + return np.linalg.eig(get_inertia_tensor(elements, coordinates))[1].T def normalize_vector(vector): - """ - Normalize a vector. + """Normalize a vector. A new vector is returned, the original vector is not modified. @@ -598,7 +602,7 @@ def normalize_vector(vector): vector : np.array The vector to be normalized. - Returns + Returns: ------- np.array The normalized vector. @@ -609,8 +613,7 @@ def normalize_vector(vector): def rotation_matrix_arbitrary_axis(angle, axis): - """ - Return a rotation matrix of `angle` radians about `axis`. + """Return a rotation matrix of `angle` radians about `axis`. Parameters ---------- @@ -621,7 +624,7 @@ def rotation_matrix_arbitrary_axis(angle, axis): A 3 element aray which represents a vector. The vector is the axis about which the rotation is carried out. - Returns + Returns: ------- numpy.array A 3x3 array representing a rotation matrix. @@ -698,22 +701,36 @@ def unit_cell_to_lattice_array(cryst): r_beta = np.deg2rad(beta) r_gamma = np.deg2rad(gamma) # Calculate unit cell volume that is neccessary. - volume = a_ * b_ * c_ * ( - 1 - np.cos(r_alpha)**2 - np.cos(r_beta)**2 - np.cos(r_gamma)**2 + 2 * - np.cos(r_alpha) * np.cos(r_beta) * np.cos(r_gamma))**0.5 + volume = ( + a_ + * b_ + * c_ + * ( + 1 + - np.cos(r_alpha) ** 2 + - np.cos(r_beta) ** 2 + - np.cos(r_gamma) ** 2 + + 2 * np.cos(r_alpha) * np.cos(r_beta) * np.cos(r_gamma) + ) + ** 0.5 + ) # Create the orthogonalisation Matrix (M^-1) - lattice matrix a_x = a_ a_y = b_ * np.cos(r_gamma) a_z = c_ * np.cos(r_beta) b_x = 0 b_y = b_ * np.sin(r_gamma) - b_z = c_ * ( - np.cos(r_alpha) - np.cos(r_beta) * np.cos(r_gamma)) / np.sin(r_gamma) + b_z = ( + c_ + * (np.cos(r_alpha) - np.cos(r_beta) * np.cos(r_gamma)) + / np.sin(r_gamma) + ) c_x = 0 c_y = 0 c_z = volume / (a_ * b_ * np.sin(r_gamma)) lattice_array = np.array( - [[a_x, a_y, a_z], [b_x, b_y, b_z], [c_x, c_y, c_z]]) + [[a_x, a_y, a_z], [b_x, b_y, b_z], [c_x, c_y, c_z]] + ) return lattice_array @@ -725,10 +742,12 @@ def lattice_array_to_unit_cell(lattice_array): alpha_r = np.arccos( lattice_array[1][2] * np.sin(gamma_r) / cell_lengths[2] + np.cos(beta_r) * np.cos(gamma_r) - ) + ) cell_angles = [ - np.rad2deg(alpha_r), np.rad2deg(beta_r), np.rad2deg(gamma_r) - ] + np.rad2deg(alpha_r), + np.rad2deg(beta_r), + np.rad2deg(gamma_r), + ] return np.append(cell_lengths, cell_angles) @@ -761,7 +780,8 @@ def cart2frac_all(coordinates, lattice_array): frac_coordinates = deepcopy(coordinates) for coord in range(frac_coordinates.shape[0]): frac_coordinates[coord] = fractional_from_cartesian( - frac_coordinates[coord], lattice_array) + frac_coordinates[coord], lattice_array + ) return frac_coordinates @@ -769,25 +789,27 @@ def frac2cart_all(frac_coordinates, lattice_array): """Convert all fractional coordinates to cartesian.""" coordinates = deepcopy(frac_coordinates) for coord in range(coordinates.shape[0]): - coordinates[coord] = cartisian_from_fractional(coordinates[coord], - lattice_array) + coordinates[coord] = cartisian_from_fractional( + coordinates[coord], lattice_array + ) return coordinates 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']) + if "lattice" not in system.keys(): + matrix = unit_cell_to_lattice_array(system["unit_cell"]) else: - matrix = system['lattice'] - coordinates = deepcopy(system['coordinates']) + matrix = system["lattice"] + coordinates = deepcopy(system["coordinates"]) multiplication_matrices = [] for a_ in range(supercell[0][0], supercell[0][1] + 1): for b_ in range(supercell[1][0], supercell[1][1] + 1): for c_ in range(supercell[2][0], supercell[2][1] + 1): mult_matrix = np.array([[a_, b_, c_]]) mult_matrix = np.repeat( - mult_matrix, coordinates.shape[0], axis=0) + mult_matrix, coordinates.shape[0], axis=0 + ) multiplication_matrices.append(mult_matrix) frac_coordinates = cart2frac_all(coordinates, matrix) updated_coordinates = [] @@ -798,18 +820,18 @@ def create_supercell(system, supercell=[[-1, 1], [-1, 1], [-1, 1]]): supercell_coordinates = frac2cart_all(supercell_frac_coordinates, matrix) # Now for each new cell in the supercell we need to repeat the # elements array so that it maches - new_elements = deepcopy(system['elements']) - new_ids = deepcopy(system['atom_ids']) + new_elements = deepcopy(system["elements"]) + new_ids = deepcopy(system["atom_ids"]) for i in range(len(updated_coordinates) - 1): - new_elements = np.concatenate((new_elements, system['elements'])) - new_ids = np.concatenate((new_ids, system['atom_ids'])) + new_elements = np.concatenate((new_elements, system["elements"])) + new_ids = np.concatenate((new_ids, system["atom_ids"])) cryst = lattice_array_to_unit_cell(matrix) supercell_system = { - 'elements': new_elements, - 'atom_ids': new_ids, - 'coordinates': supercell_coordinates, - 'unit_cell': cryst, - 'lattice': matrix, + "elements": new_elements, + "atom_ids": new_ids, + "coordinates": supercell_coordinates, + "unit_cell": cryst, + "lattice": matrix, } return supercell_system @@ -822,11 +844,13 @@ def is_inside_polyhedron(point, polyhedron): frac_coord = pw.utilities.fractional_from_cartesian(point, matrix)[0] - if 0 <= frac_coord[0] <= 1.000 and 0 <= frac_coord[ - 1] <= 1.000 and 0 <= frac_coord[2] <= 1.000: + if ( + 0 <= frac_coord[0] <= 1.000 + and 0 <= frac_coord[1] <= 1.000 + and 0 <= frac_coord[2] <= 1.000 + ): return True - else: - return False + return False def normal_vector(origin, vectors): @@ -835,10 +859,9 @@ def normal_vector(origin, vectors): def discrete_molecules(system, rebuild=None, tol=0.4): - """ - Decompose molecular system into individual discreet molecules. + """Decompose molecular system into individual discreet molecules. - Note + Note: ---- New formula for bonds: (26/07/17) The two atoms, x and y, are considered bonded if the distance between @@ -857,37 +880,36 @@ def discrete_molecules(system, rebuild=None, tol=0.4): # 3) Periodic Molecular system with rebuilding (supercell provided). if rebuild is not None: mode = 3 - else: - if 'unit_cell' in system.keys(): - if system['unit_cell'].shape == (6,): - mode = 2 - else: - mode = 1 - elif 'lattice' in system.keys(): - if system['lattice'].shape == (3, 3): - mode = 2 - else: - mode = 1 + elif "unit_cell" in system.keys(): + if system["unit_cell"].shape == (6,): + mode = 2 + else: + mode = 1 + elif "lattice" in system.keys(): + if system["lattice"].shape == (3, 3): + mode = 2 else: mode = 1 + else: + mode = 1 # We create a list containing all atoms, theirs periodic elements and # coordinates. As this process is quite complicated, we need a list # which we will gradually be reducing. try: - elements = system['elements'] - coordinates = system['coordinates'] + elements = system["elements"] + coordinates = system["coordinates"] except KeyError: raise _FunctionError( "The 'elements' key is missing in the 'system' dictionary " "attribute of the MolecularSystem object. Which means, you need to" " decipher the forcefield based atom keys first (see manual)." ) - coordinates = system['coordinates'] + coordinates = system["coordinates"] args = (elements, coordinates) adj = 0 # If there are forcefield 'atom ids' as well we will retain them. - if 'atom_ids' in system.keys(): - atom_ids = system['atom_ids'] + if "atom_ids" in system.keys(): + atom_ids = system["atom_ids"] args = (elements, atom_ids, coordinates) adj = 1 atom_list = compose_atom_list(*args) @@ -910,19 +932,19 @@ def discrete_molecules(system, rebuild=None, tol=0.4): # and on different machines. if mode == 2 or mode == 3: # Scenarios 2 or 3. - origin = np.array([0.01, 0., 0.]) - if 'lattice' not in system.keys(): - matrix = unit_cell_to_lattice_array(system['unit_cell']) + origin = np.array([0.01, 0.0, 0.0]) + if "lattice" not in system.keys(): + matrix = unit_cell_to_lattice_array(system["unit_cell"]) else: - matrix = system['lattice'] + matrix = system["lattice"] pseudo_origin_frac = np.array([0.26, 0.25, 0.25]) pseudo_origin = cartisian_from_fractional(pseudo_origin_frac, matrix) # If a supercell is also provided that encloses the unit cell for the # reconstruction of the molecules through the periodic boundary. if rebuild is not None: - selements = rebuild['elements'] - sids = rebuild['atom_ids'] - scoordinates = rebuild['coordinates'] + selements = rebuild["elements"] + sids = rebuild["atom_ids"] + scoordinates = rebuild["coordinates"] satom_list = compose_atom_list(selements, sids, scoordinates) satom_coor = decompose_atom_list(satom_list)[1 + adj] # There is one more step. We need to sort out for all the @@ -940,23 +962,25 @@ def discrete_molecules(system, rebuild=None, tol=0.4): if np.allclose(system_com, origin, atol=1e-00): boundary = np.array([-0.5, 0.5]) else: - boundary = np.array([0., 1.]) + boundary = np.array([0.0, 1.0]) else: # Scenario 1. - pseudo_origin = center_of_mass( - elements, coordinates) + np.array([0.01, 0., 0.]) + pseudo_origin = center_of_mass(elements, coordinates) + np.array( + [0.01, 0.0, 0.0] + ) # Here the final discrete molecules will be stored. molecules = [] # Exceptions. Usually end-point atoms that create single bonds or # just a separate atoms in the system. - exceptions = ['H', 'CL', 'BR', 'F', 'HE', 'AR', 'NE', 'KR', 'XE', 'RN'] + exceptions = ["H", "CL", "BR", "F", "HE", "AR", "NE", "KR", "XE", "RN"] # The upper limit for distances analysed for bonds will be assigned for # a given system (to save time). We take set('elements') and then find # the largest R(cov) in the system and set the max_dist as a double # of it plus the 150% tolerance (tol). - set_of_elements = set(system['elements']) - max_r_cov = max([ - atomic_covalent_radius[i.upper()] for i in set_of_elements]) + set_of_elements = set(system["elements"]) + max_r_cov = max( + [atomic_covalent_radius[i.upper()] for i in set_of_elements] + ) max_dist = 2 * max_r_cov + tol # We continue untill all items in the list have been analysed and popped. while atom_list: @@ -971,20 +995,23 @@ def discrete_molecules(system, rebuild=None, tol=0.4): # separate arrays that we started with and we don't want # atoms already assigned in our array for distance matrix. inside_atoms_coord_heavy = decompose_atom_list(inside_atoms_heavy)[ - 1 + adj] - dist_matrix = euclidean_distances(inside_atoms_coord_heavy, - pseudo_origin.reshape(1, -1)) - atom_index_x, _ = np.unravel_index(dist_matrix.argmin(), - dist_matrix.shape) + 1 + adj + ] + dist_matrix = euclidean_distances( + inside_atoms_coord_heavy, pseudo_origin.reshape(1, -1) + ) + atom_index_x, _ = np.unravel_index( + dist_matrix.argmin(), dist_matrix.shape + ) # Added this so that lone atoms (even if heavy) close to the # periodic boundary are not analysed, as they surely have matching # symmetry equivalence that bind to a bigger atom cluster inside # the unit_cell. potential_starting_point = inside_atoms_heavy[atom_index_x] - pot_arr = np.array(potential_starting_point[1 + adj:]) + pot_arr = np.array(potential_starting_point[1 + adj :]) dist_matrix = euclidean_distances( atom_coor, pot_arr.reshape(1, -1) - ) + ) idx = (dist_matrix > 0.1) * (dist_matrix < max_dist) if len(idx) < 1: pass @@ -1006,24 +1033,28 @@ def discrete_molecules(system, rebuild=None, tol=0.4): # is assigned here before entering the atom_coor loop.! # Otherwise it will not be re-asigned when the satom_list # still iterates, but the atom_list is already empty... - i_arr = np.array(i[1 + adj:]) + i_arr = np.array(i[1 + adj :]) if atom_coor is not None: dist_matrix = euclidean_distances( atom_coor, i_arr.reshape(1, -1) - ) + ) idx = (dist_matrix > 0.1) * (dist_matrix < max_dist) neighbours_indexes = np.where(idx)[0] for j in neighbours_indexes: j_arr = np.array(atom_coor[j]) r_i_j = distance(i_arr, j_arr) - r_cov_i_j = atomic_covalent_radius[ - i[0].upper()] + atomic_covalent_radius[ - atom_list[j][0].upper()] + r_cov_i_j = ( + atomic_covalent_radius[i[0].upper()] + + atomic_covalent_radius[ + atom_list[j][0].upper() + ] + ) if r_cov_i_j - tol < r_i_j < r_cov_i_j + tol: working_list_temp.append(atom_list[j]) if rebuild is not None: sdist_matrix = euclidean_distances( - satom_coor, i_arr.reshape(1, -1)) + satom_coor, i_arr.reshape(1, -1) + ) sidx = (sdist_matrix > 0.1) * (sdist_matrix < max_dist) sneighbours_indexes = np.where(sidx)[0] for j in sneighbours_indexes: @@ -1032,10 +1063,12 @@ def discrete_molecules(system, rebuild=None, tol=0.4): else: j_arr = np.array(satom_coor[j]) r_i_j = distance(i_arr, j_arr) - r_cov_i_j = atomic_covalent_radius[ - i[0].upper() - ] + atomic_covalent_radius[ - satom_list[j][0].upper()] + r_cov_i_j = ( + atomic_covalent_radius[i[0].upper()] + + atomic_covalent_radius[ + satom_list[j][0].upper() + ] + ) if r_cov_i_j - tol < r_i_j < r_cov_i_j + tol: working_list_temp.append(satom_list[j]) final_molecule.append(i) @@ -1059,25 +1092,33 @@ def discrete_molecules(system, rebuild=None, tol=0.4): if i not in final_molecule: working_list.append(i) final_molecule_dict = {} - final_molecule_dict['elements'] = np.array( - [x[0] for x in final_molecule], dtype='str') - final_molecule_dict['coordinates'] = np.array( - [[*xyz[1 + adj:]] for xyz in final_molecule]) + final_molecule_dict["elements"] = np.array( + [x[0] for x in final_molecule], dtype="str" + ) + final_molecule_dict["coordinates"] = np.array( + [[*xyz[1 + adj :]] for xyz in final_molecule] + ) if adj == 1: - final_molecule_dict['atom_ids'] = np.array( - [x[1] for x in final_molecule], dtype='str') + final_molecule_dict["atom_ids"] = np.array( + [x[1] for x in final_molecule], dtype="str" + ) # In general we always want the molecule so the initial bool_ is True. bool_ = True # But, for periodic only if the molecule is in the initial unit cell. if rebuild is not None: - com = center_of_mass(final_molecule_dict['elements'], - final_molecule_dict['coordinates']) + com = center_of_mass( + final_molecule_dict["elements"], + final_molecule_dict["coordinates"], + ) com_frac = fractional_from_cartesian(com, matrix)[0] # If we don't round the numerical errors will come up. com_frac_round = np.around(com_frac, decimals=8) - bool_ = np.all(np.logical_and(com_frac_round >= boundary[0], - com_frac_round < boundary[1]), - axis=0) + bool_ = np.all( + np.logical_and( + com_frac_round >= boundary[0], com_frac_round < boundary[1] + ), + axis=0, + ) if bool(bool_) is True: molecules.append(final_molecule_dict) return molecules @@ -1086,10 +1127,11 @@ def discrete_molecules(system, rebuild=None, tol=0.4): 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) * - np.sqrt(y[0]**2 + y[1]**2 + y[2]**2)) + np.sqrt(x[0] ** 2 + x[1] ** 2 + x[2] ** 2) + * np.sqrt(y[0] ** 2 + y[1] ** 2 + y[2] ** 2) + ) second_step = np.arccos(first_step) - return (second_step) + return second_step def vector_analysis(vector, coordinates, elements_vdw, increment=1.0): @@ -1100,26 +1142,31 @@ def vector_analysis(vector, coordinates, elements_vdw, increment=1.0): chunk = vector / chunks # Calculate set of points on vector's path every increment. vector_pathway = np.array([chunk * i for i in range(chunks + 1)]) - analysed_vector = np.array([ - np.amin( - euclidean_distances(coordinates, i.reshape(1, -1)) - elements_vdw) - for i in vector_pathway - ]) + analysed_vector = np.array( + [ + np.amin( + euclidean_distances(coordinates, i.reshape(1, -1)) + - elements_vdw + ) + for i in vector_pathway + ] + ) if all(i > 0 for i in analysed_vector): pos = np.argmin(analysed_vector) # As first argument we need to give the distance from the origin. dist = np.linalg.norm(chunk * pos) return np.array( - [dist, analysed_vector[pos] * 2, *chunk * pos, *vector]) + [dist, analysed_vector[pos] * 2, *chunk * pos, *vector] + ) def vector_preanalysis(vector, coordinates, elements_vdw, increment=1.0): - norm_vec = vector/np.linalg.norm(vector) + norm_vec = vector / np.linalg.norm(vector) intersections = [] origin = center_of_coor(coordinates) L = coordinates - origin t_ca = np.dot(L, norm_vec) - d = np.sqrt(np.einsum('ij,ij->i', L, L) - t_ca**2) + d = np.sqrt(np.einsum("ij,ij->i", L, L) - t_ca**2) under_sqrt = elements_vdw**2 - d**2 diag = under_sqrt.diagonal() positions = np.argwhere(diag > 0) @@ -1153,17 +1200,18 @@ def optimise_z(z, *args): return pore_diameter(elements, coordinates, com=window_com)[0] -def window_analysis(window, - elements, - coordinates, - elements_vdw, - increment2=0.1, - z_bounds=[None, None], - lb_z=True, - z_second_mini=False, - **kwargs): - """ - Return window diameter and window's centre. +def window_analysis( + window, + elements, + coordinates, + elements_vdw, + increment2=0.1, + z_bounds=[None, None], + lb_z=True, + z_second_mini=False, + **kwargs, +): + """Return window diameter and window's centre. Parameters ---------- @@ -1183,7 +1231,8 @@ def window_analysis(window, # Find the vector with the largest window sampling diameter from the pool. vector_ = window[window.argmax(axis=0)[1]][5:8] vector_analysed = vector_analysis( - vector_, coordinates, elements_vdw, increment=increment2) + vector_, coordinates, elements_vdw, increment=increment2 + ) # A safety check, if the refined analysis give None we end the function. if vector_analysed is not None: pass @@ -1222,15 +1271,23 @@ def window_analysis(window, angle_1 = -angle_1 angle_2 = np.pi - angle_2 # Rotation matrix for rotation around Z-axis with angle_1. - rotation_around_z = np.array([[np.cos(angle_1), -np.sin(angle_1), 0], - [np.sin(angle_1), np.cos(angle_1), 0], - [0, 0, 1]]) + rotation_around_z = np.array( + [ + [np.cos(angle_1), -np.sin(angle_1), 0], + [np.sin(angle_1), np.cos(angle_1), 0], + [0, 0, 1], + ] + ) # Rotate the whole molecule around with rotation_around_z. coordinates = np.array([np.dot(rotation_around_z, i) for i in coordinates]) # Rotation matrix for rotation around Y-axis with angle_2 - rotation_around_y = np.array([[np.cos(angle_2), 0, np.sin(angle_2)], - [0, 1, 0], - [-np.sin(angle_2), 0, np.cos(angle_2)]]) + rotation_around_y = np.array( + [ + [np.cos(angle_2), 0, np.sin(angle_2)], + [0, 1, 0], + [-np.sin(angle_2), 0, np.cos(angle_2)], + ] + ) # Rotate the whole molecule around with rotation_around_y. coordinates = np.array([np.dot(rotation_around_y, i) for i in coordinates]) # Third step is translation. We are now at [0, 0, -z]. @@ -1239,8 +1296,9 @@ def window_analysis(window, # where the largest sampling sphere was (vector_analysed[0]). new_z = vector_analysed[0] # Translate the whole molecule to shift window's center to origin. - coordinates = coordinates - np.array([[0, 0, new_z]] * - coordinates.shape[0]) + coordinates = coordinates - np.array( + [[0, 0, new_z]] * coordinates.shape[0] + ) # !!!Here the window center (xy and z) optimisation take place!!! window_com = np.array([0, 0, 0], dtype=float) # The lb_z parameter is 'lower bound equal to z' which means, @@ -1254,15 +1312,19 @@ def window_analysis(window, # SciPy minimisation on z coordinate. z_args = (window_com[0], window_com[1], elements, coordinates) z_optimisation = minimize( - optimise_z, x0=window_com[2], args=z_args, bounds=[z_bounds]) + optimise_z, x0=window_com[2], args=z_args, bounds=[z_bounds] + ) # Substitute the z coordinate for a minimised one. window_com[2] = z_optimisation.x[0] # SciPy brute optimisation on x and y coordinates in window plane. xy_args = (window_com[2], elements, coordinates) - xy_bounds = ((-window_diameter / 2, window_diameter / 2), - (-window_diameter / 2, window_diameter / 2)) + xy_bounds = ( + (-window_diameter / 2, window_diameter / 2), + (-window_diameter / 2, window_diameter / 2), + ) xy_optimisation = brute( - optimise_xy, xy_bounds, args=xy_args, full_output=True, finish=fmin) + optimise_xy, xy_bounds, args=xy_args, full_output=True, finish=fmin + ) # Substitute the x and y coordinates for the optimised ones. window_com[0] = xy_optimisation[0][0] window_com[1] = xy_optimisation[0][1] @@ -1279,7 +1341,8 @@ def window_analysis(window, z_args = (window_com[0], window_com[1], elements, coordinates) # The z_bounds should be passed in kwargs. z_optimisation = minimize( - optimise_z, x0=window_com[2], args=z_args, bounds=[z_bounds]) + optimise_z, x0=window_com[2], args=z_args, bounds=[z_bounds] + ) # Substitute the z coordinate for a minimised one. window_com[2] = z_optimisation.x[0] # Calculate the new window diameter. @@ -1289,28 +1352,38 @@ def window_analysis(window, # Reverse the translation by substracting the new_z. window_com[2] = window_com[2] + new_z angle_2_1 = -angle_2 - reverse_around_y = np.array([[np.cos(angle_2_1), 0, np.sin(angle_2_1)], - [0, 1, 0], - [-np.sin(angle_2_1), 0, np.cos(angle_2_1)]]) + reverse_around_y = np.array( + [ + [np.cos(angle_2_1), 0, np.sin(angle_2_1)], + [0, 1, 0], + [-np.sin(angle_2_1), 0, np.cos(angle_2_1)], + ] + ) # Reversing the second rotation around Y-axis. window_com = np.dot(reverse_around_y, window_com) angle_1_1 = -angle_1 - reverse_around_z = np.array([[np.cos(angle_1_1), -np.sin(angle_1_1), 0], - [np.sin(angle_1_1), np.cos(angle_1_1), 0], - [0, 0, 1]]) + reverse_around_z = np.array( + [ + [np.cos(angle_1_1), -np.sin(angle_1_1), 0], + [np.sin(angle_1_1), np.cos(angle_1_1), 0], + [0, 0, 1], + ] + ) # Reversing the first rotation around Z-axis. window_com = np.dot(reverse_around_z, window_com) return (window_diameter, window_com) -def find_windows(elements, - coordinates, - processes=None, - mol_size=None, - adjust=1, - pore_opt=True, - increment=1.0, - **kwargs): +def find_windows( + elements, + coordinates, + processes=None, + mol_size=None, + adjust=1, + pore_opt=True, + increment=1.0, + **kwargs, +): """Return windows diameters and center of masses for a molecule.""" # Copy the coordinates as will perform many opertaions on them coordinates = deepcopy(coordinates) @@ -1327,8 +1400,9 @@ def find_windows(elements, # is at the origin of the system and not the center of the not # optimised one, we need to adjust the shift. We also have to update # the initial com. - com_adjust = initial_com - opt_pore_diameter(elements, coordinates, ** - kwargs)[2] + com_adjust = ( + initial_com - opt_pore_diameter(elements, coordinates, **kwargs)[2] + ) initial_com = initial_com - com_adjust coordinates = shift_com(elements, coordinates, com_adjust=com_adjust) else: @@ -1354,8 +1428,11 @@ def find_windows(elements, # http://blog.marmakoide.org/?p=1 golden_angle = np.pi * (3 - np.sqrt(5)) theta = golden_angle * np.arange(number_of_points) - z = np.linspace(1 - 1.0 / number_of_points, 1.0 / number_of_points - 1.0, - number_of_points) + z = np.linspace( + 1 - 1.0 / number_of_points, + 1.0 / number_of_points - 1.0, + number_of_points, + ) radius = np.sqrt(1 - z * z) points = np.zeros((number_of_points, 3)) points[:, 0] = radius * np.cos(theta) * shpere_radius @@ -1383,11 +1460,10 @@ def find_windows(elements, parallel = [ pool.apply_async( vector_preanalysis, - args=( - point, - coordinates, - elements_vdw, ), - kwds={'increment': increment}) for point in points + args=(point, coordinates, elements_vdw), + kwds={"increment": increment}, + ) + for point in points ] results = [p.get() for p in parallel if p.get() is not None] pool.terminate() @@ -1396,7 +1472,8 @@ def find_windows(elements, else: results = [ vector_preanalysis( - point, coordinates, elements_vdw, increment=increment) + point, coordinates, elements_vdw, increment=increment + ) for point in points ] results = [x for x in results if x is not None] @@ -1408,80 +1485,100 @@ def find_windows(elements, # Otherwise we continue our search for windows. if len(results) == 0: return None + # Perfomr DBSCAN to cluster the sampling points vectors. + # the n_jobs will be developed later. + # db = DBSCAN(eps=eps, n_jobs=_ncpus).fit(dataset) + db = DBSCAN(eps=eps).fit(dataset) + core_samples_mask = np.zeros_like(db.labels_, dtype=bool) + core_samples_mask[db.core_sample_indices_] = True + labels = set(db.labels_) + # Assing cluster label to a sampling point. + clusters = [[i, j] for i, j in zip(results, db.labels_)] + clustered_results = {label: [] for label in labels} + # Create a dictionary of clusters with points listed. + [clustered_results[i[1]].append(i[0]) for i in clusters] + # No for the sampling point vector in each cluster that had + # the widest channel's 'neck' is assumed to pass the closest + # to the window's center and therefore will be passed to + # window analysis function. + # We also pass user defined settings for window analysis. + # Again either in serlia or in parallel. + # Noisy points get a cluster label -1, therefore we have to exclude it. + if processes: + pool = Pool(processes=processes) + parallel = [ + pool.apply_async( + window_analysis, + args=( + np.array(clustered_results[cluster]), + elements, + coordinates, + elements_vdw, + ), + kwds=kwargs, + ) + for cluster in clustered_results + if cluster != -1 + ] + window_results = [p.get() for p in parallel if p.get() is not None] + pool.terminate() else: - # Perfomr DBSCAN to cluster the sampling points vectors. - # the n_jobs will be developed later. - # db = DBSCAN(eps=eps, n_jobs=_ncpus).fit(dataset) - db = DBSCAN(eps=eps).fit(dataset) - core_samples_mask = np.zeros_like(db.labels_, dtype=bool) - core_samples_mask[db.core_sample_indices_] = True - labels = set(db.labels_) - # Assing cluster label to a sampling point. - clusters = [[i, j] for i, j in zip(results, db.labels_)] - clustered_results = {label: [] for label in labels} - # Create a dictionary of clusters with points listed. - [clustered_results[i[1]].append(i[0]) for i in clusters] - # No for the sampling point vector in each cluster that had - # the widest channel's 'neck' is assumed to pass the closest - # to the window's center and therefore will be passed to - # window analysis function. - # We also pass user defined settings for window analysis. - # Again either in serlia or in parallel. - # Noisy points get a cluster label -1, therefore we have to exclude it. - if processes: - pool = Pool(processes=processes) - parallel = [ - pool.apply_async( - window_analysis, - args=(np.array(clustered_results[cluster]), elements, - coordinates, elements_vdw), - kwds=kwargs) for cluster in clustered_results - if cluster != -1 - ] - window_results = [p.get() for p in parallel if p.get() is not None] - pool.terminate() - else: - window_results = [ - window_analysis( - np.array(clustered_results[cluster]), elements, - coordinates, elements_vdw, **kwargs) - for cluster in clustered_results if cluster != -1 - ] + window_results = [ + window_analysis( + np.array(clustered_results[cluster]), + elements, + coordinates, + elements_vdw, + **kwargs, + ) + for cluster in clustered_results + if cluster != -1 + ] # The function returns two numpy arrays, one with windows diameters # in Angstrom, second with corresponding windows center's coordinates - windows = np.array([result[0] for result in window_results - if result is not None]) + windows = np.array( + [result[0] for result in window_results if result is not None] + ) windows_coms = np.array( - [np.add(result[1], initial_com) for result in window_results - if result is not None]) + [ + np.add(result[1], initial_com) + for result in window_results + if result is not None + ] + ) # Safety measures, if one of the windows is None or negative a warning # should be raised. for result in window_results: if result is None: msg_ = " ".join( - ['Warning. One of the analysed windows has', - 'returned as None. See manual.'] + [ + "Warning. One of the analysed windows has", + "returned as None. See manual.", + ] ) # print(msg_) elif result[0] < 0: msg_ = " ".join( - ['Warning. One of the analysed windows has a vdW', - 'corrected diameter smaller than 0. See manual.'] + [ + "Warning. One of the analysed windows has a vdW", + "corrected diameter smaller than 0. See manual.", + ] ) # print(msg_) return (windows, windows_coms) -def window_shape(window, - elements, - coordinates, - increment2=0.1, - z_bounds=[None, None], - lb_z=True, - z_second_mini=False, - **kwargs): - """ - Return window diameter and window's centre. +def window_shape( + window, + elements, + coordinates, + increment2=0.1, + z_bounds=[None, None], + lb_z=True, + z_second_mini=False, + **kwargs, +): + """Return window diameter and window's centre. Parameters ---------- @@ -1503,7 +1600,8 @@ def window_shape(window, # Find the vector with the largest window sampling diameter from the pool. vector_ = window[window.argmax(axis=0)[1]][5:8] vector_analysed = vector_analysis( - vector_, coordinates, elements_vdw, increment=increment2) + vector_, coordinates, elements_vdw, increment=increment2 + ) # A safety check, if the refined analysis give None we end the function. if vector_analysed is not None: pass @@ -1542,15 +1640,23 @@ def window_shape(window, angle_1 = -angle_1 angle_2 = np.pi - angle_2 # Rotation matrix for rotation around Z-axis with angle_1. - rotation_around_z = np.array([[np.cos(angle_1), -np.sin(angle_1), 0], - [np.sin(angle_1), np.cos(angle_1), 0], - [0, 0, 1]]) + rotation_around_z = np.array( + [ + [np.cos(angle_1), -np.sin(angle_1), 0], + [np.sin(angle_1), np.cos(angle_1), 0], + [0, 0, 1], + ] + ) # Rotate the whole molecule around with rotation_around_z. coordinates = np.array([np.dot(rotation_around_z, i) for i in coordinates]) # Rotation matrix for rotation around Y-axis with angle_2 - rotation_around_y = np.array([[np.cos(angle_2), 0, np.sin(angle_2)], - [0, 1, 0], - [-np.sin(angle_2), 0, np.cos(angle_2)]]) + rotation_around_y = np.array( + [ + [np.cos(angle_2), 0, np.sin(angle_2)], + [0, 1, 0], + [-np.sin(angle_2), 0, np.cos(angle_2)], + ] + ) # Rotate the whole molecule around with rotation_around_y. coordinates = np.array([np.dot(rotation_around_y, i) for i in coordinates]) # Third step is translation. We are now at [0, 0, -z]. @@ -1559,8 +1665,9 @@ def window_shape(window, # where the largest sampling sphere was (vector_analysed[0]). new_z = vector_analysed[0] # Translate the whole molecule to shift window's center to origin. - coordinates = coordinates - np.array([[0, 0, new_z]] * - coordinates.shape[0]) + coordinates = coordinates - np.array( + [[0, 0, new_z]] * coordinates.shape[0] + ) # !!!Here the window center (xy and z) optimisation take place!!! window_com = np.array([0, 0, 0], dtype=float) # The lb_z parameter is 'lower bound equal to z' which means, @@ -1574,15 +1681,19 @@ def window_shape(window, # SciPy minimisation on z coordinate. z_args = (window_com[0], window_com[1], elements, coordinates) z_optimisation = minimize( - optimise_z, x0=window_com[2], args=z_args, bounds=[z_bounds]) + optimise_z, x0=window_com[2], args=z_args, bounds=[z_bounds] + ) # Substitute the z coordinate for a minimised one. window_com[2] = z_optimisation.x[0] # SciPy brute optimisation on x and y coordinates in window plane. xy_args = (window_com[2], elements, coordinates) - xy_bounds = ((-window_diameter / 2, window_diameter / 2), - (-window_diameter / 2, window_diameter / 2)) + xy_bounds = ( + (-window_diameter / 2, window_diameter / 2), + (-window_diameter / 2, window_diameter / 2), + ) xy_optimisation = brute( - optimise_xy, xy_bounds, args=xy_args, full_output=True, finish=fmin) + optimise_xy, xy_bounds, args=xy_args, full_output=True, finish=fmin + ) # Substitute the x and y coordinates for the optimised ones. window_com[0] = xy_optimisation[0][0] window_com[1] = xy_optimisation[0][1] @@ -1599,7 +1710,8 @@ def window_shape(window, z_args = (window_com[0], window_com[1], elements, coordinates) # The z_bounds should be passed in kwargs. z_optimisation = minimize( - optimise_z, x0=window_com[2], args=z_args, bounds=[z_bounds]) + optimise_z, x0=window_com[2], args=z_args, bounds=[z_bounds] + ) # Substitute the z coordinate for a minimised one. window_com[2] = z_optimisation.x[0] # Getting the 2D plane crosssection of a window in XY plain. (10-04-18) @@ -1609,15 +1721,17 @@ def window_shape(window, np.dot(rotation_around_z, i[5:])[0], np.dot(rotation_around_z, i[5:])[1], np.dot(rotation_around_z, i[5:])[2], - ] for i in window + ] + for i in window ] # Second rotation around Y axis. vectors_translated = [ [ np.dot(rotation_around_y, i)[0], np.dot(rotation_around_y, i)[1], - np.dot(rotation_around_y, i)[2] - ] for i in vectors_translated + np.dot(rotation_around_y, i)[2], + ] + for i in vectors_translated ] ref_distance = (new_z - window_com[2]) / np.linalg.norm(vector) # Cutting the XY plane. @@ -1630,14 +1744,16 @@ def window_shape(window, return XY_plane -def find_windows_new(elements, - coordinates, - processes=None, - mol_size=None, - adjust=1, - pore_opt=True, - increment=1.0, - **kwargs): +def find_windows_new( + elements, + coordinates, + processes=None, + mol_size=None, + adjust=1, + pore_opt=True, + increment=1.0, + **kwargs, +): """Return windows diameters and center of masses for a molecule.""" # Copy the coordinates as will perform many opertaions on them coordinates = deepcopy(coordinates) @@ -1654,8 +1770,9 @@ def find_windows_new(elements, # is at the origin of the system and not the center of the not # optimised one, we need to adjust the shift. We also have to update # the initial com. - com_adjust = initial_com - opt_pore_diameter(elements, coordinates, ** - kwargs)[2] + com_adjust = ( + initial_com - opt_pore_diameter(elements, coordinates, **kwargs)[2] + ) initial_com = initial_com - com_adjust coordinates = shift_com(elements, coordinates, com_adjust=com_adjust) else: @@ -1681,8 +1798,11 @@ def find_windows_new(elements, # http://blog.marmakoide.org/?p=1 golden_angle = np.pi * (3 - np.sqrt(5)) theta = golden_angle * np.arange(number_of_points) - z = np.linspace(1 - 1.0 / number_of_points, 1.0 / number_of_points - 1.0, - number_of_points) + z = np.linspace( + 1 - 1.0 / number_of_points, + 1.0 / number_of_points - 1.0, + number_of_points, + ) radius = np.sqrt(1 - z * z) points = np.zeros((number_of_points, 3)) points[:, 0] = radius * np.cos(theta) * shpere_radius @@ -1710,11 +1830,10 @@ def find_windows_new(elements, parallel = [ pool.apply_async( vector_preanalysis, - args=( - point, - coordinates, - elements_vdw, ), - kwds={'increment': increment}) for point in points + args=(point, coordinates, elements_vdw), + kwds={"increment": increment}, + ) + for point in points ] results = [p.get() for p in parallel if p.get() is not None] pool.terminate() @@ -1723,7 +1842,8 @@ def find_windows_new(elements, else: results = [ vector_preanalysis( - point, coordinates, elements_vdw, increment=increment) + point, coordinates, elements_vdw, increment=increment + ) for point in points ] results = [x for x in results if x is not None] @@ -1735,26 +1855,23 @@ def find_windows_new(elements, # Otherwise we continue our search for windows. if len(results) == 0: return None - else: - # Perfomr DBSCAN to cluster the sampling points vectors. - # the n_jobs will be developed later. - # db = DBSCAN(eps=eps, n_jobs=_ncpus).fit(dataset) - db = DBSCAN(eps=eps).fit(dataset) - core_samples_mask = np.zeros_like(db.labels_, dtype=bool) - core_samples_mask[db.core_sample_indices_] = True - labels = set(db.labels_) - # Assing cluster label to a sampling point. - clusters = [[i, j] for i, j in zip(results, db.labels_)] - clustered_results = {label: [] for label in labels} - # Create a dictionary of clusters with points listed. - [clustered_results[i[1]].append(i[0]) for i in clusters] - return clustered_results, elements, coordinates, initial_com + # Perfomr DBSCAN to cluster the sampling points vectors. + # the n_jobs will be developed later. + # db = DBSCAN(eps=eps, n_jobs=_ncpus).fit(dataset) + db = DBSCAN(eps=eps).fit(dataset) + core_samples_mask = np.zeros_like(db.labels_, dtype=bool) + core_samples_mask[db.core_sample_indices_] = True + labels = set(db.labels_) + # Assing cluster label to a sampling point. + clusters = [[i, j] for i, j in zip(results, db.labels_)] + clustered_results = {label: [] for label in labels} + # Create a dictionary of clusters with points listed. + [clustered_results[i[1]].append(i[0]) for i in clusters] + return clustered_results, elements, coordinates, initial_com def calculate_window_diameter(window, elements, coordinates, **kwargs): - elements_vdw = np.array( - [[atomic_vdw_radius[x.upper()]] for x in elements] - ) + elements_vdw = np.array([[atomic_vdw_radius[x.upper()]] for x in elements]) window_results = window_analysis( np.array(window), elements, coordinates, elements_vdw, **kwargs ) @@ -1762,14 +1879,11 @@ def calculate_window_diameter(window, elements, coordinates, **kwargs): # in Angstrom, second with corresponding windows center's coordinates if window_results: return window_results[0] - else: - return None + return None def get_window_com(window, elements, coordinates, initial_com, **kwargs): - elements_vdw = np.array( - [[atomic_vdw_radius[x.upper()]] for x in elements] - ) + elements_vdw = np.array([[atomic_vdw_radius[x.upper()]] for x in elements]) window_results = window_analysis( np.array(window), elements, coordinates, elements_vdw, **kwargs ) @@ -1778,17 +1892,16 @@ def get_window_com(window, elements, coordinates, initial_com, **kwargs): if window_results: # I correct the COM of window for the initial COM of the cage return np.add(window_results[1], initial_com) - else: - return None + return None def vector_analysis_reversed(vector, coordinates, elements_vdw): - norm_vec = vector/np.linalg.norm(vector) + norm_vec = vector / np.linalg.norm(vector) intersections = [] origin = center_of_coor(coordinates) L = coordinates - origin t_ca = np.dot(L, norm_vec) - d = np.sqrt(np.einsum('ij,ij->i', L, L) - t_ca**2) + d = np.sqrt(np.einsum("ij,ij->i", L, L) - t_ca**2) under_sqrt = elements_vdw**2 - d**2 diag = under_sqrt.diagonal() positions = np.argwhere(diag > 0) @@ -1800,15 +1913,16 @@ def vector_analysis_reversed(vector, coordinates, elements_vdw): P_0 = origin + np.dot(t_0, norm_vec) P_1 = origin + np.dot(t_1, norm_vec) if np.linalg.norm(P_0) < np.linalg.norm(P_1): - intersections.append([np.linalg.norm(P_1), P_1]) + intersections.append([np.linalg.norm(P_1), P_1]) if intersections: intersection = sorted(intersections, reverse=True)[0][1] dist_origin = np.linalg.norm(intersection) return [dist_origin, intersection] -def find_average_diameter(elements, coordinates, adjust=1, increment=0.1, - processes=None, **kwargs): +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 coordinates = deepcopy(coordinates) @@ -1838,8 +1952,11 @@ def find_average_diameter(elements, coordinates, adjust=1, increment=0.1, # http://blog.marmakoide.org/?p=1 golden_angle = np.pi * (3 - np.sqrt(5)) theta = golden_angle * np.arange(number_of_points) - z = np.linspace(1 - 1.0 / number_of_points, 1.0 / number_of_points - 1.0, - number_of_points) + z = np.linspace( + 1 - 1.0 / number_of_points, + 1.0 / number_of_points - 1.0, + number_of_points, + ) radius = np.sqrt(1 - z * z) points = np.zeros((number_of_points, 3)) points[:, 0] = radius * np.cos(theta) * shpere_radius @@ -1852,29 +1969,28 @@ def find_average_diameter(elements, coordinates, adjust=1, increment=0.1, parallel = [ pool.apply_async( vector_analysis_reversed, - args=( - point, coordinates, elements_vdw) - ) for point in points + args=(point, coordinates, elements_vdw), + ) + for point in points ] results = [p.get() for p in parallel if p.get() is not None] pool.terminate() else: results = [ - vector_analysis_reversed( - point, coordinates, elements_vdw) + vector_analysis_reversed(point, coordinates, elements_vdw) for point in points ] results_cleaned = [x[0] for x in results if x is not None] - return np.mean(results_cleaned)*2 + return np.mean(results_cleaned) * 2 def vector_analysis_pore_shape(vector, coordinates, elements_vdw): - norm_vec = vector/np.linalg.norm(vector) + norm_vec = vector / np.linalg.norm(vector) intersections = [] origin = center_of_coor(coordinates) L = coordinates - origin t_ca = np.dot(L, norm_vec) - d = np.sqrt(np.einsum('ij,ij->i', L, L) - t_ca**2) + d = np.sqrt(np.einsum("ij,ij->i", L, L) - t_ca**2) under_sqrt = elements_vdw**2 - d**2 diag = under_sqrt.diagonal() positions = np.argwhere(diag > 0) @@ -1892,8 +2008,9 @@ def vector_analysis_pore_shape(vector, coordinates, elements_vdw): return sorted(intersections)[0][1] -def calculate_pore_shape(elements, coordinates, adjust=1, increment=0.1, - **kwargs): +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 coordinates = deepcopy(coordinates) @@ -1907,7 +2024,7 @@ def calculate_pore_shape(elements, coordinates, adjust=1, increment=0.1, elements_vdw = np.array([[atomic_vdw_radius[x.upper()]] for x in elements]) # We calculate maximum diameter of a molecule to determine the radius # of a sampling sphere neccessary to enclose the whole molecule. - shpere_radius = max_dim(elements, coordinates)[2]/2 + shpere_radius = max_dim(elements, coordinates)[2] / 2 sphere_surface_area = 4 * np.pi * shpere_radius**2 # Here we determine the number of sampling points necessary for a fine # sampling. Smaller molecules require more finner density of sampling @@ -1923,8 +2040,11 @@ def calculate_pore_shape(elements, coordinates, adjust=1, increment=0.1, # http://blog.marmakoide.org/?p=1 golden_angle = np.pi * (3 - np.sqrt(5)) theta = golden_angle * np.arange(number_of_points) - z = np.linspace(1 - 1.0 / number_of_points, 1.0 / number_of_points - 1.0, - number_of_points) + z = np.linspace( + 1 - 1.0 / number_of_points, + 1.0 / number_of_points - 1.0, + number_of_points, + ) radius = np.sqrt(1 - z * z) points = np.zeros((number_of_points, 3)) points[:, 0] = radius * np.cos(theta) * shpere_radius @@ -1951,7 +2071,7 @@ def calculate_pore_shape(elements, coordinates, adjust=1, increment=0.1, for point in points ] results_cleaned = [x for x in results if x is not None] - ele = np.array(['X'] * len(results_cleaned)) + ele = np.array(["X"] * len(results_cleaned)) coor = np.array(results_cleaned) return coor @@ -1968,11 +2088,11 @@ def circumcircle_window(coordinates, atom_set): # Holden et al. method is intended to only work with triads of carbons, # therefore I substract the vdW radii for a carbon. # These equation calculaties the window's radius. - R = a*b*c / 4 / np.sqrt(s * (s - a) * (s - b) * (s - c)) - 1.70 + R = a * b * c / 4 / np.sqrt(s * (s - a) * (s - b) * (s - c)) - 1.70 # This steps are used to calculate the window's COM. - b1 = a*a * (b*b + c*c - a*a) - b2 = b*b * (a*a + c*c - b*b) - b3 = c*c * (a*a + b*b - c*c) + b1 = a * a * (b * b + c * c - a * a) + b2 = b * b * (a * a + c * c - b * b) + b3 = c * c * (a * a + b * b - c * c) COM = np.column_stack((A, B, C)).dot(np.hstack((b1, b2, b3))) # The window's COM. COM /= b1 + b2 + b3 @@ -1985,7 +2105,7 @@ def circumcircle(coordinates, atom_sets): iter_ = 0 while iter_ < len(atom_sets): R, COM = circumcircle_window(coordinates, atom_sets[iter_]) - pld_diameter_list.append(R*2) + pld_diameter_list.append(R * 2) pld_com_list.append(COM) iter_ += 1 return pld_diameter_list, pld_com_list From 9d5bd4d1cf5411db4c5884faf8120e97c8b04bbc Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Sat, 7 Jun 2025 15:31:02 +0200 Subject: [PATCH 3/8] Update import statements internally. --- src/pywindow/_internal/io_tools.py | 8 ++++-- src/pywindow/_internal/molecular.py | 27 +++++-------------- src/pywindow/_internal/trajectory.py | 22 +++++++--------- src/pywindow/_internal/utilities.py | 39 +++------------------------- 4 files changed, 24 insertions(+), 72 deletions(-) diff --git a/src/pywindow/_internal/io_tools.py b/src/pywindow/_internal/io_tools.py index cfcebb8..4e49311 100644 --- a/src/pywindow/_internal/io_tools.py +++ b/src/pywindow/_internal/io_tools.py @@ -1,11 +1,15 @@ """Module contains classes for input/output processing.""" +from __future__ import annotations + import json -import os import numpy as np -from .utilities import decipher_atom_key, unit_cell_to_lattice_array +from pywindow._internal.utilities import ( + decipher_atom_key, + unit_cell_to_lattice_array, +) class _CorruptedPDBFile(Exception): diff --git a/src/pywindow/_internal/molecular.py b/src/pywindow/_internal/molecular.py index d2e5bd2..2cd2d73 100644 --- a/src/pywindow/_internal/molecular.py +++ b/src/pywindow/_internal/molecular.py @@ -4,44 +4,30 @@ at the frontfront of the interaction with the user. The two main classes defined here: :class:`MolecularSystem` and :class:`Molecule` are used to store and analyse single molecules or assemblies of single molecules. - The :class:`MolecularSystem` is used as a first step to the analysis. It allows to load data, to refine it (rebuild molecules in a periodic system, decipher force field atom ids) and to extract single molecules for analysis as :class:`Molecule` instances. - To get started see :class:`MolecularSystem`. - To get started with the analysis of Molecular Dynamic trajectories go to :mod:`pywindow.trajectory`. - """ -import os +from __future__ import annotations + from copy import deepcopy import numpy as np -from scipy.spatial import ConvexHull -from .io_tools import Input, Output -from .utilities import ( +from pywindow._internal.io_tools import Input, Output +from pywindow._internal.utilities import ( align_principal_ax, - calc_acylidricity, - calc_asphericity, - calc_relative_shape_anisotropy, - calculate_pore_shape, - calculate_window_diameter, center_of_mass, - circumcircle, create_supercell, decipher_atom_key, discrete_molecules, find_average_diameter, find_windows, - find_windows_new, - get_gyration_tensor, - get_inertia_tensor, - get_window_com, max_dim, molecular_weight, opt_pore_diameter, @@ -49,7 +35,6 @@ shift_com, sphere_volume, to_list, - window_shape, ) @@ -1015,8 +1000,8 @@ def decipher_atom_keys(self, forcefield="DLF", dict_key="atom_ids"): # I do it on temporary object so that it only finishes when successful temp = deepcopy(self.system[dict_key]) for element in range(len(temp)): - temp[element] = "{0}".format( - decipher_atom_key(temp[element], forcefield=forcefield) + temp[element] = ( + f"{decipher_atom_key(temp[element], forcefield=forcefield)}" ) self.system["elements"] = temp diff --git a/src/pywindow/_internal/trajectory.py b/src/pywindow/_internal/trajectory.py index dc8d657..3ac8a74 100644 --- a/src/pywindow/_internal/trajectory.py +++ b/src/pywindow/_internal/trajectory.py @@ -6,14 +6,10 @@ Example: ------- In this example a DL_POLY_C HISTORY trajectory file is loaded. - - .. code-block:: python - pywindow.trajectory.DLPOLY('path/to/HISTORY') - Then, each of the trajectory frames can be extracted and returned as a -:class:`pywindow.molecular.MolecularSystem` object for analysis. See +:class:`pywindow.MolecularSystem` object for analysis. See :mod:`pywindow.molecular` docstring for more information. Alternatively, the analysis can be performed on a whole or a chunk of @@ -23,16 +19,16 @@ force field atom ids and the rebuilding of molecules can be applied to each frame in a consitent and automated manner. The downfall is that at the moment it is not possible to choose the set of parameters that are being -calculated in the :class:`pywindow.molecular.Molecule` as the -:func:`pywindow.molecular.Molecule.full_analysis()` is invoked by default. +calculated in the :class:`pywindow.Molecule` as the +:func:`pywindow.Molecule.full_analysis()` is invoked by default. However, the computational cost of calculating majority of the structural properties is miniscule and it is usually the -:func:`pywindow.molecular.MolecularSystem.rebuild_system()` step that is the +:func:`pywindow.MolecularSystem.rebuild_system()` step that is the bottleneck. - """ -import os +from __future__ import annotations + from contextlib import closing from copy import deepcopy from mmap import ACCESS_READ, mmap @@ -40,9 +36,9 @@ import numpy as np -from .io_tools import Output -from .molecular import MolecularSystem -from .utilities import ( +from pywindow._internal.io_tools import Output +from pywindow._internal.molecular import MolecularSystem +from pywindow._internal.utilities import ( create_supercell, is_number, lattice_array_to_unit_cell, diff --git a/src/pywindow/_internal/utilities.py b/src/pywindow/_internal/utilities.py index 1af9665..c8a368a 100644 --- a/src/pywindow/_internal/utilities.py +++ b/src/pywindow/_internal/utilities.py @@ -1,39 +1,6 @@ -"""Module containing all general purpose functions shared by other modules. +"""Module containing all general purpose functions shared by other modules.""" -This module is not intended for the direct use by a User. Therefore, I will -only docstring functions if I see fit to do so. - -LOG ---- - -11/07/18 - Changed the way vector path is analysed. Now, the initial analysis is - done with the geometrical formula for line-sphere intersection. Only - the remaining vestors that do not intersect any van der Waals spheres are - then analysed in the old way. - -27/07/17 - Fixed the cartesian coordinates -> fractional coordinates -> cartesian - coordinates conversion related functions, creation of lattice array - from unit cell parameters (triclinic system: so applicable to any) - and conversion back to unit cell parameters. WORKS! inspiration from: - http://www.ruppweb.org/Xray/tutorial/Coordinate%20system%20transformation.htm - -26/07/17 - Changed the way bonds are determined. Now, rather then fixed value - a formula and covalent radii are used as explained in the Elemental_Radii - spreadsheet (see tables module). - -TO DO LIST ----------- - -- Fix and validate calculating shape descriptors: asphericity, acylindricity - and the realtive shape anisotropy. (Not working at the moment) - -- In the find_windows() function, maybe change the way the EPS value for - the DBSCAN() is estimates. Need to look how the distances change with the - increase in size of the sampling sphere. (validate this with the MongoDB) -""" +from __future__ import annotations from copy import deepcopy from multiprocessing import Pool @@ -44,7 +11,7 @@ from sklearn.metrics.pairwise import euclidean_distances from sklearn.neighbors import KDTree -from .tables import ( +from pywindow._internal.tables import ( atomic_covalent_radius, atomic_mass, atomic_vdw_radius, From 3417cb31890722e30027bda87e260a7f06f8f240 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Sat, 7 Jun 2025 15:38:18 +0200 Subject: [PATCH 4/8] Add periodic table. --- src/pywindow/_internal/tables.py | 124 ++++++++++++++++++++++++++++++- 1 file changed, 122 insertions(+), 2 deletions(-) diff --git a/src/pywindow/_internal/tables.py b/src/pywindow/_internal/tables.py index 641133c..cf8c29d 100644 --- a/src/pywindow/_internal/tables.py +++ b/src/pywindow/_internal/tables.py @@ -1,9 +1,7 @@ -#!/usr/bin/env python3 """This module containes general-purpose chemical data (aka tables). Sources: - 1. www.ccdc.cam.ac.uk/Lists/ResourceFileList/Elemental_Radii.xlsx, (access date: 13 Oct 2015) @@ -641,3 +639,125 @@ ], "Xe": ["Xe", "xe"], } + + +periodic_table = { + "H": 1, + "He": 2, + "Li": 3, + "Be": 4, + "B": 5, + "C": 6, + "N": 7, + "O": 8, + "F": 9, + "Ne": 10, + "Na": 11, + "Mg": 12, + "Al": 13, + "Si": 14, + "P": 15, + "S": 16, + "Cl": 17, + "Ar": 18, + "K": 19, + "Ca": 20, + "Sc": 21, + "Ti": 22, + "V": 23, + "Cr": 24, + "Mn": 25, + "Fe": 26, + "Co": 27, + "Ni": 28, + "Cu": 29, + "Zn": 30, + "Ga": 31, + "Ge": 32, + "As": 33, + "Se": 34, + "Br": 35, + "Kr": 36, + "Rb": 37, + "Sr": 38, + "Y": 39, + "Zr": 40, + "Nb": 41, + "Mo": 42, + "Tc": 43, + "Ru": 44, + "Rh": 45, + "Pd": 46, + "Ag": 47, + "Cd": 48, + "In": 49, + "Sn": 50, + "Sb": 51, + "Te": 52, + "I": 53, + "Xe": 54, + "Cs": 55, + "Ba": 56, + "La": 57, + "Ce": 58, + "Pr": 59, + "Nd": 60, + "Pm": 61, + "Sm": 62, + "Eu": 63, + "Gd": 64, + "Tb": 65, + "Dy": 66, + "Ho": 67, + "Er": 68, + "Tm": 69, + "Yb": 70, + "Lu": 71, + "Hf": 72, + "Ta": 73, + "W": 74, + "Re": 75, + "Os": 76, + "Ir": 77, + "Pt": 78, + "Au": 79, + "Hg": 80, + "Tl": 81, + "Pb": 82, + "Bi": 83, + "Po": 84, + "At": 85, + "Rn": 86, + "Fr": 87, + "Ra": 88, + "Ac": 89, + "Th": 90, + "Pa": 91, + "U": 92, + "Np": 93, + "Pu": 94, + "Am": 95, + "Cm": 96, + "Bk": 97, + "Cf": 98, + "Es": 99, + "Fm": 100, + "Md": 101, + "No": 102, + "Lr": 103, + "Rf": 104, + "Db": 105, + "Sg": 106, + "Bh": 107, + "Hs": 108, + "Mt": 109, + "Ds": 110, + "Rg": 111, + "Cn": 112, + "Uut": 113, + "Fl": 114, + "Uup": 115, + "Lv": 116, + "Uus": 117, + "Uuo": 118, +} From 6614b3a21b31b06cc08547d986a667c80210d4c7 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Sat, 7 Jun 2025 15:38:31 +0200 Subject: [PATCH 5/8] Add utility for examples (implemented later). --- src/pywindow/_internal/utilities.py | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/pywindow/_internal/utilities.py b/src/pywindow/_internal/utilities.py index c8a368a..e3bd782 100644 --- a/src/pywindow/_internal/utilities.py +++ b/src/pywindow/_internal/utilities.py @@ -2076,3 +2076,66 @@ def circumcircle(coordinates, atom_sets): pld_com_list.append(COM) iter_ += 1 return pld_diameter_list, pld_com_list + + +def compare_properties_dict( # noqa: C901, PLR0911 + dict1: dict[str, int | float | dict], # type:ignore[type-arg] + dict2: dict[str, int | float | dict], # type:ignore[type-arg] +) -> tuple[bool, str]: + """Compare two properties dictionaries.""" + possible_properties = { + "centre_of_mass": "array", + "maximum_diameter.atom_1": "int", + "maximum_diameter.atom_2": "int", + "maximum_diameter.diameter": "float", + "no_of_atoms": "int", + "pore_diameter.atom": "int", + "pore_diameter.diameter": "float", + "pore_diameter_opt.atom_1": "int", + "pore_diameter_opt.centre_of_mass": "array", + "pore_diameter_opt.diameter": "float", + "pore_volume": "float", + "pore_volume_opt": "float", + "windows.centre_of_mass": "array", + "windows.diameters": "array", + "average_diameter": "float", + } + + for prop, method in possible_properties.items(): + path = prop.split(".") + if len(path) == 1: + if path[0] not in dict1 and path[0] not in dict2: + continue + if (path[0] not in dict1 and path[0] in dict2) or ( + path[0] in dict1 and path[0] not in dict2 + ): + return (False, prop) + + item1 = dict1[path[0]] + item2 = dict2[path[0]] + + elif len(path) == 2: # noqa: PLR2004 + if path[0] not in dict1 and path[0] not in dict2: + continue + if (path[0] not in dict1 and path[0] in dict2) or ( + path[0] in dict1 and path[0] not in dict2 + ): + return (False, prop) + + item1 = dict1[path[0]][path[1]] # type:ignore[index] + item2 = dict2[path[0]][path[1]] # type:ignore[index] + + if (item1 is None and item2 is not None) or ( # type:ignore[unreachable] + item1 is not None and item2 is None + ): + return (False, prop) # type:ignore[unreachable] + + if item1 is not None and item2 is not None: + if method == "array" and not np.allclose(item1, item2): # type:ignore[arg-type] + return (False, prop) + if method == "float" and not np.isclose(item1, item2): # type:ignore[arg-type] + return (False, prop) + if method in "int" and item1 != item2: + return (False, prop) + + return (True, "none") From 320e92274e64c58657d9bf1b6a8c12d263a92613 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Sat, 7 Jun 2025 15:41:58 +0200 Subject: [PATCH 6/8] Remove doc page. --- docs/source/pywindow.rst | 54 ---------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 docs/source/pywindow.rst diff --git a/docs/source/pywindow.rst b/docs/source/pywindow.rst deleted file mode 100644 index 880d1d5..0000000 --- a/docs/source/pywindow.rst +++ /dev/null @@ -1,54 +0,0 @@ -pywindow package -================ - -Submodules ----------- - -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: - - -Module contents ---------------- - -.. automodule:: pywindow - :members: - :undoc-members: - :show-inheritance: From 9d81e7566a9833e254aa542cc54490bb9bcf8b62 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Sat, 7 Jun 2025 15:43:06 +0200 Subject: [PATCH 7/8] Remove autosummary docs until docs work. --- .../_autosummary/pywindow.ConvexHull.rst | 33 ----- docs/source/_autosummary/pywindow.DBSCAN.rst | 28 ---- docs/source/_autosummary/pywindow.DLPOLY.rst | 29 ---- docs/source/_autosummary/pywindow.Input.rst | 27 ---- docs/source/_autosummary/pywindow.KDTree.rst | 37 ----- .../_autosummary/pywindow.MolecularSystem.rst | 35 ----- .../source/_autosummary/pywindow.Molecule.rst | 46 ------ docs/source/_autosummary/pywindow.Output.rst | 27 ---- docs/source/_autosummary/pywindow.PDB.rst | 29 ---- docs/source/_autosummary/pywindow.Pool.rst | 6 - docs/source/_autosummary/pywindow.XYZ.rst | 29 ---- .../_autosummary/pywindow.acylidricity.rst | 6 - .../pywindow.align_principal_ax.rst | 6 - .../pywindow.angle_between_vectors.rst | 6 - .../_autosummary/pywindow.asphericity.rst | 6 - docs/source/_autosummary/pywindow.brute.rst | 6 - .../pywindow.calc_acylidricity.rst | 6 - .../pywindow.calc_asphericity.rst | 6 - ...ywindow.calc_relative_shape_anisotropy.rst | 6 - .../pywindow.calculate_pore_shape.rst | 6 - .../pywindow.calculate_window_diameter.rst | 6 - .../_autosummary/pywindow.cart2frac_all.rst | 6 - .../pywindow.cartisian_from_fractional.rst | 6 - .../_autosummary/pywindow.center_of_coor.rst | 6 - .../_autosummary/pywindow.center_of_mass.rst | 6 - .../_autosummary/pywindow.circumcircle.rst | 6 - .../pywindow.circumcircle_window.rst | 6 - docs/source/_autosummary/pywindow.closing.rst | 25 ---- .../pywindow.compose_atom_list.rst | 6 - .../pywindow.correct_pore_diameter.rst | 6 - .../pywindow.create_supercell.rst | 6 - .../pywindow.decipher_atom_key.rst | 6 - .../pywindow.decompose_atom_list.rst | 6 - .../source/_autosummary/pywindow.deepcopy.rst | 6 - .../pywindow.discrete_molecules.rst | 6 - .../source/_autosummary/pywindow.distance.rst | 6 - .../_autosummary/pywindow.dlf_notation.rst | 6 - .../pywindow.euclidean_distances.rst | 6 - .../pywindow.find_average_diameter.rst | 6 - .../_autosummary/pywindow.find_windows.rst | 6 - .../pywindow.find_windows_new.rst | 6 - docs/source/_autosummary/pywindow.fmin.rst | 6 - .../_autosummary/pywindow.frac2cart_all.rst | 6 - .../pywindow.fractional_from_cartesian.rst | 6 - .../pywindow.get_gyration_tensor.rst | 6 - .../pywindow.get_inertia_tensor.rst | 6 - .../pywindow.get_tensor_eigenvalues.rst | 6 - .../_autosummary/pywindow.get_window_com.rst | 6 - .../_autosummary/pywindow.io_tools.Input.rst | 27 ---- .../_autosummary/pywindow.io_tools.Output.rst | 27 ---- .../pywindow.io_tools.decipher_atom_key.rst | 6 - .../source/_autosummary/pywindow.io_tools.rst | 43 ------ ...ow.io_tools.unit_cell_to_lattice_array.rst | 6 - .../pywindow.is_inside_polyhedron.rst | 6 - .../_autosummary/pywindow.is_number.rst | 6 - .../pywindow.lattice_array_to_unit_cell.rst | 6 - .../_autosummary/pywindow.make_supercell.rst | 6 - docs/source/_autosummary/pywindow.max_dim.rst | 6 - .../source/_autosummary/pywindow.minimize.rst | 6 - docs/source/_autosummary/pywindow.mmap.rst | 47 ------- .../pywindow.molecular.ConvexHull.rst | 33 ----- .../_autosummary/pywindow.molecular.Input.rst | 27 ---- .../pywindow.molecular.MolecularSystem.rst | 35 ----- .../pywindow.molecular.Molecule.rst | 46 ------ .../pywindow.molecular.Output.rst | 27 ---- .../pywindow.molecular.align_principal_ax.rst | 6 - .../pywindow.molecular.calc_acylidricity.rst | 6 - .../pywindow.molecular.calc_asphericity.rst | 6 - ...lecular.calc_relative_shape_anisotropy.rst | 6 - ...ywindow.molecular.calculate_pore_shape.rst | 6 - ...ow.molecular.calculate_window_diameter.rst | 6 - .../pywindow.molecular.center_of_mass.rst | 6 - .../pywindow.molecular.circumcircle.rst | 6 - .../pywindow.molecular.create_supercell.rst | 6 - .../pywindow.molecular.decipher_atom_key.rst | 6 - .../pywindow.molecular.deepcopy.rst | 6 - .../pywindow.molecular.discrete_molecules.rst | 6 - ...window.molecular.find_average_diameter.rst | 6 - .../pywindow.molecular.find_windows.rst | 6 - .../pywindow.molecular.find_windows_new.rst | 6 - ...pywindow.molecular.get_gyration_tensor.rst | 6 - .../pywindow.molecular.get_inertia_tensor.rst | 6 - .../pywindow.molecular.get_window_com.rst | 6 - ...ywindow.molecular.is_inside_polyhedron.rst | 6 - .../pywindow.molecular.max_dim.rst | 6 - .../pywindow.molecular.molecular_weight.rst | 6 - .../pywindow.molecular.opt_pore_diameter.rst | 6 - .../pywindow.molecular.pore_diameter.rst | 6 - .../_autosummary/pywindow.molecular.rst | 71 ---------- .../pywindow.molecular.shift_com.rst | 6 - .../pywindow.molecular.sphere_volume.rst | 6 - .../pywindow.molecular.to_list.rst | 6 - .../pywindow.molecular.window_shape.rst | 6 - .../pywindow.molecular_weight.rst | 6 - .../_autosummary/pywindow.normal_vector.rst | 6 - .../pywindow.normalize_vector.rst | 6 - .../_autosummary/pywindow.opls_notation.rst | 6 - .../pywindow.opt_pore_diameter.rst | 6 - .../_autosummary/pywindow.optimise_xy.rst | 6 - .../_autosummary/pywindow.optimise_z.rst | 6 - .../_autosummary/pywindow.pore_diameter.rst | 6 - .../_autosummary/pywindow.principal_axes.rst | 6 - .../pywindow.relative_shape_anisotropy.rst | 6 - ...ywindow.rotation_matrix_arbitrary_axis.rst | 6 - docs/source/_autosummary/pywindow.rst | 131 ------------------ .../_autosummary/pywindow.shift_com.rst | 6 - .../_autosummary/pywindow.sphere_volume.rst | 6 - docs/source/_autosummary/pywindow.tables.rst | 24 ---- docs/source/_autosummary/pywindow.to_list.rst | 6 - .../pywindow.trajectory.DLPOLY.rst | 29 ---- .../pywindow.trajectory.Input.rst | 27 ---- .../pywindow.trajectory.MolecularSystem.rst | 35 ----- .../pywindow.trajectory.Output.rst | 27 ---- .../_autosummary/pywindow.trajectory.PDB.rst | 29 ---- .../_autosummary/pywindow.trajectory.Pool.rst | 6 - .../_autosummary/pywindow.trajectory.XYZ.rst | 29 ---- .../pywindow.trajectory.closing.rst | 25 ---- .../pywindow.trajectory.create_supercell.rst | 6 - .../pywindow.trajectory.deepcopy.rst | 6 - .../pywindow.trajectory.is_number.rst | 6 - ....trajectory.lattice_array_to_unit_cell.rst | 6 - .../pywindow.trajectory.make_supercell.rst | 6 - .../_autosummary/pywindow.trajectory.mmap.rst | 47 ------- .../_autosummary/pywindow.trajectory.rst | 54 -------- .../pywindow.trajectory.to_list.rst | 6 - docs/source/_autosummary/pywindow.unique.rst | 6 - .../pywindow.unit_cell_to_lattice_array.rst | 6 - .../pywindow.utilities.DBSCAN.rst | 28 ---- .../pywindow.utilities.KDTree.rst | 37 ----- .../_autosummary/pywindow.utilities.Pool.rst | 6 - .../pywindow.utilities.acylidricity.rst | 6 - .../pywindow.utilities.align_principal_ax.rst | 6 - ...window.utilities.angle_between_vectors.rst | 6 - .../pywindow.utilities.asphericity.rst | 6 - .../_autosummary/pywindow.utilities.brute.rst | 6 - .../pywindow.utilities.calc_acylidricity.rst | 6 - .../pywindow.utilities.calc_asphericity.rst | 6 - ...ilities.calc_relative_shape_anisotropy.rst | 6 - ...ywindow.utilities.calculate_pore_shape.rst | 6 - ...ow.utilities.calculate_window_diameter.rst | 6 - .../pywindow.utilities.cart2frac_all.rst | 6 - ...ow.utilities.cartisian_from_fractional.rst | 6 - .../pywindow.utilities.center_of_coor.rst | 6 - .../pywindow.utilities.center_of_mass.rst | 6 - .../pywindow.utilities.circumcircle.rst | 6 - ...pywindow.utilities.circumcircle_window.rst | 6 - .../pywindow.utilities.compose_atom_list.rst | 6 - ...window.utilities.correct_pore_diameter.rst | 6 - .../pywindow.utilities.create_supercell.rst | 6 - .../pywindow.utilities.decipher_atom_key.rst | 6 - ...pywindow.utilities.decompose_atom_list.rst | 6 - .../pywindow.utilities.deepcopy.rst | 6 - .../pywindow.utilities.discrete_molecules.rst | 6 - .../pywindow.utilities.distance.rst | 6 - .../pywindow.utilities.dlf_notation.rst | 6 - ...pywindow.utilities.euclidean_distances.rst | 6 - ...window.utilities.find_average_diameter.rst | 6 - .../pywindow.utilities.find_windows.rst | 6 - .../pywindow.utilities.find_windows_new.rst | 6 - .../_autosummary/pywindow.utilities.fmin.rst | 6 - .../pywindow.utilities.frac2cart_all.rst | 6 - ...ow.utilities.fractional_from_cartesian.rst | 6 - ...pywindow.utilities.get_gyration_tensor.rst | 6 - .../pywindow.utilities.get_inertia_tensor.rst | 6 - ...indow.utilities.get_tensor_eigenvalues.rst | 6 - .../pywindow.utilities.get_window_com.rst | 6 - ...ywindow.utilities.is_inside_polyhedron.rst | 6 - .../pywindow.utilities.is_number.rst | 6 - ...w.utilities.lattice_array_to_unit_cell.rst | 6 - .../pywindow.utilities.max_dim.rst | 6 - .../pywindow.utilities.minimize.rst | 6 - .../pywindow.utilities.molecular_weight.rst | 6 - .../pywindow.utilities.normal_vector.rst | 6 - .../pywindow.utilities.normalize_vector.rst | 6 - .../pywindow.utilities.opls_notation.rst | 6 - .../pywindow.utilities.opt_pore_diameter.rst | 6 - .../pywindow.utilities.optimise_xy.rst | 6 - .../pywindow.utilities.optimise_z.rst | 6 - .../pywindow.utilities.pore_diameter.rst | 6 - .../pywindow.utilities.principal_axes.rst | 6 - ...ow.utilities.relative_shape_anisotropy.rst | 6 - ...ilities.rotation_matrix_arbitrary_axis.rst | 6 - .../_autosummary/pywindow.utilities.rst | 107 -------------- .../pywindow.utilities.shift_com.rst | 6 - .../pywindow.utilities.sphere_volume.rst | 6 - .../pywindow.utilities.to_list.rst | 6 - .../pywindow.utilities.unique.rst | 6 - ...w.utilities.unit_cell_to_lattice_array.rst | 6 - .../pywindow.utilities.vector_analysis.rst | 6 - ...w.utilities.vector_analysis_pore_shape.rst | 6 - ...dow.utilities.vector_analysis_reversed.rst | 6 - .../pywindow.utilities.vector_preanalysis.rst | 6 - ....utilities.volume_from_cell_parameters.rst | 6 - ...ow.utilities.volume_from_lattice_array.rst | 6 - .../pywindow.utilities.window_analysis.rst | 6 - .../pywindow.utilities.window_shape.rst | 6 - .../_autosummary/pywindow.vector_analysis.rst | 6 - .../pywindow.vector_analysis_pore_shape.rst | 6 - .../pywindow.vector_analysis_reversed.rst | 6 - .../pywindow.vector_preanalysis.rst | 6 - .../pywindow.volume_from_cell_parameters.rst | 6 - .../pywindow.volume_from_lattice_array.rst | 6 - .../_autosummary/pywindow.window_analysis.rst | 6 - .../_autosummary/pywindow.window_shape.rst | 6 - 204 files changed, 2371 deletions(-) delete mode 100644 docs/source/_autosummary/pywindow.ConvexHull.rst delete mode 100644 docs/source/_autosummary/pywindow.DBSCAN.rst delete mode 100644 docs/source/_autosummary/pywindow.DLPOLY.rst delete mode 100644 docs/source/_autosummary/pywindow.Input.rst delete mode 100644 docs/source/_autosummary/pywindow.KDTree.rst delete mode 100644 docs/source/_autosummary/pywindow.MolecularSystem.rst delete mode 100644 docs/source/_autosummary/pywindow.Molecule.rst delete mode 100644 docs/source/_autosummary/pywindow.Output.rst delete mode 100644 docs/source/_autosummary/pywindow.PDB.rst delete mode 100644 docs/source/_autosummary/pywindow.Pool.rst delete mode 100644 docs/source/_autosummary/pywindow.XYZ.rst delete mode 100644 docs/source/_autosummary/pywindow.acylidricity.rst delete mode 100644 docs/source/_autosummary/pywindow.align_principal_ax.rst delete mode 100644 docs/source/_autosummary/pywindow.angle_between_vectors.rst delete mode 100644 docs/source/_autosummary/pywindow.asphericity.rst delete mode 100644 docs/source/_autosummary/pywindow.brute.rst delete mode 100644 docs/source/_autosummary/pywindow.calc_acylidricity.rst delete mode 100644 docs/source/_autosummary/pywindow.calc_asphericity.rst delete mode 100644 docs/source/_autosummary/pywindow.calc_relative_shape_anisotropy.rst delete mode 100644 docs/source/_autosummary/pywindow.calculate_pore_shape.rst delete mode 100644 docs/source/_autosummary/pywindow.calculate_window_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.cart2frac_all.rst delete mode 100644 docs/source/_autosummary/pywindow.cartisian_from_fractional.rst delete mode 100644 docs/source/_autosummary/pywindow.center_of_coor.rst delete mode 100644 docs/source/_autosummary/pywindow.center_of_mass.rst delete mode 100644 docs/source/_autosummary/pywindow.circumcircle.rst delete mode 100644 docs/source/_autosummary/pywindow.circumcircle_window.rst delete mode 100644 docs/source/_autosummary/pywindow.closing.rst delete mode 100644 docs/source/_autosummary/pywindow.compose_atom_list.rst delete mode 100644 docs/source/_autosummary/pywindow.correct_pore_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.create_supercell.rst delete mode 100644 docs/source/_autosummary/pywindow.decipher_atom_key.rst delete mode 100644 docs/source/_autosummary/pywindow.decompose_atom_list.rst delete mode 100644 docs/source/_autosummary/pywindow.deepcopy.rst delete mode 100644 docs/source/_autosummary/pywindow.discrete_molecules.rst delete mode 100644 docs/source/_autosummary/pywindow.distance.rst delete mode 100644 docs/source/_autosummary/pywindow.dlf_notation.rst delete mode 100644 docs/source/_autosummary/pywindow.euclidean_distances.rst delete mode 100644 docs/source/_autosummary/pywindow.find_average_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.find_windows.rst delete mode 100644 docs/source/_autosummary/pywindow.find_windows_new.rst delete mode 100644 docs/source/_autosummary/pywindow.fmin.rst delete mode 100644 docs/source/_autosummary/pywindow.frac2cart_all.rst delete mode 100644 docs/source/_autosummary/pywindow.fractional_from_cartesian.rst delete mode 100644 docs/source/_autosummary/pywindow.get_gyration_tensor.rst delete mode 100644 docs/source/_autosummary/pywindow.get_inertia_tensor.rst delete mode 100644 docs/source/_autosummary/pywindow.get_tensor_eigenvalues.rst delete mode 100644 docs/source/_autosummary/pywindow.get_window_com.rst delete mode 100644 docs/source/_autosummary/pywindow.io_tools.Input.rst delete mode 100644 docs/source/_autosummary/pywindow.io_tools.Output.rst delete mode 100644 docs/source/_autosummary/pywindow.io_tools.decipher_atom_key.rst delete mode 100644 docs/source/_autosummary/pywindow.io_tools.rst delete mode 100644 docs/source/_autosummary/pywindow.io_tools.unit_cell_to_lattice_array.rst delete mode 100644 docs/source/_autosummary/pywindow.is_inside_polyhedron.rst delete mode 100644 docs/source/_autosummary/pywindow.is_number.rst delete mode 100644 docs/source/_autosummary/pywindow.lattice_array_to_unit_cell.rst delete mode 100644 docs/source/_autosummary/pywindow.make_supercell.rst delete mode 100644 docs/source/_autosummary/pywindow.max_dim.rst delete mode 100644 docs/source/_autosummary/pywindow.minimize.rst delete mode 100644 docs/source/_autosummary/pywindow.mmap.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.ConvexHull.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.Input.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.MolecularSystem.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.Molecule.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.Output.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.align_principal_ax.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.calc_acylidricity.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.calc_asphericity.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.calc_relative_shape_anisotropy.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.calculate_pore_shape.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.calculate_window_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.center_of_mass.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.circumcircle.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.create_supercell.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.decipher_atom_key.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.deepcopy.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.discrete_molecules.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.find_average_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.find_windows.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.find_windows_new.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.get_gyration_tensor.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.get_inertia_tensor.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.get_window_com.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.is_inside_polyhedron.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.max_dim.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.molecular_weight.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.opt_pore_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.pore_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.shift_com.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.sphere_volume.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.to_list.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular.window_shape.rst delete mode 100644 docs/source/_autosummary/pywindow.molecular_weight.rst delete mode 100644 docs/source/_autosummary/pywindow.normal_vector.rst delete mode 100644 docs/source/_autosummary/pywindow.normalize_vector.rst delete mode 100644 docs/source/_autosummary/pywindow.opls_notation.rst delete mode 100644 docs/source/_autosummary/pywindow.opt_pore_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.optimise_xy.rst delete mode 100644 docs/source/_autosummary/pywindow.optimise_z.rst delete mode 100644 docs/source/_autosummary/pywindow.pore_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.principal_axes.rst delete mode 100644 docs/source/_autosummary/pywindow.relative_shape_anisotropy.rst delete mode 100644 docs/source/_autosummary/pywindow.rotation_matrix_arbitrary_axis.rst delete mode 100644 docs/source/_autosummary/pywindow.rst delete mode 100644 docs/source/_autosummary/pywindow.shift_com.rst delete mode 100644 docs/source/_autosummary/pywindow.sphere_volume.rst delete mode 100644 docs/source/_autosummary/pywindow.tables.rst delete mode 100644 docs/source/_autosummary/pywindow.to_list.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.DLPOLY.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.Input.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.MolecularSystem.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.Output.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.PDB.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.Pool.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.XYZ.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.closing.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.create_supercell.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.deepcopy.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.is_number.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.lattice_array_to_unit_cell.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.make_supercell.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.mmap.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.rst delete mode 100644 docs/source/_autosummary/pywindow.trajectory.to_list.rst delete mode 100644 docs/source/_autosummary/pywindow.unique.rst delete mode 100644 docs/source/_autosummary/pywindow.unit_cell_to_lattice_array.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.DBSCAN.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.KDTree.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.Pool.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.acylidricity.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.align_principal_ax.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.angle_between_vectors.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.asphericity.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.brute.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.calc_acylidricity.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.calc_asphericity.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.calc_relative_shape_anisotropy.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.calculate_pore_shape.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.calculate_window_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.cart2frac_all.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.cartisian_from_fractional.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.center_of_coor.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.center_of_mass.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.circumcircle.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.circumcircle_window.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.compose_atom_list.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.correct_pore_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.create_supercell.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.decipher_atom_key.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.decompose_atom_list.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.deepcopy.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.discrete_molecules.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.distance.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.dlf_notation.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.euclidean_distances.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.find_average_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.find_windows.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.find_windows_new.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.fmin.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.frac2cart_all.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.fractional_from_cartesian.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.get_gyration_tensor.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.get_inertia_tensor.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.get_tensor_eigenvalues.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.get_window_com.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.is_inside_polyhedron.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.is_number.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.lattice_array_to_unit_cell.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.max_dim.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.minimize.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.molecular_weight.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.normal_vector.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.normalize_vector.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.opls_notation.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.opt_pore_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.optimise_xy.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.optimise_z.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.pore_diameter.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.principal_axes.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.relative_shape_anisotropy.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.rotation_matrix_arbitrary_axis.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.shift_com.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.sphere_volume.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.to_list.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.unique.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.unit_cell_to_lattice_array.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.vector_analysis.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.vector_analysis_pore_shape.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.vector_analysis_reversed.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.vector_preanalysis.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.volume_from_cell_parameters.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.volume_from_lattice_array.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.window_analysis.rst delete mode 100644 docs/source/_autosummary/pywindow.utilities.window_shape.rst delete mode 100644 docs/source/_autosummary/pywindow.vector_analysis.rst delete mode 100644 docs/source/_autosummary/pywindow.vector_analysis_pore_shape.rst delete mode 100644 docs/source/_autosummary/pywindow.vector_analysis_reversed.rst delete mode 100644 docs/source/_autosummary/pywindow.vector_preanalysis.rst delete mode 100644 docs/source/_autosummary/pywindow.volume_from_cell_parameters.rst delete mode 100644 docs/source/_autosummary/pywindow.volume_from_lattice_array.rst delete mode 100644 docs/source/_autosummary/pywindow.window_analysis.rst delete mode 100644 docs/source/_autosummary/pywindow.window_shape.rst diff --git a/docs/source/_autosummary/pywindow.ConvexHull.rst b/docs/source/_autosummary/pywindow.ConvexHull.rst deleted file mode 100644 index 057e812..0000000 --- a/docs/source/_autosummary/pywindow.ConvexHull.rst +++ /dev/null @@ -1,33 +0,0 @@ -pywindow.ConvexHull -=================== - -.. currentmodule:: pywindow - -.. autoclass:: ConvexHull - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ConvexHull.add_points - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ConvexHull.points - ~ConvexHull.vertices - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.DBSCAN.rst b/docs/source/_autosummary/pywindow.DBSCAN.rst deleted file mode 100644 index 9a8f4c6..0000000 --- a/docs/source/_autosummary/pywindow.DBSCAN.rst +++ /dev/null @@ -1,28 +0,0 @@ -pywindow.DBSCAN -=============== - -.. currentmodule:: pywindow - -.. autoclass:: DBSCAN - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DBSCAN.fit - ~DBSCAN.fit_predict - ~DBSCAN.set_fit_request - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.DLPOLY.rst b/docs/source/_autosummary/pywindow.DLPOLY.rst deleted file mode 100644 index 30f3592..0000000 --- a/docs/source/_autosummary/pywindow.DLPOLY.rst +++ /dev/null @@ -1,29 +0,0 @@ -pywindow.DLPOLY -=============== - -.. currentmodule:: pywindow - -.. autoclass:: DLPOLY - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DLPOLY.analysis - ~DLPOLY.get_frames - ~DLPOLY.save_analysis - ~DLPOLY.save_frames - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.Input.rst b/docs/source/_autosummary/pywindow.Input.rst deleted file mode 100644 index 5887993..0000000 --- a/docs/source/_autosummary/pywindow.Input.rst +++ /dev/null @@ -1,27 +0,0 @@ -pywindow.Input -============== - -.. currentmodule:: pywindow - -.. autoclass:: Input - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Input.load_file - ~Input.load_rdkit_mol - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.KDTree.rst b/docs/source/_autosummary/pywindow.KDTree.rst deleted file mode 100644 index 4afe801..0000000 --- a/docs/source/_autosummary/pywindow.KDTree.rst +++ /dev/null @@ -1,37 +0,0 @@ -pywindow.KDTree -=============== - -.. currentmodule:: pywindow - -.. autoclass:: KDTree - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~KDTree.data - ~KDTree.idx_array - ~KDTree.node_bounds - ~KDTree.node_data - ~KDTree.sample_weight - ~KDTree.sum_weight - ~KDTree.valid_metrics - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.MolecularSystem.rst b/docs/source/_autosummary/pywindow.MolecularSystem.rst deleted file mode 100644 index fee66d6..0000000 --- a/docs/source/_autosummary/pywindow.MolecularSystem.rst +++ /dev/null @@ -1,35 +0,0 @@ -pywindow.MolecularSystem -======================== - -.. currentmodule:: pywindow - -.. autoclass:: MolecularSystem - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MolecularSystem.decipher_atom_keys - ~MolecularSystem.dump_system - ~MolecularSystem.dump_system_json - ~MolecularSystem.load_file - ~MolecularSystem.load_rdkit_mol - ~MolecularSystem.load_system - ~MolecularSystem.make_modular - ~MolecularSystem.rebuild_system - ~MolecularSystem.swap_atom_keys - ~MolecularSystem.system_to_molecule - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.Molecule.rst b/docs/source/_autosummary/pywindow.Molecule.rst deleted file mode 100644 index 54b6c10..0000000 --- a/docs/source/_autosummary/pywindow.Molecule.rst +++ /dev/null @@ -1,46 +0,0 @@ -pywindow.Molecule -================= - -.. currentmodule:: pywindow - -.. autoclass:: Molecule - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Molecule.calculate_average_diameter - ~Molecule.calculate_centre_of_mass - ~Molecule.calculate_maximum_diameter - ~Molecule.calculate_pore_diameter - ~Molecule.calculate_pore_diameter_opt - ~Molecule.calculate_pore_volume - ~Molecule.calculate_pore_volume_opt - ~Molecule.calculate_windows - ~Molecule.dump_molecule - ~Molecule.dump_properties_json - ~Molecule.full_analysis - ~Molecule.load_rdkit_mol - ~Molecule.molecular_weight - ~Molecule.shift_to_origin - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Molecule.gyration_tensor - ~Molecule.inertia_tensor - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.Output.rst b/docs/source/_autosummary/pywindow.Output.rst deleted file mode 100644 index 432fe82..0000000 --- a/docs/source/_autosummary/pywindow.Output.rst +++ /dev/null @@ -1,27 +0,0 @@ -pywindow.Output -=============== - -.. currentmodule:: pywindow - -.. autoclass:: Output - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Output.dump2file - ~Output.dump2json - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.PDB.rst b/docs/source/_autosummary/pywindow.PDB.rst deleted file mode 100644 index 4fc2e01..0000000 --- a/docs/source/_autosummary/pywindow.PDB.rst +++ /dev/null @@ -1,29 +0,0 @@ -pywindow.PDB -============ - -.. currentmodule:: pywindow - -.. autoclass:: PDB - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~PDB.analysis - ~PDB.get_frames - ~PDB.save_analysis - ~PDB.save_frames - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.Pool.rst b/docs/source/_autosummary/pywindow.Pool.rst deleted file mode 100644 index ac42de8..0000000 --- a/docs/source/_autosummary/pywindow.Pool.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.Pool -============= - -.. currentmodule:: pywindow - -.. autofunction:: Pool \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.XYZ.rst b/docs/source/_autosummary/pywindow.XYZ.rst deleted file mode 100644 index 2e0d924..0000000 --- a/docs/source/_autosummary/pywindow.XYZ.rst +++ /dev/null @@ -1,29 +0,0 @@ -pywindow.XYZ -============ - -.. currentmodule:: pywindow - -.. autoclass:: XYZ - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~XYZ.analysis - ~XYZ.get_frames - ~XYZ.save_analysis - ~XYZ.save_frames - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.acylidricity.rst b/docs/source/_autosummary/pywindow.acylidricity.rst deleted file mode 100644 index c6212b6..0000000 --- a/docs/source/_autosummary/pywindow.acylidricity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.acylidricity -===================== - -.. currentmodule:: pywindow - -.. autofunction:: acylidricity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.align_principal_ax.rst b/docs/source/_autosummary/pywindow.align_principal_ax.rst deleted file mode 100644 index 7675ac0..0000000 --- a/docs/source/_autosummary/pywindow.align_principal_ax.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.align\_principal\_ax -============================= - -.. currentmodule:: pywindow - -.. autofunction:: align_principal_ax \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.angle_between_vectors.rst b/docs/source/_autosummary/pywindow.angle_between_vectors.rst deleted file mode 100644 index 151301b..0000000 --- a/docs/source/_autosummary/pywindow.angle_between_vectors.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.angle\_between\_vectors -================================ - -.. currentmodule:: pywindow - -.. autofunction:: angle_between_vectors \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.asphericity.rst b/docs/source/_autosummary/pywindow.asphericity.rst deleted file mode 100644 index 2379755..0000000 --- a/docs/source/_autosummary/pywindow.asphericity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.asphericity -==================== - -.. currentmodule:: pywindow - -.. autofunction:: asphericity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.brute.rst b/docs/source/_autosummary/pywindow.brute.rst deleted file mode 100644 index 6682771..0000000 --- a/docs/source/_autosummary/pywindow.brute.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.brute -============== - -.. currentmodule:: pywindow - -.. autofunction:: brute \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.calc_acylidricity.rst b/docs/source/_autosummary/pywindow.calc_acylidricity.rst deleted file mode 100644 index 2f23e75..0000000 --- a/docs/source/_autosummary/pywindow.calc_acylidricity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.calc\_acylidricity -=========================== - -.. currentmodule:: pywindow - -.. autofunction:: calc_acylidricity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.calc_asphericity.rst b/docs/source/_autosummary/pywindow.calc_asphericity.rst deleted file mode 100644 index 6f3c9fa..0000000 --- a/docs/source/_autosummary/pywindow.calc_asphericity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.calc\_asphericity -========================== - -.. currentmodule:: pywindow - -.. autofunction:: calc_asphericity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.calc_relative_shape_anisotropy.rst b/docs/source/_autosummary/pywindow.calc_relative_shape_anisotropy.rst deleted file mode 100644 index 8ef8e47..0000000 --- a/docs/source/_autosummary/pywindow.calc_relative_shape_anisotropy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.calc\_relative\_shape\_anisotropy -========================================== - -.. currentmodule:: pywindow - -.. autofunction:: calc_relative_shape_anisotropy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.calculate_pore_shape.rst b/docs/source/_autosummary/pywindow.calculate_pore_shape.rst deleted file mode 100644 index 4ab6094..0000000 --- a/docs/source/_autosummary/pywindow.calculate_pore_shape.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.calculate\_pore\_shape -=============================== - -.. currentmodule:: pywindow - -.. autofunction:: calculate_pore_shape \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.calculate_window_diameter.rst b/docs/source/_autosummary/pywindow.calculate_window_diameter.rst deleted file mode 100644 index 93fe8cb..0000000 --- a/docs/source/_autosummary/pywindow.calculate_window_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.calculate\_window\_diameter -==================================== - -.. currentmodule:: pywindow - -.. autofunction:: calculate_window_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.cart2frac_all.rst b/docs/source/_autosummary/pywindow.cart2frac_all.rst deleted file mode 100644 index 9101699..0000000 --- a/docs/source/_autosummary/pywindow.cart2frac_all.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.cart2frac\_all -======================= - -.. currentmodule:: pywindow - -.. autofunction:: cart2frac_all \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.cartisian_from_fractional.rst b/docs/source/_autosummary/pywindow.cartisian_from_fractional.rst deleted file mode 100644 index 0cfdbc9..0000000 --- a/docs/source/_autosummary/pywindow.cartisian_from_fractional.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.cartisian\_from\_fractional -==================================== - -.. currentmodule:: pywindow - -.. autofunction:: cartisian_from_fractional \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.center_of_coor.rst b/docs/source/_autosummary/pywindow.center_of_coor.rst deleted file mode 100644 index 61cf91e..0000000 --- a/docs/source/_autosummary/pywindow.center_of_coor.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.center\_of\_coor -========================= - -.. currentmodule:: pywindow - -.. autofunction:: center_of_coor \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.center_of_mass.rst b/docs/source/_autosummary/pywindow.center_of_mass.rst deleted file mode 100644 index 76fd7ea..0000000 --- a/docs/source/_autosummary/pywindow.center_of_mass.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.center\_of\_mass -========================= - -.. currentmodule:: pywindow - -.. autofunction:: center_of_mass \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.circumcircle.rst b/docs/source/_autosummary/pywindow.circumcircle.rst deleted file mode 100644 index f2800c9..0000000 --- a/docs/source/_autosummary/pywindow.circumcircle.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.circumcircle -===================== - -.. currentmodule:: pywindow - -.. autofunction:: circumcircle \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.circumcircle_window.rst b/docs/source/_autosummary/pywindow.circumcircle_window.rst deleted file mode 100644 index 1c31b97..0000000 --- a/docs/source/_autosummary/pywindow.circumcircle_window.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.circumcircle\_window -============================= - -.. currentmodule:: pywindow - -.. autofunction:: circumcircle_window \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.closing.rst b/docs/source/_autosummary/pywindow.closing.rst deleted file mode 100644 index dc641a4..0000000 --- a/docs/source/_autosummary/pywindow.closing.rst +++ /dev/null @@ -1,25 +0,0 @@ -pywindow.closing -================ - -.. currentmodule:: pywindow - -.. autoclass:: closing - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.compose_atom_list.rst b/docs/source/_autosummary/pywindow.compose_atom_list.rst deleted file mode 100644 index d67f55d..0000000 --- a/docs/source/_autosummary/pywindow.compose_atom_list.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.compose\_atom\_list -============================ - -.. currentmodule:: pywindow - -.. autofunction:: compose_atom_list \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.correct_pore_diameter.rst b/docs/source/_autosummary/pywindow.correct_pore_diameter.rst deleted file mode 100644 index bf86d1d..0000000 --- a/docs/source/_autosummary/pywindow.correct_pore_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.correct\_pore\_diameter -================================ - -.. currentmodule:: pywindow - -.. autofunction:: correct_pore_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.create_supercell.rst b/docs/source/_autosummary/pywindow.create_supercell.rst deleted file mode 100644 index 12aa960..0000000 --- a/docs/source/_autosummary/pywindow.create_supercell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.create\_supercell -========================== - -.. currentmodule:: pywindow - -.. autofunction:: create_supercell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.decipher_atom_key.rst b/docs/source/_autosummary/pywindow.decipher_atom_key.rst deleted file mode 100644 index d2c9379..0000000 --- a/docs/source/_autosummary/pywindow.decipher_atom_key.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.decipher\_atom\_key -============================ - -.. currentmodule:: pywindow - -.. autofunction:: decipher_atom_key \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.decompose_atom_list.rst b/docs/source/_autosummary/pywindow.decompose_atom_list.rst deleted file mode 100644 index d26fcb0..0000000 --- a/docs/source/_autosummary/pywindow.decompose_atom_list.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.decompose\_atom\_list -============================== - -.. currentmodule:: pywindow - -.. autofunction:: decompose_atom_list \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.deepcopy.rst b/docs/source/_autosummary/pywindow.deepcopy.rst deleted file mode 100644 index 8bc9660..0000000 --- a/docs/source/_autosummary/pywindow.deepcopy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.deepcopy -================= - -.. currentmodule:: pywindow - -.. autofunction:: deepcopy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.discrete_molecules.rst b/docs/source/_autosummary/pywindow.discrete_molecules.rst deleted file mode 100644 index 797f472..0000000 --- a/docs/source/_autosummary/pywindow.discrete_molecules.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.discrete\_molecules -============================ - -.. currentmodule:: pywindow - -.. autofunction:: discrete_molecules \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.distance.rst b/docs/source/_autosummary/pywindow.distance.rst deleted file mode 100644 index 450ceac..0000000 --- a/docs/source/_autosummary/pywindow.distance.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.distance -================= - -.. currentmodule:: pywindow - -.. autofunction:: distance \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.dlf_notation.rst b/docs/source/_autosummary/pywindow.dlf_notation.rst deleted file mode 100644 index ef6d447..0000000 --- a/docs/source/_autosummary/pywindow.dlf_notation.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.dlf\_notation -====================== - -.. currentmodule:: pywindow - -.. autofunction:: dlf_notation \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.euclidean_distances.rst b/docs/source/_autosummary/pywindow.euclidean_distances.rst deleted file mode 100644 index ff23056..0000000 --- a/docs/source/_autosummary/pywindow.euclidean_distances.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.euclidean\_distances -============================= - -.. currentmodule:: pywindow - -.. autofunction:: euclidean_distances \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.find_average_diameter.rst b/docs/source/_autosummary/pywindow.find_average_diameter.rst deleted file mode 100644 index a60df0e..0000000 --- a/docs/source/_autosummary/pywindow.find_average_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.find\_average\_diameter -================================ - -.. currentmodule:: pywindow - -.. autofunction:: find_average_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.find_windows.rst b/docs/source/_autosummary/pywindow.find_windows.rst deleted file mode 100644 index 8c12553..0000000 --- a/docs/source/_autosummary/pywindow.find_windows.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.find\_windows -====================== - -.. currentmodule:: pywindow - -.. autofunction:: find_windows \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.find_windows_new.rst b/docs/source/_autosummary/pywindow.find_windows_new.rst deleted file mode 100644 index 42dc89a..0000000 --- a/docs/source/_autosummary/pywindow.find_windows_new.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.find\_windows\_new -=========================== - -.. currentmodule:: pywindow - -.. autofunction:: find_windows_new \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.fmin.rst b/docs/source/_autosummary/pywindow.fmin.rst deleted file mode 100644 index 911664e..0000000 --- a/docs/source/_autosummary/pywindow.fmin.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.fmin -============= - -.. currentmodule:: pywindow - -.. autofunction:: fmin \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.frac2cart_all.rst b/docs/source/_autosummary/pywindow.frac2cart_all.rst deleted file mode 100644 index 58b46f6..0000000 --- a/docs/source/_autosummary/pywindow.frac2cart_all.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.frac2cart\_all -======================= - -.. currentmodule:: pywindow - -.. autofunction:: frac2cart_all \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.fractional_from_cartesian.rst b/docs/source/_autosummary/pywindow.fractional_from_cartesian.rst deleted file mode 100644 index 060557e..0000000 --- a/docs/source/_autosummary/pywindow.fractional_from_cartesian.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.fractional\_from\_cartesian -==================================== - -.. currentmodule:: pywindow - -.. autofunction:: fractional_from_cartesian \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.get_gyration_tensor.rst b/docs/source/_autosummary/pywindow.get_gyration_tensor.rst deleted file mode 100644 index 8eaef08..0000000 --- a/docs/source/_autosummary/pywindow.get_gyration_tensor.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.get\_gyration\_tensor -============================== - -.. currentmodule:: pywindow - -.. autofunction:: get_gyration_tensor \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.get_inertia_tensor.rst b/docs/source/_autosummary/pywindow.get_inertia_tensor.rst deleted file mode 100644 index 0d07605..0000000 --- a/docs/source/_autosummary/pywindow.get_inertia_tensor.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.get\_inertia\_tensor -============================= - -.. currentmodule:: pywindow - -.. autofunction:: get_inertia_tensor \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.get_tensor_eigenvalues.rst b/docs/source/_autosummary/pywindow.get_tensor_eigenvalues.rst deleted file mode 100644 index 7b8fad3..0000000 --- a/docs/source/_autosummary/pywindow.get_tensor_eigenvalues.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.get\_tensor\_eigenvalues -================================= - -.. currentmodule:: pywindow - -.. autofunction:: get_tensor_eigenvalues \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.get_window_com.rst b/docs/source/_autosummary/pywindow.get_window_com.rst deleted file mode 100644 index 28e2a81..0000000 --- a/docs/source/_autosummary/pywindow.get_window_com.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.get\_window\_com -========================= - -.. currentmodule:: pywindow - -.. autofunction:: get_window_com \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.io_tools.Input.rst b/docs/source/_autosummary/pywindow.io_tools.Input.rst deleted file mode 100644 index 0f071c9..0000000 --- a/docs/source/_autosummary/pywindow.io_tools.Input.rst +++ /dev/null @@ -1,27 +0,0 @@ -pywindow.io\_tools.Input -======================== - -.. currentmodule:: pywindow.io_tools - -.. autoclass:: Input - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Input.load_file - ~Input.load_rdkit_mol - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.io_tools.Output.rst b/docs/source/_autosummary/pywindow.io_tools.Output.rst deleted file mode 100644 index 94d3631..0000000 --- a/docs/source/_autosummary/pywindow.io_tools.Output.rst +++ /dev/null @@ -1,27 +0,0 @@ -pywindow.io\_tools.Output -========================= - -.. currentmodule:: pywindow.io_tools - -.. autoclass:: Output - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Output.dump2file - ~Output.dump2json - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.io_tools.decipher_atom_key.rst b/docs/source/_autosummary/pywindow.io_tools.decipher_atom_key.rst deleted file mode 100644 index 4a222c2..0000000 --- a/docs/source/_autosummary/pywindow.io_tools.decipher_atom_key.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.io\_tools.decipher\_atom\_key -====================================== - -.. currentmodule:: pywindow.io_tools - -.. autofunction:: decipher_atom_key \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.io_tools.rst b/docs/source/_autosummary/pywindow.io_tools.rst deleted file mode 100644 index da384ae..0000000 --- a/docs/source/_autosummary/pywindow.io_tools.rst +++ /dev/null @@ -1,43 +0,0 @@ -pywindow.io\_tools -================== - -.. automodule:: pywindow.io_tools - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: class.rst - :nosignatures: - - Input - Output - - - - - - - .. rubric:: Functions - - .. autosummary:: - :toctree: - :nosignatures: - - decipher_atom_key - unit_cell_to_lattice_array - - - - - - - - - diff --git a/docs/source/_autosummary/pywindow.io_tools.unit_cell_to_lattice_array.rst b/docs/source/_autosummary/pywindow.io_tools.unit_cell_to_lattice_array.rst deleted file mode 100644 index 309dc4e..0000000 --- a/docs/source/_autosummary/pywindow.io_tools.unit_cell_to_lattice_array.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.io\_tools.unit\_cell\_to\_lattice\_array -================================================= - -.. currentmodule:: pywindow.io_tools - -.. autofunction:: unit_cell_to_lattice_array \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.is_inside_polyhedron.rst b/docs/source/_autosummary/pywindow.is_inside_polyhedron.rst deleted file mode 100644 index 204a61f..0000000 --- a/docs/source/_autosummary/pywindow.is_inside_polyhedron.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.is\_inside\_polyhedron -=============================== - -.. currentmodule:: pywindow - -.. autofunction:: is_inside_polyhedron \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.is_number.rst b/docs/source/_autosummary/pywindow.is_number.rst deleted file mode 100644 index fbe335c..0000000 --- a/docs/source/_autosummary/pywindow.is_number.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.is\_number -=================== - -.. currentmodule:: pywindow - -.. autofunction:: is_number \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.lattice_array_to_unit_cell.rst b/docs/source/_autosummary/pywindow.lattice_array_to_unit_cell.rst deleted file mode 100644 index 3a2468c..0000000 --- a/docs/source/_autosummary/pywindow.lattice_array_to_unit_cell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.lattice\_array\_to\_unit\_cell -======================================= - -.. currentmodule:: pywindow - -.. autofunction:: lattice_array_to_unit_cell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.make_supercell.rst b/docs/source/_autosummary/pywindow.make_supercell.rst deleted file mode 100644 index 1135625..0000000 --- a/docs/source/_autosummary/pywindow.make_supercell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.make\_supercell -======================== - -.. currentmodule:: pywindow - -.. autofunction:: make_supercell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.max_dim.rst b/docs/source/_autosummary/pywindow.max_dim.rst deleted file mode 100644 index 59af64a..0000000 --- a/docs/source/_autosummary/pywindow.max_dim.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.max\_dim -================= - -.. currentmodule:: pywindow - -.. autofunction:: max_dim \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.minimize.rst b/docs/source/_autosummary/pywindow.minimize.rst deleted file mode 100644 index 4da817e..0000000 --- a/docs/source/_autosummary/pywindow.minimize.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.minimize -================= - -.. currentmodule:: pywindow - -.. autofunction:: minimize \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.mmap.rst b/docs/source/_autosummary/pywindow.mmap.rst deleted file mode 100644 index f3ebdca..0000000 --- a/docs/source/_autosummary/pywindow.mmap.rst +++ /dev/null @@ -1,47 +0,0 @@ -pywindow.mmap -============= - -.. currentmodule:: pywindow - -.. autoclass:: mmap - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~mmap.close - ~mmap.find - ~mmap.flush - ~mmap.madvise - ~mmap.move - ~mmap.read - ~mmap.read_byte - ~mmap.readline - ~mmap.resize - ~mmap.rfind - ~mmap.seek - ~mmap.seekable - ~mmap.size - ~mmap.tell - ~mmap.write - ~mmap.write_byte - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~mmap.closed - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.ConvexHull.rst b/docs/source/_autosummary/pywindow.molecular.ConvexHull.rst deleted file mode 100644 index b5c9553..0000000 --- a/docs/source/_autosummary/pywindow.molecular.ConvexHull.rst +++ /dev/null @@ -1,33 +0,0 @@ -pywindow.molecular.ConvexHull -============================= - -.. currentmodule:: pywindow.molecular - -.. autoclass:: ConvexHull - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~ConvexHull.add_points - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ConvexHull.points - ~ConvexHull.vertices - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.Input.rst b/docs/source/_autosummary/pywindow.molecular.Input.rst deleted file mode 100644 index ba47e2b..0000000 --- a/docs/source/_autosummary/pywindow.molecular.Input.rst +++ /dev/null @@ -1,27 +0,0 @@ -pywindow.molecular.Input -======================== - -.. currentmodule:: pywindow.molecular - -.. autoclass:: Input - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Input.load_file - ~Input.load_rdkit_mol - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.MolecularSystem.rst b/docs/source/_autosummary/pywindow.molecular.MolecularSystem.rst deleted file mode 100644 index 59c8045..0000000 --- a/docs/source/_autosummary/pywindow.molecular.MolecularSystem.rst +++ /dev/null @@ -1,35 +0,0 @@ -pywindow.molecular.MolecularSystem -================================== - -.. currentmodule:: pywindow.molecular - -.. autoclass:: MolecularSystem - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MolecularSystem.decipher_atom_keys - ~MolecularSystem.dump_system - ~MolecularSystem.dump_system_json - ~MolecularSystem.load_file - ~MolecularSystem.load_rdkit_mol - ~MolecularSystem.load_system - ~MolecularSystem.make_modular - ~MolecularSystem.rebuild_system - ~MolecularSystem.swap_atom_keys - ~MolecularSystem.system_to_molecule - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.Molecule.rst b/docs/source/_autosummary/pywindow.molecular.Molecule.rst deleted file mode 100644 index dbbb1e0..0000000 --- a/docs/source/_autosummary/pywindow.molecular.Molecule.rst +++ /dev/null @@ -1,46 +0,0 @@ -pywindow.molecular.Molecule -=========================== - -.. currentmodule:: pywindow.molecular - -.. autoclass:: Molecule - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Molecule.calculate_average_diameter - ~Molecule.calculate_centre_of_mass - ~Molecule.calculate_maximum_diameter - ~Molecule.calculate_pore_diameter - ~Molecule.calculate_pore_diameter_opt - ~Molecule.calculate_pore_volume - ~Molecule.calculate_pore_volume_opt - ~Molecule.calculate_windows - ~Molecule.dump_molecule - ~Molecule.dump_properties_json - ~Molecule.full_analysis - ~Molecule.load_rdkit_mol - ~Molecule.molecular_weight - ~Molecule.shift_to_origin - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Molecule.gyration_tensor - ~Molecule.inertia_tensor - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.Output.rst b/docs/source/_autosummary/pywindow.molecular.Output.rst deleted file mode 100644 index d6bce85..0000000 --- a/docs/source/_autosummary/pywindow.molecular.Output.rst +++ /dev/null @@ -1,27 +0,0 @@ -pywindow.molecular.Output -========================= - -.. currentmodule:: pywindow.molecular - -.. autoclass:: Output - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Output.dump2file - ~Output.dump2json - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.align_principal_ax.rst b/docs/source/_autosummary/pywindow.molecular.align_principal_ax.rst deleted file mode 100644 index 61c6311..0000000 --- a/docs/source/_autosummary/pywindow.molecular.align_principal_ax.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.align\_principal\_ax -======================================= - -.. currentmodule:: pywindow.molecular - -.. autofunction:: align_principal_ax \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.calc_acylidricity.rst b/docs/source/_autosummary/pywindow.molecular.calc_acylidricity.rst deleted file mode 100644 index ecaf033..0000000 --- a/docs/source/_autosummary/pywindow.molecular.calc_acylidricity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.calc\_acylidricity -===================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: calc_acylidricity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.calc_asphericity.rst b/docs/source/_autosummary/pywindow.molecular.calc_asphericity.rst deleted file mode 100644 index 38db332..0000000 --- a/docs/source/_autosummary/pywindow.molecular.calc_asphericity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.calc\_asphericity -==================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: calc_asphericity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.calc_relative_shape_anisotropy.rst b/docs/source/_autosummary/pywindow.molecular.calc_relative_shape_anisotropy.rst deleted file mode 100644 index b535a49..0000000 --- a/docs/source/_autosummary/pywindow.molecular.calc_relative_shape_anisotropy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.calc\_relative\_shape\_anisotropy -==================================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: calc_relative_shape_anisotropy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.calculate_pore_shape.rst b/docs/source/_autosummary/pywindow.molecular.calculate_pore_shape.rst deleted file mode 100644 index fc5dd68..0000000 --- a/docs/source/_autosummary/pywindow.molecular.calculate_pore_shape.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.calculate\_pore\_shape -========================================= - -.. currentmodule:: pywindow.molecular - -.. autofunction:: calculate_pore_shape \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.calculate_window_diameter.rst b/docs/source/_autosummary/pywindow.molecular.calculate_window_diameter.rst deleted file mode 100644 index ce15f02..0000000 --- a/docs/source/_autosummary/pywindow.molecular.calculate_window_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.calculate\_window\_diameter -============================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: calculate_window_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.center_of_mass.rst b/docs/source/_autosummary/pywindow.molecular.center_of_mass.rst deleted file mode 100644 index 8d5e73a..0000000 --- a/docs/source/_autosummary/pywindow.molecular.center_of_mass.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.center\_of\_mass -=================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: center_of_mass \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.circumcircle.rst b/docs/source/_autosummary/pywindow.molecular.circumcircle.rst deleted file mode 100644 index 7f54523..0000000 --- a/docs/source/_autosummary/pywindow.molecular.circumcircle.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.circumcircle -=============================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: circumcircle \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.create_supercell.rst b/docs/source/_autosummary/pywindow.molecular.create_supercell.rst deleted file mode 100644 index e634eeb..0000000 --- a/docs/source/_autosummary/pywindow.molecular.create_supercell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.create\_supercell -==================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: create_supercell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.decipher_atom_key.rst b/docs/source/_autosummary/pywindow.molecular.decipher_atom_key.rst deleted file mode 100644 index f5ff665..0000000 --- a/docs/source/_autosummary/pywindow.molecular.decipher_atom_key.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.decipher\_atom\_key -====================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: decipher_atom_key \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.deepcopy.rst b/docs/source/_autosummary/pywindow.molecular.deepcopy.rst deleted file mode 100644 index d9f7fba..0000000 --- a/docs/source/_autosummary/pywindow.molecular.deepcopy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.deepcopy -=========================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: deepcopy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.discrete_molecules.rst b/docs/source/_autosummary/pywindow.molecular.discrete_molecules.rst deleted file mode 100644 index cd23981..0000000 --- a/docs/source/_autosummary/pywindow.molecular.discrete_molecules.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.discrete\_molecules -====================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: discrete_molecules \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.find_average_diameter.rst b/docs/source/_autosummary/pywindow.molecular.find_average_diameter.rst deleted file mode 100644 index b6f2a17..0000000 --- a/docs/source/_autosummary/pywindow.molecular.find_average_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.find\_average\_diameter -========================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: find_average_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.find_windows.rst b/docs/source/_autosummary/pywindow.molecular.find_windows.rst deleted file mode 100644 index 976d940..0000000 --- a/docs/source/_autosummary/pywindow.molecular.find_windows.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.find\_windows -================================ - -.. currentmodule:: pywindow.molecular - -.. autofunction:: find_windows \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.find_windows_new.rst b/docs/source/_autosummary/pywindow.molecular.find_windows_new.rst deleted file mode 100644 index 1044376..0000000 --- a/docs/source/_autosummary/pywindow.molecular.find_windows_new.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.find\_windows\_new -===================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: find_windows_new \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.get_gyration_tensor.rst b/docs/source/_autosummary/pywindow.molecular.get_gyration_tensor.rst deleted file mode 100644 index 5e00413..0000000 --- a/docs/source/_autosummary/pywindow.molecular.get_gyration_tensor.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.get\_gyration\_tensor -======================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: get_gyration_tensor \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.get_inertia_tensor.rst b/docs/source/_autosummary/pywindow.molecular.get_inertia_tensor.rst deleted file mode 100644 index e8fd839..0000000 --- a/docs/source/_autosummary/pywindow.molecular.get_inertia_tensor.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.get\_inertia\_tensor -======================================= - -.. currentmodule:: pywindow.molecular - -.. autofunction:: get_inertia_tensor \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.get_window_com.rst b/docs/source/_autosummary/pywindow.molecular.get_window_com.rst deleted file mode 100644 index b989f7e..0000000 --- a/docs/source/_autosummary/pywindow.molecular.get_window_com.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.get\_window\_com -=================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: get_window_com \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.is_inside_polyhedron.rst b/docs/source/_autosummary/pywindow.molecular.is_inside_polyhedron.rst deleted file mode 100644 index 9c60efe..0000000 --- a/docs/source/_autosummary/pywindow.molecular.is_inside_polyhedron.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.is\_inside\_polyhedron -========================================= - -.. currentmodule:: pywindow.molecular - -.. autofunction:: is_inside_polyhedron \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.max_dim.rst b/docs/source/_autosummary/pywindow.molecular.max_dim.rst deleted file mode 100644 index beb4f91..0000000 --- a/docs/source/_autosummary/pywindow.molecular.max_dim.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.max\_dim -=========================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: max_dim \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.molecular_weight.rst b/docs/source/_autosummary/pywindow.molecular.molecular_weight.rst deleted file mode 100644 index bc96428..0000000 --- a/docs/source/_autosummary/pywindow.molecular.molecular_weight.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.molecular\_weight -==================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: molecular_weight \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.opt_pore_diameter.rst b/docs/source/_autosummary/pywindow.molecular.opt_pore_diameter.rst deleted file mode 100644 index a2c1dd8..0000000 --- a/docs/source/_autosummary/pywindow.molecular.opt_pore_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.opt\_pore\_diameter -====================================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: opt_pore_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.pore_diameter.rst b/docs/source/_autosummary/pywindow.molecular.pore_diameter.rst deleted file mode 100644 index a5a3b1d..0000000 --- a/docs/source/_autosummary/pywindow.molecular.pore_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.pore\_diameter -================================= - -.. currentmodule:: pywindow.molecular - -.. autofunction:: pore_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.rst b/docs/source/_autosummary/pywindow.molecular.rst deleted file mode 100644 index 6266071..0000000 --- a/docs/source/_autosummary/pywindow.molecular.rst +++ /dev/null @@ -1,71 +0,0 @@ -pywindow.molecular -================== - -.. automodule:: pywindow.molecular - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: class.rst - :nosignatures: - - ConvexHull - Input - MolecularSystem - Molecule - Output - - - - - - - .. rubric:: Functions - - .. autosummary:: - :toctree: - :nosignatures: - - align_principal_ax - calc_acylidricity - calc_asphericity - calc_relative_shape_anisotropy - calculate_pore_shape - calculate_window_diameter - center_of_mass - circumcircle - create_supercell - decipher_atom_key - deepcopy - discrete_molecules - find_average_diameter - find_windows - find_windows_new - get_gyration_tensor - get_inertia_tensor - get_window_com - is_inside_polyhedron - max_dim - molecular_weight - opt_pore_diameter - pore_diameter - shift_com - sphere_volume - to_list - window_shape - - - - - - - - - diff --git a/docs/source/_autosummary/pywindow.molecular.shift_com.rst b/docs/source/_autosummary/pywindow.molecular.shift_com.rst deleted file mode 100644 index 452be74..0000000 --- a/docs/source/_autosummary/pywindow.molecular.shift_com.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.shift\_com -============================= - -.. currentmodule:: pywindow.molecular - -.. autofunction:: shift_com \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.sphere_volume.rst b/docs/source/_autosummary/pywindow.molecular.sphere_volume.rst deleted file mode 100644 index 8f652c0..0000000 --- a/docs/source/_autosummary/pywindow.molecular.sphere_volume.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.sphere\_volume -================================= - -.. currentmodule:: pywindow.molecular - -.. autofunction:: sphere_volume \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.to_list.rst b/docs/source/_autosummary/pywindow.molecular.to_list.rst deleted file mode 100644 index 66f020d..0000000 --- a/docs/source/_autosummary/pywindow.molecular.to_list.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.to\_list -=========================== - -.. currentmodule:: pywindow.molecular - -.. autofunction:: to_list \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular.window_shape.rst b/docs/source/_autosummary/pywindow.molecular.window_shape.rst deleted file mode 100644 index d7714e0..0000000 --- a/docs/source/_autosummary/pywindow.molecular.window_shape.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular.window\_shape -================================ - -.. currentmodule:: pywindow.molecular - -.. autofunction:: window_shape \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.molecular_weight.rst b/docs/source/_autosummary/pywindow.molecular_weight.rst deleted file mode 100644 index 3aad2f2..0000000 --- a/docs/source/_autosummary/pywindow.molecular_weight.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.molecular\_weight -========================== - -.. currentmodule:: pywindow - -.. autofunction:: molecular_weight \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.normal_vector.rst b/docs/source/_autosummary/pywindow.normal_vector.rst deleted file mode 100644 index 11cb2bc..0000000 --- a/docs/source/_autosummary/pywindow.normal_vector.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.normal\_vector -======================= - -.. currentmodule:: pywindow - -.. autofunction:: normal_vector \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.normalize_vector.rst b/docs/source/_autosummary/pywindow.normalize_vector.rst deleted file mode 100644 index 82aa364..0000000 --- a/docs/source/_autosummary/pywindow.normalize_vector.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.normalize\_vector -========================== - -.. currentmodule:: pywindow - -.. autofunction:: normalize_vector \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.opls_notation.rst b/docs/source/_autosummary/pywindow.opls_notation.rst deleted file mode 100644 index 9a985cb..0000000 --- a/docs/source/_autosummary/pywindow.opls_notation.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.opls\_notation -======================= - -.. currentmodule:: pywindow - -.. autofunction:: opls_notation \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.opt_pore_diameter.rst b/docs/source/_autosummary/pywindow.opt_pore_diameter.rst deleted file mode 100644 index d347cfa..0000000 --- a/docs/source/_autosummary/pywindow.opt_pore_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.opt\_pore\_diameter -============================ - -.. currentmodule:: pywindow - -.. autofunction:: opt_pore_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.optimise_xy.rst b/docs/source/_autosummary/pywindow.optimise_xy.rst deleted file mode 100644 index dc087ad..0000000 --- a/docs/source/_autosummary/pywindow.optimise_xy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.optimise\_xy -===================== - -.. currentmodule:: pywindow - -.. autofunction:: optimise_xy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.optimise_z.rst b/docs/source/_autosummary/pywindow.optimise_z.rst deleted file mode 100644 index c809170..0000000 --- a/docs/source/_autosummary/pywindow.optimise_z.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.optimise\_z -==================== - -.. currentmodule:: pywindow - -.. autofunction:: optimise_z \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.pore_diameter.rst b/docs/source/_autosummary/pywindow.pore_diameter.rst deleted file mode 100644 index 4ab343b..0000000 --- a/docs/source/_autosummary/pywindow.pore_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.pore\_diameter -======================= - -.. currentmodule:: pywindow - -.. autofunction:: pore_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.principal_axes.rst b/docs/source/_autosummary/pywindow.principal_axes.rst deleted file mode 100644 index 82da5e1..0000000 --- a/docs/source/_autosummary/pywindow.principal_axes.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.principal\_axes -======================== - -.. currentmodule:: pywindow - -.. autofunction:: principal_axes \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.relative_shape_anisotropy.rst b/docs/source/_autosummary/pywindow.relative_shape_anisotropy.rst deleted file mode 100644 index d1c6ba0..0000000 --- a/docs/source/_autosummary/pywindow.relative_shape_anisotropy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.relative\_shape\_anisotropy -==================================== - -.. currentmodule:: pywindow - -.. autofunction:: relative_shape_anisotropy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.rotation_matrix_arbitrary_axis.rst b/docs/source/_autosummary/pywindow.rotation_matrix_arbitrary_axis.rst deleted file mode 100644 index 21a5b1d..0000000 --- a/docs/source/_autosummary/pywindow.rotation_matrix_arbitrary_axis.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.rotation\_matrix\_arbitrary\_axis -========================================== - -.. currentmodule:: pywindow - -.. autofunction:: rotation_matrix_arbitrary_axis \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.rst b/docs/source/_autosummary/pywindow.rst deleted file mode 100644 index 02e6da8..0000000 --- a/docs/source/_autosummary/pywindow.rst +++ /dev/null @@ -1,131 +0,0 @@ -pywindow -======== - -.. automodule:: pywindow - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: class.rst - :nosignatures: - - ConvexHull - DBSCAN - DLPOLY - Input - KDTree - MolecularSystem - Molecule - Output - PDB - XYZ - closing - mmap - - - - - - - .. rubric:: Functions - - .. autosummary:: - :toctree: - :nosignatures: - - Pool - acylidricity - align_principal_ax - angle_between_vectors - asphericity - brute - calc_acylidricity - calc_asphericity - calc_relative_shape_anisotropy - calculate_pore_shape - calculate_window_diameter - cart2frac_all - cartisian_from_fractional - center_of_coor - center_of_mass - circumcircle - circumcircle_window - compose_atom_list - correct_pore_diameter - create_supercell - decipher_atom_key - decompose_atom_list - deepcopy - discrete_molecules - distance - dlf_notation - euclidean_distances - find_average_diameter - find_windows - find_windows_new - fmin - frac2cart_all - fractional_from_cartesian - get_gyration_tensor - get_inertia_tensor - get_tensor_eigenvalues - get_window_com - is_inside_polyhedron - is_number - lattice_array_to_unit_cell - make_supercell - max_dim - minimize - molecular_weight - normal_vector - normalize_vector - opls_notation - opt_pore_diameter - optimise_xy - optimise_z - pore_diameter - principal_axes - relative_shape_anisotropy - rotation_matrix_arbitrary_axis - shift_com - sphere_volume - to_list - unique - unit_cell_to_lattice_array - vector_analysis - vector_analysis_pore_shape - vector_analysis_reversed - vector_preanalysis - volume_from_cell_parameters - volume_from_lattice_array - window_analysis - window_shape - - - - - - - - - -.. rubric:: Modules - -.. autosummary:: - :toctree: - :template: module.rst - :recursive: - - io_tools - molecular - tables - trajectory - utilities - diff --git a/docs/source/_autosummary/pywindow.shift_com.rst b/docs/source/_autosummary/pywindow.shift_com.rst deleted file mode 100644 index 18cfd38..0000000 --- a/docs/source/_autosummary/pywindow.shift_com.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.shift\_com -=================== - -.. currentmodule:: pywindow - -.. autofunction:: shift_com \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.sphere_volume.rst b/docs/source/_autosummary/pywindow.sphere_volume.rst deleted file mode 100644 index a4f2220..0000000 --- a/docs/source/_autosummary/pywindow.sphere_volume.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.sphere\_volume -======================= - -.. currentmodule:: pywindow - -.. autofunction:: sphere_volume \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.tables.rst b/docs/source/_autosummary/pywindow.tables.rst deleted file mode 100644 index 1b0b442..0000000 --- a/docs/source/_autosummary/pywindow.tables.rst +++ /dev/null @@ -1,24 +0,0 @@ -pywindow.tables -=============== - -.. automodule:: pywindow.tables - - - - - - - - - - - - - - - - - - - - diff --git a/docs/source/_autosummary/pywindow.to_list.rst b/docs/source/_autosummary/pywindow.to_list.rst deleted file mode 100644 index cd4b0ce..0000000 --- a/docs/source/_autosummary/pywindow.to_list.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.to\_list -================= - -.. currentmodule:: pywindow - -.. autofunction:: to_list \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.DLPOLY.rst b/docs/source/_autosummary/pywindow.trajectory.DLPOLY.rst deleted file mode 100644 index dd41918..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.DLPOLY.rst +++ /dev/null @@ -1,29 +0,0 @@ -pywindow.trajectory.DLPOLY -========================== - -.. currentmodule:: pywindow.trajectory - -.. autoclass:: DLPOLY - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DLPOLY.analysis - ~DLPOLY.get_frames - ~DLPOLY.save_analysis - ~DLPOLY.save_frames - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.Input.rst b/docs/source/_autosummary/pywindow.trajectory.Input.rst deleted file mode 100644 index 607bd20..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.Input.rst +++ /dev/null @@ -1,27 +0,0 @@ -pywindow.trajectory.Input -========================= - -.. currentmodule:: pywindow.trajectory - -.. autoclass:: Input - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Input.load_file - ~Input.load_rdkit_mol - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.MolecularSystem.rst b/docs/source/_autosummary/pywindow.trajectory.MolecularSystem.rst deleted file mode 100644 index 84a7d0f..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.MolecularSystem.rst +++ /dev/null @@ -1,35 +0,0 @@ -pywindow.trajectory.MolecularSystem -=================================== - -.. currentmodule:: pywindow.trajectory - -.. autoclass:: MolecularSystem - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~MolecularSystem.decipher_atom_keys - ~MolecularSystem.dump_system - ~MolecularSystem.dump_system_json - ~MolecularSystem.load_file - ~MolecularSystem.load_rdkit_mol - ~MolecularSystem.load_system - ~MolecularSystem.make_modular - ~MolecularSystem.rebuild_system - ~MolecularSystem.swap_atom_keys - ~MolecularSystem.system_to_molecule - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.Output.rst b/docs/source/_autosummary/pywindow.trajectory.Output.rst deleted file mode 100644 index d03153a..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.Output.rst +++ /dev/null @@ -1,27 +0,0 @@ -pywindow.trajectory.Output -========================== - -.. currentmodule:: pywindow.trajectory - -.. autoclass:: Output - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~Output.dump2file - ~Output.dump2json - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.PDB.rst b/docs/source/_autosummary/pywindow.trajectory.PDB.rst deleted file mode 100644 index a9b48c4..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.PDB.rst +++ /dev/null @@ -1,29 +0,0 @@ -pywindow.trajectory.PDB -======================= - -.. currentmodule:: pywindow.trajectory - -.. autoclass:: PDB - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~PDB.analysis - ~PDB.get_frames - ~PDB.save_analysis - ~PDB.save_frames - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.Pool.rst b/docs/source/_autosummary/pywindow.trajectory.Pool.rst deleted file mode 100644 index 9d2731b..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.Pool.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.trajectory.Pool -======================== - -.. currentmodule:: pywindow.trajectory - -.. autofunction:: Pool \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.XYZ.rst b/docs/source/_autosummary/pywindow.trajectory.XYZ.rst deleted file mode 100644 index d912610..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.XYZ.rst +++ /dev/null @@ -1,29 +0,0 @@ -pywindow.trajectory.XYZ -======================= - -.. currentmodule:: pywindow.trajectory - -.. autoclass:: XYZ - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~XYZ.analysis - ~XYZ.get_frames - ~XYZ.save_analysis - ~XYZ.save_frames - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.closing.rst b/docs/source/_autosummary/pywindow.trajectory.closing.rst deleted file mode 100644 index 9b8a516..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.closing.rst +++ /dev/null @@ -1,25 +0,0 @@ -pywindow.trajectory.closing -=========================== - -.. currentmodule:: pywindow.trajectory - -.. autoclass:: closing - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.create_supercell.rst b/docs/source/_autosummary/pywindow.trajectory.create_supercell.rst deleted file mode 100644 index c95f241..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.create_supercell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.trajectory.create\_supercell -===================================== - -.. currentmodule:: pywindow.trajectory - -.. autofunction:: create_supercell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.deepcopy.rst b/docs/source/_autosummary/pywindow.trajectory.deepcopy.rst deleted file mode 100644 index b2554d3..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.deepcopy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.trajectory.deepcopy -============================ - -.. currentmodule:: pywindow.trajectory - -.. autofunction:: deepcopy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.is_number.rst b/docs/source/_autosummary/pywindow.trajectory.is_number.rst deleted file mode 100644 index 187f18b..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.is_number.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.trajectory.is\_number -============================== - -.. currentmodule:: pywindow.trajectory - -.. autofunction:: is_number \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.lattice_array_to_unit_cell.rst b/docs/source/_autosummary/pywindow.trajectory.lattice_array_to_unit_cell.rst deleted file mode 100644 index c9b9a5d..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.lattice_array_to_unit_cell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.trajectory.lattice\_array\_to\_unit\_cell -================================================== - -.. currentmodule:: pywindow.trajectory - -.. autofunction:: lattice_array_to_unit_cell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.make_supercell.rst b/docs/source/_autosummary/pywindow.trajectory.make_supercell.rst deleted file mode 100644 index fb97065..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.make_supercell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.trajectory.make\_supercell -=================================== - -.. currentmodule:: pywindow.trajectory - -.. autofunction:: make_supercell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.mmap.rst b/docs/source/_autosummary/pywindow.trajectory.mmap.rst deleted file mode 100644 index 9ce64be..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.mmap.rst +++ /dev/null @@ -1,47 +0,0 @@ -pywindow.trajectory.mmap -======================== - -.. currentmodule:: pywindow.trajectory - -.. autoclass:: mmap - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~mmap.close - ~mmap.find - ~mmap.flush - ~mmap.madvise - ~mmap.move - ~mmap.read - ~mmap.read_byte - ~mmap.readline - ~mmap.resize - ~mmap.rfind - ~mmap.seek - ~mmap.seekable - ~mmap.size - ~mmap.tell - ~mmap.write - ~mmap.write_byte - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~mmap.closed - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.trajectory.rst b/docs/source/_autosummary/pywindow.trajectory.rst deleted file mode 100644 index 59dce4a..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.rst +++ /dev/null @@ -1,54 +0,0 @@ -pywindow.trajectory -=================== - -.. automodule:: pywindow.trajectory - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: class.rst - :nosignatures: - - DLPOLY - Input - MolecularSystem - Output - PDB - XYZ - closing - mmap - - - - - - - .. rubric:: Functions - - .. autosummary:: - :toctree: - :nosignatures: - - Pool - create_supercell - deepcopy - is_number - lattice_array_to_unit_cell - make_supercell - to_list - - - - - - - - - diff --git a/docs/source/_autosummary/pywindow.trajectory.to_list.rst b/docs/source/_autosummary/pywindow.trajectory.to_list.rst deleted file mode 100644 index f42fd8d..0000000 --- a/docs/source/_autosummary/pywindow.trajectory.to_list.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.trajectory.to\_list -============================ - -.. currentmodule:: pywindow.trajectory - -.. autofunction:: to_list \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.unique.rst b/docs/source/_autosummary/pywindow.unique.rst deleted file mode 100644 index 6e786e0..0000000 --- a/docs/source/_autosummary/pywindow.unique.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.unique -=============== - -.. currentmodule:: pywindow - -.. autofunction:: unique \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.unit_cell_to_lattice_array.rst b/docs/source/_autosummary/pywindow.unit_cell_to_lattice_array.rst deleted file mode 100644 index 3a1b8d4..0000000 --- a/docs/source/_autosummary/pywindow.unit_cell_to_lattice_array.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.unit\_cell\_to\_lattice\_array -======================================= - -.. currentmodule:: pywindow - -.. autofunction:: unit_cell_to_lattice_array \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.DBSCAN.rst b/docs/source/_autosummary/pywindow.utilities.DBSCAN.rst deleted file mode 100644 index b6eb13c..0000000 --- a/docs/source/_autosummary/pywindow.utilities.DBSCAN.rst +++ /dev/null @@ -1,28 +0,0 @@ -pywindow.utilities.DBSCAN -========================= - -.. currentmodule:: pywindow.utilities - -.. autoclass:: DBSCAN - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - ~DBSCAN.fit - ~DBSCAN.fit_predict - ~DBSCAN.set_fit_request - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.KDTree.rst b/docs/source/_autosummary/pywindow.utilities.KDTree.rst deleted file mode 100644 index 1a845c8..0000000 --- a/docs/source/_autosummary/pywindow.utilities.KDTree.rst +++ /dev/null @@ -1,37 +0,0 @@ -pywindow.utilities.KDTree -========================= - -.. currentmodule:: pywindow.utilities - -.. autoclass:: KDTree - :members: - :inherited-members: - :undoc-members: - :show-inheritance: - - - - - .. rubric:: Methods - - .. autosummary:: - :nosignatures: - - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~KDTree.data - ~KDTree.idx_array - ~KDTree.node_bounds - ~KDTree.node_data - ~KDTree.sample_weight - ~KDTree.sum_weight - ~KDTree.valid_metrics - - \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.Pool.rst b/docs/source/_autosummary/pywindow.utilities.Pool.rst deleted file mode 100644 index f63e969..0000000 --- a/docs/source/_autosummary/pywindow.utilities.Pool.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.Pool -======================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: Pool \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.acylidricity.rst b/docs/source/_autosummary/pywindow.utilities.acylidricity.rst deleted file mode 100644 index 5d3f8b0..0000000 --- a/docs/source/_autosummary/pywindow.utilities.acylidricity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.acylidricity -=============================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: acylidricity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.align_principal_ax.rst b/docs/source/_autosummary/pywindow.utilities.align_principal_ax.rst deleted file mode 100644 index c585747..0000000 --- a/docs/source/_autosummary/pywindow.utilities.align_principal_ax.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.align\_principal\_ax -======================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: align_principal_ax \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.angle_between_vectors.rst b/docs/source/_autosummary/pywindow.utilities.angle_between_vectors.rst deleted file mode 100644 index 311179c..0000000 --- a/docs/source/_autosummary/pywindow.utilities.angle_between_vectors.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.angle\_between\_vectors -========================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: angle_between_vectors \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.asphericity.rst b/docs/source/_autosummary/pywindow.utilities.asphericity.rst deleted file mode 100644 index 50be104..0000000 --- a/docs/source/_autosummary/pywindow.utilities.asphericity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.asphericity -============================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: asphericity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.brute.rst b/docs/source/_autosummary/pywindow.utilities.brute.rst deleted file mode 100644 index 9eb5d76..0000000 --- a/docs/source/_autosummary/pywindow.utilities.brute.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.brute -======================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: brute \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.calc_acylidricity.rst b/docs/source/_autosummary/pywindow.utilities.calc_acylidricity.rst deleted file mode 100644 index b396abf..0000000 --- a/docs/source/_autosummary/pywindow.utilities.calc_acylidricity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.calc\_acylidricity -===================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: calc_acylidricity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.calc_asphericity.rst b/docs/source/_autosummary/pywindow.utilities.calc_asphericity.rst deleted file mode 100644 index ac8dced..0000000 --- a/docs/source/_autosummary/pywindow.utilities.calc_asphericity.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.calc\_asphericity -==================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: calc_asphericity \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.calc_relative_shape_anisotropy.rst b/docs/source/_autosummary/pywindow.utilities.calc_relative_shape_anisotropy.rst deleted file mode 100644 index 6325d25..0000000 --- a/docs/source/_autosummary/pywindow.utilities.calc_relative_shape_anisotropy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.calc\_relative\_shape\_anisotropy -==================================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: calc_relative_shape_anisotropy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.calculate_pore_shape.rst b/docs/source/_autosummary/pywindow.utilities.calculate_pore_shape.rst deleted file mode 100644 index 9dc149b..0000000 --- a/docs/source/_autosummary/pywindow.utilities.calculate_pore_shape.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.calculate\_pore\_shape -========================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: calculate_pore_shape \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.calculate_window_diameter.rst b/docs/source/_autosummary/pywindow.utilities.calculate_window_diameter.rst deleted file mode 100644 index 07498b7..0000000 --- a/docs/source/_autosummary/pywindow.utilities.calculate_window_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.calculate\_window\_diameter -============================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: calculate_window_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.cart2frac_all.rst b/docs/source/_autosummary/pywindow.utilities.cart2frac_all.rst deleted file mode 100644 index d77e529..0000000 --- a/docs/source/_autosummary/pywindow.utilities.cart2frac_all.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.cart2frac\_all -================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: cart2frac_all \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.cartisian_from_fractional.rst b/docs/source/_autosummary/pywindow.utilities.cartisian_from_fractional.rst deleted file mode 100644 index 5d5a5ea..0000000 --- a/docs/source/_autosummary/pywindow.utilities.cartisian_from_fractional.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.cartisian\_from\_fractional -============================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: cartisian_from_fractional \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.center_of_coor.rst b/docs/source/_autosummary/pywindow.utilities.center_of_coor.rst deleted file mode 100644 index a1d978a..0000000 --- a/docs/source/_autosummary/pywindow.utilities.center_of_coor.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.center\_of\_coor -=================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: center_of_coor \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.center_of_mass.rst b/docs/source/_autosummary/pywindow.utilities.center_of_mass.rst deleted file mode 100644 index 6c073c4..0000000 --- a/docs/source/_autosummary/pywindow.utilities.center_of_mass.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.center\_of\_mass -=================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: center_of_mass \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.circumcircle.rst b/docs/source/_autosummary/pywindow.utilities.circumcircle.rst deleted file mode 100644 index 8474470..0000000 --- a/docs/source/_autosummary/pywindow.utilities.circumcircle.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.circumcircle -=============================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: circumcircle \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.circumcircle_window.rst b/docs/source/_autosummary/pywindow.utilities.circumcircle_window.rst deleted file mode 100644 index 7c22de1..0000000 --- a/docs/source/_autosummary/pywindow.utilities.circumcircle_window.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.circumcircle\_window -======================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: circumcircle_window \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.compose_atom_list.rst b/docs/source/_autosummary/pywindow.utilities.compose_atom_list.rst deleted file mode 100644 index d8f55fa..0000000 --- a/docs/source/_autosummary/pywindow.utilities.compose_atom_list.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.compose\_atom\_list -====================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: compose_atom_list \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.correct_pore_diameter.rst b/docs/source/_autosummary/pywindow.utilities.correct_pore_diameter.rst deleted file mode 100644 index be9cd4c..0000000 --- a/docs/source/_autosummary/pywindow.utilities.correct_pore_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.correct\_pore\_diameter -========================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: correct_pore_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.create_supercell.rst b/docs/source/_autosummary/pywindow.utilities.create_supercell.rst deleted file mode 100644 index 63eaf50..0000000 --- a/docs/source/_autosummary/pywindow.utilities.create_supercell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.create\_supercell -==================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: create_supercell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.decipher_atom_key.rst b/docs/source/_autosummary/pywindow.utilities.decipher_atom_key.rst deleted file mode 100644 index 30ff542..0000000 --- a/docs/source/_autosummary/pywindow.utilities.decipher_atom_key.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.decipher\_atom\_key -====================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: decipher_atom_key \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.decompose_atom_list.rst b/docs/source/_autosummary/pywindow.utilities.decompose_atom_list.rst deleted file mode 100644 index fcda63f..0000000 --- a/docs/source/_autosummary/pywindow.utilities.decompose_atom_list.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.decompose\_atom\_list -======================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: decompose_atom_list \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.deepcopy.rst b/docs/source/_autosummary/pywindow.utilities.deepcopy.rst deleted file mode 100644 index e882a3e..0000000 --- a/docs/source/_autosummary/pywindow.utilities.deepcopy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.deepcopy -=========================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: deepcopy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.discrete_molecules.rst b/docs/source/_autosummary/pywindow.utilities.discrete_molecules.rst deleted file mode 100644 index dc343eb..0000000 --- a/docs/source/_autosummary/pywindow.utilities.discrete_molecules.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.discrete\_molecules -====================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: discrete_molecules \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.distance.rst b/docs/source/_autosummary/pywindow.utilities.distance.rst deleted file mode 100644 index b4ed474..0000000 --- a/docs/source/_autosummary/pywindow.utilities.distance.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.distance -=========================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: distance \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.dlf_notation.rst b/docs/source/_autosummary/pywindow.utilities.dlf_notation.rst deleted file mode 100644 index 0f66ea7..0000000 --- a/docs/source/_autosummary/pywindow.utilities.dlf_notation.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.dlf\_notation -================================ - -.. currentmodule:: pywindow.utilities - -.. autofunction:: dlf_notation \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.euclidean_distances.rst b/docs/source/_autosummary/pywindow.utilities.euclidean_distances.rst deleted file mode 100644 index c9b4abb..0000000 --- a/docs/source/_autosummary/pywindow.utilities.euclidean_distances.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.euclidean\_distances -======================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: euclidean_distances \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.find_average_diameter.rst b/docs/source/_autosummary/pywindow.utilities.find_average_diameter.rst deleted file mode 100644 index 073c00e..0000000 --- a/docs/source/_autosummary/pywindow.utilities.find_average_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.find\_average\_diameter -========================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: find_average_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.find_windows.rst b/docs/source/_autosummary/pywindow.utilities.find_windows.rst deleted file mode 100644 index 2b19c76..0000000 --- a/docs/source/_autosummary/pywindow.utilities.find_windows.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.find\_windows -================================ - -.. currentmodule:: pywindow.utilities - -.. autofunction:: find_windows \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.find_windows_new.rst b/docs/source/_autosummary/pywindow.utilities.find_windows_new.rst deleted file mode 100644 index 2b3e9fa..0000000 --- a/docs/source/_autosummary/pywindow.utilities.find_windows_new.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.find\_windows\_new -===================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: find_windows_new \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.fmin.rst b/docs/source/_autosummary/pywindow.utilities.fmin.rst deleted file mode 100644 index 6a34a3f..0000000 --- a/docs/source/_autosummary/pywindow.utilities.fmin.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.fmin -======================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: fmin \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.frac2cart_all.rst b/docs/source/_autosummary/pywindow.utilities.frac2cart_all.rst deleted file mode 100644 index 1106e22..0000000 --- a/docs/source/_autosummary/pywindow.utilities.frac2cart_all.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.frac2cart\_all -================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: frac2cart_all \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.fractional_from_cartesian.rst b/docs/source/_autosummary/pywindow.utilities.fractional_from_cartesian.rst deleted file mode 100644 index dc0f584..0000000 --- a/docs/source/_autosummary/pywindow.utilities.fractional_from_cartesian.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.fractional\_from\_cartesian -============================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: fractional_from_cartesian \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.get_gyration_tensor.rst b/docs/source/_autosummary/pywindow.utilities.get_gyration_tensor.rst deleted file mode 100644 index 1e92db8..0000000 --- a/docs/source/_autosummary/pywindow.utilities.get_gyration_tensor.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.get\_gyration\_tensor -======================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: get_gyration_tensor \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.get_inertia_tensor.rst b/docs/source/_autosummary/pywindow.utilities.get_inertia_tensor.rst deleted file mode 100644 index 2868165..0000000 --- a/docs/source/_autosummary/pywindow.utilities.get_inertia_tensor.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.get\_inertia\_tensor -======================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: get_inertia_tensor \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.get_tensor_eigenvalues.rst b/docs/source/_autosummary/pywindow.utilities.get_tensor_eigenvalues.rst deleted file mode 100644 index 51587b4..0000000 --- a/docs/source/_autosummary/pywindow.utilities.get_tensor_eigenvalues.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.get\_tensor\_eigenvalues -=========================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: get_tensor_eigenvalues \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.get_window_com.rst b/docs/source/_autosummary/pywindow.utilities.get_window_com.rst deleted file mode 100644 index b2c1486..0000000 --- a/docs/source/_autosummary/pywindow.utilities.get_window_com.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.get\_window\_com -=================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: get_window_com \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.is_inside_polyhedron.rst b/docs/source/_autosummary/pywindow.utilities.is_inside_polyhedron.rst deleted file mode 100644 index 1ad1afb..0000000 --- a/docs/source/_autosummary/pywindow.utilities.is_inside_polyhedron.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.is\_inside\_polyhedron -========================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: is_inside_polyhedron \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.is_number.rst b/docs/source/_autosummary/pywindow.utilities.is_number.rst deleted file mode 100644 index 4fe6d47..0000000 --- a/docs/source/_autosummary/pywindow.utilities.is_number.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.is\_number -============================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: is_number \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.lattice_array_to_unit_cell.rst b/docs/source/_autosummary/pywindow.utilities.lattice_array_to_unit_cell.rst deleted file mode 100644 index 6185723..0000000 --- a/docs/source/_autosummary/pywindow.utilities.lattice_array_to_unit_cell.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.lattice\_array\_to\_unit\_cell -================================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: lattice_array_to_unit_cell \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.max_dim.rst b/docs/source/_autosummary/pywindow.utilities.max_dim.rst deleted file mode 100644 index 8472a50..0000000 --- a/docs/source/_autosummary/pywindow.utilities.max_dim.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.max\_dim -=========================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: max_dim \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.minimize.rst b/docs/source/_autosummary/pywindow.utilities.minimize.rst deleted file mode 100644 index 47651d3..0000000 --- a/docs/source/_autosummary/pywindow.utilities.minimize.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.minimize -=========================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: minimize \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.molecular_weight.rst b/docs/source/_autosummary/pywindow.utilities.molecular_weight.rst deleted file mode 100644 index 4f4a08c..0000000 --- a/docs/source/_autosummary/pywindow.utilities.molecular_weight.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.molecular\_weight -==================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: molecular_weight \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.normal_vector.rst b/docs/source/_autosummary/pywindow.utilities.normal_vector.rst deleted file mode 100644 index 4b9d81f..0000000 --- a/docs/source/_autosummary/pywindow.utilities.normal_vector.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.normal\_vector -================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: normal_vector \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.normalize_vector.rst b/docs/source/_autosummary/pywindow.utilities.normalize_vector.rst deleted file mode 100644 index 29fae25..0000000 --- a/docs/source/_autosummary/pywindow.utilities.normalize_vector.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.normalize\_vector -==================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: normalize_vector \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.opls_notation.rst b/docs/source/_autosummary/pywindow.utilities.opls_notation.rst deleted file mode 100644 index 077e429..0000000 --- a/docs/source/_autosummary/pywindow.utilities.opls_notation.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.opls\_notation -================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: opls_notation \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.opt_pore_diameter.rst b/docs/source/_autosummary/pywindow.utilities.opt_pore_diameter.rst deleted file mode 100644 index f7a53fe..0000000 --- a/docs/source/_autosummary/pywindow.utilities.opt_pore_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.opt\_pore\_diameter -====================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: opt_pore_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.optimise_xy.rst b/docs/source/_autosummary/pywindow.utilities.optimise_xy.rst deleted file mode 100644 index 20c2530..0000000 --- a/docs/source/_autosummary/pywindow.utilities.optimise_xy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.optimise\_xy -=============================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: optimise_xy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.optimise_z.rst b/docs/source/_autosummary/pywindow.utilities.optimise_z.rst deleted file mode 100644 index 2af1215..0000000 --- a/docs/source/_autosummary/pywindow.utilities.optimise_z.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.optimise\_z -============================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: optimise_z \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.pore_diameter.rst b/docs/source/_autosummary/pywindow.utilities.pore_diameter.rst deleted file mode 100644 index 00b42bd..0000000 --- a/docs/source/_autosummary/pywindow.utilities.pore_diameter.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.pore\_diameter -================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: pore_diameter \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.principal_axes.rst b/docs/source/_autosummary/pywindow.utilities.principal_axes.rst deleted file mode 100644 index bfaab25..0000000 --- a/docs/source/_autosummary/pywindow.utilities.principal_axes.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.principal\_axes -================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: principal_axes \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.relative_shape_anisotropy.rst b/docs/source/_autosummary/pywindow.utilities.relative_shape_anisotropy.rst deleted file mode 100644 index 86177b9..0000000 --- a/docs/source/_autosummary/pywindow.utilities.relative_shape_anisotropy.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.relative\_shape\_anisotropy -============================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: relative_shape_anisotropy \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.rotation_matrix_arbitrary_axis.rst b/docs/source/_autosummary/pywindow.utilities.rotation_matrix_arbitrary_axis.rst deleted file mode 100644 index 6917a90..0000000 --- a/docs/source/_autosummary/pywindow.utilities.rotation_matrix_arbitrary_axis.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.rotation\_matrix\_arbitrary\_axis -==================================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: rotation_matrix_arbitrary_axis \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.rst b/docs/source/_autosummary/pywindow.utilities.rst deleted file mode 100644 index a25275f..0000000 --- a/docs/source/_autosummary/pywindow.utilities.rst +++ /dev/null @@ -1,107 +0,0 @@ -pywindow.utilities -================== - -.. automodule:: pywindow.utilities - - - - - - - - .. rubric:: Classes - - .. autosummary:: - :toctree: - :template: class.rst - :nosignatures: - - DBSCAN - KDTree - - - - - - - .. rubric:: Functions - - .. autosummary:: - :toctree: - :nosignatures: - - Pool - acylidricity - align_principal_ax - angle_between_vectors - asphericity - brute - calc_acylidricity - calc_asphericity - calc_relative_shape_anisotropy - calculate_pore_shape - calculate_window_diameter - cart2frac_all - cartisian_from_fractional - center_of_coor - center_of_mass - circumcircle - circumcircle_window - compose_atom_list - correct_pore_diameter - create_supercell - decipher_atom_key - decompose_atom_list - deepcopy - discrete_molecules - distance - dlf_notation - euclidean_distances - find_average_diameter - find_windows - find_windows_new - fmin - frac2cart_all - fractional_from_cartesian - get_gyration_tensor - get_inertia_tensor - get_tensor_eigenvalues - get_window_com - is_inside_polyhedron - is_number - lattice_array_to_unit_cell - max_dim - minimize - molecular_weight - normal_vector - normalize_vector - opls_notation - opt_pore_diameter - optimise_xy - optimise_z - pore_diameter - principal_axes - relative_shape_anisotropy - rotation_matrix_arbitrary_axis - shift_com - sphere_volume - to_list - unique - unit_cell_to_lattice_array - vector_analysis - vector_analysis_pore_shape - vector_analysis_reversed - vector_preanalysis - volume_from_cell_parameters - volume_from_lattice_array - window_analysis - window_shape - - - - - - - - - diff --git a/docs/source/_autosummary/pywindow.utilities.shift_com.rst b/docs/source/_autosummary/pywindow.utilities.shift_com.rst deleted file mode 100644 index 918b415..0000000 --- a/docs/source/_autosummary/pywindow.utilities.shift_com.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.shift\_com -============================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: shift_com \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.sphere_volume.rst b/docs/source/_autosummary/pywindow.utilities.sphere_volume.rst deleted file mode 100644 index 4d416d4..0000000 --- a/docs/source/_autosummary/pywindow.utilities.sphere_volume.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.sphere\_volume -================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: sphere_volume \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.to_list.rst b/docs/source/_autosummary/pywindow.utilities.to_list.rst deleted file mode 100644 index 1be7aad..0000000 --- a/docs/source/_autosummary/pywindow.utilities.to_list.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.to\_list -=========================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: to_list \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.unique.rst b/docs/source/_autosummary/pywindow.utilities.unique.rst deleted file mode 100644 index bef9ad2..0000000 --- a/docs/source/_autosummary/pywindow.utilities.unique.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.unique -========================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: unique \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.unit_cell_to_lattice_array.rst b/docs/source/_autosummary/pywindow.utilities.unit_cell_to_lattice_array.rst deleted file mode 100644 index 6870d30..0000000 --- a/docs/source/_autosummary/pywindow.utilities.unit_cell_to_lattice_array.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.unit\_cell\_to\_lattice\_array -================================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: unit_cell_to_lattice_array \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.vector_analysis.rst b/docs/source/_autosummary/pywindow.utilities.vector_analysis.rst deleted file mode 100644 index f6b43a8..0000000 --- a/docs/source/_autosummary/pywindow.utilities.vector_analysis.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.vector\_analysis -=================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: vector_analysis \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.vector_analysis_pore_shape.rst b/docs/source/_autosummary/pywindow.utilities.vector_analysis_pore_shape.rst deleted file mode 100644 index d2b0eb6..0000000 --- a/docs/source/_autosummary/pywindow.utilities.vector_analysis_pore_shape.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.vector\_analysis\_pore\_shape -================================================ - -.. currentmodule:: pywindow.utilities - -.. autofunction:: vector_analysis_pore_shape \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.vector_analysis_reversed.rst b/docs/source/_autosummary/pywindow.utilities.vector_analysis_reversed.rst deleted file mode 100644 index 418f81c..0000000 --- a/docs/source/_autosummary/pywindow.utilities.vector_analysis_reversed.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.vector\_analysis\_reversed -============================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: vector_analysis_reversed \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.vector_preanalysis.rst b/docs/source/_autosummary/pywindow.utilities.vector_preanalysis.rst deleted file mode 100644 index ba8e609..0000000 --- a/docs/source/_autosummary/pywindow.utilities.vector_preanalysis.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.vector\_preanalysis -====================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: vector_preanalysis \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.volume_from_cell_parameters.rst b/docs/source/_autosummary/pywindow.utilities.volume_from_cell_parameters.rst deleted file mode 100644 index 554ad7f..0000000 --- a/docs/source/_autosummary/pywindow.utilities.volume_from_cell_parameters.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.volume\_from\_cell\_parameters -================================================= - -.. currentmodule:: pywindow.utilities - -.. autofunction:: volume_from_cell_parameters \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.volume_from_lattice_array.rst b/docs/source/_autosummary/pywindow.utilities.volume_from_lattice_array.rst deleted file mode 100644 index 5ed027f..0000000 --- a/docs/source/_autosummary/pywindow.utilities.volume_from_lattice_array.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.volume\_from\_lattice\_array -=============================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: volume_from_lattice_array \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.window_analysis.rst b/docs/source/_autosummary/pywindow.utilities.window_analysis.rst deleted file mode 100644 index 669a34c..0000000 --- a/docs/source/_autosummary/pywindow.utilities.window_analysis.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.window\_analysis -=================================== - -.. currentmodule:: pywindow.utilities - -.. autofunction:: window_analysis \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.utilities.window_shape.rst b/docs/source/_autosummary/pywindow.utilities.window_shape.rst deleted file mode 100644 index a1704fc..0000000 --- a/docs/source/_autosummary/pywindow.utilities.window_shape.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.utilities.window\_shape -================================ - -.. currentmodule:: pywindow.utilities - -.. autofunction:: window_shape \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.vector_analysis.rst b/docs/source/_autosummary/pywindow.vector_analysis.rst deleted file mode 100644 index 65a2c0c..0000000 --- a/docs/source/_autosummary/pywindow.vector_analysis.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.vector\_analysis -========================= - -.. currentmodule:: pywindow - -.. autofunction:: vector_analysis \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.vector_analysis_pore_shape.rst b/docs/source/_autosummary/pywindow.vector_analysis_pore_shape.rst deleted file mode 100644 index 1905021..0000000 --- a/docs/source/_autosummary/pywindow.vector_analysis_pore_shape.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.vector\_analysis\_pore\_shape -====================================== - -.. currentmodule:: pywindow - -.. autofunction:: vector_analysis_pore_shape \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.vector_analysis_reversed.rst b/docs/source/_autosummary/pywindow.vector_analysis_reversed.rst deleted file mode 100644 index cf1a33e..0000000 --- a/docs/source/_autosummary/pywindow.vector_analysis_reversed.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.vector\_analysis\_reversed -=================================== - -.. currentmodule:: pywindow - -.. autofunction:: vector_analysis_reversed \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.vector_preanalysis.rst b/docs/source/_autosummary/pywindow.vector_preanalysis.rst deleted file mode 100644 index be1b5e4..0000000 --- a/docs/source/_autosummary/pywindow.vector_preanalysis.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.vector\_preanalysis -============================ - -.. currentmodule:: pywindow - -.. autofunction:: vector_preanalysis \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.volume_from_cell_parameters.rst b/docs/source/_autosummary/pywindow.volume_from_cell_parameters.rst deleted file mode 100644 index 8ffcecf..0000000 --- a/docs/source/_autosummary/pywindow.volume_from_cell_parameters.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.volume\_from\_cell\_parameters -======================================= - -.. currentmodule:: pywindow - -.. autofunction:: volume_from_cell_parameters \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.volume_from_lattice_array.rst b/docs/source/_autosummary/pywindow.volume_from_lattice_array.rst deleted file mode 100644 index 0759387..0000000 --- a/docs/source/_autosummary/pywindow.volume_from_lattice_array.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.volume\_from\_lattice\_array -===================================== - -.. currentmodule:: pywindow - -.. autofunction:: volume_from_lattice_array \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.window_analysis.rst b/docs/source/_autosummary/pywindow.window_analysis.rst deleted file mode 100644 index 5250fb8..0000000 --- a/docs/source/_autosummary/pywindow.window_analysis.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.window\_analysis -========================= - -.. currentmodule:: pywindow - -.. autofunction:: window_analysis \ No newline at end of file diff --git a/docs/source/_autosummary/pywindow.window_shape.rst b/docs/source/_autosummary/pywindow.window_shape.rst deleted file mode 100644 index 5f07fd9..0000000 --- a/docs/source/_autosummary/pywindow.window_shape.rst +++ /dev/null @@ -1,6 +0,0 @@ -pywindow.window\_shape -====================== - -.. currentmodule:: pywindow - -.. autofunction:: window_shape \ No newline at end of file From 0da779fdcfd6f84b2430802cba0cb8ad5a832036 Mon Sep 17 00:00:00 2001 From: Andrew Tarzia Date: Sat, 7 Jun 2025 15:43:51 +0200 Subject: [PATCH 8/8] Add os import (temporary). --- src/pywindow/_internal/io_tools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pywindow/_internal/io_tools.py b/src/pywindow/_internal/io_tools.py index 4e49311..1bda98f 100644 --- a/src/pywindow/_internal/io_tools.py +++ b/src/pywindow/_internal/io_tools.py @@ -3,6 +3,7 @@ from __future__ import annotations import json +import os import numpy as np