partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
Plane.is_in_list
Checks whether the plane is identical to one of the Planes in the plane_list list of Planes :param plane_list: List of Planes to be compared to :return: True if the plane is in the list, False otherwise
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def is_in_list(self, plane_list): """ Checks whether the plane is identical to one of the Planes in the plane_list list of Planes :param plane_list: List of Planes to be compared to :return: True if the plane is in the list, False otherwise """ for plane in plane_list: ...
def is_in_list(self, plane_list): """ Checks whether the plane is identical to one of the Planes in the plane_list list of Planes :param plane_list: List of Planes to be compared to :return: True if the plane is in the list, False otherwise """ for plane in plane_list: ...
[ "Checks", "whether", "the", "plane", "is", "identical", "to", "one", "of", "the", "Planes", "in", "the", "plane_list", "list", "of", "Planes", ":", "param", "plane_list", ":", "List", "of", "Planes", "to", "be", "compared", "to", ":", "return", ":", "Tru...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L651-L660
[ "def", "is_in_list", "(", "self", ",", "plane_list", ")", ":", "for", "plane", "in", "plane_list", ":", "if", "self", ".", "is_same_plane_as", "(", "plane", ")", ":", "return", "True", "return", "False" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.indices_separate
Returns three lists containing the indices of the points lying on one side of the plane, on the plane and on the other side of the plane. The dist_tolerance parameter controls the tolerance to which a point is considered to lie on the plane or not (distance to the plane) :param points: list of p...
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def indices_separate(self, points, dist_tolerance): """ Returns three lists containing the indices of the points lying on one side of the plane, on the plane and on the other side of the plane. The dist_tolerance parameter controls the tolerance to which a point is considered to lie on t...
def indices_separate(self, points, dist_tolerance): """ Returns three lists containing the indices of the points lying on one side of the plane, on the plane and on the other side of the plane. The dist_tolerance parameter controls the tolerance to which a point is considered to lie on t...
[ "Returns", "three", "lists", "containing", "the", "indices", "of", "the", "points", "lying", "on", "one", "side", "of", "the", "plane", "on", "the", "plane", "and", "on", "the", "other", "side", "of", "the", "plane", ".", "The", "dist_tolerance", "paramete...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L662-L684
[ "def", "indices_separate", "(", "self", ",", "points", ",", "dist_tolerance", ")", ":", "side1", "=", "list", "(", ")", "inplane", "=", "list", "(", ")", "side2", "=", "list", "(", ")", "for", "ip", ",", "pp", "in", "enumerate", "(", "points", ")", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.distance_to_point
Computes the absolute distance from the plane to the point :param point: Point for which distance is computed :return: Distance between the plane and the point
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def distance_to_point(self, point): """ Computes the absolute distance from the plane to the point :param point: Point for which distance is computed :return: Distance between the plane and the point """ return np.abs(np.dot(self.normal_vector, point) + self.d)
def distance_to_point(self, point): """ Computes the absolute distance from the plane to the point :param point: Point for which distance is computed :return: Distance between the plane and the point """ return np.abs(np.dot(self.normal_vector, point) + self.d)
[ "Computes", "the", "absolute", "distance", "from", "the", "plane", "to", "the", "point", ":", "param", "point", ":", "Point", "for", "which", "distance", "is", "computed", ":", "return", ":", "Distance", "between", "the", "plane", "and", "the", "point" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L686-L692
[ "def", "distance_to_point", "(", "self", ",", "point", ")", ":", "return", "np", ".", "abs", "(", "np", ".", "dot", "(", "self", ".", "normal_vector", ",", "point", ")", "+", "self", ".", "d", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.distances
Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side :param points: Points for which distances are computed :return: Distances from the plane to the points (positive values on the...
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def distances(self, points): """ Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side :param points: Points for which distances are computed :return: Distances fro...
def distances(self, points): """ Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side :param points: Points for which distances are computed :return: Distances fro...
[ "Computes", "the", "distances", "from", "the", "plane", "to", "each", "of", "the", "points", ".", "Positive", "distances", "are", "on", "the", "side", "of", "the", "normal", "of", "the", "plane", "while", "negative", "distances", "are", "on", "the", "other...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L694-L702
[ "def", "distances", "(", "self", ",", "points", ")", ":", "return", "[", "np", ".", "dot", "(", "self", ".", "normal_vector", ",", "pp", ")", "+", "self", ".", "d", "for", "pp", "in", "points", "]" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.distances_indices_sorted
Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side. Indices sorting the points from closest to furthest is also computed. :param points: Points for which distances are computed ...
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def distances_indices_sorted(self, points, sign=False): """ Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side. Indices sorting the points from closest to furthest is al...
def distances_indices_sorted(self, points, sign=False): """ Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side. Indices sorting the points from closest to furthest is al...
[ "Computes", "the", "distances", "from", "the", "plane", "to", "each", "of", "the", "points", ".", "Positive", "distances", "are", "on", "the", "side", "of", "the", "normal", "of", "the", "plane", "while", "negative", "distances", "are", "on", "the", "other...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L704-L720
[ "def", "distances_indices_sorted", "(", "self", ",", "points", ",", "sign", "=", "False", ")", ":", "distances", "=", "[", "np", ".", "dot", "(", "self", ".", "normal_vector", ",", "pp", ")", "+", "self", ".", "d", "for", "pp", "in", "points", "]", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.distances_indices_groups
Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side. Indices sorting the points from closest to furthest is also computed. Grouped indices are also given, for which indices of the distan...
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def distances_indices_groups(self, points, delta=None, delta_factor=0.05, sign=False): """ Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side. Indices sorting the points from cl...
def distances_indices_groups(self, points, delta=None, delta_factor=0.05, sign=False): """ Computes the distances from the plane to each of the points. Positive distances are on the side of the normal of the plane while negative distances are on the other side. Indices sorting the points from cl...
[ "Computes", "the", "distances", "from", "the", "plane", "to", "each", "of", "the", "points", ".", "Positive", "distances", "are", "on", "the", "side", "of", "the", "normal", "of", "the", "plane", "while", "negative", "distances", "are", "on", "the", "other...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L722-L749
[ "def", "distances_indices_groups", "(", "self", ",", "points", ",", "delta", "=", "None", ",", "delta_factor", "=", "0.05", ",", "sign", "=", "False", ")", ":", "distances", ",", "indices", "=", "self", ".", "distances_indices_sorted", "(", "points", "=", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.projectionpoints
Projects each points in the point list pps on plane and returns the list of projected points :param pps: List of points to project on plane :return: List of projected point on plane
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def projectionpoints(self, pps): """ Projects each points in the point list pps on plane and returns the list of projected points :param pps: List of points to project on plane :return: List of projected point on plane """ return [pp - np.dot(pp - self.p1, self.normal_vec...
def projectionpoints(self, pps): """ Projects each points in the point list pps on plane and returns the list of projected points :param pps: List of points to project on plane :return: List of projected point on plane """ return [pp - np.dot(pp - self.p1, self.normal_vec...
[ "Projects", "each", "points", "in", "the", "point", "list", "pps", "on", "plane", "and", "returns", "the", "list", "of", "projected", "points", ":", "param", "pps", ":", "List", "of", "points", "to", "project", "on", "plane", ":", "return", ":", "List", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L751-L757
[ "def", "projectionpoints", "(", "self", ",", "pps", ")", ":", "return", "[", "pp", "-", "np", ".", "dot", "(", "pp", "-", "self", ".", "p1", ",", "self", ".", "normal_vector", ")", "*", "self", ".", "normal_vector", "for", "pp", "in", "pps", "]" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.orthonormal_vectors
Returns a list of three orthogonal vectors, the two first being parallel to the plane and the third one is the normal vector of the plane :return: List of orthogonal vectors :raise: ValueError if all the coefficients are zero or if there is some other strange error
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def orthonormal_vectors(self): """ Returns a list of three orthogonal vectors, the two first being parallel to the plane and the third one is the normal vector of the plane :return: List of orthogonal vectors :raise: ValueError if all the coefficients are zero or if there is some...
def orthonormal_vectors(self): """ Returns a list of three orthogonal vectors, the two first being parallel to the plane and the third one is the normal vector of the plane :return: List of orthogonal vectors :raise: ValueError if all the coefficients are zero or if there is some...
[ "Returns", "a", "list", "of", "three", "orthogonal", "vectors", "the", "two", "first", "being", "parallel", "to", "the", "plane", "and", "the", "third", "one", "is", "the", "normal", "vector", "of", "the", "plane", ":", "return", ":", "List", "of", "orth...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L759-L770
[ "def", "orthonormal_vectors", "(", "self", ")", ":", "if", "self", ".", "e1", "is", "None", ":", "diff", "=", "self", ".", "p2", "-", "self", ".", "p1", "self", ".", "e1", "=", "diff", "/", "norm", "(", "diff", ")", "self", ".", "e2", "=", "np"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.orthonormal_vectors_old
Returns a list of three orthogonal vectors, the two first being parallel to the plane and the third one is the normal vector of the plane :return: List of orthogonal vectors :raise: ValueError if all the coefficients are zero or if there is some other strange error
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def orthonormal_vectors_old(self): """ Returns a list of three orthogonal vectors, the two first being parallel to the plane and the third one is the normal vector of the plane :return: List of orthogonal vectors :raise: ValueError if all the coefficients are zero or if there is ...
def orthonormal_vectors_old(self): """ Returns a list of three orthogonal vectors, the two first being parallel to the plane and the third one is the normal vector of the plane :return: List of orthogonal vectors :raise: ValueError if all the coefficients are zero or if there is ...
[ "Returns", "a", "list", "of", "three", "orthogonal", "vectors", "the", "two", "first", "being", "parallel", "to", "the", "plane", "and", "the", "third", "one", "is", "the", "normal", "vector", "of", "the", "plane", ":", "return", ":", "List", "of", "orth...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L772-L790
[ "def", "orthonormal_vectors_old", "(", "self", ")", ":", "if", "self", ".", "e1", "is", "None", ":", "imax", "=", "np", ".", "argmax", "(", "np", ".", "abs", "(", "self", ".", "normal_vector", ")", ")", "if", "imax", "==", "0", ":", "self", ".", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.project_and_to2dim_ordered_indices
Projects each points in the point list pps on plane and returns the indices that would sort the list of projected points in anticlockwise order :param pps: List of points to project on plane :return: List of indices that would sort the list of projected points
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def project_and_to2dim_ordered_indices(self, pps, plane_center='mean'): """ Projects each points in the point list pps on plane and returns the indices that would sort the list of projected points in anticlockwise order :param pps: List of points to project on plane :return: List...
def project_and_to2dim_ordered_indices(self, pps, plane_center='mean'): """ Projects each points in the point list pps on plane and returns the indices that would sort the list of projected points in anticlockwise order :param pps: List of points to project on plane :return: List...
[ "Projects", "each", "points", "in", "the", "point", "list", "pps", "on", "plane", "and", "returns", "the", "indices", "that", "would", "sort", "the", "list", "of", "projected", "points", "in", "anticlockwise", "order", ":", "param", "pps", ":", "List", "of...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L793-L801
[ "def", "project_and_to2dim_ordered_indices", "(", "self", ",", "pps", ",", "plane_center", "=", "'mean'", ")", ":", "pp2d", "=", "self", ".", "project_and_to2dim", "(", "pps", ",", "plane_center", ")", "return", "anticlockwise_sort_indices", "(", "pp2d", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Plane.project_and_to2dim
Projects the list of points pps to the plane and changes the basis from 3D to the 2D basis of the plane :param pps: List of points to be projected :return: :raise:
pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py
def project_and_to2dim(self, pps, plane_center): """ Projects the list of points pps to the plane and changes the basis from 3D to the 2D basis of the plane :param pps: List of points to be projected :return: :raise: """ proj = self.projectionpoints(pps) [u1, u2, ...
def project_and_to2dim(self, pps, plane_center): """ Projects the list of points pps to the plane and changes the basis from 3D to the 2D basis of the plane :param pps: List of points to be projected :return: :raise: """ proj = self.projectionpoints(pps) [u1, u2, ...
[ "Projects", "the", "list", "of", "points", "pps", "to", "the", "plane", "and", "changes", "the", "basis", "from", "3D", "to", "the", "2D", "basis", "of", "the", "plane", ":", "param", "pps", ":", "List", "of", "points", "to", "be", "projected", ":", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/chemenv/utils/coordination_geometry_utils.py#L803-L828
[ "def", "project_and_to2dim", "(", "self", ",", "pps", ",", "plane_center", ")", ":", "proj", "=", "self", ".", "projectionpoints", "(", "pps", ")", "[", "u1", ",", "u2", ",", "u3", "]", "=", "self", ".", "orthonormal_vectors", "(", ")", "PP", "=", "n...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
open_ring
Function to actually open a ring using OpenBabel's local opt. Given a molecule graph and a bond, convert the molecule graph into an OpenBabel molecule, remove the given bond, perform the local opt with the number of steps determined by self.steps, and then convert the resulting structure back into a molecul...
pymatgen/analysis/fragmenter.py
def open_ring(mol_graph, bond, opt_steps): """ Function to actually open a ring using OpenBabel's local opt. Given a molecule graph and a bond, convert the molecule graph into an OpenBabel molecule, remove the given bond, perform the local opt with the number of steps determined by self.steps, and t...
def open_ring(mol_graph, bond, opt_steps): """ Function to actually open a ring using OpenBabel's local opt. Given a molecule graph and a bond, convert the molecule graph into an OpenBabel molecule, remove the given bond, perform the local opt with the number of steps determined by self.steps, and t...
[ "Function", "to", "actually", "open", "a", "ring", "using", "OpenBabel", "s", "local", "opt", ".", "Given", "a", "molecule", "graph", "and", "a", "bond", "convert", "the", "molecule", "graph", "into", "an", "OpenBabel", "molecule", "remove", "the", "given", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/fragmenter.py#L153-L164
[ "def", "open_ring", "(", "mol_graph", ",", "bond", ",", "opt_steps", ")", ":", "obmol", "=", "BabelMolAdaptor", ".", "from_molecule_graph", "(", "mol_graph", ")", "obmol", ".", "remove_bond", "(", "bond", "[", "0", "]", "[", "0", "]", "+", "1", ",", "b...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Fragmenter._fragment_one_level
Perform one step of iterative fragmentation on a list of molecule graphs. Loop through the graphs, then loop through each graph's edges and attempt to remove that edge in order to obtain two disconnected subgraphs, aka two new fragments. If successful, check to see if the new fragments are alrea...
pymatgen/analysis/fragmenter.py
def _fragment_one_level(self, mol_graphs): """ Perform one step of iterative fragmentation on a list of molecule graphs. Loop through the graphs, then loop through each graph's edges and attempt to remove that edge in order to obtain two disconnected subgraphs, aka two new fragments. If ...
def _fragment_one_level(self, mol_graphs): """ Perform one step of iterative fragmentation on a list of molecule graphs. Loop through the graphs, then loop through each graph's edges and attempt to remove that edge in order to obtain two disconnected subgraphs, aka two new fragments. If ...
[ "Perform", "one", "step", "of", "iterative", "fragmentation", "on", "a", "list", "of", "molecule", "graphs", ".", "Loop", "through", "the", "graphs", "then", "loop", "through", "each", "graph", "s", "edges", "and", "attempt", "to", "remove", "that", "edge", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/fragmenter.py#L90-L126
[ "def", "_fragment_one_level", "(", "self", ",", "mol_graphs", ")", ":", "unique_fragments_on_this_level", "=", "[", "]", "for", "mol_graph", "in", "mol_graphs", ":", "for", "edge", "in", "mol_graph", ".", "graph", ".", "edges", ":", "bond", "=", "[", "(", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Fragmenter._open_all_rings
Having already generated all unique fragments that did not require ring opening, now we want to also obtain fragments that do require opening. We achieve this by looping through all unique fragments and opening each bond present in any ring we find. We also temporarily add the principle molecule...
pymatgen/analysis/fragmenter.py
def _open_all_rings(self): """ Having already generated all unique fragments that did not require ring opening, now we want to also obtain fragments that do require opening. We achieve this by looping through all unique fragments and opening each bond present in any ring we find....
def _open_all_rings(self): """ Having already generated all unique fragments that did not require ring opening, now we want to also obtain fragments that do require opening. We achieve this by looping through all unique fragments and opening each bond present in any ring we find....
[ "Having", "already", "generated", "all", "unique", "fragments", "that", "did", "not", "require", "ring", "opening", "now", "we", "want", "to", "also", "obtain", "fragments", "that", "do", "require", "opening", ".", "We", "achieve", "this", "by", "looping", "...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/fragmenter.py#L128-L151
[ "def", "_open_all_rings", "(", "self", ")", ":", "self", ".", "unique_fragments", ".", "insert", "(", "0", ",", "self", ".", "mol_graph", ")", "for", "fragment", "in", "self", ".", "unique_fragments", ":", "ring_edges", "=", "fragment", ".", "find_rings", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Cohp.as_dict
Json-serializable dict representation of COHP.
pymatgen/electronic_structure/cohp.py
def as_dict(self): """ Json-serializable dict representation of COHP. """ d = {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "are_coops": self.are_coops, "efermi": self.efermi, "energies": self.energies.tolist...
def as_dict(self): """ Json-serializable dict representation of COHP. """ d = {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "are_coops": self.are_coops, "efermi": self.efermi, "energies": self.energies.tolist...
[ "Json", "-", "serializable", "dict", "representation", "of", "COHP", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L109-L123
[ "def", "as_dict", "(", "self", ")", ":", "d", "=", "{", "\"@module\"", ":", "self", ".", "__class__", ".", "__module__", ",", "\"@class\"", ":", "self", ".", "__class__", ".", "__name__", ",", "\"are_coops\"", ":", "self", ".", "are_coops", ",", "\"eferm...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Cohp.get_cohp
Returns the COHP or ICOHP for a particular spin. Args: spin: Spin. Can be parsed as spin object, integer (-1/1) or str ("up"/"down") integrated: Return COHP (False) or ICOHP (True) Returns: Returns the CHOP or ICOHP for the input spin. If Spin is ...
pymatgen/electronic_structure/cohp.py
def get_cohp(self, spin=None, integrated=False): """ Returns the COHP or ICOHP for a particular spin. Args: spin: Spin. Can be parsed as spin object, integer (-1/1) or str ("up"/"down") integrated: Return COHP (False) or ICOHP (True) Returns: ...
def get_cohp(self, spin=None, integrated=False): """ Returns the COHP or ICOHP for a particular spin. Args: spin: Spin. Can be parsed as spin object, integer (-1/1) or str ("up"/"down") integrated: Return COHP (False) or ICOHP (True) Returns: ...
[ "Returns", "the", "COHP", "or", "ICOHP", "for", "a", "particular", "spin", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L125-L154
[ "def", "get_cohp", "(", "self", ",", "spin", "=", "None", ",", "integrated", "=", "False", ")", ":", "if", "not", "integrated", ":", "populations", "=", "self", ".", "cohp", "else", ":", "populations", "=", "self", ".", "icohp", "if", "populations", "i...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Cohp.get_interpolated_value
Returns the COHP for a particular energy. Args: energy: Energy to return the COHP value for.
pymatgen/electronic_structure/cohp.py
def get_interpolated_value(self, energy, integrated=False): """ Returns the COHP for a particular energy. Args: energy: Energy to return the COHP value for. """ inter = {} for spin in self.cohp: if not integrated: inter[spin] = get...
def get_interpolated_value(self, energy, integrated=False): """ Returns the COHP for a particular energy. Args: energy: Energy to return the COHP value for. """ inter = {} for spin in self.cohp: if not integrated: inter[spin] = get...
[ "Returns", "the", "COHP", "for", "a", "particular", "energy", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L162-L181
[ "def", "get_interpolated_value", "(", "self", ",", "energy", ",", "integrated", "=", "False", ")", ":", "inter", "=", "{", "}", "for", "spin", "in", "self", ".", "cohp", ":", "if", "not", "integrated", ":", "inter", "[", "spin", "]", "=", "get_linear_i...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Cohp.has_antibnd_states_below_efermi
Returns dict indicating if there are antibonding states below the Fermi level depending on the spin spin: Spin limit: -COHP smaller -limit will be considered.
pymatgen/electronic_structure/cohp.py
def has_antibnd_states_below_efermi(self, spin=None, limit=0.01): """ Returns dict indicating if there are antibonding states below the Fermi level depending on the spin spin: Spin limit: -COHP smaller -limit will be considered. """ warnings.warn("This method has...
def has_antibnd_states_below_efermi(self, spin=None, limit=0.01): """ Returns dict indicating if there are antibonding states below the Fermi level depending on the spin spin: Spin limit: -COHP smaller -limit will be considered. """ warnings.warn("This method has...
[ "Returns", "dict", "indicating", "if", "there", "are", "antibonding", "states", "below", "the", "Fermi", "level", "depending", "on", "the", "spin", "spin", ":", "Spin", "limit", ":", "-", "COHP", "smaller", "-", "limit", "will", "be", "considered", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L183-L216
[ "def", "has_antibnd_states_below_efermi", "(", "self", ",", "spin", "=", "None", ",", "limit", "=", "0.01", ")", ":", "warnings", ".", "warn", "(", "\"This method has not been tested on many examples. Check the parameter limit, pls!\"", ")", "populations", "=", "self", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Cohp.from_dict
Returns a COHP object from a dict representation of the COHP.
pymatgen/electronic_structure/cohp.py
def from_dict(cls, d): """ Returns a COHP object from a dict representation of the COHP. """ if "ICOHP" in d: icohp = {Spin(int(key)): np.array(val) for key, val in d["ICOHP"].items()} else: icohp = None return Cohp(d["efermi"...
def from_dict(cls, d): """ Returns a COHP object from a dict representation of the COHP. """ if "ICOHP" in d: icohp = {Spin(int(key)): np.array(val) for key, val in d["ICOHP"].items()} else: icohp = None return Cohp(d["efermi"...
[ "Returns", "a", "COHP", "object", "from", "a", "dict", "representation", "of", "the", "COHP", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L219-L232
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "if", "\"ICOHP\"", "in", "d", ":", "icohp", "=", "{", "Spin", "(", "int", "(", "key", ")", ")", ":", "np", ".", "array", "(", "val", ")", "for", "key", ",", "val", "in", "d", "[", "\"ICOHP\"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
CompleteCohp.as_dict
Json-serializable dict representation of CompleteCohp.
pymatgen/electronic_structure/cohp.py
def as_dict(self): """ Json-serializable dict representation of CompleteCohp. """ d = {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "are_coops": self.are_coops, "efermi": self.efermi, "structure": self.struct...
def as_dict(self): """ Json-serializable dict representation of CompleteCohp. """ d = {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "are_coops": self.are_coops, "efermi": self.efermi, "structure": self.struct...
[ "Json", "-", "serializable", "dict", "representation", "of", "CompleteCohp", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L307-L360
[ "def", "as_dict", "(", "self", ")", ":", "d", "=", "{", "\"@module\"", ":", "self", ".", "__class__", ".", "__module__", ",", "\"@class\"", ":", "self", ".", "__class__", ".", "__name__", ",", "\"are_coops\"", ":", "self", ".", "are_coops", ",", "\"eferm...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
CompleteCohp.get_cohp_by_label
Get specific COHP object. Args: label: string (for newer Lobster versions: a number) Returns: Returns the COHP object to simplify plotting
pymatgen/electronic_structure/cohp.py
def get_cohp_by_label(self, label): """ Get specific COHP object. Args: label: string (for newer Lobster versions: a number) Returns: Returns the COHP object to simplify plotting """ if label.lower() == "average": return Cohp(efermi=s...
def get_cohp_by_label(self, label): """ Get specific COHP object. Args: label: string (for newer Lobster versions: a number) Returns: Returns the COHP object to simplify plotting """ if label.lower() == "average": return Cohp(efermi=s...
[ "Get", "specific", "COHP", "object", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L362-L383
[ "def", "get_cohp_by_label", "(", "self", ",", "label", ")", ":", "if", "label", ".", "lower", "(", ")", "==", "\"average\"", ":", "return", "Cohp", "(", "efermi", "=", "self", ".", "efermi", ",", "energies", "=", "self", ".", "energies", ",", "cohp", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
CompleteCohp.get_summed_cohp_by_label_list
Returns a COHP object that includes a summed COHP divided by divisor Args: label_list: list of labels for the COHP that should be included in the summed cohp divisor: float/int, the summed cohp will be divided by this divisor Returns: Returns a COHP object including ...
pymatgen/electronic_structure/cohp.py
def get_summed_cohp_by_label_list(self, label_list, divisor=1): """ Returns a COHP object that includes a summed COHP divided by divisor Args: label_list: list of labels for the COHP that should be included in the summed cohp divisor: float/int, the summed cohp will be d...
def get_summed_cohp_by_label_list(self, label_list, divisor=1): """ Returns a COHP object that includes a summed COHP divided by divisor Args: label_list: list of labels for the COHP that should be included in the summed cohp divisor: float/int, the summed cohp will be d...
[ "Returns", "a", "COHP", "object", "that", "includes", "a", "summed", "COHP", "divided", "by", "divisor" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L385-L418
[ "def", "get_summed_cohp_by_label_list", "(", "self", ",", "label_list", ",", "divisor", "=", "1", ")", ":", "# check if cohps are spinpolarized or not", "first_cohpobject", "=", "self", ".", "get_cohp_by_label", "(", "label_list", "[", "0", "]", ")", "summed_cohp", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
CompleteCohp.get_summed_cohp_by_label_and_orbital_list
Returns a COHP object that includes a summed COHP divided by divisor Args: label_list: list of labels for the COHP that should be included in the summed cohp orbital_list: list of orbitals for the COHPs that should be included in the summed cohp (same order as label_list) di...
pymatgen/electronic_structure/cohp.py
def get_summed_cohp_by_label_and_orbital_list(self, label_list, orbital_list, divisor=1): """ Returns a COHP object that includes a summed COHP divided by divisor Args: label_list: list of labels for the COHP that should be included in the summed cohp orbital_list: list ...
def get_summed_cohp_by_label_and_orbital_list(self, label_list, orbital_list, divisor=1): """ Returns a COHP object that includes a summed COHP divided by divisor Args: label_list: list of labels for the COHP that should be included in the summed cohp orbital_list: list ...
[ "Returns", "a", "COHP", "object", "that", "includes", "a", "summed", "COHP", "divided", "by", "divisor" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L420-L454
[ "def", "get_summed_cohp_by_label_and_orbital_list", "(", "self", ",", "label_list", ",", "orbital_list", ",", "divisor", "=", "1", ")", ":", "# check if cohps are spinpolarized or not", "first_cohpobject", "=", "self", ".", "get_orbital_resolved_cohp", "(", "label_list", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
CompleteCohp.get_orbital_resolved_cohp
Get orbital-resolved COHP. Args: label: bond label (Lobster: labels as in ICOHPLIST/ICOOPLIST.lobster). orbitals: The orbitals as a label, or list or tuple of the form [(n1, orbital1), (n2, orbital2)]. Orbitals can either be str, int, or Orbital. ...
pymatgen/electronic_structure/cohp.py
def get_orbital_resolved_cohp(self, label, orbitals): """ Get orbital-resolved COHP. Args: label: bond label (Lobster: labels as in ICOHPLIST/ICOOPLIST.lobster). orbitals: The orbitals as a label, or list or tuple of the form [(n1, orbital1), (n2, orbita...
def get_orbital_resolved_cohp(self, label, orbitals): """ Get orbital-resolved COHP. Args: label: bond label (Lobster: labels as in ICOHPLIST/ICOOPLIST.lobster). orbitals: The orbitals as a label, or list or tuple of the form [(n1, orbital1), (n2, orbita...
[ "Get", "orbital", "-", "resolved", "COHP", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L456-L502
[ "def", "get_orbital_resolved_cohp", "(", "self", ",", "label", ",", "orbitals", ")", ":", "if", "self", ".", "orb_res_cohp", "is", "None", ":", "return", "None", "elif", "isinstance", "(", "orbitals", ",", "list", ")", "or", "isinstance", "(", "orbitals", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
CompleteCohp.from_dict
Returns CompleteCohp object from dict representation.
pymatgen/electronic_structure/cohp.py
def from_dict(cls, d): """ Returns CompleteCohp object from dict representation. """ cohp_dict = {} efermi = d["efermi"] energies = d["energies"] structure = Structure.from_dict(d["structure"]) if "bonds" in d.keys(): bonds = {bond: {"length": ...
def from_dict(cls, d): """ Returns CompleteCohp object from dict representation. """ cohp_dict = {} efermi = d["efermi"] energies = d["energies"] structure = Structure.from_dict(d["structure"]) if "bonds" in d.keys(): bonds = {bond: {"length": ...
[ "Returns", "CompleteCohp", "object", "from", "dict", "representation", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L505-L596
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "cohp_dict", "=", "{", "}", "efermi", "=", "d", "[", "\"efermi\"", "]", "energies", "=", "d", "[", "\"energies\"", "]", "structure", "=", "Structure", ".", "from_dict", "(", "d", "[", "\"structure\"",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
CompleteCohp.from_file
Creates a CompleteCohp object from an output file of a COHP calculation. Valid formats are either LMTO (for the Stuttgart LMTO-ASA code) or LOBSTER (for the LOBSTER code). Args: cohp_file: Name of the COHP output file. Defaults to COPL for LMTO and COHPCAR.lobster/CO...
pymatgen/electronic_structure/cohp.py
def from_file(cls, fmt, filename=None, structure_file=None, are_coops=False): """ Creates a CompleteCohp object from an output file of a COHP calculation. Valid formats are either LMTO (for the Stuttgart LMTO-ASA code) or LOBSTER (for the LOBSTER code). Args: ...
def from_file(cls, fmt, filename=None, structure_file=None, are_coops=False): """ Creates a CompleteCohp object from an output file of a COHP calculation. Valid formats are either LMTO (for the Stuttgart LMTO-ASA code) or LOBSTER (for the LOBSTER code). Args: ...
[ "Creates", "a", "CompleteCohp", "object", "from", "an", "output", "file", "of", "a", "COHP", "calculation", ".", "Valid", "formats", "are", "either", "LMTO", "(", "for", "the", "Stuttgart", "LMTO", "-", "ASA", "code", ")", "or", "LOBSTER", "(", "for", "t...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L599-L716
[ "def", "from_file", "(", "cls", ",", "fmt", ",", "filename", "=", "None", ",", "structure_file", "=", "None", ",", "are_coops", "=", "False", ")", ":", "fmt", "=", "fmt", ".", "upper", "(", ")", "if", "fmt", "==", "\"LMTO\"", ":", "# LMTO COOPs and orb...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IcohpValue.icohpvalue
Args: spin: Spin.up or Spin.down Returns: icohpvalue (float) corresponding to chosen spin
pymatgen/electronic_structure/cohp.py
def icohpvalue(self, spin=Spin.up): """ Args: spin: Spin.up or Spin.down Returns: icohpvalue (float) corresponding to chosen spin """ if not self.is_spin_polarized and spin == Spin.down: raise ValueError("The calculation was not performed with ...
def icohpvalue(self, spin=Spin.up): """ Args: spin: Spin.up or Spin.down Returns: icohpvalue (float) corresponding to chosen spin """ if not self.is_spin_polarized and spin == Spin.down: raise ValueError("The calculation was not performed with ...
[ "Args", ":", "spin", ":", "Spin", ".", "up", "or", "Spin", ".", "down", "Returns", ":", "icohpvalue", "(", "float", ")", "corresponding", "to", "chosen", "spin" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L808-L818
[ "def", "icohpvalue", "(", "self", ",", "spin", "=", "Spin", ".", "up", ")", ":", "if", "not", "self", ".", "is_spin_polarized", "and", "spin", "==", "Spin", ".", "down", ":", "raise", "ValueError", "(", "\"The calculation was not performed with spin polarization...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IcohpValue.summed_icohp
Adds ICOHPs of both spin channels for spin polarized compounds Returns: icohp value in eV
pymatgen/electronic_structure/cohp.py
def summed_icohp(self): """ Adds ICOHPs of both spin channels for spin polarized compounds Returns: icohp value in eV """ if self._is_spin_polarized: sum_icohp = self._icohp[Spin.down] + self._icohp[Spin.up] else: sum_icohp = self._ico...
def summed_icohp(self): """ Adds ICOHPs of both spin channels for spin polarized compounds Returns: icohp value in eV """ if self._is_spin_polarized: sum_icohp = self._icohp[Spin.down] + self._icohp[Spin.up] else: sum_icohp = self._ico...
[ "Adds", "ICOHPs", "of", "both", "spin", "channels", "for", "spin", "polarized", "compounds", "Returns", ":", "icohp", "value", "in", "eV" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L830-L840
[ "def", "summed_icohp", "(", "self", ")", ":", "if", "self", ".", "_is_spin_polarized", ":", "sum_icohp", "=", "self", ".", "_icohp", "[", "Spin", ".", "down", "]", "+", "self", ".", "_icohp", "[", "Spin", ".", "up", "]", "else", ":", "sum_icohp", "="...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IcohpCollection.get_icohp_by_label
get an icohp value for a certain bond as indicated by the label (bond labels starting by "1" as in ICOHPLIST/ICOOPLIST) Args: label: label in str format (usually the bond number in Icohplist.lobster/Icooplist.lobster summed_spin_channels: Boolean to indicate whether the ICOHPs/ICOOPs of ...
pymatgen/electronic_structure/cohp.py
def get_icohp_by_label(self, label, summed_spin_channels=True, spin=Spin.up): """ get an icohp value for a certain bond as indicated by the label (bond labels starting by "1" as in ICOHPLIST/ICOOPLIST) Args: label: label in str format (usually the bond number in Icohplist.lobster/Ico...
def get_icohp_by_label(self, label, summed_spin_channels=True, spin=Spin.up): """ get an icohp value for a certain bond as indicated by the label (bond labels starting by "1" as in ICOHPLIST/ICOOPLIST) Args: label: label in str format (usually the bond number in Icohplist.lobster/Ico...
[ "get", "an", "icohp", "value", "for", "a", "certain", "bond", "as", "indicated", "by", "the", "label", "(", "bond", "labels", "starting", "by", "1", "as", "in", "ICOHPLIST", "/", "ICOOPLIST", ")", "Args", ":", "label", ":", "label", "in", "str", "forma...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L888-L907
[ "def", "get_icohp_by_label", "(", "self", ",", "label", ",", "summed_spin_channels", "=", "True", ",", "spin", "=", "Spin", ".", "up", ")", ":", "icohp_here", "=", "self", ".", "_icohplist", "[", "label", "]", "if", "icohp_here", ".", "_is_spin_polarized", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IcohpCollection.get_summed_icohp_by_label_list
get the sum of several ICOHP values that are indicated by a list of labels (labels of the bonds are the same as in ICOHPLIST/ICOOPLIST) Args: label_list: list of labels of the ICOHPs/ICOOPs that should be summed divisor: is used to divide the sum summed_spin_channels: Boolean...
pymatgen/electronic_structure/cohp.py
def get_summed_icohp_by_label_list(self, label_list, divisor=1.0, summed_spin_channels=True, spin=Spin.up): """ get the sum of several ICOHP values that are indicated by a list of labels (labels of the bonds are the same as in ICOHPLIST/ICOOPLIST) Args: label_list: list of labels of ...
def get_summed_icohp_by_label_list(self, label_list, divisor=1.0, summed_spin_channels=True, spin=Spin.up): """ get the sum of several ICOHP values that are indicated by a list of labels (labels of the bonds are the same as in ICOHPLIST/ICOOPLIST) Args: label_list: list of labels of ...
[ "get", "the", "sum", "of", "several", "ICOHP", "values", "that", "are", "indicated", "by", "a", "list", "of", "labels", "(", "labels", "of", "the", "bonds", "are", "the", "same", "as", "in", "ICOHPLIST", "/", "ICOOPLIST", ")", "Args", ":", "label_list", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L909-L934
[ "def", "get_summed_icohp_by_label_list", "(", "self", ",", "label_list", ",", "divisor", "=", "1.0", ",", "summed_spin_channels", "=", "True", ",", "spin", "=", "Spin", ".", "up", ")", ":", "sum_icohp", "=", "0", "for", "label", "in", "label_list", ":", "i...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IcohpCollection.get_icohp_dict_by_bondlengths
get a dict of IcohpValues corresponding to certaind bond lengths Args: minbondlength: defines the minimum of the bond lengths of the bonds maxbondlength: defines the maximum of the bond lengths of the bonds Returns: dict of IcohpValues, the keys correspond to the val...
pymatgen/electronic_structure/cohp.py
def get_icohp_dict_by_bondlengths(self, minbondlength=0.0, maxbondlength=8.0): """ get a dict of IcohpValues corresponding to certaind bond lengths Args: minbondlength: defines the minimum of the bond lengths of the bonds maxbondlength: defines the maximum of the bond len...
def get_icohp_dict_by_bondlengths(self, minbondlength=0.0, maxbondlength=8.0): """ get a dict of IcohpValues corresponding to certaind bond lengths Args: minbondlength: defines the minimum of the bond lengths of the bonds maxbondlength: defines the maximum of the bond len...
[ "get", "a", "dict", "of", "IcohpValues", "corresponding", "to", "certaind", "bond", "lengths", "Args", ":", "minbondlength", ":", "defines", "the", "minimum", "of", "the", "bond", "lengths", "of", "the", "bonds", "maxbondlength", ":", "defines", "the", "maximu...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L936-L949
[ "def", "get_icohp_dict_by_bondlengths", "(", "self", ",", "minbondlength", "=", "0.0", ",", "maxbondlength", "=", "8.0", ")", ":", "newicohp_dict", "=", "{", "}", "for", "value", "in", "self", ".", "_icohplist", ".", "values", "(", ")", ":", "if", "value",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IcohpCollection.get_icohp_dict_of_site
get a dict of IcohpValue for a certain site (indicated by integer) Args: site: integer describing the site of interest, order as in Icohplist.lobster/Icooplist.lobster, starts at 0 minsummedicohp: float, minimal icohp/icoop of the bonds that are considered. It is the summed ICOHP value f...
pymatgen/electronic_structure/cohp.py
def get_icohp_dict_of_site(self, site, minsummedicohp=None, maxsummedicohp=None, minbondlength=0.0, maxbondlength=8.0, only_bonds_to=None): """ get a dict of IcohpValue for a certain site (indicated by integer) Args: site: integer describing the site of...
def get_icohp_dict_of_site(self, site, minsummedicohp=None, maxsummedicohp=None, minbondlength=0.0, maxbondlength=8.0, only_bonds_to=None): """ get a dict of IcohpValue for a certain site (indicated by integer) Args: site: integer describing the site of...
[ "get", "a", "dict", "of", "IcohpValue", "for", "a", "certain", "site", "(", "indicated", "by", "integer", ")", "Args", ":", "site", ":", "integer", "describing", "the", "site", "of", "interest", "order", "as", "in", "Icohplist", ".", "lobster", "/", "Ico...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L951-L996
[ "def", "get_icohp_dict_of_site", "(", "self", ",", "site", ",", "minsummedicohp", "=", "None", ",", "maxsummedicohp", "=", "None", ",", "minbondlength", "=", "0.0", ",", "maxbondlength", "=", "8.0", ",", "only_bonds_to", "=", "None", ")", ":", "newicohp_dict",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IcohpCollection.extremum_icohpvalue
get ICOHP/ICOOP of strongest bond Args: summed_spin_channels: Boolean to indicate whether the ICOHPs/ICOOPs of both spin channels should be summed spin: if summed_spin_channels is equal to False, this spin indicates which spin channel should be returned Returns: lowe...
pymatgen/electronic_structure/cohp.py
def extremum_icohpvalue(self, summed_spin_channels=True, spin=Spin.up): """ get ICOHP/ICOOP of strongest bond Args: summed_spin_channels: Boolean to indicate whether the ICOHPs/ICOOPs of both spin channels should be summed spin: if summed_spin_channels is equal to False,...
def extremum_icohpvalue(self, summed_spin_channels=True, spin=Spin.up): """ get ICOHP/ICOOP of strongest bond Args: summed_spin_channels: Boolean to indicate whether the ICOHPs/ICOOPs of both spin channels should be summed spin: if summed_spin_channels is equal to False,...
[ "get", "ICOHP", "/", "ICOOP", "of", "strongest", "bond", "Args", ":", "summed_spin_channels", ":", "Boolean", "to", "indicate", "whether", "the", "ICOHPs", "/", "ICOOPs", "of", "both", "spin", "channels", "should", "be", "summed" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/cohp.py#L998-L1037
[ "def", "extremum_icohpvalue", "(", "self", ",", "summed_spin_channels", "=", "True", ",", "spin", "=", "Spin", ".", "up", ")", ":", "if", "not", "self", ".", "_are_coops", ":", "extremum", "=", "sys", ".", "float_info", ".", "max", "else", ":", "extremum...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Site.distance
Get distance between two sites. Args: other: Other site. Returns: Distance (float)
pymatgen/core/sites.py
def distance(self, other): """ Get distance between two sites. Args: other: Other site. Returns: Distance (float) """ return np.linalg.norm(other.coords - self.coords)
def distance(self, other): """ Get distance between two sites. Args: other: Other site. Returns: Distance (float) """ return np.linalg.norm(other.coords - self.coords)
[ "Get", "distance", "between", "two", "sites", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L130-L140
[ "def", "distance", "(", "self", ",", "other", ")", ":", "return", "np", ".", "linalg", ".", "norm", "(", "other", ".", "coords", "-", "self", ".", "coords", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Site.distance_from_point
Returns distance between the site and a point in space. Args: pt: Cartesian coordinates of point. Returns: Distance (float)
pymatgen/core/sites.py
def distance_from_point(self, pt): """ Returns distance between the site and a point in space. Args: pt: Cartesian coordinates of point. Returns: Distance (float) """ return np.linalg.norm(np.array(pt) - self.coords)
def distance_from_point(self, pt): """ Returns distance between the site and a point in space. Args: pt: Cartesian coordinates of point. Returns: Distance (float) """ return np.linalg.norm(np.array(pt) - self.coords)
[ "Returns", "distance", "between", "the", "site", "and", "a", "point", "in", "space", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L142-L152
[ "def", "distance_from_point", "(", "self", ",", "pt", ")", ":", "return", "np", ".", "linalg", ".", "norm", "(", "np", ".", "array", "(", "pt", ")", "-", "self", ".", "coords", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Site.species_string
String representation of species on the site.
pymatgen/core/sites.py
def species_string(self): """ String representation of species on the site. """ if self.is_ordered: return list(self.species.keys())[0].__str__() else: sorted_species = sorted(self.species.keys()) return ", ".join(["{}:{:.3f}".format(sp, self.s...
def species_string(self): """ String representation of species on the site. """ if self.is_ordered: return list(self.species.keys())[0].__str__() else: sorted_species = sorted(self.species.keys()) return ", ".join(["{}:{:.3f}".format(sp, self.s...
[ "String", "representation", "of", "species", "on", "the", "site", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L155-L164
[ "def", "species_string", "(", "self", ")", ":", "if", "self", ".", "is_ordered", ":", "return", "list", "(", "self", ".", "species", ".", "keys", "(", ")", ")", "[", "0", "]", ".", "__str__", "(", ")", "else", ":", "sorted_species", "=", "sorted", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Site.is_ordered
True if site is an ordered site, i.e., with a single species with occupancy 1.
pymatgen/core/sites.py
def is_ordered(self): """ True if site is an ordered site, i.e., with a single species with occupancy 1. """ totaloccu = self.species.num_atoms return totaloccu == 1 and len(self.species) == 1
def is_ordered(self): """ True if site is an ordered site, i.e., with a single species with occupancy 1. """ totaloccu = self.species.num_atoms return totaloccu == 1 and len(self.species) == 1
[ "True", "if", "site", "is", "an", "ordered", "site", "i", ".", "e", ".", "with", "a", "single", "species", "with", "occupancy", "1", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L191-L197
[ "def", "is_ordered", "(", "self", ")", ":", "totaloccu", "=", "self", ".", "species", ".", "num_atoms", "return", "totaloccu", "==", "1", "and", "len", "(", "self", ".", "species", ")", "==", "1" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Site.as_dict
Json-serializable dict representation for Site.
pymatgen/core/sites.py
def as_dict(self): """ Json-serializable dict representation for Site. """ species_list = [] for spec, occu in self.species.items(): d = spec.as_dict() del d["@module"] del d["@class"] d["occu"] = occu species_list.appen...
def as_dict(self): """ Json-serializable dict representation for Site. """ species_list = [] for spec, occu in self.species.items(): d = spec.as_dict() del d["@module"] del d["@class"] d["occu"] = occu species_list.appen...
[ "Json", "-", "serializable", "dict", "representation", "for", "Site", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L254-L272
[ "def", "as_dict", "(", "self", ")", ":", "species_list", "=", "[", "]", "for", "spec", ",", "occu", "in", "self", ".", "species", ".", "items", "(", ")", ":", "d", "=", "spec", ".", "as_dict", "(", ")", "del", "d", "[", "\"@module\"", "]", "del",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Site.from_dict
Create Site from dict representation
pymatgen/core/sites.py
def from_dict(cls, d): """ Create Site from dict representation """ atoms_n_occu = {} for sp_occu in d["species"]: if "oxidation_state" in sp_occu and Element.is_valid_symbol( sp_occu["element"]): sp = Specie.from_dict(sp_occu) ...
def from_dict(cls, d): """ Create Site from dict representation """ atoms_n_occu = {} for sp_occu in d["species"]: if "oxidation_state" in sp_occu and Element.is_valid_symbol( sp_occu["element"]): sp = Specie.from_dict(sp_occu) ...
[ "Create", "Site", "from", "dict", "representation" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L275-L290
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "atoms_n_occu", "=", "{", "}", "for", "sp_occu", "in", "d", "[", "\"species\"", "]", ":", "if", "\"oxidation_state\"", "in", "sp_occu", "and", "Element", ".", "is_valid_symbol", "(", "sp_occu", "[", "\"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
PeriodicSite.lattice
Sets Lattice associated with PeriodicSite
pymatgen/core/sites.py
def lattice(self, lattice): """ Sets Lattice associated with PeriodicSite """ self._lattice = lattice self._coords = self._lattice.get_cartesian_coords(self._frac_coords)
def lattice(self, lattice): """ Sets Lattice associated with PeriodicSite """ self._lattice = lattice self._coords = self._lattice.get_cartesian_coords(self._frac_coords)
[ "Sets", "Lattice", "associated", "with", "PeriodicSite" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L368-L373
[ "def", "lattice", "(", "self", ",", "lattice", ")", ":", "self", ".", "_lattice", "=", "lattice", "self", ".", "_coords", "=", "self", ".", "_lattice", ".", "get_cartesian_coords", "(", "self", ".", "_frac_coords", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
PeriodicSite.coords
Fractional a coordinate
pymatgen/core/sites.py
def coords(self, coords): """ Fractional a coordinate """ self._coords = np.array(coords) self._frac_coords = self._lattice.get_fractional_coords(self._coords)
def coords(self, coords): """ Fractional a coordinate """ self._coords = np.array(coords) self._frac_coords = self._lattice.get_fractional_coords(self._coords)
[ "Fractional", "a", "coordinate" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L383-L388
[ "def", "coords", "(", "self", ",", "coords", ")", ":", "self", ".", "_coords", "=", "np", ".", "array", "(", "coords", ")", "self", ".", "_frac_coords", "=", "self", ".", "_lattice", ".", "get_fractional_coords", "(", "self", ".", "_coords", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
PeriodicSite.frac_coords
Fractional a coordinate
pymatgen/core/sites.py
def frac_coords(self, frac_coords): """ Fractional a coordinate """ self._frac_coords = np.array(frac_coords) self._coords = self._lattice.get_cartesian_coords(self._frac_coords)
def frac_coords(self, frac_coords): """ Fractional a coordinate """ self._frac_coords = np.array(frac_coords) self._coords = self._lattice.get_cartesian_coords(self._frac_coords)
[ "Fractional", "a", "coordinate" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L398-L403
[ "def", "frac_coords", "(", "self", ",", "frac_coords", ")", ":", "self", ".", "_frac_coords", "=", "np", ".", "array", "(", "frac_coords", ")", "self", ".", "_coords", "=", "self", ".", "_lattice", ".", "get_cartesian_coords", "(", "self", ".", "_frac_coor...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
PeriodicSite.to_unit_cell
Move frac coords to within the unit cell cell.
pymatgen/core/sites.py
def to_unit_cell(self, in_place=False): """ Move frac coords to within the unit cell cell. """ frac_coords = np.mod(self.frac_coords, 1) if in_place: self.frac_coords = frac_coords else: return PeriodicSite(self.species, frac_coords, self.lattice, ...
def to_unit_cell(self, in_place=False): """ Move frac coords to within the unit cell cell. """ frac_coords = np.mod(self.frac_coords, 1) if in_place: self.frac_coords = frac_coords else: return PeriodicSite(self.species, frac_coords, self.lattice, ...
[ "Move", "frac", "coords", "to", "within", "the", "unit", "cell", "cell", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L477-L486
[ "def", "to_unit_cell", "(", "self", ",", "in_place", "=", "False", ")", ":", "frac_coords", "=", "np", ".", "mod", "(", "self", ".", "frac_coords", ",", "1", ")", "if", "in_place", ":", "self", ".", "frac_coords", "=", "frac_coords", "else", ":", "retu...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
PeriodicSite.is_periodic_image
Returns True if sites are periodic images of each other. Args: other (PeriodicSite): Other site tolerance (float): Tolerance to compare fractional coordinates check_lattice (bool): Whether to check if the two sites have the same lattice. Returns: ...
pymatgen/core/sites.py
def is_periodic_image(self, other, tolerance=1e-8, check_lattice=True): """ Returns True if sites are periodic images of each other. Args: other (PeriodicSite): Other site tolerance (float): Tolerance to compare fractional coordinates check_lattice (bool): Wh...
def is_periodic_image(self, other, tolerance=1e-8, check_lattice=True): """ Returns True if sites are periodic images of each other. Args: other (PeriodicSite): Other site tolerance (float): Tolerance to compare fractional coordinates check_lattice (bool): Wh...
[ "Returns", "True", "if", "sites", "are", "periodic", "images", "of", "each", "other", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L488-L507
[ "def", "is_periodic_image", "(", "self", ",", "other", ",", "tolerance", "=", "1e-8", ",", "check_lattice", "=", "True", ")", ":", "if", "check_lattice", "and", "self", ".", "lattice", "!=", "other", ".", "lattice", ":", "return", "False", "if", "self", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
PeriodicSite.distance_and_image_from_frac_coords
Gets distance between site and a fractional coordinate assuming periodic boundary conditions. If the index jimage of two sites atom j is not specified it selects the j image nearest to the i atom and returns the distance and jimage indices in terms of lattice vector translations. If the ...
pymatgen/core/sites.py
def distance_and_image_from_frac_coords(self, fcoords, jimage=None): """ Gets distance between site and a fractional coordinate assuming periodic boundary conditions. If the index jimage of two sites atom j is not specified it selects the j image nearest to the i atom and returns...
def distance_and_image_from_frac_coords(self, fcoords, jimage=None): """ Gets distance between site and a fractional coordinate assuming periodic boundary conditions. If the index jimage of two sites atom j is not specified it selects the j image nearest to the i atom and returns...
[ "Gets", "distance", "between", "site", "and", "a", "fractional", "coordinate", "assuming", "periodic", "boundary", "conditions", ".", "If", "the", "index", "jimage", "of", "two", "sites", "atom", "j", "is", "not", "specified", "it", "selects", "the", "j", "i...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L519-L541
[ "def", "distance_and_image_from_frac_coords", "(", "self", ",", "fcoords", ",", "jimage", "=", "None", ")", ":", "return", "self", ".", "lattice", ".", "get_distance_and_image", "(", "self", ".", "frac_coords", ",", "fcoords", ",", "jimage", "=", "jimage", ")"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
PeriodicSite.as_dict
Json-serializable dict representation of PeriodicSite. Args: verbosity (int): Verbosity level. Default of 0 only includes the matrix representation. Set to 1 for more details such as cartesian coordinates, etc.
pymatgen/core/sites.py
def as_dict(self, verbosity=0): """ Json-serializable dict representation of PeriodicSite. Args: verbosity (int): Verbosity level. Default of 0 only includes the matrix representation. Set to 1 for more details such as cartesian coordinates, etc. ...
def as_dict(self, verbosity=0): """ Json-serializable dict representation of PeriodicSite. Args: verbosity (int): Verbosity level. Default of 0 only includes the matrix representation. Set to 1 for more details such as cartesian coordinates, etc. ...
[ "Json", "-", "serializable", "dict", "representation", "of", "PeriodicSite", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/sites.py#L587-L615
[ "def", "as_dict", "(", "self", ",", "verbosity", "=", "0", ")", ":", "species_list", "=", "[", "]", "for", "spec", ",", "occu", "in", "self", ".", "_species", ".", "items", "(", ")", ":", "d", "=", "spec", ".", "as_dict", "(", ")", "del", "d", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
get_energies
Doc string.
pymatgen/cli/pmg_analyze.py
def get_energies(rootdir, reanalyze, verbose, detailed, sort, fmt): """ Doc string. """ if verbose: logformat = "%(relativeCreated)d msecs : %(message)s" logging.basicConfig(level=logging.INFO, format=logformat) if not detailed: drone = SimpleVaspToComputedEntryDrone(inc_str...
def get_energies(rootdir, reanalyze, verbose, detailed, sort, fmt): """ Doc string. """ if verbose: logformat = "%(relativeCreated)d msecs : %(message)s" logging.basicConfig(level=logging.INFO, format=logformat) if not detailed: drone = SimpleVaspToComputedEntryDrone(inc_str...
[ "Doc", "string", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/cli/pmg_analyze.py#L33-L90
[ "def", "get_energies", "(", "rootdir", ",", "reanalyze", ",", "verbose", ",", "detailed", ",", "sort", ",", "fmt", ")", ":", "if", "verbose", ":", "logformat", "=", "\"%(relativeCreated)d msecs : %(message)s\"", "logging", ".", "basicConfig", "(", "level", "=", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
NDCalculator.get_pattern
Calculates the powder neutron diffraction pattern for a structure. Args: structure (Structure): Input structure scaled (bool): Whether to return scaled intensities. The maximum peak is set to a value of 100. Defaults to True. Use False if you need the abs...
pymatgen/analysis/diffraction/neutron.py
def get_pattern(self, structure, scaled=True, two_theta_range=(0, 90)): """ Calculates the powder neutron diffraction pattern for a structure. Args: structure (Structure): Input structure scaled (bool): Whether to return scaled intensities. The maximum pe...
def get_pattern(self, structure, scaled=True, two_theta_range=(0, 90)): """ Calculates the powder neutron diffraction pattern for a structure. Args: structure (Structure): Input structure scaled (bool): Whether to return scaled intensities. The maximum pe...
[ "Calculates", "the", "powder", "neutron", "diffraction", "pattern", "for", "a", "structure", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/diffraction/neutron.py#L68-L202
[ "def", "get_pattern", "(", "self", ",", "structure", ",", "scaled", "=", "True", ",", "two_theta_range", "=", "(", "0", ",", "90", ")", ")", ":", "if", "self", ".", "symprec", ":", "finder", "=", "SpacegroupAnalyzer", "(", "structure", ",", "symprec", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
SymmetrizedStructure.find_equivalent_sites
Finds all symmetrically equivalent sites for a particular site Args: site (PeriodicSite): A site in the structure Returns: ([PeriodicSite]): List of all symmetrically equivalent sites.
pymatgen/symmetry/structure.py
def find_equivalent_sites(self, site): """ Finds all symmetrically equivalent sites for a particular site Args: site (PeriodicSite): A site in the structure Returns: ([PeriodicSite]): List of all symmetrically equivalent sites. """ for sites in s...
def find_equivalent_sites(self, site): """ Finds all symmetrically equivalent sites for a particular site Args: site (PeriodicSite): A site in the structure Returns: ([PeriodicSite]): List of all symmetrically equivalent sites. """ for sites in s...
[ "Finds", "all", "symmetrically", "equivalent", "sites", "for", "a", "particular", "site" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/symmetry/structure.py#L64-L78
[ "def", "find_equivalent_sites", "(", "self", ",", "site", ")", ":", "for", "sites", "in", "self", ".", "equivalent_sites", ":", "if", "site", "in", "sites", ":", "return", "sites", "raise", "ValueError", "(", "\"Site not in structure\"", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Nwchem2Fiesta.run
Performs actual NWCHEM2FIESTA run
pymatgen/io/fiesta.py
def run(self): """ Performs actual NWCHEM2FIESTA run """ init_folder = os.getcwd() os.chdir(self.folder) with zopen(self.log_file, 'w') as fout: subprocess.call([self._NWCHEM2FIESTA_cmd, self._nwcheminput_fn, self._nwchemoutput_f...
def run(self): """ Performs actual NWCHEM2FIESTA run """ init_folder = os.getcwd() os.chdir(self.folder) with zopen(self.log_file, 'w') as fout: subprocess.call([self._NWCHEM2FIESTA_cmd, self._nwcheminput_fn, self._nwchemoutput_f...
[ "Performs", "actual", "NWCHEM2FIESTA", "run" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L60-L73
[ "def", "run", "(", "self", ")", ":", "init_folder", "=", "os", ".", "getcwd", "(", ")", "os", ".", "chdir", "(", "self", ".", "folder", ")", "with", "zopen", "(", "self", ".", "log_file", ",", "'w'", ")", "as", "fout", ":", "subprocess", ".", "ca...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Fiesta_run.gw_run
Performs FIESTA (gw) run
pymatgen/io/fiesta.py
def gw_run(self): """ Performs FIESTA (gw) run """ if self.folder != os.getcwd(): init_folder = os.getcwd() os.chdir(self.folder) with zopen(self.log_file, 'w') as fout: subprocess.call(["mpirun", "-n", str(self.mpi_procs), "fiesta", ...
def gw_run(self): """ Performs FIESTA (gw) run """ if self.folder != os.getcwd(): init_folder = os.getcwd() os.chdir(self.folder) with zopen(self.log_file, 'w') as fout: subprocess.call(["mpirun", "-n", str(self.mpi_procs), "fiesta", ...
[ "Performs", "FIESTA", "(", "gw", ")", "run" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L115-L130
[ "def", "gw_run", "(", "self", ")", ":", "if", "self", ".", "folder", "!=", "os", ".", "getcwd", "(", ")", ":", "init_folder", "=", "os", ".", "getcwd", "(", ")", "os", ".", "chdir", "(", "self", ".", "folder", ")", "with", "zopen", "(", "self", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Basis_set_reader.set_n_nlmo
:return: the number of nlm orbitals for the basis set
pymatgen/io/fiesta.py
def set_n_nlmo(self): """ :return: the number of nlm orbitals for the basis set """ nnlmo = 0 data_tmp = self.data data_tmp.pop('lmax') data_tmp.pop('n_nlo') data_tmp.pop('preamble') for l_zeta_ng in data_tmp: l = l_zeta_ng.s...
def set_n_nlmo(self): """ :return: the number of nlm orbitals for the basis set """ nnlmo = 0 data_tmp = self.data data_tmp.pop('lmax') data_tmp.pop('n_nlo') data_tmp.pop('preamble') for l_zeta_ng in data_tmp: l = l_zeta_ng.s...
[ ":", "return", ":", "the", "number", "of", "nlm", "orbitals", "for", "the", "basis", "set" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L232-L248
[ "def", "set_n_nlmo", "(", "self", ")", ":", "nnlmo", "=", "0", "data_tmp", "=", "self", ".", "data", "data_tmp", ".", "pop", "(", "'lmax'", ")", "data_tmp", ".", "pop", "(", "'n_nlo'", ")", "data_tmp", ".", "pop", "(", "'preamble'", ")", "for", "l_ze...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Basis_set_reader.infos_on_basis_set
infos on the basis set as in Fiesta log
pymatgen/io/fiesta.py
def infos_on_basis_set(self): """ infos on the basis set as in Fiesta log """ o = [] o.append("=========================================") o.append("Reading basis set:") o.append("") o.append(" Basis set for {} atom ".format(str(self.filename))) o....
def infos_on_basis_set(self): """ infos on the basis set as in Fiesta log """ o = [] o.append("=========================================") o.append("Reading basis set:") o.append("") o.append(" Basis set for {} atom ".format(str(self.filename))) o....
[ "infos", "on", "the", "basis", "set", "as", "in", "Fiesta", "log" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L250-L264
[ "def", "infos_on_basis_set", "(", "self", ")", ":", "o", "=", "[", "]", "o", ".", "append", "(", "\"=========================================\"", ")", "o", ".", "append", "(", "\"Reading basis set:\"", ")", "o", ".", "append", "(", "\"\"", ")", "o", ".", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.set_auxiliary_basis_set
copy in the desired folder the needed auxiliary basis set "X2.ion" where X is a specie. :param auxiliary_folder: folder where the auxiliary basis sets are stored :param auxiliary_basis_set_type: type of basis set (string to be found in the extension of the file name; must be in lower case) ...
pymatgen/io/fiesta.py
def set_auxiliary_basis_set(self, folder, auxiliary_folder, auxiliary_basis_set_type="aug_cc_pvtz"): """ copy in the desired folder the needed auxiliary basis set "X2.ion" where X is a specie. :param auxiliary_folder: folder where the auxiliary basis sets are stor...
def set_auxiliary_basis_set(self, folder, auxiliary_folder, auxiliary_basis_set_type="aug_cc_pvtz"): """ copy in the desired folder the needed auxiliary basis set "X2.ion" where X is a specie. :param auxiliary_folder: folder where the auxiliary basis sets are stor...
[ "copy", "in", "the", "desired", "folder", "the", "needed", "auxiliary", "basis", "set", "X2", ".", "ion", "where", "X", "is", "a", "specie", ".", ":", "param", "auxiliary_folder", ":", "folder", "where", "the", "auxiliary", "basis", "sets", "are", "stored"...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L300-L317
[ "def", "set_auxiliary_basis_set", "(", "self", ",", "folder", ",", "auxiliary_folder", ",", "auxiliary_basis_set_type", "=", "\"aug_cc_pvtz\"", ")", ":", "list_files", "=", "os", ".", "listdir", "(", "auxiliary_folder", ")", "for", "specie", "in", "self", ".", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.set_GW_options
Set parameters in cell.in for a GW computation :param nv__band: number of valence bands to correct with GW :param nc_band: number of conduction bands to correct with GW :param n_iteration: number of iteration :param n_grid and dE_grid:: number of points and spacing in eV for correlation ...
pymatgen/io/fiesta.py
def set_GW_options(self, nv_band=10, nc_band=10, n_iteration=5, n_grid=6, dE_grid=0.5): """ Set parameters in cell.in for a GW computation :param nv__band: number of valence bands to correct with GW :param nc_band: number of conduction bands to correct with GW ...
def set_GW_options(self, nv_band=10, nc_band=10, n_iteration=5, n_grid=6, dE_grid=0.5): """ Set parameters in cell.in for a GW computation :param nv__band: number of valence bands to correct with GW :param nc_band: number of conduction bands to correct with GW ...
[ "Set", "parameters", "in", "cell", ".", "in", "for", "a", "GW", "computation", ":", "param", "nv__band", ":", "number", "of", "valence", "bands", "to", "correct", "with", "GW", ":", "param", "nc_band", ":", "number", "of", "conduction", "bands", "to", "c...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L319-L331
[ "def", "set_GW_options", "(", "self", ",", "nv_band", "=", "10", ",", "nc_band", "=", "10", ",", "n_iteration", "=", "5", ",", "n_grid", "=", "6", ",", "dE_grid", "=", "0.5", ")", ":", "self", ".", "GW_options", ".", "update", "(", "nv_corr", "=", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.make_FULL_BSE_Densities_folder
mkdir "FULL_BSE_Densities" folder (needed for bse run) in the desired folder
pymatgen/io/fiesta.py
def make_FULL_BSE_Densities_folder(self, folder): """ mkdir "FULL_BSE_Densities" folder (needed for bse run) in the desired folder """ if os.path.exists(folder + "/FULL_BSE_Densities"): return "FULL_BSE_Densities folder already exists" else: os.makedirs(f...
def make_FULL_BSE_Densities_folder(self, folder): """ mkdir "FULL_BSE_Densities" folder (needed for bse run) in the desired folder """ if os.path.exists(folder + "/FULL_BSE_Densities"): return "FULL_BSE_Densities folder already exists" else: os.makedirs(f...
[ "mkdir", "FULL_BSE_Densities", "folder", "(", "needed", "for", "bse", "run", ")", "in", "the", "desired", "folder" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L333-L342
[ "def", "make_FULL_BSE_Densities_folder", "(", "self", ",", "folder", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "folder", "+", "\"/FULL_BSE_Densities\"", ")", ":", "return", "\"FULL_BSE_Densities folder already exists\"", "else", ":", "os", ".", "maked...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.set_BSE_options
Set parameters in cell.in for a BSE computation :param nv_bse: number of valence bands :param nc_bse: number of conduction bands :param n_excitations: number of excitations :param nit_bse: number of iterations
pymatgen/io/fiesta.py
def set_BSE_options(self, n_excitations=10, nit_bse=200): """ Set parameters in cell.in for a BSE computation :param nv_bse: number of valence bands :param nc_bse: number of conduction bands :param n_excitations: number of excitations :param nit_bse: number of iterations ...
def set_BSE_options(self, n_excitations=10, nit_bse=200): """ Set parameters in cell.in for a BSE computation :param nv_bse: number of valence bands :param nc_bse: number of conduction bands :param n_excitations: number of excitations :param nit_bse: number of iterations ...
[ "Set", "parameters", "in", "cell", ".", "in", "for", "a", "BSE", "computation", ":", "param", "nv_bse", ":", "number", "of", "valence", "bands", ":", "param", "nc_bse", ":", "number", "of", "conduction", "bands", ":", "param", "n_excitations", ":", "number...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L344-L353
[ "def", "set_BSE_options", "(", "self", ",", "n_excitations", "=", "10", ",", "nit_bse", "=", "200", ")", ":", "self", ".", "BSE_TDDFT_options", ".", "update", "(", "npsi_bse", "=", "n_excitations", ",", "nit_bse", "=", "nit_bse", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.dump_BSE_data_in_GW_run
:param BSE_dump: boolean :return: set the "do_bse" variable to one in cell.in
pymatgen/io/fiesta.py
def dump_BSE_data_in_GW_run(self, BSE_dump=True): """ :param BSE_dump: boolean :return: set the "do_bse" variable to one in cell.in """ if BSE_dump: self.BSE_TDDFT_options.update(do_bse=1, do_tddft=0) else: self.BSE_TDDFT_options.update(do_bse=0, ...
def dump_BSE_data_in_GW_run(self, BSE_dump=True): """ :param BSE_dump: boolean :return: set the "do_bse" variable to one in cell.in """ if BSE_dump: self.BSE_TDDFT_options.update(do_bse=1, do_tddft=0) else: self.BSE_TDDFT_options.update(do_bse=0, ...
[ ":", "param", "BSE_dump", ":", "boolean", ":", "return", ":", "set", "the", "do_bse", "variable", "to", "one", "in", "cell", ".", "in" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L355-L364
[ "def", "dump_BSE_data_in_GW_run", "(", "self", ",", "BSE_dump", "=", "True", ")", ":", "if", "BSE_dump", ":", "self", ".", "BSE_TDDFT_options", ".", "update", "(", "do_bse", "=", "1", ",", "do_tddft", "=", "0", ")", "else", ":", "self", ".", "BSE_TDDFT_o...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.dump_TDDFT_data_in_GW_run
:param TDDFT_dump: boolen :return: set the do_tddft variable to one in cell.in
pymatgen/io/fiesta.py
def dump_TDDFT_data_in_GW_run(self, TDDFT_dump=True): """ :param TDDFT_dump: boolen :return: set the do_tddft variable to one in cell.in """ if TDDFT_dump == True: self.BSE_TDDFT_options.update(do_bse=0, do_tddft=1) else: self.BSE_TDDFT_options.upd...
def dump_TDDFT_data_in_GW_run(self, TDDFT_dump=True): """ :param TDDFT_dump: boolen :return: set the do_tddft variable to one in cell.in """ if TDDFT_dump == True: self.BSE_TDDFT_options.update(do_bse=0, do_tddft=1) else: self.BSE_TDDFT_options.upd...
[ ":", "param", "TDDFT_dump", ":", "boolen", ":", "return", ":", "set", "the", "do_tddft", "variable", "to", "one", "in", "cell", ".", "in" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L366-L374
[ "def", "dump_TDDFT_data_in_GW_run", "(", "self", ",", "TDDFT_dump", "=", "True", ")", ":", "if", "TDDFT_dump", "==", "True", ":", "self", ".", "BSE_TDDFT_options", ".", "update", "(", "do_bse", "=", "0", ",", "do_tddft", "=", "1", ")", "else", ":", "self...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.infos_on_system
Returns infos on initial parameters as in the log file of Fiesta
pymatgen/io/fiesta.py
def infos_on_system(self): """ Returns infos on initial parameters as in the log file of Fiesta """ o = [] o.append("=========================================") o.append("Reading infos on system:") o.append("") o.append(" Number of atoms = {} ; number of ...
def infos_on_system(self): """ Returns infos on initial parameters as in the log file of Fiesta """ o = [] o.append("=========================================") o.append("Reading infos on system:") o.append("") o.append(" Number of atoms = {} ; number of ...
[ "Returns", "infos", "on", "initial", "parameters", "as", "in", "the", "log", "file", "of", "Fiesta" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L377-L438
[ "def", "infos_on_system", "(", "self", ")", ":", "o", "=", "[", "]", "o", ".", "append", "(", "\"=========================================\"", ")", "o", ".", "append", "(", "\"Reading infos on system:\"", ")", "o", ".", "append", "(", "\"\"", ")", "o", ".", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.from_string
Read an FiestaInput from a string. Currently tested to work with files generated from this class itself. Args: string_input: string_input to parse. Returns: FiestaInput object
pymatgen/io/fiesta.py
def from_string(cls, string_input): """ Read an FiestaInput from a string. Currently tested to work with files generated from this class itself. Args: string_input: string_input to parse. Returns: FiestaInput object """ correlation_grid =...
def from_string(cls, string_input): """ Read an FiestaInput from a string. Currently tested to work with files generated from this class itself. Args: string_input: string_input to parse. Returns: FiestaInput object """ correlation_grid =...
[ "Read", "an", "FiestaInput", "from", "a", "string", ".", "Currently", "tested", "to", "work", "with", "files", "generated", "from", "this", "class", "itself", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L538-L669
[ "def", "from_string", "(", "cls", ",", "string_input", ")", ":", "correlation_grid", "=", "{", "}", "Exc_DFT_option", "=", "{", "}", "COHSEX_options", "=", "{", "}", "GW_options", "=", "{", "}", "BSE_TDDFT_options", "=", "{", "}", "lines", "=", "string_inp...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
FiestaInput.from_file
Read an Fiesta input from a file. Currently tested to work with files generated from this class itself. Args: filename: Filename to parse. Returns: FiestaInput object
pymatgen/io/fiesta.py
def from_file(cls, filename): """ Read an Fiesta input from a file. Currently tested to work with files generated from this class itself. Args: filename: Filename to parse. Returns: FiestaInput object """ with zopen(filename) as f: ...
def from_file(cls, filename): """ Read an Fiesta input from a file. Currently tested to work with files generated from this class itself. Args: filename: Filename to parse. Returns: FiestaInput object """ with zopen(filename) as f: ...
[ "Read", "an", "Fiesta", "input", "from", "a", "file", ".", "Currently", "tested", "to", "work", "with", "files", "generated", "from", "this", "class", "itself", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/fiesta.py#L672-L684
[ "def", "from_file", "(", "cls", ",", "filename", ")", ":", "with", "zopen", "(", "filename", ")", "as", "f", ":", "return", "cls", ".", "from_string", "(", "f", ".", "read", "(", ")", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.undo_last_change
Undo the last change in the TransformedStructure. Raises: IndexError: If already at the oldest change.
pymatgen/alchemy/materials.py
def undo_last_change(self): """ Undo the last change in the TransformedStructure. Raises: IndexError: If already at the oldest change. """ if len(self.history) == 0: raise IndexError("Can't undo. Already at oldest change.") if 'input_structure' no...
def undo_last_change(self): """ Undo the last change in the TransformedStructure. Raises: IndexError: If already at the oldest change. """ if len(self.history) == 0: raise IndexError("Can't undo. Already at oldest change.") if 'input_structure' no...
[ "Undo", "the", "last", "change", "in", "the", "TransformedStructure", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L69-L86
[ "def", "undo_last_change", "(", "self", ")", ":", "if", "len", "(", "self", ".", "history", ")", "==", "0", ":", "raise", "IndexError", "(", "\"Can't undo. Already at oldest change.\"", ")", "if", "'input_structure'", "not", "in", "self", ".", "history", "[", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.redo_next_change
Redo the last undone change in the TransformedStructure. Raises: IndexError: If already at the latest change.
pymatgen/alchemy/materials.py
def redo_next_change(self): """ Redo the last undone change in the TransformedStructure. Raises: IndexError: If already at the latest change. """ if len(self._undone) == 0: raise IndexError("Can't redo. Already at latest change.") h, s = self._und...
def redo_next_change(self): """ Redo the last undone change in the TransformedStructure. Raises: IndexError: If already at the latest change. """ if len(self._undone) == 0: raise IndexError("Can't redo. Already at latest change.") h, s = self._und...
[ "Redo", "the", "last", "undone", "change", "in", "the", "TransformedStructure", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L88-L99
[ "def", "redo_next_change", "(", "self", ")", ":", "if", "len", "(", "self", ".", "_undone", ")", "==", "0", ":", "raise", "IndexError", "(", "\"Can't redo. Already at latest change.\"", ")", "h", ",", "s", "=", "self", ".", "_undone", ".", "pop", "(", ")...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.append_transformation
Appends a transformation to the TransformedStructure. Args: transformation: Transformation to append return_alternatives: Whether to return alternative TransformedStructures for one-to-many transformations. return_alternatives can be a number, which stipu...
pymatgen/alchemy/materials.py
def append_transformation(self, transformation, return_alternatives=False, clear_redo=True): """ Appends a transformation to the TransformedStructure. Args: transformation: Transformation to append return_alternatives: Whether to return alte...
def append_transformation(self, transformation, return_alternatives=False, clear_redo=True): """ Appends a transformation to the TransformedStructure. Args: transformation: Transformation to append return_alternatives: Whether to return alte...
[ "Appends", "a", "transformation", "to", "the", "TransformedStructure", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L108-L161
[ "def", "append_transformation", "(", "self", ",", "transformation", ",", "return_alternatives", "=", "False", ",", "clear_redo", "=", "True", ")", ":", "if", "clear_redo", ":", "self", ".", "_undone", "=", "[", "]", "if", "return_alternatives", "and", "transfo...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.append_filter
Adds a filter. Args: structure_filter (StructureFilter): A filter implementating the AbstractStructureFilter API. Tells transmuter waht structures to retain.
pymatgen/alchemy/materials.py
def append_filter(self, structure_filter): """ Adds a filter. Args: structure_filter (StructureFilter): A filter implementating the AbstractStructureFilter API. Tells transmuter waht structures to retain. """ hdict = structure_filter.a...
def append_filter(self, structure_filter): """ Adds a filter. Args: structure_filter (StructureFilter): A filter implementating the AbstractStructureFilter API. Tells transmuter waht structures to retain. """ hdict = structure_filter.a...
[ "Adds", "a", "filter", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L163-L174
[ "def", "append_filter", "(", "self", ",", "structure_filter", ")", ":", "hdict", "=", "structure_filter", ".", "as_dict", "(", ")", "hdict", "[", "\"input_structure\"", "]", "=", "self", ".", "final_structure", ".", "as_dict", "(", ")", "self", ".", "history...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.extend_transformations
Extends a sequence of transformations to the TransformedStructure. Args: transformations: Sequence of Transformations return_alternatives: Whether to return alternative TransformedStructures for one-to-many transformations. return_alternatives can be a nu...
pymatgen/alchemy/materials.py
def extend_transformations(self, transformations, return_alternatives=False): """ Extends a sequence of transformations to the TransformedStructure. Args: transformations: Sequence of Transformations return_alternatives: Whether to return a...
def extend_transformations(self, transformations, return_alternatives=False): """ Extends a sequence of transformations to the TransformedStructure. Args: transformations: Sequence of Transformations return_alternatives: Whether to return a...
[ "Extends", "a", "sequence", "of", "transformations", "to", "the", "TransformedStructure", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L176-L190
[ "def", "extend_transformations", "(", "self", ",", "transformations", ",", "return_alternatives", "=", "False", ")", ":", "for", "t", "in", "transformations", ":", "self", ".", "append_transformation", "(", "t", ",", "return_alternatives", "=", "return_alternatives"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.get_vasp_input
Returns VASP input as a dict of vasp objects. Args: vasp_input_set (pymatgen.io.vaspio_set.VaspInputSet): input set to create vasp input files from structures
pymatgen/alchemy/materials.py
def get_vasp_input(self, vasp_input_set=MPRelaxSet, **kwargs): """ Returns VASP input as a dict of vasp objects. Args: vasp_input_set (pymatgen.io.vaspio_set.VaspInputSet): input set to create vasp input files from structures """ d = vasp_input_set(se...
def get_vasp_input(self, vasp_input_set=MPRelaxSet, **kwargs): """ Returns VASP input as a dict of vasp objects. Args: vasp_input_set (pymatgen.io.vaspio_set.VaspInputSet): input set to create vasp input files from structures """ d = vasp_input_set(se...
[ "Returns", "VASP", "input", "as", "a", "dict", "of", "vasp", "objects", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L192-L202
[ "def", "get_vasp_input", "(", "self", ",", "vasp_input_set", "=", "MPRelaxSet", ",", "*", "*", "kwargs", ")", ":", "d", "=", "vasp_input_set", "(", "self", ".", "final_structure", ",", "*", "*", "kwargs", ")", ".", "get_vasp_input", "(", ")", "d", "[", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.write_vasp_input
Writes VASP input to an output_dir. Args: vasp_input_set: pymatgen.io.vaspio_set.VaspInputSet like object that creates vasp input files from structures output_dir: Directory to output files create_directory: Create the directory if not present...
pymatgen/alchemy/materials.py
def write_vasp_input(self, vasp_input_set=MPRelaxSet, output_dir=".", create_directory=True, **kwargs): """ Writes VASP input to an output_dir. Args: vasp_input_set: pymatgen.io.vaspio_set.VaspInputSet like object that creates ...
def write_vasp_input(self, vasp_input_set=MPRelaxSet, output_dir=".", create_directory=True, **kwargs): """ Writes VASP input to an output_dir. Args: vasp_input_set: pymatgen.io.vaspio_set.VaspInputSet like object that creates ...
[ "Writes", "VASP", "input", "to", "an", "output_dir", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L204-L221
[ "def", "write_vasp_input", "(", "self", ",", "vasp_input_set", "=", "MPRelaxSet", ",", "output_dir", "=", "\".\"", ",", "create_directory", "=", "True", ",", "*", "*", "kwargs", ")", ":", "vasp_input_set", "(", "self", ".", "final_structure", ",", "*", "*", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.structures
Copy of all structures in the TransformedStructure. A structure is stored after every single transformation.
pymatgen/alchemy/materials.py
def structures(self): """ Copy of all structures in the TransformedStructure. A structure is stored after every single transformation. """ hstructs = [Structure.from_dict(s['input_structure']) for s in self.history if 'input_structure' in s] return hst...
def structures(self): """ Copy of all structures in the TransformedStructure. A structure is stored after every single transformation. """ hstructs = [Structure.from_dict(s['input_structure']) for s in self.history if 'input_structure' in s] return hst...
[ "Copy", "of", "all", "structures", "in", "the", "TransformedStructure", ".", "A", "structure", "is", "stored", "after", "every", "single", "transformation", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L250-L257
[ "def", "structures", "(", "self", ")", ":", "hstructs", "=", "[", "Structure", ".", "from_dict", "(", "s", "[", "'input_structure'", "]", ")", "for", "s", "in", "self", ".", "history", "if", "'input_structure'", "in", "s", "]", "return", "hstructs", "+",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.from_cif_string
Generates TransformedStructure from a cif string. Args: cif_string (str): Input cif string. Should contain only one structure. For cifs containing multiple structures, please use CifTransmuter. transformations ([Transformations]): Sequence of transformati...
pymatgen/alchemy/materials.py
def from_cif_string(cif_string, transformations=None, primitive=True, occupancy_tolerance=1.): """ Generates TransformedStructure from a cif string. Args: cif_string (str): Input cif string. Should contain only one structure. For cifs containi...
def from_cif_string(cif_string, transformations=None, primitive=True, occupancy_tolerance=1.): """ Generates TransformedStructure from a cif string. Args: cif_string (str): Input cif string. Should contain only one structure. For cifs containi...
[ "Generates", "TransformedStructure", "from", "a", "cif", "string", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L260-L297
[ "def", "from_cif_string", "(", "cif_string", ",", "transformations", "=", "None", ",", "primitive", "=", "True", ",", "occupancy_tolerance", "=", "1.", ")", ":", "parser", "=", "CifParser", ".", "from_string", "(", "cif_string", ",", "occupancy_tolerance", ")", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.from_poscar_string
Generates TransformedStructure from a poscar string. Args: poscar_string (str): Input POSCAR string. transformations ([Transformations]): Sequence of transformations to be applied to the input structure.
pymatgen/alchemy/materials.py
def from_poscar_string(poscar_string, transformations=None): """ Generates TransformedStructure from a poscar string. Args: poscar_string (str): Input POSCAR string. transformations ([Transformations]): Sequence of transformations to be applied to the inp...
def from_poscar_string(poscar_string, transformations=None): """ Generates TransformedStructure from a poscar string. Args: poscar_string (str): Input POSCAR string. transformations ([Transformations]): Sequence of transformations to be applied to the inp...
[ "Generates", "TransformedStructure", "from", "a", "poscar", "string", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L300-L318
[ "def", "from_poscar_string", "(", "poscar_string", ",", "transformations", "=", "None", ")", ":", "p", "=", "Poscar", ".", "from_string", "(", "poscar_string", ")", "if", "not", "p", ".", "true_names", ":", "raise", "ValueError", "(", "\"Transformation can be cr...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.as_dict
Dict representation of the TransformedStructure.
pymatgen/alchemy/materials.py
def as_dict(self): """ Dict representation of the TransformedStructure. """ d = self.final_structure.as_dict() d["@module"] = self.__class__.__module__ d["@class"] = self.__class__.__name__ d["history"] = jsanitize(self.history) d["version"] = __version__ ...
def as_dict(self): """ Dict representation of the TransformedStructure. """ d = self.final_structure.as_dict() d["@module"] = self.__class__.__module__ d["@class"] = self.__class__.__name__ d["history"] = jsanitize(self.history) d["version"] = __version__ ...
[ "Dict", "representation", "of", "the", "TransformedStructure", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L320-L331
[ "def", "as_dict", "(", "self", ")", ":", "d", "=", "self", ".", "final_structure", ".", "as_dict", "(", ")", "d", "[", "\"@module\"", "]", "=", "self", ".", "__class__", ".", "__module__", "d", "[", "\"@class\"", "]", "=", "self", ".", "__class__", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.from_dict
Creates a TransformedStructure from a dict.
pymatgen/alchemy/materials.py
def from_dict(cls, d): """ Creates a TransformedStructure from a dict. """ s = Structure.from_dict(d) return cls(s, history=d["history"], other_parameters=d.get("other_parameters", None))
def from_dict(cls, d): """ Creates a TransformedStructure from a dict. """ s = Structure.from_dict(d) return cls(s, history=d["history"], other_parameters=d.get("other_parameters", None))
[ "Creates", "a", "TransformedStructure", "from", "a", "dict", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L334-L340
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "s", "=", "Structure", ".", "from_dict", "(", "d", ")", "return", "cls", "(", "s", ",", "history", "=", "d", "[", "\"history\"", "]", ",", "other_parameters", "=", "d", ".", "get", "(", "\"other_p...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TransformedStructure.from_snl
Create TransformedStructure from SNL. Args: snl (StructureNL): Starting snl Returns: TransformedStructure
pymatgen/alchemy/materials.py
def from_snl(cls, snl): """ Create TransformedStructure from SNL. Args: snl (StructureNL): Starting snl Returns: TransformedStructure """ hist = [] for h in snl.history: d = h.description d['_snl'] = {'url': h.url,...
def from_snl(cls, snl): """ Create TransformedStructure from SNL. Args: snl (StructureNL): Starting snl Returns: TransformedStructure """ hist = [] for h in snl.history: d = h.description d['_snl'] = {'url': h.url,...
[ "Create", "TransformedStructure", "from", "SNL", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/alchemy/materials.py#L359-L374
[ "def", "from_snl", "(", "cls", ",", "snl", ")", ":", "hist", "=", "[", "]", "for", "h", "in", "snl", ".", "history", ":", "d", "=", "h", ".", "description", "d", "[", "'_snl'", "]", "=", "{", "'url'", ":", "h", ".", "url", ",", "'name'", ":",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
LDos.from_file
Creates LDos object from raw Feff ldos files by by assuming they are numbered consecutively, i.e. ldos01.dat ldos02.dat... Args: feff_inp_file (str): input file of run to obtain structure ldos_file (str): output ldos file of run to obtain dos info, etc.
pymatgen/io/feff/outputs.py
def from_file(feff_inp_file='feff.inp', ldos_file='ldos'): """" Creates LDos object from raw Feff ldos files by by assuming they are numbered consecutively, i.e. ldos01.dat ldos02.dat... Args: feff_inp_file (str): input file of run to obtain structure ldo...
def from_file(feff_inp_file='feff.inp', ldos_file='ldos'): """" Creates LDos object from raw Feff ldos files by by assuming they are numbered consecutively, i.e. ldos01.dat ldos02.dat... Args: feff_inp_file (str): input file of run to obtain structure ldo...
[ "Creates", "LDos", "object", "from", "raw", "Feff", "ldos", "files", "by", "by", "assuming", "they", "are", "numbered", "consecutively", "i", ".", "e", ".", "ldos01", ".", "dat", "ldos02", ".", "dat", "..." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/feff/outputs.py#L49-L155
[ "def", "from_file", "(", "feff_inp_file", "=", "'feff.inp'", ",", "ldos_file", "=", "'ldos'", ")", ":", "header_str", "=", "Header", ".", "header_string_from_file", "(", "feff_inp_file", ")", "header", "=", "Header", ".", "from_string", "(", "header_str", ")", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
LDos.charge_transfer_from_file
Get charge transfer from file. Args: feff_inp_file (str): name of feff.inp file for run ldos_file (str): ldos filename for run, assume consequetive order, i.e., ldos01.dat, ldos02.dat.... Returns: dictionary of dictionaries in order of potential site...
pymatgen/io/feff/outputs.py
def charge_transfer_from_file(feff_inp_file, ldos_file): """ Get charge transfer from file. Args: feff_inp_file (str): name of feff.inp file for run ldos_file (str): ldos filename for run, assume consequetive order, i.e., ldos01.dat, ldos02.dat.... ...
def charge_transfer_from_file(feff_inp_file, ldos_file): """ Get charge transfer from file. Args: feff_inp_file (str): name of feff.inp file for run ldos_file (str): ldos filename for run, assume consequetive order, i.e., ldos01.dat, ldos02.dat.... ...
[ "Get", "charge", "transfer", "from", "file", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/feff/outputs.py#L158-L236
[ "def", "charge_transfer_from_file", "(", "feff_inp_file", ",", "ldos_file", ")", ":", "cht", "=", "OrderedDict", "(", ")", "parameters", "=", "Tags", ".", "from_file", "(", "feff_inp_file", ")", "if", "'RECIPROCAL'", "in", "parameters", ":", "dicts", "=", "[",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
LDos.charge_transfer_to_string
returns shrage transfer as string
pymatgen/io/feff/outputs.py
def charge_transfer_to_string(self): """returns shrage transfer as string""" ch = self.charge_transfer chts = ['\nCharge Transfer\n\nabsorbing atom'] for i in range(len(ch)): for atom, v2 in ch[str(i)].items(): a = ['\n', atom, '\n', 's ', str(v2['s']), '\n'...
def charge_transfer_to_string(self): """returns shrage transfer as string""" ch = self.charge_transfer chts = ['\nCharge Transfer\n\nabsorbing atom'] for i in range(len(ch)): for atom, v2 in ch[str(i)].items(): a = ['\n', atom, '\n', 's ', str(v2['s']), '\n'...
[ "returns", "shrage", "transfer", "as", "string" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/feff/outputs.py#L238-L250
[ "def", "charge_transfer_to_string", "(", "self", ")", ":", "ch", "=", "self", ".", "charge_transfer", "chts", "=", "[", "'\\nCharge Transfer\\n\\nabsorbing atom'", "]", "for", "i", "in", "range", "(", "len", "(", "ch", ")", ")", ":", "for", "atom", ",", "v...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Xmu.from_file
Get Xmu from file. Args: xmu_dat_file (str): filename and path for xmu.dat feff_inp_file (str): filename and path of feff.inp input file Returns: Xmu object
pymatgen/io/feff/outputs.py
def from_file(xmu_dat_file="xmu.dat", feff_inp_file="feff.inp"): """ Get Xmu from file. Args: xmu_dat_file (str): filename and path for xmu.dat feff_inp_file (str): filename and path of feff.inp input file Returns: Xmu object """ dat...
def from_file(xmu_dat_file="xmu.dat", feff_inp_file="feff.inp"): """ Get Xmu from file. Args: xmu_dat_file (str): filename and path for xmu.dat feff_inp_file (str): filename and path of feff.inp input file Returns: Xmu object """ dat...
[ "Get", "Xmu", "from", "file", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/feff/outputs.py#L288-L309
[ "def", "from_file", "(", "xmu_dat_file", "=", "\"xmu.dat\"", ",", "feff_inp_file", "=", "\"feff.inp\"", ")", ":", "data", "=", "np", ".", "loadtxt", "(", "xmu_dat_file", ")", "header", "=", "Header", ".", "from_file", "(", "feff_inp_file", ")", "parameters", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Xmu.material_formula
Returns chemical formula of material from feff.inp file
pymatgen/io/feff/outputs.py
def material_formula(self): """ Returns chemical formula of material from feff.inp file """ try: form = self.header.formula except IndexError: form = 'No formula provided' return "".join(map(str, form))
def material_formula(self): """ Returns chemical formula of material from feff.inp file """ try: form = self.header.formula except IndexError: form = 'No formula provided' return "".join(map(str, form))
[ "Returns", "chemical", "formula", "of", "material", "from", "feff", ".", "inp", "file" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/feff/outputs.py#L378-L386
[ "def", "material_formula", "(", "self", ")", ":", "try", ":", "form", "=", "self", ".", "header", ".", "formula", "except", "IndexError", ":", "form", "=", "'No formula provided'", "return", "\"\"", ".", "join", "(", "map", "(", "str", ",", "form", ")", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Xmu.as_dict
Returns dict representations of Xmu object
pymatgen/io/feff/outputs.py
def as_dict(self): """ Returns dict representations of Xmu object """ d = MSONable.as_dict(self) d["data"] = self.data.tolist() return d
def as_dict(self): """ Returns dict representations of Xmu object """ d = MSONable.as_dict(self) d["data"] = self.data.tolist() return d
[ "Returns", "dict", "representations", "of", "Xmu", "object" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/feff/outputs.py#L395-L401
[ "def", "as_dict", "(", "self", ")", ":", "d", "=", "MSONable", ".", "as_dict", "(", "self", ")", "d", "[", "\"data\"", "]", "=", "self", ".", "data", ".", "tolist", "(", ")", "return", "d" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
iterlines
A generator form of s.split('\n') for reducing memory overhead. Parameters ---------- s : str A multi-line string. Yields ------ line : str A string.
pymatgen/io/adf.py
def iterlines(s): """ A generator form of s.split('\n') for reducing memory overhead. Parameters ---------- s : str A multi-line string. Yields ------ line : str A string. """ prevnl = -1 while True: nextnl = s.find('\n', prevnl + 1) if next...
def iterlines(s): """ A generator form of s.split('\n') for reducing memory overhead. Parameters ---------- s : str A multi-line string. Yields ------ line : str A string. """ prevnl = -1 while True: nextnl = s.find('\n', prevnl + 1) if next...
[ "A", "generator", "form", "of", "s", ".", "split", "(", "\\", "n", ")", "for", "reducing", "memory", "overhead", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L37-L60
[ "def", "iterlines", "(", "s", ")", ":", "prevnl", "=", "-", "1", "while", "True", ":", "nextnl", "=", "s", ".", "find", "(", "'\\n'", ",", "prevnl", "+", "1", ")", "if", "nextnl", "<", "0", ":", "yield", "s", "[", "(", "prevnl", "+", "1", ")"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey._options_string
Return the option string.
pymatgen/io/adf.py
def _options_string(self): """ Return the option string. """ if len(self.options) > 0: s = "" for op in self.options: if self._sized_op: s += "{:s}={:s} ".format(*map(str, op)) else: s += "{:s...
def _options_string(self): """ Return the option string. """ if len(self.options) > 0: s = "" for op in self.options: if self._sized_op: s += "{:s}={:s} ".format(*map(str, op)) else: s += "{:s...
[ "Return", "the", "option", "string", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L125-L138
[ "def", "_options_string", "(", "self", ")", ":", "if", "len", "(", "self", ".", "options", ")", ">", "0", ":", "s", "=", "\"\"", "for", "op", "in", "self", ".", "options", ":", "if", "self", ".", "_sized_op", ":", "s", "+=", "\"{:s}={:s} \"", ".", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.has_subkey
Return True if this AdfKey contains the given subkey. Parameters ---------- subkey : str or AdfKey A key name or an AdfKey object. Returns ------- has : bool True if this key contains the given key. Otherwise False.
pymatgen/io/adf.py
def has_subkey(self, subkey): """ Return True if this AdfKey contains the given subkey. Parameters ---------- subkey : str or AdfKey A key name or an AdfKey object. Returns ------- has : bool True if this key contains the given ke...
def has_subkey(self, subkey): """ Return True if this AdfKey contains the given subkey. Parameters ---------- subkey : str or AdfKey A key name or an AdfKey object. Returns ------- has : bool True if this key contains the given ke...
[ "Return", "True", "if", "this", "AdfKey", "contains", "the", "given", "subkey", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L193-L217
[ "def", "has_subkey", "(", "self", ",", "subkey", ")", ":", "if", "isinstance", "(", "subkey", ",", "str", ")", ":", "key", "=", "subkey", "elif", "isinstance", "(", "subkey", ",", "AdfKey", ")", ":", "key", "=", "subkey", ".", "key", "else", ":", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.add_subkey
Add a new subkey to this key. Parameters ---------- subkey : AdfKey A new subkey. Notes ----- Duplicate check will not be performed if this is an 'Atoms' block.
pymatgen/io/adf.py
def add_subkey(self, subkey): """ Add a new subkey to this key. Parameters ---------- subkey : AdfKey A new subkey. Notes ----- Duplicate check will not be performed if this is an 'Atoms' block. """ if self.key.lower() == 'at...
def add_subkey(self, subkey): """ Add a new subkey to this key. Parameters ---------- subkey : AdfKey A new subkey. Notes ----- Duplicate check will not be performed if this is an 'Atoms' block. """ if self.key.lower() == 'at...
[ "Add", "a", "new", "subkey", "to", "this", "key", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L219-L234
[ "def", "add_subkey", "(", "self", ",", "subkey", ")", ":", "if", "self", ".", "key", ".", "lower", "(", ")", "==", "'atoms'", "or", "not", "self", ".", "has_subkey", "(", "subkey", ")", ":", "self", ".", "subkeys", ".", "append", "(", "subkey", ")"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.remove_subkey
Remove the given subkey, if existed, from this AdfKey. Parameters ---------- subkey : str or AdfKey The subkey to remove.
pymatgen/io/adf.py
def remove_subkey(self, subkey): """ Remove the given subkey, if existed, from this AdfKey. Parameters ---------- subkey : str or AdfKey The subkey to remove. """ if len(self.subkeys) > 0: key = subkey if isinstance(subkey, str) else subk...
def remove_subkey(self, subkey): """ Remove the given subkey, if existed, from this AdfKey. Parameters ---------- subkey : str or AdfKey The subkey to remove. """ if len(self.subkeys) > 0: key = subkey if isinstance(subkey, str) else subk...
[ "Remove", "the", "given", "subkey", "if", "existed", "from", "this", "AdfKey", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L236-L251
[ "def", "remove_subkey", "(", "self", ",", "subkey", ")", ":", "if", "len", "(", "self", ".", "subkeys", ")", ">", "0", ":", "key", "=", "subkey", "if", "isinstance", "(", "subkey", ",", "str", ")", "else", "subkey", ".", "key", "for", "i", "in", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.add_option
Add a new option to this key. Parameters ---------- option : Sized or str or int or float A new option to add. This must have the same format with exsiting options. Raises ------ TypeError If the format of the given ``option`` is diff...
pymatgen/io/adf.py
def add_option(self, option): """ Add a new option to this key. Parameters ---------- option : Sized or str or int or float A new option to add. This must have the same format with exsiting options. Raises ------ TypeError ...
def add_option(self, option): """ Add a new option to this key. Parameters ---------- option : Sized or str or int or float A new option to add. This must have the same format with exsiting options. Raises ------ TypeError ...
[ "Add", "a", "new", "option", "to", "this", "key", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L253-L275
[ "def", "add_option", "(", "self", ",", "option", ")", ":", "if", "len", "(", "self", ".", "options", ")", "==", "0", ":", "self", ".", "options", ".", "append", "(", "option", ")", "else", ":", "sized_op", "=", "isinstance", "(", "option", ",", "("...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.remove_option
Remove an option. Parameters ---------- option : str or int The name (str) or index (int) of the option to remove. Raises ------ TypeError If the option has a wrong type.
pymatgen/io/adf.py
def remove_option(self, option): """ Remove an option. Parameters ---------- option : str or int The name (str) or index (int) of the option to remove. Raises ------ TypeError If the option has a wrong type. """ i...
def remove_option(self, option): """ Remove an option. Parameters ---------- option : str or int The name (str) or index (int) of the option to remove. Raises ------ TypeError If the option has a wrong type. """ i...
[ "Remove", "an", "option", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L277-L303
[ "def", "remove_option", "(", "self", ",", "option", ")", ":", "if", "len", "(", "self", ".", "options", ")", ">", "0", ":", "if", "self", ".", "_sized_op", ":", "if", "not", "isinstance", "(", "option", ",", "str", ")", ":", "raise", "TypeError", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.has_option
Return True if the option is included in this key. Parameters ---------- option : str The option. Returns ------- has : bool True if the option can be found. Otherwise False will be returned.
pymatgen/io/adf.py
def has_option(self, option): """ Return True if the option is included in this key. Parameters ---------- option : str The option. Returns ------- has : bool True if the option can be found. Otherwise False will be returned. ...
def has_option(self, option): """ Return True if the option is included in this key. Parameters ---------- option : str The option. Returns ------- has : bool True if the option can be found. Otherwise False will be returned. ...
[ "Return", "True", "if", "the", "option", "is", "included", "in", "this", "key", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L305-L325
[ "def", "has_option", "(", "self", ",", "option", ")", ":", "if", "len", "(", "self", ".", "options", ")", "==", "0", ":", "return", "False", "for", "op", "in", "self", ".", "options", ":", "if", "(", "self", ".", "_sized_op", "and", "op", "[", "0...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.as_dict
A JSON serializable dict representation of self.
pymatgen/io/adf.py
def as_dict(self): """ A JSON serializable dict representation of self. """ d = {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "name": self.name, "options": self.options} if len(self.subkeys) > 0: subkeys = [] ...
def as_dict(self): """ A JSON serializable dict representation of self. """ d = {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "name": self.name, "options": self.options} if len(self.subkeys) > 0: subkeys = [] ...
[ "A", "JSON", "serializable", "dict", "representation", "of", "self", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L327-L339
[ "def", "as_dict", "(", "self", ")", ":", "d", "=", "{", "\"@module\"", ":", "self", ".", "__class__", ".", "__module__", ",", "\"@class\"", ":", "self", ".", "__class__", ".", "__name__", ",", "\"name\"", ":", "self", ".", "name", ",", "\"options\"", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.from_dict
Construct a MSONable AdfKey object from the JSON dict. Parameters ---------- d : dict A dict of saved attributes. Returns ------- adfkey : AdfKey An AdfKey object recovered from the JSON dict ``d``.
pymatgen/io/adf.py
def from_dict(cls, d): """ Construct a MSONable AdfKey object from the JSON dict. Parameters ---------- d : dict A dict of saved attributes. Returns ------- adfkey : AdfKey An AdfKey object recovered from the JSON dict ``d``. ...
def from_dict(cls, d): """ Construct a MSONable AdfKey object from the JSON dict. Parameters ---------- d : dict A dict of saved attributes. Returns ------- adfkey : AdfKey An AdfKey object recovered from the JSON dict ``d``. ...
[ "Construct", "a", "MSONable", "AdfKey", "object", "from", "the", "JSON", "dict", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L348-L370
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "key", "=", "d", ".", "get", "(", "\"name\"", ")", "options", "=", "d", ".", "get", "(", "\"options\"", ",", "None", ")", "subkey_list", "=", "d", ".", "get", "(", "\"subkeys\"", ",", "[", "]", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfKey.from_string
Construct an AdfKey object from the string. Parameters ---------- string : str A string. Returns ------- adfkey : AdfKey An AdfKey object recovered from the string. Raises ------ ValueError Currently nested su...
pymatgen/io/adf.py
def from_string(string): """ Construct an AdfKey object from the string. Parameters ---------- string : str A string. Returns ------- adfkey : AdfKey An AdfKey object recovered from the string. Raises ------ ...
def from_string(string): """ Construct an AdfKey object from the string. Parameters ---------- string : str A string. Returns ------- adfkey : AdfKey An AdfKey object recovered from the string. Raises ------ ...
[ "Construct", "an", "AdfKey", "object", "from", "the", "string", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L373-L440
[ "def", "from_string", "(", "string", ")", ":", "def", "is_float", "(", "s", ")", ":", "if", "'.'", "in", "s", "or", "'E'", "in", "s", "or", "'e'", "in", "s", ":", "return", "True", "else", ":", "return", "False", "if", "string", ".", "find", "(",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfTask._setup_task
Setup the block 'Geometry' given subkeys and the task. Parameters ---------- geo_subkeys : Sized User-defined subkeys for the block 'Geometry'. Notes ----- Most of the run types of ADF are specified in the Geometry block except the 'AnalyticFreq'.
pymatgen/io/adf.py
def _setup_task(self, geo_subkeys): """ Setup the block 'Geometry' given subkeys and the task. Parameters ---------- geo_subkeys : Sized User-defined subkeys for the block 'Geometry'. Notes ----- Most of the run types of ADF are specified in ...
def _setup_task(self, geo_subkeys): """ Setup the block 'Geometry' given subkeys and the task. Parameters ---------- geo_subkeys : Sized User-defined subkeys for the block 'Geometry'. Notes ----- Most of the run types of ADF are specified in ...
[ "Setup", "the", "block", "Geometry", "given", "subkeys", "and", "the", "task", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L522-L551
[ "def", "_setup_task", "(", "self", ",", "geo_subkeys", ")", ":", "self", ".", "geo", "=", "AdfKey", "(", "\"Geometry\"", ",", "subkeys", "=", "geo_subkeys", ")", "if", "self", ".", "operation", ".", "lower", "(", ")", "==", "\"energy\"", ":", "self", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfTask.as_dict
A JSON serializable dict representation of self.
pymatgen/io/adf.py
def as_dict(self): """ A JSON serializable dict representation of self. """ return {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "operation": self.operation, "title": self.title, "xc": self.xc.as_dict(), "basis_s...
def as_dict(self): """ A JSON serializable dict representation of self. """ return {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "operation": self.operation, "title": self.title, "xc": self.xc.as_dict(), "basis_s...
[ "A", "JSON", "serializable", "dict", "representation", "of", "self", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L570-L580
[ "def", "as_dict", "(", "self", ")", ":", "return", "{", "\"@module\"", ":", "self", ".", "__class__", ".", "__module__", ",", "\"@class\"", ":", "self", ".", "__class__", ".", "__name__", ",", "\"operation\"", ":", "self", ".", "operation", ",", "\"title\"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfTask.from_dict
Construct a MSONable AdfTask object from the JSON dict. Parameters ---------- d : dict A dict of saved attributes. Returns ------- task : AdfTask An AdfTask object recovered from the JSON dict ``d``.
pymatgen/io/adf.py
def from_dict(cls, d): """ Construct a MSONable AdfTask object from the JSON dict. Parameters ---------- d : dict A dict of saved attributes. Returns ------- task : AdfTask An AdfTask object recovered from the JSON dict ``d``. ...
def from_dict(cls, d): """ Construct a MSONable AdfTask object from the JSON dict. Parameters ---------- d : dict A dict of saved attributes. Returns ------- task : AdfTask An AdfTask object recovered from the JSON dict ``d``. ...
[ "Construct", "a", "MSONable", "AdfTask", "object", "from", "the", "JSON", "dict", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L589-L617
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "def", "_from_dict", "(", "_d", ")", ":", "return", "AdfKey", ".", "from_dict", "(", "_d", ")", "if", "_d", "is", "not", "None", "else", "None", "operation", "=", "d", ".", "get", "(", "\"operatio...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfInput.write_file
Write an ADF input file. Parameters ---------- molecule : Molecule The molecule for this task. inpfile : str The name where the input file will be saved.
pymatgen/io/adf.py
def write_file(self, molecule, inpfile): """ Write an ADF input file. Parameters ---------- molecule : Molecule The molecule for this task. inpfile : str The name where the input file will be saved. """ mol_blocks = [] at...
def write_file(self, molecule, inpfile): """ Write an ADF input file. Parameters ---------- molecule : Molecule The molecule for this task. inpfile : str The name where the input file will be saved. """ mol_blocks = [] at...
[ "Write", "an", "ADF", "input", "file", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L637-L669
[ "def", "write_file", "(", "self", ",", "molecule", ",", "inpfile", ")", ":", "mol_blocks", "=", "[", "]", "atom_block", "=", "AdfKey", "(", "\"Atoms\"", ",", "options", "=", "[", "\"cartesian\"", "]", ")", "for", "site", "in", "molecule", ":", "atom_bloc...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfOutput._parse
Parse the ADF outputs. There are two files: one is 'logfile', the other is the ADF output file. The final energy and structures are parsed from the 'logfile'. Frequencies and normal modes are parsed from the ADF output file.
pymatgen/io/adf.py
def _parse(self): """ Parse the ADF outputs. There are two files: one is 'logfile', the other is the ADF output file. The final energy and structures are parsed from the 'logfile'. Frequencies and normal modes are parsed from the ADF output file. """ workdir = os....
def _parse(self): """ Parse the ADF outputs. There are two files: one is 'logfile', the other is the ADF output file. The final energy and structures are parsed from the 'logfile'. Frequencies and normal modes are parsed from the ADF output file. """ workdir = os....
[ "Parse", "the", "ADF", "outputs", ".", "There", "are", "two", "files", ":", "one", "is", "logfile", "the", "other", "is", "the", "ADF", "output", "file", ".", "The", "final", "energy", "and", "structures", "are", "parsed", "from", "the", "logfile", ".", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L718-L744
[ "def", "_parse", "(", "self", ")", ":", "workdir", "=", "os", ".", "path", ".", "dirname", "(", "self", ".", "filename", ")", "logfile", "=", "os", ".", "path", ".", "join", "(", "workdir", ",", "\"logfile\"", ")", "if", "not", "os", ".", "path", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfOutput._parse_logfile
Parse the formatted logfile.
pymatgen/io/adf.py
def _parse_logfile(self, logfile): """ Parse the formatted logfile. """ cycle_patt = re.compile(r"Coordinates\sin\sGeometry\sCycle\s(\d+)") coord_patt = re.compile(r"\s+([0-9]+)\.([A-Za-z]+)"+3*r"\s+([-\.0-9]+)") energy_patt = re.compile(r"<.*>\s<.*>\s+current\senergy\s+...
def _parse_logfile(self, logfile): """ Parse the formatted logfile. """ cycle_patt = re.compile(r"Coordinates\sin\sGeometry\sCycle\s(\d+)") coord_patt = re.compile(r"\s+([0-9]+)\.([A-Za-z]+)"+3*r"\s+([-\.0-9]+)") energy_patt = re.compile(r"<.*>\s<.*>\s+current\senergy\s+...
[ "Parse", "the", "formatted", "logfile", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L765-L876
[ "def", "_parse_logfile", "(", "self", ",", "logfile", ")", ":", "cycle_patt", "=", "re", ".", "compile", "(", "r\"Coordinates\\sin\\sGeometry\\sCycle\\s(\\d+)\"", ")", "coord_patt", "=", "re", ".", "compile", "(", "r\"\\s+([0-9]+)\\.([A-Za-z]+)\"", "+", "3", "*", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AdfOutput._parse_adf_output
Parse the standard ADF output file.
pymatgen/io/adf.py
def _parse_adf_output(self): """ Parse the standard ADF output file. """ numerical_freq_patt = re.compile( r"\s+\*\s+F\sR\sE\sQ\sU\sE\sN\sC\sI\sE\sS\s+\*") analytic_freq_patt = re.compile( r"\s+\*\s+F\sR\sE\sQ\sU\sE\sN\sC\sY\s+A\sN\sA\sL\sY\sS\sI\sS\s+\*")...
def _parse_adf_output(self): """ Parse the standard ADF output file. """ numerical_freq_patt = re.compile( r"\s+\*\s+F\sR\sE\sQ\sU\sE\sN\sC\sI\sE\sS\s+\*") analytic_freq_patt = re.compile( r"\s+\*\s+F\sR\sE\sQ\sU\sE\sN\sC\sY\s+A\sN\sA\sL\sY\sS\sI\sS\s+\*")...
[ "Parse", "the", "standard", "ADF", "output", "file", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/adf.py#L878-L967
[ "def", "_parse_adf_output", "(", "self", ")", ":", "numerical_freq_patt", "=", "re", ".", "compile", "(", "r\"\\s+\\*\\s+F\\sR\\sE\\sQ\\sU\\sE\\sN\\sC\\sI\\sE\\sS\\s+\\*\"", ")", "analytic_freq_patt", "=", "re", ".", "compile", "(", "r\"\\s+\\*\\s+F\\sR\\sE\\sQ\\sU\\sE\\sN\\s...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
get_reconstructed_band_structure
This method takes a list of band structures and reconstructs one band structure object from all of them. This is typically very useful when you split non self consistent band structure runs in several independent jobs and want to merge back the results Args: list_bs: A list of BandStructur...
pymatgen/electronic_structure/bandstructure.py
def get_reconstructed_band_structure(list_bs, efermi=None): """ This method takes a list of band structures and reconstructs one band structure object from all of them. This is typically very useful when you split non self consistent band structure runs in several independent jobs and want to merge...
def get_reconstructed_band_structure(list_bs, efermi=None): """ This method takes a list of band structures and reconstructs one band structure object from all of them. This is typically very useful when you split non self consistent band structure runs in several independent jobs and want to merge...
[ "This", "method", "takes", "a", "list", "of", "band", "structures", "and", "reconstructs", "one", "band", "structure", "object", "from", "all", "of", "them", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/electronic_structure/bandstructure.py#L962-L1019
[ "def", "get_reconstructed_band_structure", "(", "list_bs", ",", "efermi", "=", "None", ")", ":", "if", "efermi", "is", "None", ":", "efermi", "=", "sum", "(", "[", "b", ".", "efermi", "for", "b", "in", "list_bs", "]", ")", "/", "len", "(", "list_bs", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da