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 | CollinearMagneticStructureAnalyzer.ordering | Applies heuristics to return a magnetic ordering for a collinear
magnetic structure. Result is not guaranteed for correctness.
:return: Ordering Enum ('FiM' is used as the abbreviation for
ferrimagnetic) | pymatgen/analysis/magnetism/analyzer.py | def ordering(self):
"""
Applies heuristics to return a magnetic ordering for a collinear
magnetic structure. Result is not guaranteed for correctness.
:return: Ordering Enum ('FiM' is used as the abbreviation for
ferrimagnetic)
"""
if not self.is_collinear:
... | def ordering(self):
"""
Applies heuristics to return a magnetic ordering for a collinear
magnetic structure. Result is not guaranteed for correctness.
:return: Ordering Enum ('FiM' is used as the abbreviation for
ferrimagnetic)
"""
if not self.is_collinear:
... | [
"Applies",
"heuristics",
"to",
"return",
"a",
"magnetic",
"ordering",
"for",
"a",
"collinear",
"magnetic",
"structure",
".",
"Result",
"is",
"not",
"guaranteed",
"for",
"correctness",
".",
":",
"return",
":",
"Ordering",
"Enum",
"(",
"FiM",
"is",
"used",
"as... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/magnetism/analyzer.py#L502-L536 | [
"def",
"ordering",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_collinear",
":",
"warnings",
".",
"warn",
"(",
"\"Detecting ordering in non-collinear structures not yet implemented.\"",
")",
"return",
"Ordering",
".",
"Unknown",
"if",
"\"magmom\"",
"not",
"i... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CollinearMagneticStructureAnalyzer.get_exchange_group_info | Returns the information on the symmetry of the Hamiltonian
describing the exchange energy of the system, taking into
account relative direction of magnetic moments but not their
absolute direction.
This is not strictly accurate (e.g. some/many atoms will
have zero magnetic momen... | pymatgen/analysis/magnetism/analyzer.py | def get_exchange_group_info(self, symprec=1e-2, angle_tolerance=5.0):
"""
Returns the information on the symmetry of the Hamiltonian
describing the exchange energy of the system, taking into
account relative direction of magnetic moments but not their
absolute direction.
... | def get_exchange_group_info(self, symprec=1e-2, angle_tolerance=5.0):
"""
Returns the information on the symmetry of the Hamiltonian
describing the exchange energy of the system, taking into
account relative direction of magnetic moments but not their
absolute direction.
... | [
"Returns",
"the",
"information",
"on",
"the",
"symmetry",
"of",
"the",
"Hamiltonian",
"describing",
"the",
"exchange",
"energy",
"of",
"the",
"system",
"taking",
"into",
"account",
"relative",
"direction",
"of",
"magnetic",
"moments",
"but",
"not",
"their",
"abs... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/magnetism/analyzer.py#L538-L559 | [
"def",
"get_exchange_group_info",
"(",
"self",
",",
"symprec",
"=",
"1e-2",
",",
"angle_tolerance",
"=",
"5.0",
")",
":",
"structure",
"=",
"self",
".",
"get_structure_with_spin",
"(",
")",
"return",
"structure",
".",
"get_space_group_info",
"(",
"symprec",
"=",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CollinearMagneticStructureAnalyzer.matches_ordering | Compares the magnetic orderings of one structure with another.
:param other: Structure
:return (bool): | pymatgen/analysis/magnetism/analyzer.py | def matches_ordering(self, other):
"""
Compares the magnetic orderings of one structure with another.
:param other: Structure
:return (bool):
"""
a = CollinearMagneticStructureAnalyzer(
self.structure, overwrite_magmom_mode="normalize"
).get_structure... | def matches_ordering(self, other):
"""
Compares the magnetic orderings of one structure with another.
:param other: Structure
:return (bool):
"""
a = CollinearMagneticStructureAnalyzer(
self.structure, overwrite_magmom_mode="normalize"
).get_structure... | [
"Compares",
"the",
"magnetic",
"orderings",
"of",
"one",
"structure",
"with",
"another",
".",
":",
"param",
"other",
":",
"Structure",
":",
"return",
"(",
"bool",
")",
":"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/magnetism/analyzer.py#L561-L597 | [
"def",
"matches_ordering",
"(",
"self",
",",
"other",
")",
":",
"a",
"=",
"CollinearMagneticStructureAnalyzer",
"(",
"self",
".",
"structure",
",",
"overwrite_magmom_mode",
"=",
"\"normalize\"",
")",
".",
"get_structure_with_spin",
"(",
")",
"# sign of spins doesn't m... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MagneticStructureEnumerator._sanitize_input_structure | Sanitize our input structure by removing magnetic information
and making primitive.
Args:
input_structure: Structure
Returns: Structure | pymatgen/analysis/magnetism/analyzer.py | def _sanitize_input_structure(input_structure):
"""
Sanitize our input structure by removing magnetic information
and making primitive.
Args:
input_structure: Structure
Returns: Structure
"""
input_structure = input_structure.copy()
# remov... | def _sanitize_input_structure(input_structure):
"""
Sanitize our input structure by removing magnetic information
and making primitive.
Args:
input_structure: Structure
Returns: Structure
"""
input_structure = input_structure.copy()
# remov... | [
"Sanitize",
"our",
"input",
"structure",
"by",
"removing",
"magnetic",
"information",
"and",
"making",
"primitive",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/magnetism/analyzer.py#L740-L765 | [
"def",
"_sanitize_input_structure",
"(",
"input_structure",
")",
":",
"input_structure",
"=",
"input_structure",
".",
"copy",
"(",
")",
"# remove any annotated spin",
"input_structure",
".",
"remove_spin",
"(",
")",
"# sanitize input structure: first make primitive ...",
"inp... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MagneticStructureEnumerator._generate_transformations | The central problem with trying to enumerate magnetic orderings is
that we have to enumerate orderings that might plausibly be magnetic
ground states, while not enumerating orderings that are physically
implausible. The problem is that it is not always obvious by e.g.
symmetry arguments ... | pymatgen/analysis/magnetism/analyzer.py | def _generate_transformations(self, structure):
"""
The central problem with trying to enumerate magnetic orderings is
that we have to enumerate orderings that might plausibly be magnetic
ground states, while not enumerating orderings that are physically
implausible. The problem ... | def _generate_transformations(self, structure):
"""
The central problem with trying to enumerate magnetic orderings is
that we have to enumerate orderings that might plausibly be magnetic
ground states, while not enumerating orderings that are physically
implausible. The problem ... | [
"The",
"central",
"problem",
"with",
"trying",
"to",
"enumerate",
"magnetic",
"orderings",
"is",
"that",
"we",
"have",
"to",
"enumerate",
"orderings",
"that",
"might",
"plausibly",
"be",
"magnetic",
"ground",
"states",
"while",
"not",
"enumerating",
"orderings",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/magnetism/analyzer.py#L767-L994 | [
"def",
"_generate_transformations",
"(",
"self",
",",
"structure",
")",
":",
"formula",
"=",
"structure",
".",
"composition",
".",
"reduced_formula",
"transformations",
"=",
"{",
"}",
"# analyzer is used to obtain information on sanitized input",
"analyzer",
"=",
"Colline... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MagneticStructureEnumerator._generate_ordered_structures | Apply our input structure to our list of transformations and output a list
of ordered structures that have been pruned for duplicates and for those
with low symmetry (optional).
Args:
sanitized_input_structure: A sanitized input structure
(_sanitize_input_structure)
... | pymatgen/analysis/magnetism/analyzer.py | def _generate_ordered_structures(self, sanitized_input_structure, transformations):
"""
Apply our input structure to our list of transformations and output a list
of ordered structures that have been pruned for duplicates and for those
with low symmetry (optional).
Args:
... | def _generate_ordered_structures(self, sanitized_input_structure, transformations):
"""
Apply our input structure to our list of transformations and output a list
of ordered structures that have been pruned for duplicates and for those
with low symmetry (optional).
Args:
... | [
"Apply",
"our",
"input",
"structure",
"to",
"our",
"list",
"of",
"transformations",
"and",
"output",
"a",
"list",
"of",
"ordered",
"structures",
"that",
"have",
"been",
"pruned",
"for",
"duplicates",
"and",
"for",
"those",
"with",
"low",
"symmetry",
"(",
"op... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/magnetism/analyzer.py#L996-L1167 | [
"def",
"_generate_ordered_structures",
"(",
"self",
",",
"sanitized_input_structure",
",",
"transformations",
")",
":",
"ordered_structures",
"=",
"self",
".",
"ordered_structures",
"ordered_structures_origins",
"=",
"self",
".",
"ordered_structure_origins",
"# utility functi... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | str2float | Remove uncertainty brackets from strings and return the float. | pymatgen/io/cif.py | def str2float(text):
"""
Remove uncertainty brackets from strings and return the float.
"""
try:
# Note that the ending ) is sometimes missing. That is why the code has
# been modified to treat it as optional. Same logic applies to lists.
return float(re.sub(r"\(.+\)*", "", text... | def str2float(text):
"""
Remove uncertainty brackets from strings and return the float.
"""
try:
# Note that the ending ) is sometimes missing. That is why the code has
# been modified to treat it as optional. Same logic applies to lists.
return float(re.sub(r"\(.+\)*", "", text... | [
"Remove",
"uncertainty",
"brackets",
"from",
"strings",
"and",
"return",
"the",
"float",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L1374-L1389 | [
"def",
"str2float",
"(",
"text",
")",
":",
"try",
":",
"# Note that the ending ) is sometimes missing. That is why the code has",
"# been modified to treat it as optional. Same logic applies to lists.",
"return",
"float",
"(",
"re",
".",
"sub",
"(",
"r\"\\(.+\\)*\"",
",",
"\"\"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser._sanitize_data | Some CIF files do not conform to spec. This function corrects
known issues, particular in regards to Springer materials/
Pauling files.
This function is here so that CifParser can assume its
input conforms to spec, simplifying its implementation.
:param data: CifBlock
:r... | pymatgen/io/cif.py | def _sanitize_data(self, data):
"""
Some CIF files do not conform to spec. This function corrects
known issues, particular in regards to Springer materials/
Pauling files.
This function is here so that CifParser can assume its
input conforms to spec, simplifying its impl... | def _sanitize_data(self, data):
"""
Some CIF files do not conform to spec. This function corrects
known issues, particular in regards to Springer materials/
Pauling files.
This function is here so that CifParser can assume its
input conforms to spec, simplifying its impl... | [
"Some",
"CIF",
"files",
"do",
"not",
"conform",
"to",
"spec",
".",
"This",
"function",
"corrects",
"known",
"issues",
"particular",
"in",
"regards",
"to",
"Springer",
"materials",
"/",
"Pauling",
"files",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L377-L571 | [
"def",
"_sanitize_data",
"(",
"self",
",",
"data",
")",
":",
"\"\"\"\n This part of the code deals with handling formats of data as found in\n CIF files extracted from the Springer Materials/Pauling File\n databases, and that are different from standard ICSD formats.\n \"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser._unique_coords | Generate unique coordinates using coord and symmetry positions
and also their corresponding magnetic moments, if supplied. | pymatgen/io/cif.py | def _unique_coords(self, coords_in, magmoms_in=None, lattice=None):
"""
Generate unique coordinates using coord and symmetry positions
and also their corresponding magnetic moments, if supplied.
"""
coords = []
if magmoms_in:
magmoms = []
if len(ma... | def _unique_coords(self, coords_in, magmoms_in=None, lattice=None):
"""
Generate unique coordinates using coord and symmetry positions
and also their corresponding magnetic moments, if supplied.
"""
coords = []
if magmoms_in:
magmoms = []
if len(ma... | [
"Generate",
"unique",
"coordinates",
"using",
"coord",
"and",
"symmetry",
"positions",
"and",
"also",
"their",
"corresponding",
"magnetic",
"moments",
"if",
"supplied",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L573-L610 | [
"def",
"_unique_coords",
"(",
"self",
",",
"coords_in",
",",
"magmoms_in",
"=",
"None",
",",
"lattice",
"=",
"None",
")",
":",
"coords",
"=",
"[",
"]",
"if",
"magmoms_in",
":",
"magmoms",
"=",
"[",
"]",
"if",
"len",
"(",
"magmoms_in",
")",
"!=",
"len... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser.get_lattice | Generate the lattice from the provided lattice parameters. In
the absence of all six lattice parameters, the crystal system
and necessary parameters are parsed | pymatgen/io/cif.py | def get_lattice(self, data, length_strings=("a", "b", "c"),
angle_strings=("alpha", "beta", "gamma"),
lattice_type=None):
"""
Generate the lattice from the provided lattice parameters. In
the absence of all six lattice parameters, the crystal system
... | def get_lattice(self, data, length_strings=("a", "b", "c"),
angle_strings=("alpha", "beta", "gamma"),
lattice_type=None):
"""
Generate the lattice from the provided lattice parameters. In
the absence of all six lattice parameters, the crystal system
... | [
"Generate",
"the",
"lattice",
"from",
"the",
"provided",
"lattice",
"parameters",
".",
"In",
"the",
"absence",
"of",
"all",
"six",
"lattice",
"parameters",
"the",
"crystal",
"system",
"and",
"necessary",
"parameters",
"are",
"parsed"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L612-L654 | [
"def",
"get_lattice",
"(",
"self",
",",
"data",
",",
"length_strings",
"=",
"(",
"\"a\"",
",",
"\"b\"",
",",
"\"c\"",
")",
",",
"angle_strings",
"=",
"(",
"\"alpha\"",
",",
"\"beta\"",
",",
"\"gamma\"",
")",
",",
"lattice_type",
"=",
"None",
")",
":",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser.get_symops | In order to generate symmetry equivalent positions, the symmetry
operations are parsed. If the symops are not present, the space
group symbol is parsed, and symops are generated. | pymatgen/io/cif.py | def get_symops(self, data):
"""
In order to generate symmetry equivalent positions, the symmetry
operations are parsed. If the symops are not present, the space
group symbol is parsed, and symops are generated.
"""
symops = []
for symmetry_label in ["_symmetry_equ... | def get_symops(self, data):
"""
In order to generate symmetry equivalent positions, the symmetry
operations are parsed. If the symops are not present, the space
group symbol is parsed, and symops are generated.
"""
symops = []
for symmetry_label in ["_symmetry_equ... | [
"In",
"order",
"to",
"generate",
"symmetry",
"equivalent",
"positions",
"the",
"symmetry",
"operations",
"are",
"parsed",
".",
"If",
"the",
"symops",
"are",
"not",
"present",
"the",
"space",
"group",
"symbol",
"is",
"parsed",
"and",
"symops",
"are",
"generated... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L656-L749 | [
"def",
"get_symops",
"(",
"self",
",",
"data",
")",
":",
"symops",
"=",
"[",
"]",
"for",
"symmetry_label",
"in",
"[",
"\"_symmetry_equiv_pos_as_xyz\"",
",",
"\"_symmetry_equiv_pos_as_xyz_\"",
",",
"\"_space_group_symop_operation_xyz\"",
",",
"\"_space_group_symop_operatio... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser.get_magsymops | Equivalent to get_symops except for magnetic symmetry groups.
Separate function since additional operation for time reversal symmetry
(which changes magnetic moments on sites) needs to be returned. | pymatgen/io/cif.py | def get_magsymops(self, data):
"""
Equivalent to get_symops except for magnetic symmetry groups.
Separate function since additional operation for time reversal symmetry
(which changes magnetic moments on sites) needs to be returned.
"""
magsymmops = []
# check to... | def get_magsymops(self, data):
"""
Equivalent to get_symops except for magnetic symmetry groups.
Separate function since additional operation for time reversal symmetry
(which changes magnetic moments on sites) needs to be returned.
"""
magsymmops = []
# check to... | [
"Equivalent",
"to",
"get_symops",
"except",
"for",
"magnetic",
"symmetry",
"groups",
".",
"Separate",
"function",
"since",
"additional",
"operation",
"for",
"time",
"reversal",
"symmetry",
"(",
"which",
"changes",
"magnetic",
"moments",
"on",
"sites",
")",
"needs"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L751-L820 | [
"def",
"get_magsymops",
"(",
"self",
",",
"data",
")",
":",
"magsymmops",
"=",
"[",
"]",
"# check to see if magCIF file explicitly contains magnetic symmetry operations",
"if",
"data",
".",
"data",
".",
"get",
"(",
"\"_space_group_symop_magn_operation.xyz\"",
")",
":",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser.parse_oxi_states | Parse oxidation states from data dictionary | pymatgen/io/cif.py | def parse_oxi_states(self, data):
"""
Parse oxidation states from data dictionary
"""
try:
oxi_states = {
data["_atom_type_symbol"][i]:
str2float(data["_atom_type_oxidation_number"][i])
for i in range(len(data["_atom_type_sy... | def parse_oxi_states(self, data):
"""
Parse oxidation states from data dictionary
"""
try:
oxi_states = {
data["_atom_type_symbol"][i]:
str2float(data["_atom_type_oxidation_number"][i])
for i in range(len(data["_atom_type_sy... | [
"Parse",
"oxidation",
"states",
"from",
"data",
"dictionary"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L822-L839 | [
"def",
"parse_oxi_states",
"(",
"self",
",",
"data",
")",
":",
"try",
":",
"oxi_states",
"=",
"{",
"data",
"[",
"\"_atom_type_symbol\"",
"]",
"[",
"i",
"]",
":",
"str2float",
"(",
"data",
"[",
"\"_atom_type_oxidation_number\"",
"]",
"[",
"i",
"]",
")",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser.parse_magmoms | Parse atomic magnetic moments from data dictionary | pymatgen/io/cif.py | def parse_magmoms(self, data, lattice=None):
"""
Parse atomic magnetic moments from data dictionary
"""
if lattice is None:
raise Exception(
'Magmoms given in terms of crystal axes in magCIF spec.')
try:
magmoms = {
data["_a... | def parse_magmoms(self, data, lattice=None):
"""
Parse atomic magnetic moments from data dictionary
"""
if lattice is None:
raise Exception(
'Magmoms given in terms of crystal axes in magCIF spec.')
try:
magmoms = {
data["_a... | [
"Parse",
"atomic",
"magnetic",
"moments",
"from",
"data",
"dictionary"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L841-L860 | [
"def",
"parse_magmoms",
"(",
"self",
",",
"data",
",",
"lattice",
"=",
"None",
")",
":",
"if",
"lattice",
"is",
"None",
":",
"raise",
"Exception",
"(",
"'Magmoms given in terms of crystal axes in magCIF spec.'",
")",
"try",
":",
"magmoms",
"=",
"{",
"data",
"[... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser._parse_symbol | Parse a string with a symbol to extract a string representing an element.
Args:
sym (str): A symbol to be parsed.
Returns:
A string with the parsed symbol. None if no parsing was possible. | pymatgen/io/cif.py | def _parse_symbol(self, sym):
"""
Parse a string with a symbol to extract a string representing an element.
Args:
sym (str): A symbol to be parsed.
Returns:
A string with the parsed symbol. None if no parsing was possible.
"""
# Common representa... | def _parse_symbol(self, sym):
"""
Parse a string with a symbol to extract a string representing an element.
Args:
sym (str): A symbol to be parsed.
Returns:
A string with the parsed symbol. None if no parsing was possible.
"""
# Common representa... | [
"Parse",
"a",
"string",
"with",
"a",
"symbol",
"to",
"extract",
"a",
"string",
"representing",
"an",
"element",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L862-L898 | [
"def",
"_parse_symbol",
"(",
"self",
",",
"sym",
")",
":",
"# Common representations for elements/water in cif files",
"# TODO: fix inconsistent handling of water",
"special",
"=",
"{",
"\"Hw\"",
":",
"\"H\"",
",",
"\"Ow\"",
":",
"\"O\"",
",",
"\"Wat\"",
":",
"\"O\"",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser._get_structure | Generate structure from part of the cif. | pymatgen/io/cif.py | def _get_structure(self, data, primitive):
"""
Generate structure from part of the cif.
"""
def get_num_implicit_hydrogens(sym):
num_h = {"Wat": 2, "wat": 2, "O-H": 1}
return num_h.get(sym[:3], 0)
lattice = self.get_lattice(data)
# if magCIF, ge... | def _get_structure(self, data, primitive):
"""
Generate structure from part of the cif.
"""
def get_num_implicit_hydrogens(sym):
num_h = {"Wat": 2, "wat": 2, "O-H": 1}
return num_h.get(sym[:3], 0)
lattice = self.get_lattice(data)
# if magCIF, ge... | [
"Generate",
"structure",
"from",
"part",
"of",
"the",
"cif",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L900-L1079 | [
"def",
"_get_structure",
"(",
"self",
",",
"data",
",",
"primitive",
")",
":",
"def",
"get_num_implicit_hydrogens",
"(",
"sym",
")",
":",
"num_h",
"=",
"{",
"\"Wat\"",
":",
"2",
",",
"\"wat\"",
":",
"2",
",",
"\"O-H\"",
":",
"1",
"}",
"return",
"num_h"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser.get_structures | Return list of structures in CIF file. primitive boolean sets whether a
conventional cell structure or primitive cell structure is returned.
Args:
primitive (bool): Set to False to return conventional unit cells.
Defaults to True. With magnetic CIF files, will return primiti... | pymatgen/io/cif.py | def get_structures(self, primitive=True):
"""
Return list of structures in CIF file. primitive boolean sets whether a
conventional cell structure or primitive cell structure is returned.
Args:
primitive (bool): Set to False to return conventional unit cells.
... | def get_structures(self, primitive=True):
"""
Return list of structures in CIF file. primitive boolean sets whether a
conventional cell structure or primitive cell structure is returned.
Args:
primitive (bool): Set to False to return conventional unit cells.
... | [
"Return",
"list",
"of",
"structures",
"in",
"CIF",
"file",
".",
"primitive",
"boolean",
"sets",
"whether",
"a",
"conventional",
"cell",
"structure",
"or",
"primitive",
"cell",
"structure",
"is",
"returned",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L1081-L1112 | [
"def",
"get_structures",
"(",
"self",
",",
"primitive",
"=",
"True",
")",
":",
"structures",
"=",
"[",
"]",
"for",
"d",
"in",
"self",
".",
"_cif",
".",
"data",
".",
"values",
"(",
")",
":",
"try",
":",
"s",
"=",
"self",
".",
"_get_structure",
"(",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | CifParser.get_bibtex_string | Get BibTeX reference from CIF file.
:param data:
:return: BibTeX string | pymatgen/io/cif.py | def get_bibtex_string(self):
"""
Get BibTeX reference from CIF file.
:param data:
:return: BibTeX string
"""
bibtex_keys = {'author': ('_publ_author_name', '_citation_author_name'),
'title': ('_publ_section_title', '_citation_title'),
... | def get_bibtex_string(self):
"""
Get BibTeX reference from CIF file.
:param data:
:return: BibTeX string
"""
bibtex_keys = {'author': ('_publ_author_name', '_citation_author_name'),
'title': ('_publ_section_title', '_citation_title'),
... | [
"Get",
"BibTeX",
"reference",
"from",
"CIF",
"file",
".",
":",
"param",
"data",
":",
":",
"return",
":",
"BibTeX",
"string"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/cif.py#L1115-L1174 | [
"def",
"get_bibtex_string",
"(",
"self",
")",
":",
"bibtex_keys",
"=",
"{",
"'author'",
":",
"(",
"'_publ_author_name'",
",",
"'_citation_author_name'",
")",
",",
"'title'",
":",
"(",
"'_publ_section_title'",
",",
"'_citation_title'",
")",
",",
"'journal'",
":",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | entry_dict_from_list | Converts a list of SlabEntry to an appropriate dictionary. It is
assumed that if there is no adsorbate, then it is a clean SlabEntry
and that adsorbed SlabEntry has the clean_entry parameter set.
Args:
all_slab_entries (list): List of SlabEntry objects
Returns:
(dict): Dictionary of Sl... | pymatgen/analysis/surface_analysis.py | def entry_dict_from_list(all_slab_entries):
"""
Converts a list of SlabEntry to an appropriate dictionary. It is
assumed that if there is no adsorbate, then it is a clean SlabEntry
and that adsorbed SlabEntry has the clean_entry parameter set.
Args:
all_slab_entries (list): List of SlabEntr... | def entry_dict_from_list(all_slab_entries):
"""
Converts a list of SlabEntry to an appropriate dictionary. It is
assumed that if there is no adsorbate, then it is a clean SlabEntry
and that adsorbed SlabEntry has the clean_entry parameter set.
Args:
all_slab_entries (list): List of SlabEntr... | [
"Converts",
"a",
"list",
"of",
"SlabEntry",
"to",
"an",
"appropriate",
"dictionary",
".",
"It",
"is",
"assumed",
"that",
"if",
"there",
"is",
"no",
"adsorbate",
"then",
"it",
"is",
"a",
"clean",
"SlabEntry",
"and",
"that",
"adsorbed",
"SlabEntry",
"has",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1286-L1316 | [
"def",
"entry_dict_from_list",
"(",
"all_slab_entries",
")",
":",
"entry_dict",
"=",
"{",
"}",
"for",
"entry",
"in",
"all_slab_entries",
":",
"hkl",
"=",
"tuple",
"(",
"entry",
".",
"miller_index",
")",
"if",
"hkl",
"not",
"in",
"entry_dict",
".",
"keys",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | sub_chempots | Uses dot product of numpy array to sub chemical potentials
into the surface grand potential. This is much faster
than using the subs function in sympy.
Args:
gamma_dict (dict): Surface grand potential equation
as a coefficient dictionary
chempots (dict): Dictionary assign... | pymatgen/analysis/surface_analysis.py | def sub_chempots(gamma_dict, chempots):
"""
Uses dot product of numpy array to sub chemical potentials
into the surface grand potential. This is much faster
than using the subs function in sympy.
Args:
gamma_dict (dict): Surface grand potential equation
as a coefficient d... | def sub_chempots(gamma_dict, chempots):
"""
Uses dot product of numpy array to sub chemical potentials
into the surface grand potential. This is much faster
than using the subs function in sympy.
Args:
gamma_dict (dict): Surface grand potential equation
as a coefficient d... | [
"Uses",
"dot",
"product",
"of",
"numpy",
"array",
"to",
"sub",
"chemical",
"potentials",
"into",
"the",
"surface",
"grand",
"potential",
".",
"This",
"is",
"much",
"faster",
"than",
"using",
"the",
"subs",
"function",
"in",
"sympy",
".",
"Args",
":",
"gamm... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1850-L1874 | [
"def",
"sub_chempots",
"(",
"gamma_dict",
",",
"chempots",
")",
":",
"coeffs",
"=",
"[",
"gamma_dict",
"[",
"k",
"]",
"for",
"k",
"in",
"gamma_dict",
".",
"keys",
"(",
")",
"]",
"chempot_vals",
"=",
"[",
"]",
"for",
"k",
"in",
"gamma_dict",
".",
"key... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.as_dict | Returns dict which contains Slab Entry data. | pymatgen/analysis/surface_analysis.py | def as_dict(self):
"""
Returns dict which contains Slab Entry data.
"""
d = {"@module": self.__class__.__module__,
"@class": self.__class__.__name__}
d["structure"] = self.structure
d["energy"] = self.energy
d["miller_index"] = self.miller_index
... | def as_dict(self):
"""
Returns dict which contains Slab Entry data.
"""
d = {"@module": self.__class__.__module__,
"@class": self.__class__.__name__}
d["structure"] = self.structure
d["energy"] = self.energy
d["miller_index"] = self.miller_index
... | [
"Returns",
"dict",
"which",
"contains",
"Slab",
"Entry",
"data",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L140-L155 | [
"def",
"as_dict",
"(",
"self",
")",
":",
"d",
"=",
"{",
"\"@module\"",
":",
"self",
".",
"__class__",
".",
"__module__",
",",
"\"@class\"",
":",
"self",
".",
"__class__",
".",
"__name__",
"}",
"d",
"[",
"\"structure\"",
"]",
"=",
"self",
".",
"structur... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.gibbs_binding_energy | Returns the adsorption energy or Gibb's binding energy
of an adsorbate on a surface
Args:
eads (bool): Whether to calculate the adsorption energy
(True) or the binding energy (False) which is just
adsorption energy normalized by number of adsorbates. | pymatgen/analysis/surface_analysis.py | def gibbs_binding_energy(self, eads=False):
"""
Returns the adsorption energy or Gibb's binding energy
of an adsorbate on a surface
Args:
eads (bool): Whether to calculate the adsorption energy
(True) or the binding energy (False) which is just
... | def gibbs_binding_energy(self, eads=False):
"""
Returns the adsorption energy or Gibb's binding energy
of an adsorbate on a surface
Args:
eads (bool): Whether to calculate the adsorption energy
(True) or the binding energy (False) which is just
... | [
"Returns",
"the",
"adsorption",
"energy",
"or",
"Gibb",
"s",
"binding",
"energy",
"of",
"an",
"adsorbate",
"on",
"a",
"surface",
"Args",
":",
"eads",
"(",
"bool",
")",
":",
"Whether",
"to",
"calculate",
"the",
"adsorption",
"energy",
"(",
"True",
")",
"o... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L157-L172 | [
"def",
"gibbs_binding_energy",
"(",
"self",
",",
"eads",
"=",
"False",
")",
":",
"n",
"=",
"self",
".",
"get_unit_primitive_area",
"Nads",
"=",
"self",
".",
"Nads_in_slab",
"BE",
"=",
"(",
"self",
".",
"energy",
"-",
"n",
"*",
"self",
".",
"clean_entry",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.surface_energy | Calculates the surface energy of this SlabEntry.
Args:
ucell_entry (entry): An entry object for the bulk
ref_entries (list: [entry]): A list of entries for each type
of element to be used as a reservoir for nonstoichiometric
systems. The length of this lis... | pymatgen/analysis/surface_analysis.py | def surface_energy(self, ucell_entry, ref_entries=None):
"""
Calculates the surface energy of this SlabEntry.
Args:
ucell_entry (entry): An entry object for the bulk
ref_entries (list: [entry]): A list of entries for each type
of element to be used as a re... | def surface_energy(self, ucell_entry, ref_entries=None):
"""
Calculates the surface energy of this SlabEntry.
Args:
ucell_entry (entry): An entry object for the bulk
ref_entries (list: [entry]): A list of entries for each type
of element to be used as a re... | [
"Calculates",
"the",
"surface",
"energy",
"of",
"this",
"SlabEntry",
".",
"Args",
":",
"ucell_entry",
"(",
"entry",
")",
":",
"An",
"entry",
"object",
"for",
"the",
"bulk",
"ref_entries",
"(",
"list",
":",
"[",
"entry",
"]",
")",
":",
"A",
"list",
"of"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L174-L235 | [
"def",
"surface_energy",
"(",
"self",
",",
"ucell_entry",
",",
"ref_entries",
"=",
"None",
")",
":",
"# Set up",
"ref_entries",
"=",
"[",
"]",
"if",
"not",
"ref_entries",
"else",
"ref_entries",
"# Check if appropriate ref_entries are present if the slab is non-stoichiomet... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.get_unit_primitive_area | Returns the surface area of the adsorbed system per
unit area of the primitive slab system. | pymatgen/analysis/surface_analysis.py | def get_unit_primitive_area(self):
"""
Returns the surface area of the adsorbed system per
unit area of the primitive slab system.
"""
A_ads = self.surface_area
A_clean = self.clean_entry.surface_area
n = (A_ads / A_clean)
return n | def get_unit_primitive_area(self):
"""
Returns the surface area of the adsorbed system per
unit area of the primitive slab system.
"""
A_ads = self.surface_area
A_clean = self.clean_entry.surface_area
n = (A_ads / A_clean)
return n | [
"Returns",
"the",
"surface",
"area",
"of",
"the",
"adsorbed",
"system",
"per",
"unit",
"area",
"of",
"the",
"primitive",
"slab",
"system",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L238-L247 | [
"def",
"get_unit_primitive_area",
"(",
"self",
")",
":",
"A_ads",
"=",
"self",
".",
"surface_area",
"A_clean",
"=",
"self",
".",
"clean_entry",
".",
"surface_area",
"n",
"=",
"(",
"A_ads",
"/",
"A_clean",
")",
"return",
"n"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.get_monolayer | Returns the primitive unit surface area density of the
adsorbate. | pymatgen/analysis/surface_analysis.py | def get_monolayer(self):
"""
Returns the primitive unit surface area density of the
adsorbate.
"""
unit_a = self.get_unit_primitive_area
Nsurfs = self.Nsurfs_ads_in_slab
Nads = self.Nads_in_slab
return Nads / (unit_a * Nsurfs) | def get_monolayer(self):
"""
Returns the primitive unit surface area density of the
adsorbate.
"""
unit_a = self.get_unit_primitive_area
Nsurfs = self.Nsurfs_ads_in_slab
Nads = self.Nads_in_slab
return Nads / (unit_a * Nsurfs) | [
"Returns",
"the",
"primitive",
"unit",
"surface",
"area",
"density",
"of",
"the",
"adsorbate",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L250-L259 | [
"def",
"get_monolayer",
"(",
"self",
")",
":",
"unit_a",
"=",
"self",
".",
"get_unit_primitive_area",
"Nsurfs",
"=",
"self",
".",
"Nsurfs_ads_in_slab",
"Nads",
"=",
"self",
".",
"Nads_in_slab",
"return",
"Nads",
"/",
"(",
"unit_a",
"*",
"Nsurfs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.Nads_in_slab | Returns the TOTAL number of adsorbates in the slab on BOTH sides | pymatgen/analysis/surface_analysis.py | def Nads_in_slab(self):
"""
Returns the TOTAL number of adsorbates in the slab on BOTH sides
"""
return sum([self.composition.as_dict()[a] for a \
in self.ads_entries_dict.keys()]) | def Nads_in_slab(self):
"""
Returns the TOTAL number of adsorbates in the slab on BOTH sides
"""
return sum([self.composition.as_dict()[a] for a \
in self.ads_entries_dict.keys()]) | [
"Returns",
"the",
"TOTAL",
"number",
"of",
"adsorbates",
"in",
"the",
"slab",
"on",
"BOTH",
"sides"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L262-L267 | [
"def",
"Nads_in_slab",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"[",
"self",
".",
"composition",
".",
"as_dict",
"(",
")",
"[",
"a",
"]",
"for",
"a",
"in",
"self",
".",
"ads_entries_dict",
".",
"keys",
"(",
")",
"]",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.Nsurfs_ads_in_slab | Returns the TOTAL number of adsorbed surfaces in the slab | pymatgen/analysis/surface_analysis.py | def Nsurfs_ads_in_slab(self):
"""
Returns the TOTAL number of adsorbed surfaces in the slab
"""
struct = self.structure
weights = [s.species.weight for s in struct]
center_of_mass = np.average(struct.frac_coords,
weights=weights, axis=... | def Nsurfs_ads_in_slab(self):
"""
Returns the TOTAL number of adsorbed surfaces in the slab
"""
struct = self.structure
weights = [s.species.weight for s in struct]
center_of_mass = np.average(struct.frac_coords,
weights=weights, axis=... | [
"Returns",
"the",
"TOTAL",
"number",
"of",
"adsorbed",
"surfaces",
"in",
"the",
"slab"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L270-L290 | [
"def",
"Nsurfs_ads_in_slab",
"(",
"self",
")",
":",
"struct",
"=",
"self",
".",
"structure",
"weights",
"=",
"[",
"s",
".",
"species",
".",
"weight",
"for",
"s",
"in",
"struct",
"]",
"center_of_mass",
"=",
"np",
".",
"average",
"(",
"struct",
".",
"fra... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.from_dict | Returns a SlabEntry by reading in an dictionary | pymatgen/analysis/surface_analysis.py | def from_dict(cls, d):
"""
Returns a SlabEntry by reading in an dictionary
"""
structure = SlabEntry.from_dict(d["structure"])
energy = SlabEntry.from_dict(d["energy"])
miller_index = d["miller_index"]
label = d["label"]
coverage = d["coverage"]
a... | def from_dict(cls, d):
"""
Returns a SlabEntry by reading in an dictionary
"""
structure = SlabEntry.from_dict(d["structure"])
energy = SlabEntry.from_dict(d["energy"])
miller_index = d["miller_index"]
label = d["label"]
coverage = d["coverage"]
a... | [
"Returns",
"a",
"SlabEntry",
"by",
"reading",
"in",
"an",
"dictionary"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L293-L308 | [
"def",
"from_dict",
"(",
"cls",
",",
"d",
")",
":",
"structure",
"=",
"SlabEntry",
".",
"from_dict",
"(",
"d",
"[",
"\"structure\"",
"]",
")",
"energy",
"=",
"SlabEntry",
".",
"from_dict",
"(",
"d",
"[",
"\"energy\"",
"]",
")",
"miller_index",
"=",
"d"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.cleaned_up_slab | Returns a slab with the adsorbates removed | pymatgen/analysis/surface_analysis.py | def cleaned_up_slab(self):
"""
Returns a slab with the adsorbates removed
"""
ads_strs = list(self.ads_entries_dict.keys())
cleaned = self.structure.copy()
cleaned.remove_species(ads_strs)
return cleaned | def cleaned_up_slab(self):
"""
Returns a slab with the adsorbates removed
"""
ads_strs = list(self.ads_entries_dict.keys())
cleaned = self.structure.copy()
cleaned.remove_species(ads_strs)
return cleaned | [
"Returns",
"a",
"slab",
"with",
"the",
"adsorbates",
"removed"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L319-L326 | [
"def",
"cleaned_up_slab",
"(",
"self",
")",
":",
"ads_strs",
"=",
"list",
"(",
"self",
".",
"ads_entries_dict",
".",
"keys",
"(",
")",
")",
"cleaned",
"=",
"self",
".",
"structure",
".",
"copy",
"(",
")",
"cleaned",
".",
"remove_species",
"(",
"ads_strs"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.create_slab_label | Returns a label (str) for this particular slab based
on composition, coverage and Miller index. | pymatgen/analysis/surface_analysis.py | def create_slab_label(self):
"""
Returns a label (str) for this particular slab based
on composition, coverage and Miller index.
"""
if "label" in self.data.keys():
return self.data["label"]
label = str(self.miller_index)
ads_strs = list(self.ads... | def create_slab_label(self):
"""
Returns a label (str) for this particular slab based
on composition, coverage and Miller index.
"""
if "label" in self.data.keys():
return self.data["label"]
label = str(self.miller_index)
ads_strs = list(self.ads... | [
"Returns",
"a",
"label",
"(",
"str",
")",
"for",
"this",
"particular",
"slab",
"based",
"on",
"composition",
"coverage",
"and",
"Miller",
"index",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L329-L348 | [
"def",
"create_slab_label",
"(",
"self",
")",
":",
"if",
"\"label\"",
"in",
"self",
".",
"data",
".",
"keys",
"(",
")",
":",
"return",
"self",
".",
"data",
"[",
"\"label\"",
"]",
"label",
"=",
"str",
"(",
"self",
".",
"miller_index",
")",
"ads_strs",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SlabEntry.from_computed_structure_entry | Returns SlabEntry from a ComputedStructureEntry | pymatgen/analysis/surface_analysis.py | def from_computed_structure_entry(entry, miller_index, label=None,
adsorbates=None, clean_entry=None, **kwargs):
"""
Returns SlabEntry from a ComputedStructureEntry
"""
return SlabEntry(entry.structure, entry.energy, miller_index, label=label,
... | def from_computed_structure_entry(entry, miller_index, label=None,
adsorbates=None, clean_entry=None, **kwargs):
"""
Returns SlabEntry from a ComputedStructureEntry
"""
return SlabEntry(entry.structure, entry.energy, miller_index, label=label,
... | [
"Returns",
"SlabEntry",
"from",
"a",
"ComputedStructureEntry"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L351-L357 | [
"def",
"from_computed_structure_entry",
"(",
"entry",
",",
"miller_index",
",",
"label",
"=",
"None",
",",
"adsorbates",
"=",
"None",
",",
"clean_entry",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"SlabEntry",
"(",
"entry",
".",
"structure",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.get_stable_entry_at_u | Returns the entry corresponding to the most stable slab for a particular
facet at a specific chempot. We assume that surface energy is constant
so all free variables must be set with delu_dict, otherwise they are
assumed to be equal to delu_default.
Args:
miller_... | pymatgen/analysis/surface_analysis.py | def get_stable_entry_at_u(self, miller_index, delu_dict=None, delu_default=0,
no_doped=False, no_clean=False):
"""
Returns the entry corresponding to the most stable slab for a particular
facet at a specific chempot. We assume that surface energy is constant
... | def get_stable_entry_at_u(self, miller_index, delu_dict=None, delu_default=0,
no_doped=False, no_clean=False):
"""
Returns the entry corresponding to the most stable slab for a particular
facet at a specific chempot. We assume that surface energy is constant
... | [
"Returns",
"the",
"entry",
"corresponding",
"to",
"the",
"most",
"stable",
"slab",
"for",
"a",
"particular",
"facet",
"at",
"a",
"specific",
"chempot",
".",
"We",
"assume",
"that",
"surface",
"energy",
"is",
"constant",
"so",
"all",
"free",
"variables",
"mus... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L470-L516 | [
"def",
"get_stable_entry_at_u",
"(",
"self",
",",
"miller_index",
",",
"delu_dict",
"=",
"None",
",",
"delu_default",
"=",
"0",
",",
"no_doped",
"=",
"False",
",",
"no_clean",
"=",
"False",
")",
":",
"all_delu_dict",
"=",
"self",
".",
"set_all_variables",
"(... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.wulff_from_chempot | Method to get the Wulff shape at a specific chemical potential.
Args:
delu_dict (Dict): Dictionary of the chemical potentials to be set as
constant. Note the key should be a sympy Symbol object of the
format: Symbol("delu_el") where el is the name of the element.
... | pymatgen/analysis/surface_analysis.py | def wulff_from_chempot(self, delu_dict=None, delu_default=0, symprec=1e-5,
no_clean=False, no_doped=False):
"""
Method to get the Wulff shape at a specific chemical potential.
Args:
delu_dict (Dict): Dictionary of the chemical potentials to be set as
... | def wulff_from_chempot(self, delu_dict=None, delu_default=0, symprec=1e-5,
no_clean=False, no_doped=False):
"""
Method to get the Wulff shape at a specific chemical potential.
Args:
delu_dict (Dict): Dictionary of the chemical potentials to be set as
... | [
"Method",
"to",
"get",
"the",
"Wulff",
"shape",
"at",
"a",
"specific",
"chemical",
"potential",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L518-L551 | [
"def",
"wulff_from_chempot",
"(",
"self",
",",
"delu_dict",
"=",
"None",
",",
"delu_default",
"=",
"0",
",",
"symprec",
"=",
"1e-5",
",",
"no_clean",
"=",
"False",
",",
"no_doped",
"=",
"False",
")",
":",
"latt",
"=",
"SpacegroupAnalyzer",
"(",
"self",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.area_frac_vs_chempot_plot | 1D plot. Plots the change in the area contribution
of each facet as a function of chemical potential.
Args:
ref_delu (sympy Symbol): The free variable chempot with the format:
Symbol("delu_el") where el is the name of the element.
chempot_range (list): Min/max ra... | pymatgen/analysis/surface_analysis.py | def area_frac_vs_chempot_plot(self, ref_delu, chempot_range, delu_dict=None,
delu_default=0, increments=10, no_clean=False, no_doped=False):
"""
1D plot. Plots the change in the area contribution
of each facet as a function of chemical potential.
Args:
... | def area_frac_vs_chempot_plot(self, ref_delu, chempot_range, delu_dict=None,
delu_default=0, increments=10, no_clean=False, no_doped=False):
"""
1D plot. Plots the change in the area contribution
of each facet as a function of chemical potential.
Args:
... | [
"1D",
"plot",
".",
"Plots",
"the",
"change",
"in",
"the",
"area",
"contribution",
"of",
"each",
"facet",
"as",
"a",
"function",
"of",
"chemical",
"potential",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L553-L614 | [
"def",
"area_frac_vs_chempot_plot",
"(",
"self",
",",
"ref_delu",
",",
"chempot_range",
",",
"delu_dict",
"=",
"None",
",",
"delu_default",
"=",
"0",
",",
"increments",
"=",
"10",
",",
"no_clean",
"=",
"False",
",",
"no_doped",
"=",
"False",
")",
":",
"del... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.get_surface_equilibrium | Takes in a list of SlabEntries and calculates the chemical potentials
at which all slabs in the list coexists simultaneously. Useful for
building surface phase diagrams. Note that to solve for x equations
(x slab_entries), there must be x free variables (chemical potentials).
... | pymatgen/analysis/surface_analysis.py | def get_surface_equilibrium(self, slab_entries, delu_dict=None):
"""
Takes in a list of SlabEntries and calculates the chemical potentials
at which all slabs in the list coexists simultaneously. Useful for
building surface phase diagrams. Note that to solve for x equations
... | def get_surface_equilibrium(self, slab_entries, delu_dict=None):
"""
Takes in a list of SlabEntries and calculates the chemical potentials
at which all slabs in the list coexists simultaneously. Useful for
building surface phase diagrams. Note that to solve for x equations
... | [
"Takes",
"in",
"a",
"list",
"of",
"SlabEntries",
"and",
"calculates",
"the",
"chemical",
"potentials",
"at",
"which",
"all",
"slabs",
"in",
"the",
"list",
"coexists",
"simultaneously",
".",
"Useful",
"for",
"building",
"surface",
"phase",
"diagrams",
".",
"Not... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L616-L659 | [
"def",
"get_surface_equilibrium",
"(",
"self",
",",
"slab_entries",
",",
"delu_dict",
"=",
"None",
")",
":",
"# Generate all possible coefficients",
"all_parameters",
"=",
"[",
"]",
"all_eqns",
"=",
"[",
"]",
"for",
"slab_entry",
"in",
"slab_entries",
":",
"se",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.stable_u_range_dict | Creates a dictionary where each entry is a key pointing to a
chemical potential range where the surface of that entry is stable.
Does so by enumerating through all possible solutions (intersect)
for surface energies of a specific facet.
Args:
chempot_range ([max_chempot, min... | pymatgen/analysis/surface_analysis.py | def stable_u_range_dict(self, chempot_range, ref_delu, no_doped=True,
no_clean=False, delu_dict={}, miller_index=(),
dmu_at_0=False, return_se_dict=False):
"""
Creates a dictionary where each entry is a key pointing to a
chemical potential ... | def stable_u_range_dict(self, chempot_range, ref_delu, no_doped=True,
no_clean=False, delu_dict={}, miller_index=(),
dmu_at_0=False, return_se_dict=False):
"""
Creates a dictionary where each entry is a key pointing to a
chemical potential ... | [
"Creates",
"a",
"dictionary",
"where",
"each",
"entry",
"is",
"a",
"key",
"pointing",
"to",
"a",
"chemical",
"potential",
"range",
"where",
"the",
"surface",
"of",
"that",
"entry",
"is",
"stable",
".",
"Does",
"so",
"by",
"enumerating",
"through",
"all",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L661-L781 | [
"def",
"stable_u_range_dict",
"(",
"self",
",",
"chempot_range",
",",
"ref_delu",
",",
"no_doped",
"=",
"True",
",",
"no_clean",
"=",
"False",
",",
"delu_dict",
"=",
"{",
"}",
",",
"miller_index",
"=",
"(",
")",
",",
"dmu_at_0",
"=",
"False",
",",
"retur... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.color_palette_dict | Helper function to assign each facet a unique color using a dictionary.
Args:
alpha (float): Degree of transparency
return (dict): Dictionary of colors (r,g,b,a) when plotting surface
energy stability. The keys are individual surface entries where
clean surfaces hav... | pymatgen/analysis/surface_analysis.py | def color_palette_dict(self, alpha=0.35):
"""
Helper function to assign each facet a unique color using a dictionary.
Args:
alpha (float): Degree of transparency
return (dict): Dictionary of colors (r,g,b,a) when plotting surface
energy stability. The keys are i... | def color_palette_dict(self, alpha=0.35):
"""
Helper function to assign each facet a unique color using a dictionary.
Args:
alpha (float): Degree of transparency
return (dict): Dictionary of colors (r,g,b,a) when plotting surface
energy stability. The keys are i... | [
"Helper",
"function",
"to",
"assign",
"each",
"facet",
"a",
"unique",
"color",
"using",
"a",
"dictionary",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L783-L819 | [
"def",
"color_palette_dict",
"(",
"self",
",",
"alpha",
"=",
"0.35",
")",
":",
"color_dict",
"=",
"{",
"}",
"for",
"hkl",
"in",
"self",
".",
"all_slab_entries",
".",
"keys",
"(",
")",
":",
"rgb_indices",
"=",
"[",
"0",
",",
"1",
",",
"2",
"]",
"col... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.chempot_vs_gamma_plot_one | Helper function to help plot the surface energy of a
single SlabEntry as a function of chemical potential.
Args:
plt (Plot): A plot.
entry (SlabEntry): Entry of the slab whose surface energy we want
to plot
ref_delu (sympy Symbol): The range stabilit... | pymatgen/analysis/surface_analysis.py | def chempot_vs_gamma_plot_one(self, plt, entry, ref_delu, chempot_range,
delu_dict={}, delu_default=0, label='', JPERM2=False):
"""
Helper function to help plot the surface energy of a
single SlabEntry as a function of chemical potential.
Args:
... | def chempot_vs_gamma_plot_one(self, plt, entry, ref_delu, chempot_range,
delu_dict={}, delu_default=0, label='', JPERM2=False):
"""
Helper function to help plot the surface energy of a
single SlabEntry as a function of chemical potential.
Args:
... | [
"Helper",
"function",
"to",
"help",
"plot",
"the",
"surface",
"energy",
"of",
"a",
"single",
"SlabEntry",
"as",
"a",
"function",
"of",
"chemical",
"potential",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L821-L881 | [
"def",
"chempot_vs_gamma_plot_one",
"(",
"self",
",",
"plt",
",",
"entry",
",",
"ref_delu",
",",
"chempot_range",
",",
"delu_dict",
"=",
"{",
"}",
",",
"delu_default",
"=",
"0",
",",
"label",
"=",
"''",
",",
"JPERM2",
"=",
"False",
")",
":",
"chempot_ran... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.chempot_vs_gamma | Plots the surface energy as a function of chemical potential.
Each facet will be associated with its own distinct colors.
Dashed lines will represent stoichiometries different from that
of the mpid's compound. Transparent lines indicates adsorption.
Args:
ref_del... | pymatgen/analysis/surface_analysis.py | def chempot_vs_gamma(self, ref_delu, chempot_range, miller_index=(),
delu_dict={}, delu_default=0, JPERM2=False,
show_unstable=False, ylim=[], plt=None,
no_clean=False, no_doped=False,
use_entry_labels=False, no_label=Fa... | def chempot_vs_gamma(self, ref_delu, chempot_range, miller_index=(),
delu_dict={}, delu_default=0, JPERM2=False,
show_unstable=False, ylim=[], plt=None,
no_clean=False, no_doped=False,
use_entry_labels=False, no_label=Fa... | [
"Plots",
"the",
"surface",
"energy",
"as",
"a",
"function",
"of",
"chemical",
"potential",
".",
"Each",
"facet",
"will",
"be",
"associated",
"with",
"its",
"own",
"distinct",
"colors",
".",
"Dashed",
"lines",
"will",
"represent",
"stoichiometries",
"different",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L883-L985 | [
"def",
"chempot_vs_gamma",
"(",
"self",
",",
"ref_delu",
",",
"chempot_range",
",",
"miller_index",
"=",
"(",
")",
",",
"delu_dict",
"=",
"{",
"}",
",",
"delu_default",
"=",
"0",
",",
"JPERM2",
"=",
"False",
",",
"show_unstable",
"=",
"False",
",",
"ylim... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.monolayer_vs_BE | Plots the binding energy energy as a function of monolayers (ML), i.e.
the fractional area adsorbate density for all facets. For each
facet at a specific monlayer, only plot the lowest binding energy.
Args:
plot_eads (bool): Option to plot the adsorption energy (binding
... | pymatgen/analysis/surface_analysis.py | def monolayer_vs_BE(self, plot_eads=False):
"""
Plots the binding energy energy as a function of monolayers (ML), i.e.
the fractional area adsorbate density for all facets. For each
facet at a specific monlayer, only plot the lowest binding energy.
Args:
plot... | def monolayer_vs_BE(self, plot_eads=False):
"""
Plots the binding energy energy as a function of monolayers (ML), i.e.
the fractional area adsorbate density for all facets. For each
facet at a specific monlayer, only plot the lowest binding energy.
Args:
plot... | [
"Plots",
"the",
"binding",
"energy",
"energy",
"as",
"a",
"function",
"of",
"monolayers",
"(",
"ML",
")",
"i",
".",
"e",
".",
"the",
"fractional",
"area",
"adsorbate",
"density",
"for",
"all",
"facets",
".",
"For",
"each",
"facet",
"at",
"a",
"specific",... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L987-L1026 | [
"def",
"monolayer_vs_BE",
"(",
"self",
",",
"plot_eads",
"=",
"False",
")",
":",
"plt",
"=",
"pretty_plot",
"(",
"width",
"=",
"8",
",",
"height",
"=",
"7",
")",
"for",
"hkl",
"in",
"self",
".",
"all_slab_entries",
".",
"keys",
"(",
")",
":",
"ml_be_... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.chempot_plot_addons | Helper function to a chempot plot look nicer.
Args:
plt (Plot) Plot to add things to.
xrange (list): xlim parameter
ref_el (str): Element of the referenced chempot.
axes(axes) Axes object from matplotlib
pad (float) For tight layout
rect (... | pymatgen/analysis/surface_analysis.py | def chempot_plot_addons(self, plt, xrange, ref_el, axes, pad=2.4,
rect=[-0.047, 0, 0.84, 1], ylim=[]):
"""
Helper function to a chempot plot look nicer.
Args:
plt (Plot) Plot to add things to.
xrange (list): xlim parameter
ref_el ... | def chempot_plot_addons(self, plt, xrange, ref_el, axes, pad=2.4,
rect=[-0.047, 0, 0.84, 1], ylim=[]):
"""
Helper function to a chempot plot look nicer.
Args:
plt (Plot) Plot to add things to.
xrange (list): xlim parameter
ref_el ... | [
"Helper",
"function",
"to",
"a",
"chempot",
"plot",
"look",
"nicer",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1028-L1066 | [
"def",
"chempot_plot_addons",
"(",
"self",
",",
"plt",
",",
"xrange",
",",
"ref_el",
",",
"axes",
",",
"pad",
"=",
"2.4",
",",
"rect",
"=",
"[",
"-",
"0.047",
",",
"0",
",",
"0.84",
",",
"1",
"]",
",",
"ylim",
"=",
"[",
"]",
")",
":",
"# Make t... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.BE_vs_clean_SE | For each facet, plot the clean surface energy against the most
stable binding energy.
Args:
delu_dict (Dict): Dictionary of the chemical potentials to be set as
constant. Note the key should be a sympy Symbol object of the
format: Symbol("delu_el") where e... | pymatgen/analysis/surface_analysis.py | def BE_vs_clean_SE(self, delu_dict, delu_default=0, plot_eads=False,
annotate_monolayer=True, JPERM2=False):
"""
For each facet, plot the clean surface energy against the most
stable binding energy.
Args:
delu_dict (Dict): Dictionary of the chemical... | def BE_vs_clean_SE(self, delu_dict, delu_default=0, plot_eads=False,
annotate_monolayer=True, JPERM2=False):
"""
For each facet, plot the clean surface energy against the most
stable binding energy.
Args:
delu_dict (Dict): Dictionary of the chemical... | [
"For",
"each",
"facet",
"plot",
"the",
"clean",
"surface",
"energy",
"against",
"the",
"most",
"stable",
"binding",
"energy",
".",
"Args",
":",
"delu_dict",
"(",
"Dict",
")",
":",
"Dictionary",
"of",
"the",
"chemical",
"potentials",
"to",
"be",
"set",
"as"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1068-L1114 | [
"def",
"BE_vs_clean_SE",
"(",
"self",
",",
"delu_dict",
",",
"delu_default",
"=",
"0",
",",
"plot_eads",
"=",
"False",
",",
"annotate_monolayer",
"=",
"True",
",",
"JPERM2",
"=",
"False",
")",
":",
"plt",
"=",
"pretty_plot",
"(",
"width",
"=",
"8",
",",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.surface_chempot_range_map | Adapted from the get_chempot_range_map() method in the PhaseDiagram
class. Plot the chemical potential range map based on surface
energy stability. Currently works only for 2-component PDs. At
the moment uses a brute force method by enumerating through the
range of the fi... | pymatgen/analysis/surface_analysis.py | def surface_chempot_range_map(self, elements, miller_index, ranges,
incr=50, no_doped=False, no_clean=False,
delu_dict=None, plt=None, annotate=True,
show_unphyiscal_only=False, fontsize=10):
"""
Adapte... | def surface_chempot_range_map(self, elements, miller_index, ranges,
incr=50, no_doped=False, no_clean=False,
delu_dict=None, plt=None, annotate=True,
show_unphyiscal_only=False, fontsize=10):
"""
Adapte... | [
"Adapted",
"from",
"the",
"get_chempot_range_map",
"()",
"method",
"in",
"the",
"PhaseDiagram",
"class",
".",
"Plot",
"the",
"chemical",
"potential",
"range",
"map",
"based",
"on",
"surface",
"energy",
"stability",
".",
"Currently",
"works",
"only",
"for",
"2",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1116-L1237 | [
"def",
"surface_chempot_range_map",
"(",
"self",
",",
"elements",
",",
"miller_index",
",",
"ranges",
",",
"incr",
"=",
"50",
",",
"no_doped",
"=",
"False",
",",
"no_clean",
"=",
"False",
",",
"delu_dict",
"=",
"None",
",",
"plt",
"=",
"None",
",",
"anno... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | SurfaceEnergyPlotter.set_all_variables | Sets all chemical potential values and returns a dictionary where
the key is a sympy Symbol and the value is a float (chempot).
Args:
entry (SlabEntry): Computed structure entry of the slab
delu_dict (Dict): Dictionary of the chemical potentials to be set as
... | pymatgen/analysis/surface_analysis.py | def set_all_variables(self, delu_dict, delu_default):
"""
Sets all chemical potential values and returns a dictionary where
the key is a sympy Symbol and the value is a float (chempot).
Args:
entry (SlabEntry): Computed structure entry of the slab
delu_dict (... | def set_all_variables(self, delu_dict, delu_default):
"""
Sets all chemical potential values and returns a dictionary where
the key is a sympy Symbol and the value is a float (chempot).
Args:
entry (SlabEntry): Computed structure entry of the slab
delu_dict (... | [
"Sets",
"all",
"chemical",
"potential",
"values",
"and",
"returns",
"a",
"dictionary",
"where",
"the",
"key",
"is",
"a",
"sympy",
"Symbol",
"and",
"the",
"value",
"is",
"a",
"float",
"(",
"chempot",
")",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1239-L1265 | [
"def",
"set_all_variables",
"(",
"self",
",",
"delu_dict",
",",
"delu_default",
")",
":",
"# Set up the variables",
"all_delu_dict",
"=",
"{",
"}",
"for",
"du",
"in",
"self",
".",
"list_of_chempots",
":",
"if",
"delu_dict",
"and",
"du",
"in",
"delu_dict",
".",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | WorkFunctionAnalyzer.get_locpot_along_slab_plot | Returns a plot of the local potential (eV) vs the
position along the c axis of the slab model (Ang)
Args:
label_energies (bool): Whether to label relevant energy
quantities such as the work function, Fermi energy,
vacuum locpot, bulk-like locpot
... | pymatgen/analysis/surface_analysis.py | def get_locpot_along_slab_plot(self, label_energies=True,
plt=None, label_fontsize=10):
"""
Returns a plot of the local potential (eV) vs the
position along the c axis of the slab model (Ang)
Args:
label_energies (bool): Whether to labe... | def get_locpot_along_slab_plot(self, label_energies=True,
plt=None, label_fontsize=10):
"""
Returns a plot of the local potential (eV) vs the
position along the c axis of the slab model (Ang)
Args:
label_energies (bool): Whether to labe... | [
"Returns",
"a",
"plot",
"of",
"the",
"local",
"potential",
"(",
"eV",
")",
"vs",
"the",
"position",
"along",
"the",
"c",
"axis",
"of",
"the",
"slab",
"model",
"(",
"Ang",
")"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1435-L1493 | [
"def",
"get_locpot_along_slab_plot",
"(",
"self",
",",
"label_energies",
"=",
"True",
",",
"plt",
"=",
"None",
",",
"label_fontsize",
"=",
"10",
")",
":",
"plt",
"=",
"pretty_plot",
"(",
"width",
"=",
"6",
",",
"height",
"=",
"4",
")",
"if",
"not",
"pl... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | WorkFunctionAnalyzer.get_labels | Handles the optional labelling of the plot with relevant quantities
Args:
plt (plt): Plot of the locpot vs c axis
label_fontsize (float): Fontsize of labels
Returns Labelled plt | pymatgen/analysis/surface_analysis.py | def get_labels(self, plt, label_fontsize=10):
"""
Handles the optional labelling of the plot with relevant quantities
Args:
plt (plt): Plot of the locpot vs c axis
label_fontsize (float): Fontsize of labels
Returns Labelled plt
"""
# center of vac... | def get_labels(self, plt, label_fontsize=10):
"""
Handles the optional labelling of the plot with relevant quantities
Args:
plt (plt): Plot of the locpot vs c axis
label_fontsize (float): Fontsize of labels
Returns Labelled plt
"""
# center of vac... | [
"Handles",
"the",
"optional",
"labelling",
"of",
"the",
"plot",
"with",
"relevant",
"quantities",
"Args",
":",
"plt",
"(",
"plt",
")",
":",
"Plot",
"of",
"the",
"locpot",
"vs",
"c",
"axis",
"label_fontsize",
"(",
"float",
")",
":",
"Fontsize",
"of",
"lab... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1495-L1544 | [
"def",
"get_labels",
"(",
"self",
",",
"plt",
",",
"label_fontsize",
"=",
"10",
")",
":",
"# center of vacuum and bulk region",
"if",
"len",
"(",
"self",
".",
"slab_regions",
")",
">",
"1",
":",
"label_in_vac",
"=",
"(",
"self",
".",
"slab_regions",
"[",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | WorkFunctionAnalyzer.is_converged | A well converged work function should have a flat electrostatic
potential within some distance (min_point) about where the peak
electrostatic potential is found along the c direction of the
slab. This is dependent on the size of the slab.
Args:
min_point (fraction... | pymatgen/analysis/surface_analysis.py | def is_converged(self, min_points_frac=0.015, tol=0.0025):
"""
A well converged work function should have a flat electrostatic
potential within some distance (min_point) about where the peak
electrostatic potential is found along the c direction of the
slab. This is d... | def is_converged(self, min_points_frac=0.015, tol=0.0025):
"""
A well converged work function should have a flat electrostatic
potential within some distance (min_point) about where the peak
electrostatic potential is found along the c direction of the
slab. This is d... | [
"A",
"well",
"converged",
"work",
"function",
"should",
"have",
"a",
"flat",
"electrostatic",
"potential",
"within",
"some",
"distance",
"(",
"min_point",
")",
"about",
"where",
"the",
"peak",
"electrostatic",
"potential",
"is",
"found",
"along",
"the",
"c",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1546-L1572 | [
"def",
"is_converged",
"(",
"self",
",",
"min_points_frac",
"=",
"0.015",
",",
"tol",
"=",
"0.0025",
")",
":",
"conv_within",
"=",
"tol",
"*",
"(",
"max",
"(",
"self",
".",
"locpot_along_c",
")",
"-",
"min",
"(",
"self",
".",
"locpot_along_c",
")",
")"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NanoscaleStability.solve_equilibrium_point | Gives the radial size of two particles where equilibrium is reached
between both particles. NOTE: the solution here is not the same
as the solution visualized in the plot because solving for r
requires that both the total surface area and volume of the
particles are funct... | pymatgen/analysis/surface_analysis.py | def solve_equilibrium_point(self, analyzer1, analyzer2,
delu_dict={}, delu_default=0, units="nanometers"):
"""
Gives the radial size of two particles where equilibrium is reached
between both particles. NOTE: the solution here is not the same
as th... | def solve_equilibrium_point(self, analyzer1, analyzer2,
delu_dict={}, delu_default=0, units="nanometers"):
"""
Gives the radial size of two particles where equilibrium is reached
between both particles. NOTE: the solution here is not the same
as th... | [
"Gives",
"the",
"radial",
"size",
"of",
"two",
"particles",
"where",
"equilibrium",
"is",
"reached",
"between",
"both",
"particles",
".",
"NOTE",
":",
"the",
"solution",
"here",
"is",
"not",
"the",
"same",
"as",
"the",
"solution",
"visualized",
"in",
"the",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1618-L1655 | [
"def",
"solve_equilibrium_point",
"(",
"self",
",",
"analyzer1",
",",
"analyzer2",
",",
"delu_dict",
"=",
"{",
"}",
",",
"delu_default",
"=",
"0",
",",
"units",
"=",
"\"nanometers\"",
")",
":",
"# Set up",
"wulff1",
"=",
"analyzer1",
".",
"wulff_from_chempot",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NanoscaleStability.wulff_gform_and_r | Calculates the formation energy of the particle with arbitrary radius r.
Args:
wulffshape (WulffShape): Initial, unscaled WulffShape
bulk_entry (ComputedStructureEntry): Entry of the corresponding bulk.
r (float (Ang)): Arbitrary effective radius of the WulffShape
... | pymatgen/analysis/surface_analysis.py | def wulff_gform_and_r(self, wulffshape, bulk_entry, r, from_sphere_area=False,
r_units="nanometers", e_units="keV", normalize=False,
scale_per_atom=False):
"""
Calculates the formation energy of the particle with arbitrary radius r.
Args:
... | def wulff_gform_and_r(self, wulffshape, bulk_entry, r, from_sphere_area=False,
r_units="nanometers", e_units="keV", normalize=False,
scale_per_atom=False):
"""
Calculates the formation energy of the particle with arbitrary radius r.
Args:
... | [
"Calculates",
"the",
"formation",
"energy",
"of",
"the",
"particle",
"with",
"arbitrary",
"radius",
"r",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1657-L1711 | [
"def",
"wulff_gform_and_r",
"(",
"self",
",",
"wulffshape",
",",
"bulk_entry",
",",
"r",
",",
"from_sphere_area",
"=",
"False",
",",
"r_units",
"=",
"\"nanometers\"",
",",
"e_units",
"=",
"\"keV\"",
",",
"normalize",
"=",
"False",
",",
"scale_per_atom",
"=",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NanoscaleStability.scaled_wulff | Scales the Wulff shape with an effective radius r. Note that the resulting
Wulff does not neccesarily have the same effective radius as the one
provided. The Wulff shape is scaled by its surface energies where first
the surface energies are scale by the minimum surface energy and the... | pymatgen/analysis/surface_analysis.py | def scaled_wulff(self, wulffshape, r):
"""
Scales the Wulff shape with an effective radius r. Note that the resulting
Wulff does not neccesarily have the same effective radius as the one
provided. The Wulff shape is scaled by its surface energies where first
the surfa... | def scaled_wulff(self, wulffshape, r):
"""
Scales the Wulff shape with an effective radius r. Note that the resulting
Wulff does not neccesarily have the same effective radius as the one
provided. The Wulff shape is scaled by its surface energies where first
the surfa... | [
"Scales",
"the",
"Wulff",
"shape",
"with",
"an",
"effective",
"radius",
"r",
".",
"Note",
"that",
"the",
"resulting",
"Wulff",
"does",
"not",
"neccesarily",
"have",
"the",
"same",
"effective",
"radius",
"as",
"the",
"one",
"provided",
".",
"The",
"Wulff",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1721-L1747 | [
"def",
"scaled_wulff",
"(",
"self",
",",
"wulffshape",
",",
"r",
")",
":",
"# get the scaling ratio for the energies",
"r_ratio",
"=",
"r",
"/",
"wulffshape",
".",
"effective_radius",
"miller_list",
"=",
"wulffshape",
".",
"miller_energy_dict",
".",
"keys",
"(",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NanoscaleStability.plot_one_stability_map | Returns the plot of the formation energy of a particle against its
effect radius
Args:
analyzer (SurfaceEnergyPlotter): Analyzer associated with the
first polymorph
max_r (float): The maximum radius of the particle to plot up to.
delu_dict (Dict):... | pymatgen/analysis/surface_analysis.py | def plot_one_stability_map(self, analyzer, max_r, delu_dict=None, label="",
increments=50, delu_default=0, plt=None,
from_sphere_area=False, e_units="keV",
r_units="nanometers", normalize=False,
s... | def plot_one_stability_map(self, analyzer, max_r, delu_dict=None, label="",
increments=50, delu_default=0, plt=None,
from_sphere_area=False, e_units="keV",
r_units="nanometers", normalize=False,
s... | [
"Returns",
"the",
"plot",
"of",
"the",
"formation",
"energy",
"of",
"a",
"particle",
"against",
"its",
"effect",
"radius"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1749-L1800 | [
"def",
"plot_one_stability_map",
"(",
"self",
",",
"analyzer",
",",
"max_r",
",",
"delu_dict",
"=",
"None",
",",
"label",
"=",
"\"\"",
",",
"increments",
"=",
"50",
",",
"delu_default",
"=",
"0",
",",
"plt",
"=",
"None",
",",
"from_sphere_area",
"=",
"Fa... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NanoscaleStability.plot_all_stability_map | Returns the plot of the formation energy of a particles
of different polymorphs against its effect radius
Args:
max_r (float): The maximum radius of the particle to plot up to.
increments (int): Number of plot points
delu_dict (Dict): Dictionary of the chemical p... | pymatgen/analysis/surface_analysis.py | def plot_all_stability_map(self, max_r, increments=50, delu_dict=None,
delu_default=0, plt=None, labels=None,
from_sphere_area=False, e_units="keV",
r_units="nanometers", normalize=False,
scale_pe... | def plot_all_stability_map(self, max_r, increments=50, delu_dict=None,
delu_default=0, plt=None, labels=None,
from_sphere_area=False, e_units="keV",
r_units="nanometers", normalize=False,
scale_pe... | [
"Returns",
"the",
"plot",
"of",
"the",
"formation",
"energy",
"of",
"a",
"particles",
"of",
"different",
"polymorphs",
"against",
"its",
"effect",
"radius"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/surface_analysis.py#L1802-L1839 | [
"def",
"plot_all_stability_map",
"(",
"self",
",",
"max_r",
",",
"increments",
"=",
"50",
",",
"delu_dict",
"=",
"None",
",",
"delu_default",
"=",
"0",
",",
"plt",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"from_sphere_area",
"=",
"False",
",",
"e_un... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | AbstractElectrode.max_delta_volume | Maximum volume change along insertion | pymatgen/apps/battery/battery_abc.py | def max_delta_volume(self):
"""
Maximum volume change along insertion
"""
vols = [v.vol_charge for v in self.voltage_pairs]
vols.extend([v.vol_discharge for v in self.voltage_pairs])
return max(vols) / min(vols) - 1 | def max_delta_volume(self):
"""
Maximum volume change along insertion
"""
vols = [v.vol_charge for v in self.voltage_pairs]
vols.extend([v.vol_discharge for v in self.voltage_pairs])
return max(vols) / min(vols) - 1 | [
"Maximum",
"volume",
"change",
"along",
"insertion"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/apps/battery/battery_abc.py#L161-L167 | [
"def",
"max_delta_volume",
"(",
"self",
")",
":",
"vols",
"=",
"[",
"v",
".",
"vol_charge",
"for",
"v",
"in",
"self",
".",
"voltage_pairs",
"]",
"vols",
".",
"extend",
"(",
"[",
"v",
".",
"vol_discharge",
"for",
"v",
"in",
"self",
".",
"voltage_pairs",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | AbstractElectrode.max_voltage_step | Maximum absolute difference in adjacent voltage steps | pymatgen/apps/battery/battery_abc.py | def max_voltage_step(self):
"""
Maximum absolute difference in adjacent voltage steps
"""
steps = [self.voltage_pairs[i].voltage
- self.voltage_pairs[i + 1].voltage
for i in range(len(self.voltage_pairs) - 1)]
return max(steps) if len(steps) > 0 ... | def max_voltage_step(self):
"""
Maximum absolute difference in adjacent voltage steps
"""
steps = [self.voltage_pairs[i].voltage
- self.voltage_pairs[i + 1].voltage
for i in range(len(self.voltage_pairs) - 1)]
return max(steps) if len(steps) > 0 ... | [
"Maximum",
"absolute",
"difference",
"in",
"adjacent",
"voltage",
"steps"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/apps/battery/battery_abc.py#L192-L199 | [
"def",
"max_voltage_step",
"(",
"self",
")",
":",
"steps",
"=",
"[",
"self",
".",
"voltage_pairs",
"[",
"i",
"]",
".",
"voltage",
"-",
"self",
".",
"voltage_pairs",
"[",
"i",
"+",
"1",
"]",
".",
"voltage",
"for",
"i",
"in",
"range",
"(",
"len",
"("... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | AbstractElectrode.get_average_voltage | Average voltage for path satisfying between a min and max voltage.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage allowable for a
given step.
Returns:
Aver... | pymatgen/apps/battery/battery_abc.py | def get_average_voltage(self, min_voltage=None, max_voltage=None):
"""
Average voltage for path satisfying between a min and max voltage.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable... | def get_average_voltage(self, min_voltage=None, max_voltage=None):
"""
Average voltage for path satisfying between a min and max voltage.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable... | [
"Average",
"voltage",
"for",
"path",
"satisfying",
"between",
"a",
"min",
"and",
"max",
"voltage",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/apps/battery/battery_abc.py#L209-L229 | [
"def",
"get_average_voltage",
"(",
"self",
",",
"min_voltage",
"=",
"None",
",",
"max_voltage",
"=",
"None",
")",
":",
"pairs_in_range",
"=",
"self",
".",
"_select_in_voltage_range",
"(",
"min_voltage",
",",
"max_voltage",
")",
"if",
"len",
"(",
"pairs_in_range"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | AbstractElectrode.get_capacity_grav | Get the gravimetric capacity of the electrode.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage allowable for a
given step.
use_overall_normalization (booL): If False... | pymatgen/apps/battery/battery_abc.py | def get_capacity_grav(self, min_voltage=None, max_voltage=None,
use_overall_normalization=True):
"""
Get the gravimetric capacity of the electrode.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_vo... | def get_capacity_grav(self, min_voltage=None, max_voltage=None,
use_overall_normalization=True):
"""
Get the gravimetric capacity of the electrode.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_vo... | [
"Get",
"the",
"gravimetric",
"capacity",
"of",
"the",
"electrode",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/apps/battery/battery_abc.py#L231-L255 | [
"def",
"get_capacity_grav",
"(",
"self",
",",
"min_voltage",
"=",
"None",
",",
"max_voltage",
"=",
"None",
",",
"use_overall_normalization",
"=",
"True",
")",
":",
"pairs_in_range",
"=",
"self",
".",
"_select_in_voltage_range",
"(",
"min_voltage",
",",
"max_voltag... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | AbstractElectrode.get_capacity_vol | Get the volumetric capacity of the electrode.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage allowable for a
given step.
use_overall_normalization (booL): If False,... | pymatgen/apps/battery/battery_abc.py | def get_capacity_vol(self, min_voltage=None, max_voltage=None,
use_overall_normalization=True):
"""
Get the volumetric capacity of the electrode.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_volta... | def get_capacity_vol(self, min_voltage=None, max_voltage=None,
use_overall_normalization=True):
"""
Get the volumetric capacity of the electrode.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_volta... | [
"Get",
"the",
"volumetric",
"capacity",
"of",
"the",
"electrode",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/apps/battery/battery_abc.py#L257-L282 | [
"def",
"get_capacity_vol",
"(",
"self",
",",
"min_voltage",
"=",
"None",
",",
"max_voltage",
"=",
"None",
",",
"use_overall_normalization",
"=",
"True",
")",
":",
"pairs_in_range",
"=",
"self",
".",
"_select_in_voltage_range",
"(",
"min_voltage",
",",
"max_voltage... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | AbstractElectrode.get_specific_energy | Returns the specific energy of the battery in mAh/g.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage allowable for a
given step.
use_overall_normalization (booL): If... | pymatgen/apps/battery/battery_abc.py | def get_specific_energy(self, min_voltage=None, max_voltage=None,
use_overall_normalization=True):
"""
Returns the specific energy of the battery in mAh/g.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
... | def get_specific_energy(self, min_voltage=None, max_voltage=None,
use_overall_normalization=True):
"""
Returns the specific energy of the battery in mAh/g.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
... | [
"Returns",
"the",
"specific",
"energy",
"of",
"the",
"battery",
"in",
"mAh",
"/",
"g",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/apps/battery/battery_abc.py#L284-L305 | [
"def",
"get_specific_energy",
"(",
"self",
",",
"min_voltage",
"=",
"None",
",",
"max_voltage",
"=",
"None",
",",
"use_overall_normalization",
"=",
"True",
")",
":",
"return",
"self",
".",
"get_capacity_grav",
"(",
"min_voltage",
",",
"max_voltage",
",",
"use_ov... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | AbstractElectrode.get_energy_density | Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage allowable for a
given step.
use_overall_normalization (booL): If False, normalize by the
discharged state of o... | pymatgen/apps/battery/battery_abc.py | def get_energy_density(self, min_voltage=None, max_voltage=None,
use_overall_normalization=True):
"""
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage allowable... | def get_energy_density(self, min_voltage=None, max_voltage=None,
use_overall_normalization=True):
"""
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage allowable... | [
"Args",
":",
"min_voltage",
"(",
"float",
")",
":",
"The",
"minimum",
"allowable",
"voltage",
"for",
"a",
"given",
"step",
".",
"max_voltage",
"(",
"float",
")",
":",
"The",
"maximum",
"allowable",
"voltage",
"allowable",
"for",
"a",
"given",
"step",
".",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/apps/battery/battery_abc.py#L307-L326 | [
"def",
"get_energy_density",
"(",
"self",
",",
"min_voltage",
"=",
"None",
",",
"max_voltage",
"=",
"None",
",",
"use_overall_normalization",
"=",
"True",
")",
":",
"return",
"self",
".",
"get_capacity_vol",
"(",
"min_voltage",
",",
"max_voltage",
",",
"use_over... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | AbstractElectrode._select_in_voltage_range | Selects VoltagePairs within a certain voltage range.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage allowable for a
given step.
Returns:
A list of VoltageP... | pymatgen/apps/battery/battery_abc.py | def _select_in_voltage_range(self, min_voltage=None, max_voltage=None):
"""
Selects VoltagePairs within a certain voltage range.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage ... | def _select_in_voltage_range(self, min_voltage=None, max_voltage=None):
"""
Selects VoltagePairs within a certain voltage range.
Args:
min_voltage (float): The minimum allowable voltage for a given
step.
max_voltage (float): The maximum allowable voltage ... | [
"Selects",
"VoltagePairs",
"within",
"a",
"certain",
"voltage",
"range",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/apps/battery/battery_abc.py#L328-L346 | [
"def",
"_select_in_voltage_range",
"(",
"self",
",",
"min_voltage",
"=",
"None",
",",
"max_voltage",
"=",
"None",
")",
":",
"min_voltage",
"=",
"min_voltage",
"if",
"min_voltage",
"is",
"not",
"None",
"else",
"self",
".",
"min_voltage",
"max_voltage",
"=",
"ma... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.pymatgen_mol | Returns pymatgen Molecule object. | pymatgen/io/babel.py | def pymatgen_mol(self):
"""
Returns pymatgen Molecule object.
"""
sp = []
coords = []
for atom in ob.OBMolAtomIter(self._obmol):
sp.append(atom.GetAtomicNum())
coords.append([atom.GetX(), atom.GetY(), atom.GetZ()])
return Molecule(sp, coord... | def pymatgen_mol(self):
"""
Returns pymatgen Molecule object.
"""
sp = []
coords = []
for atom in ob.OBMolAtomIter(self._obmol):
sp.append(atom.GetAtomicNum())
coords.append([atom.GetX(), atom.GetY(), atom.GetZ()])
return Molecule(sp, coord... | [
"Returns",
"pymatgen",
"Molecule",
"object",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L82-L91 | [
"def",
"pymatgen_mol",
"(",
"self",
")",
":",
"sp",
"=",
"[",
"]",
"coords",
"=",
"[",
"]",
"for",
"atom",
"in",
"ob",
".",
"OBMolAtomIter",
"(",
"self",
".",
"_obmol",
")",
":",
"sp",
".",
"append",
"(",
"atom",
".",
"GetAtomicNum",
"(",
")",
")... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.localopt | A wrapper to pybel's localopt method to optimize a Molecule.
Args:
forcefield: Default is mmff94. Options are 'gaff', 'ghemical',
'mmff94', 'mmff94s', and 'uff'.
steps: Default is 500. | pymatgen/io/babel.py | def localopt(self, forcefield='mmff94', steps=500):
"""
A wrapper to pybel's localopt method to optimize a Molecule.
Args:
forcefield: Default is mmff94. Options are 'gaff', 'ghemical',
'mmff94', 'mmff94s', and 'uff'.
steps: Default is 500.
"""
... | def localopt(self, forcefield='mmff94', steps=500):
"""
A wrapper to pybel's localopt method to optimize a Molecule.
Args:
forcefield: Default is mmff94. Options are 'gaff', 'ghemical',
'mmff94', 'mmff94s', and 'uff'.
steps: Default is 500.
"""
... | [
"A",
"wrapper",
"to",
"pybel",
"s",
"localopt",
"method",
"to",
"optimize",
"a",
"Molecule",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L100-L111 | [
"def",
"localopt",
"(",
"self",
",",
"forcefield",
"=",
"'mmff94'",
",",
"steps",
"=",
"500",
")",
":",
"pbmol",
"=",
"pb",
".",
"Molecule",
"(",
"self",
".",
"_obmol",
")",
"pbmol",
".",
"localopt",
"(",
"forcefield",
"=",
"forcefield",
",",
"steps",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.make3d | A wrapper to pybel's make3D method generate a 3D structure from a
2D or 0D structure.
The 3D structure is made very quickly using a combination of rules
(e.g. sp3 atoms should have four bonds arranged in a tetrahedron) and
ring templates (e.g. cyclohexane is shaped like a chair). Once 3D... | pymatgen/io/babel.py | def make3d(self, forcefield="mmff94", steps=50):
"""
A wrapper to pybel's make3D method generate a 3D structure from a
2D or 0D structure.
The 3D structure is made very quickly using a combination of rules
(e.g. sp3 atoms should have four bonds arranged in a tetrahedron) and
... | def make3d(self, forcefield="mmff94", steps=50):
"""
A wrapper to pybel's make3D method generate a 3D structure from a
2D or 0D structure.
The 3D structure is made very quickly using a combination of rules
(e.g. sp3 atoms should have four bonds arranged in a tetrahedron) and
... | [
"A",
"wrapper",
"to",
"pybel",
"s",
"make3D",
"method",
"generate",
"a",
"3D",
"structure",
"from",
"a",
"2D",
"or",
"0D",
"structure",
".",
"The",
"3D",
"structure",
"is",
"made",
"very",
"quickly",
"using",
"a",
"combination",
"of",
"rules",
"(",
"e",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L113-L134 | [
"def",
"make3d",
"(",
"self",
",",
"forcefield",
"=",
"\"mmff94\"",
",",
"steps",
"=",
"50",
")",
":",
"pbmol",
"=",
"pb",
".",
"Molecule",
"(",
"self",
".",
"_obmol",
")",
"pbmol",
".",
"make3D",
"(",
"forcefield",
"=",
"forcefield",
",",
"steps",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.remove_bond | Remove a bond from an openbabel molecule
Args:
idx1: The atom index of one of the atoms participating the in bond
idx2: The atom index of the other atom participating in the bond | pymatgen/io/babel.py | def remove_bond(self, idx1, idx2):
"""
Remove a bond from an openbabel molecule
Args:
idx1: The atom index of one of the atoms participating the in bond
idx2: The atom index of the other atom participating in the bond
"""
for obbond in ob.OBMolBondIter(s... | def remove_bond(self, idx1, idx2):
"""
Remove a bond from an openbabel molecule
Args:
idx1: The atom index of one of the atoms participating the in bond
idx2: The atom index of the other atom participating in the bond
"""
for obbond in ob.OBMolBondIter(s... | [
"Remove",
"a",
"bond",
"from",
"an",
"openbabel",
"molecule"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L142-L152 | [
"def",
"remove_bond",
"(",
"self",
",",
"idx1",
",",
"idx2",
")",
":",
"for",
"obbond",
"in",
"ob",
".",
"OBMolBondIter",
"(",
"self",
".",
"_obmol",
")",
":",
"if",
"(",
"obbond",
".",
"GetBeginAtomIdx",
"(",
")",
"==",
"idx1",
"and",
"obbond",
".",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.rotor_conformer | Conformer search based on several Rotor Search algorithms of openbabel.
If the input molecule is not 3D, make3d will be called (generate 3D
structure, add hydrogen, a quick localopt). All hydrogen atoms need
to be made explicit.
Args:
rotor_args: pass args to Rotor Search in... | pymatgen/io/babel.py | def rotor_conformer(self, *rotor_args, algo="WeightedRotorSearch",
forcefield="mmff94"):
"""
Conformer search based on several Rotor Search algorithms of openbabel.
If the input molecule is not 3D, make3d will be called (generate 3D
structure, add hydrogen, a quic... | def rotor_conformer(self, *rotor_args, algo="WeightedRotorSearch",
forcefield="mmff94"):
"""
Conformer search based on several Rotor Search algorithms of openbabel.
If the input molecule is not 3D, make3d will be called (generate 3D
structure, add hydrogen, a quic... | [
"Conformer",
"search",
"based",
"on",
"several",
"Rotor",
"Search",
"algorithms",
"of",
"openbabel",
".",
"If",
"the",
"input",
"molecule",
"is",
"not",
"3D",
"make3d",
"will",
"be",
"called",
"(",
"generate",
"3D",
"structure",
"add",
"hydrogen",
"a",
"quic... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L154-L199 | [
"def",
"rotor_conformer",
"(",
"self",
",",
"*",
"rotor_args",
",",
"algo",
"=",
"\"WeightedRotorSearch\"",
",",
"forcefield",
"=",
"\"mmff94\"",
")",
":",
"if",
"self",
".",
"_obmol",
".",
"GetDimension",
"(",
")",
"!=",
"3",
":",
"self",
".",
"make3d",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.gen3d_conformer | A combined method to first generate 3D structures from 0D or 2D
structures and then find the minimum energy conformer:
1. Use OBBuilder to create a 3D structure using rules and ring templates
2. Do 250 steps of a steepest descent geometry optimization with the
MMFF94 forcefield
... | pymatgen/io/babel.py | def gen3d_conformer(self):
"""
A combined method to first generate 3D structures from 0D or 2D
structures and then find the minimum energy conformer:
1. Use OBBuilder to create a 3D structure using rules and ring templates
2. Do 250 steps of a steepest descent geometry optimizati... | def gen3d_conformer(self):
"""
A combined method to first generate 3D structures from 0D or 2D
structures and then find the minimum energy conformer:
1. Use OBBuilder to create a 3D structure using rules and ring templates
2. Do 250 steps of a steepest descent geometry optimizati... | [
"A",
"combined",
"method",
"to",
"first",
"generate",
"3D",
"structures",
"from",
"0D",
"or",
"2D",
"structures",
"and",
"then",
"find",
"the",
"minimum",
"energy",
"conformer",
":",
"1",
".",
"Use",
"OBBuilder",
"to",
"create",
"a",
"3D",
"structure",
"us... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L201-L221 | [
"def",
"gen3d_conformer",
"(",
"self",
")",
":",
"gen3d",
"=",
"ob",
".",
"OBOp",
".",
"FindType",
"(",
"\"Gen3D\"",
")",
"gen3d",
".",
"Do",
"(",
"self",
".",
"_obmol",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.confab_conformers | Conformer generation based on Confab to generate all diverse low-energy
conformers for molecules. This is different from rotor_conformer or
gen3d_conformer as it aims to not simply to find a low energy
conformation but to generate several different conformations.
Args:
force... | pymatgen/io/babel.py | def confab_conformers(self, forcefield="mmff94", freeze_atoms=None,
rmsd_cutoff=0.5, energy_cutoff=50.0,
conf_cutoff=100000, verbose=False):
"""
Conformer generation based on Confab to generate all diverse low-energy
conformers for molecules. T... | def confab_conformers(self, forcefield="mmff94", freeze_atoms=None,
rmsd_cutoff=0.5, energy_cutoff=50.0,
conf_cutoff=100000, verbose=False):
"""
Conformer generation based on Confab to generate all diverse low-energy
conformers for molecules. T... | [
"Conformer",
"generation",
"based",
"on",
"Confab",
"to",
"generate",
"all",
"diverse",
"low",
"-",
"energy",
"conformers",
"for",
"molecules",
".",
"This",
"is",
"different",
"from",
"rotor_conformer",
"or",
"gen3d_conformer",
"as",
"it",
"aims",
"to",
"not",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L223-L282 | [
"def",
"confab_conformers",
"(",
"self",
",",
"forcefield",
"=",
"\"mmff94\"",
",",
"freeze_atoms",
"=",
"None",
",",
"rmsd_cutoff",
"=",
"0.5",
",",
"energy_cutoff",
"=",
"50.0",
",",
"conf_cutoff",
"=",
"100000",
",",
"verbose",
"=",
"False",
")",
":",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.write_file | Uses OpenBabel to output all supported formats.
Args:
filename: Filename of file to output
file_format: String specifying any OpenBabel supported formats. | pymatgen/io/babel.py | def write_file(self, filename, file_format="xyz"):
"""
Uses OpenBabel to output all supported formats.
Args:
filename: Filename of file to output
file_format: String specifying any OpenBabel supported formats.
"""
mol = pb.Molecule(self._obmol)
re... | def write_file(self, filename, file_format="xyz"):
"""
Uses OpenBabel to output all supported formats.
Args:
filename: Filename of file to output
file_format: String specifying any OpenBabel supported formats.
"""
mol = pb.Molecule(self._obmol)
re... | [
"Uses",
"OpenBabel",
"to",
"output",
"all",
"supported",
"formats",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L291-L300 | [
"def",
"write_file",
"(",
"self",
",",
"filename",
",",
"file_format",
"=",
"\"xyz\"",
")",
":",
"mol",
"=",
"pb",
".",
"Molecule",
"(",
"self",
".",
"_obmol",
")",
"return",
"mol",
".",
"write",
"(",
"file_format",
",",
"filename",
",",
"overwrite",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.from_file | Uses OpenBabel to read a molecule from a file in all supported formats.
Args:
filename: Filename of input file
file_format: String specifying any OpenBabel supported formats.
Returns:
BabelMolAdaptor object | pymatgen/io/babel.py | def from_file(filename, file_format="xyz"):
"""
Uses OpenBabel to read a molecule from a file in all supported formats.
Args:
filename: Filename of input file
file_format: String specifying any OpenBabel supported formats.
Returns:
BabelMolAdaptor ob... | def from_file(filename, file_format="xyz"):
"""
Uses OpenBabel to read a molecule from a file in all supported formats.
Args:
filename: Filename of input file
file_format: String specifying any OpenBabel supported formats.
Returns:
BabelMolAdaptor ob... | [
"Uses",
"OpenBabel",
"to",
"read",
"a",
"molecule",
"from",
"a",
"file",
"in",
"all",
"supported",
"formats",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L303-L315 | [
"def",
"from_file",
"(",
"filename",
",",
"file_format",
"=",
"\"xyz\"",
")",
":",
"mols",
"=",
"list",
"(",
"pb",
".",
"readfile",
"(",
"str",
"(",
"file_format",
")",
",",
"str",
"(",
"filename",
")",
")",
")",
"return",
"BabelMolAdaptor",
"(",
"mols... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BabelMolAdaptor.from_string | Uses OpenBabel to read a molecule from a string in all supported
formats.
Args:
string_data: String containing molecule data.
file_format: String specifying any OpenBabel supported formats.
Returns:
BabelMolAdaptor object | pymatgen/io/babel.py | def from_string(string_data, file_format="xyz"):
"""
Uses OpenBabel to read a molecule from a string in all supported
formats.
Args:
string_data: String containing molecule data.
file_format: String specifying any OpenBabel supported formats.
Returns:
... | def from_string(string_data, file_format="xyz"):
"""
Uses OpenBabel to read a molecule from a string in all supported
formats.
Args:
string_data: String containing molecule data.
file_format: String specifying any OpenBabel supported formats.
Returns:
... | [
"Uses",
"OpenBabel",
"to",
"read",
"a",
"molecule",
"from",
"a",
"string",
"in",
"all",
"supported",
"formats",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/babel.py#L332-L345 | [
"def",
"from_string",
"(",
"string_data",
",",
"file_format",
"=",
"\"xyz\"",
")",
":",
"mols",
"=",
"pb",
".",
"readstring",
"(",
"str",
"(",
"file_format",
")",
",",
"str",
"(",
"string_data",
")",
")",
"return",
"BabelMolAdaptor",
"(",
"mols",
".",
"O... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | find_connected_atoms | Finds the list of bonded atoms.
Args:
struct (Structure): Input structure
tolerance: length in angstroms used in finding bonded atoms. Two atoms are considered bonded if (radius of atom 1) + (radius of atom 2) + (tolerance) < (distance between atoms 1 and 2). Default value = 0.45, the value used by... | pymatgen/analysis/find_dimension.py | def find_connected_atoms(struct, tolerance=0.45, ldict=JmolNN().el_radius):
"""
Finds the list of bonded atoms.
Args:
struct (Structure): Input structure
tolerance: length in angstroms used in finding bonded atoms. Two atoms are considered bonded if (radius of atom 1) + (radius of atom 2) +... | def find_connected_atoms(struct, tolerance=0.45, ldict=JmolNN().el_radius):
"""
Finds the list of bonded atoms.
Args:
struct (Structure): Input structure
tolerance: length in angstroms used in finding bonded atoms. Two atoms are considered bonded if (radius of atom 1) + (radius of atom 2) +... | [
"Finds",
"the",
"list",
"of",
"bonded",
"atoms",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/find_dimension.py#L28-L66 | [
"def",
"find_connected_atoms",
"(",
"struct",
",",
"tolerance",
"=",
"0.45",
",",
"ldict",
"=",
"JmolNN",
"(",
")",
".",
"el_radius",
")",
":",
"n_atoms",
"=",
"len",
"(",
"struct",
".",
"species",
")",
"fc",
"=",
"np",
".",
"array",
"(",
"struct",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | find_clusters | Finds bonded clusters of atoms in the structure with periodic boundary conditions.
If there are atoms that are not bonded to anything, returns [0,1,0].(For faster computation time in FindDimension())
Args:
struct (Structure): Input structure
connected_list: Must be made from the same structure ... | pymatgen/analysis/find_dimension.py | def find_clusters(struct, connected_list):
"""
Finds bonded clusters of atoms in the structure with periodic boundary conditions.
If there are atoms that are not bonded to anything, returns [0,1,0].(For faster computation time in FindDimension())
Args:
struct (Structure): Input structure
... | def find_clusters(struct, connected_list):
"""
Finds bonded clusters of atoms in the structure with periodic boundary conditions.
If there are atoms that are not bonded to anything, returns [0,1,0].(For faster computation time in FindDimension())
Args:
struct (Structure): Input structure
... | [
"Finds",
"bonded",
"clusters",
"of",
"atoms",
"in",
"the",
"structure",
"with",
"periodic",
"boundary",
"conditions",
".",
"If",
"there",
"are",
"atoms",
"that",
"are",
"not",
"bonded",
"to",
"anything",
"returns",
"[",
"0",
"1",
"0",
"]",
".",
"(",
"For... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/find_dimension.py#L72-L121 | [
"def",
"find_clusters",
"(",
"struct",
",",
"connected_list",
")",
":",
"n_atoms",
"=",
"len",
"(",
"struct",
".",
"species",
")",
"if",
"len",
"(",
"np",
".",
"unique",
"(",
"connected_list",
")",
")",
"!=",
"n_atoms",
":",
"return",
"[",
"0",
",",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | find_dimension | Algorithm for finding the dimensions of connected subunits in a crystal structure.
This method finds the dimensionality of the material even when the material is not layered along low-index planes, or does not have flat layers/molecular wires.
See details at : Cheon, G.; Duerloo, K.-A. N.; Sendek, A. D.; Porter... | pymatgen/analysis/find_dimension.py | def find_dimension(structure_raw, tolerance=0.45, ldict=JmolNN().el_radius, standardize=True):
"""
Algorithm for finding the dimensions of connected subunits in a crystal structure.
This method finds the dimensionality of the material even when the material is not layered along low-index planes, or does not... | def find_dimension(structure_raw, tolerance=0.45, ldict=JmolNN().el_radius, standardize=True):
"""
Algorithm for finding the dimensions of connected subunits in a crystal structure.
This method finds the dimensionality of the material even when the material is not layered along low-index planes, or does not... | [
"Algorithm",
"for",
"finding",
"the",
"dimensions",
"of",
"connected",
"subunits",
"in",
"a",
"crystal",
"structure",
".",
"This",
"method",
"finds",
"the",
"dimensionality",
"of",
"the",
"material",
"even",
"when",
"the",
"material",
"is",
"not",
"layered",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/find_dimension.py#L127-L177 | [
"def",
"find_dimension",
"(",
"structure_raw",
",",
"tolerance",
"=",
"0.45",
",",
"ldict",
"=",
"JmolNN",
"(",
")",
".",
"el_radius",
",",
"standardize",
"=",
"True",
")",
":",
"if",
"standardize",
":",
"structure",
"=",
"SpacegroupAnalyzer",
"(",
"structur... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | XSF.to_string | Returns a string with the structure in XSF format
See http://www.xcrysden.org/doc/XSF.html | pymatgen/io/xcrysden.py | def to_string(self):
"""
Returns a string with the structure in XSF format
See http://www.xcrysden.org/doc/XSF.html
"""
lines = []
app = lines.append
app("CRYSTAL")
app("# Primitive lattice vectors in Angstrom")
app("PRIMVEC")
cell = self.... | def to_string(self):
"""
Returns a string with the structure in XSF format
See http://www.xcrysden.org/doc/XSF.html
"""
lines = []
app = lines.append
app("CRYSTAL")
app("# Primitive lattice vectors in Angstrom")
app("PRIMVEC")
cell = self.... | [
"Returns",
"a",
"string",
"with",
"the",
"structure",
"in",
"XSF",
"format",
"See",
"http",
":",
"//",
"www",
".",
"xcrysden",
".",
"org",
"/",
"doc",
"/",
"XSF",
".",
"html"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/xcrysden.py#L19-L43 | [
"def",
"to_string",
"(",
"self",
")",
":",
"lines",
"=",
"[",
"]",
"app",
"=",
"lines",
".",
"append",
"app",
"(",
"\"CRYSTAL\"",
")",
"app",
"(",
"\"# Primitive lattice vectors in Angstrom\"",
")",
"app",
"(",
"\"PRIMVEC\"",
")",
"cell",
"=",
"self",
".",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | XSF.from_string | Initialize a `Structure` object from a string with data in XSF format.
Args:
input_string: String with the structure in XSF format.
See http://www.xcrysden.org/doc/XSF.html
cls_: Structure class to be created. default: pymatgen structure | pymatgen/io/xcrysden.py | def from_string(cls, input_string, cls_=None):
"""
Initialize a `Structure` object from a string with data in XSF format.
Args:
input_string: String with the structure in XSF format.
See http://www.xcrysden.org/doc/XSF.html
cls_: Structure class to be cre... | def from_string(cls, input_string, cls_=None):
"""
Initialize a `Structure` object from a string with data in XSF format.
Args:
input_string: String with the structure in XSF format.
See http://www.xcrysden.org/doc/XSF.html
cls_: Structure class to be cre... | [
"Initialize",
"a",
"Structure",
"object",
"from",
"a",
"string",
"with",
"data",
"in",
"XSF",
"format",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/xcrysden.py#L46-L99 | [
"def",
"from_string",
"(",
"cls",
",",
"input_string",
",",
"cls_",
"=",
"None",
")",
":",
"# CRYSTAL see (1)",
"# these are primitive lattice vectors (in Angstroms)",
"# PRIMVEC",
"# 0.0000000 2.7100000 2.7100000 see (2)",
"# ... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | HighSymmKpath.get_kpoints | Returns:
the kpoints along the paths in cartesian coordinates
together with the labels for symmetry points -Wei | pymatgen/symmetry/bandstructure.py | def get_kpoints(self, line_density=20, coords_are_cartesian=True):
"""
Returns:
the kpoints along the paths in cartesian coordinates
together with the labels for symmetry points -Wei
"""
list_k_points = []
sym_point_labels = []
for b in self.kpath[... | def get_kpoints(self, line_density=20, coords_are_cartesian=True):
"""
Returns:
the kpoints along the paths in cartesian coordinates
together with the labels for symmetry points -Wei
"""
list_k_points = []
sym_point_labels = []
for b in self.kpath[... | [
"Returns",
":",
"the",
"kpoints",
"along",
"the",
"paths",
"in",
"cartesian",
"coordinates",
"together",
"with",
"the",
"labels",
"for",
"symmetry",
"points",
"-",
"Wei"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/symmetry/bandstructure.py#L208-L236 | [
"def",
"get_kpoints",
"(",
"self",
",",
"line_density",
"=",
"20",
",",
"coords_are_cartesian",
"=",
"True",
")",
":",
"list_k_points",
"=",
"[",
"]",
"sym_point_labels",
"=",
"[",
"]",
"for",
"b",
"in",
"self",
".",
"kpath",
"[",
"'path'",
"]",
":",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | WorkResults.from_node | Initialize an instance from a :class:`Work` instance. | pymatgen/io/abinit/works.py | def from_node(cls, work):
"""Initialize an instance from a :class:`Work` instance."""
new = super().from_node(work)
# Will put all files found in outdir in GridFs
# Warning: assuming binary files.
d = {os.path.basename(f): f for f in work.outdir.list_filepaths()}
new.reg... | def from_node(cls, work):
"""Initialize an instance from a :class:`Work` instance."""
new = super().from_node(work)
# Will put all files found in outdir in GridFs
# Warning: assuming binary files.
d = {os.path.basename(f): f for f in work.outdir.list_filepaths()}
new.reg... | [
"Initialize",
"an",
"instance",
"from",
"a",
":",
"class",
":",
"Work",
"instance",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L61-L70 | [
"def",
"from_node",
"(",
"cls",
",",
"work",
")",
":",
"new",
"=",
"super",
"(",
")",
".",
"from_node",
"(",
"work",
")",
"# Will put all files found in outdir in GridFs",
"# Warning: assuming binary files.",
"d",
"=",
"{",
"os",
".",
"path",
".",
"basename",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BaseWork.ncores_reserved | Returns the number of cores reserved in this moment.
A core is reserved if it's still not running but
we have submitted the task to the queue manager. | pymatgen/io/abinit/works.py | def ncores_reserved(self):
"""
Returns the number of cores reserved in this moment.
A core is reserved if it's still not running but
we have submitted the task to the queue manager.
"""
return sum(task.manager.num_cores for task in self if task.status == task.S_SUB) | def ncores_reserved(self):
"""
Returns the number of cores reserved in this moment.
A core is reserved if it's still not running but
we have submitted the task to the queue manager.
"""
return sum(task.manager.num_cores for task in self if task.status == task.S_SUB) | [
"Returns",
"the",
"number",
"of",
"cores",
"reserved",
"in",
"this",
"moment",
".",
"A",
"core",
"is",
"reserved",
"if",
"it",
"s",
"still",
"not",
"running",
"but",
"we",
"have",
"submitted",
"the",
"task",
"to",
"the",
"queue",
"manager",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L122-L128 | [
"def",
"ncores_reserved",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"task",
".",
"manager",
".",
"num_cores",
"for",
"task",
"in",
"self",
"if",
"task",
".",
"status",
"==",
"task",
".",
"S_SUB",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BaseWork.ncores_allocated | Returns the number of CPUs allocated in this moment.
A core is allocated if it's running a task or if we have
submitted a task to the queue manager but the job is still pending. | pymatgen/io/abinit/works.py | def ncores_allocated(self):
"""
Returns the number of CPUs allocated in this moment.
A core is allocated if it's running a task or if we have
submitted a task to the queue manager but the job is still pending.
"""
return sum(task.manager.num_cores for task in self if task... | def ncores_allocated(self):
"""
Returns the number of CPUs allocated in this moment.
A core is allocated if it's running a task or if we have
submitted a task to the queue manager but the job is still pending.
"""
return sum(task.manager.num_cores for task in self if task... | [
"Returns",
"the",
"number",
"of",
"CPUs",
"allocated",
"in",
"this",
"moment",
".",
"A",
"core",
"is",
"allocated",
"if",
"it",
"s",
"running",
"a",
"task",
"or",
"if",
"we",
"have",
"submitted",
"a",
"task",
"to",
"the",
"queue",
"manager",
"but",
"th... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L131-L137 | [
"def",
"ncores_allocated",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"task",
".",
"manager",
".",
"num_cores",
"for",
"task",
"in",
"self",
"if",
"task",
".",
"status",
"in",
"[",
"task",
".",
"S_SUB",
",",
"task",
".",
"S_RUN",
"]",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BaseWork.ncores_used | Returns the number of cores used in this moment.
A core is used if there's a job that is running on it. | pymatgen/io/abinit/works.py | def ncores_used(self):
"""
Returns the number of cores used in this moment.
A core is used if there's a job that is running on it.
"""
return sum(task.manager.num_cores for task in self if task.status == task.S_RUN) | def ncores_used(self):
"""
Returns the number of cores used in this moment.
A core is used if there's a job that is running on it.
"""
return sum(task.manager.num_cores for task in self if task.status == task.S_RUN) | [
"Returns",
"the",
"number",
"of",
"cores",
"used",
"in",
"this",
"moment",
".",
"A",
"core",
"is",
"used",
"if",
"there",
"s",
"a",
"job",
"that",
"is",
"running",
"on",
"it",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L140-L145 | [
"def",
"ncores_used",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"task",
".",
"manager",
".",
"num_cores",
"for",
"task",
"in",
"self",
"if",
"task",
".",
"status",
"==",
"task",
".",
"S_RUN",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BaseWork.fetch_task_to_run | Returns the first task that is ready to run or
None if no task can be submitted at present"
Raises:
`StopIteration` if all tasks are done. | pymatgen/io/abinit/works.py | def fetch_task_to_run(self):
"""
Returns the first task that is ready to run or
None if no task can be submitted at present"
Raises:
`StopIteration` if all tasks are done.
"""
# All the tasks are done so raise an exception
# that will be handled by th... | def fetch_task_to_run(self):
"""
Returns the first task that is ready to run or
None if no task can be submitted at present"
Raises:
`StopIteration` if all tasks are done.
"""
# All the tasks are done so raise an exception
# that will be handled by th... | [
"Returns",
"the",
"first",
"task",
"that",
"is",
"ready",
"to",
"run",
"or",
"None",
"if",
"no",
"task",
"can",
"be",
"submitted",
"at",
"present"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L147-L167 | [
"def",
"fetch_task_to_run",
"(",
"self",
")",
":",
"# All the tasks are done so raise an exception",
"# that will be handled by the client code.",
"if",
"all",
"(",
"task",
".",
"is_completed",
"for",
"task",
"in",
"self",
")",
":",
"raise",
"StopIteration",
"(",
"\"All... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BaseWork.connect_signals | Connect the signals within the work.
The :class:`Work` is responsible for catching the important signals raised from
its task and raise new signals when some particular condition occurs. | pymatgen/io/abinit/works.py | def connect_signals(self):
"""
Connect the signals within the work.
The :class:`Work` is responsible for catching the important signals raised from
its task and raise new signals when some particular condition occurs.
"""
for task in self:
dispatcher.connect(s... | def connect_signals(self):
"""
Connect the signals within the work.
The :class:`Work` is responsible for catching the important signals raised from
its task and raise new signals when some particular condition occurs.
"""
for task in self:
dispatcher.connect(s... | [
"Connect",
"the",
"signals",
"within",
"the",
"work",
".",
"The",
":",
"class",
":",
"Work",
"is",
"responsible",
"for",
"catching",
"the",
"important",
"signals",
"raised",
"from",
"its",
"task",
"and",
"raise",
"new",
"signals",
"when",
"some",
"particular... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L183-L190 | [
"def",
"connect_signals",
"(",
"self",
")",
":",
"for",
"task",
"in",
"self",
":",
"dispatcher",
".",
"connect",
"(",
"self",
".",
"on_ok",
",",
"signal",
"=",
"task",
".",
"S_OK",
",",
"sender",
"=",
"task",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BaseWork.disconnect_signals | Disable the signals within the work. This function reverses the process of `connect_signals` | pymatgen/io/abinit/works.py | def disconnect_signals(self):
"""
Disable the signals within the work. This function reverses the process of `connect_signals`
"""
for task in self:
try:
dispatcher.disconnect(self.on_ok, signal=task.S_OK, sender=task)
except dispatcher.errors.Disp... | def disconnect_signals(self):
"""
Disable the signals within the work. This function reverses the process of `connect_signals`
"""
for task in self:
try:
dispatcher.disconnect(self.on_ok, signal=task.S_OK, sender=task)
except dispatcher.errors.Disp... | [
"Disable",
"the",
"signals",
"within",
"the",
"work",
".",
"This",
"function",
"reverses",
"the",
"process",
"of",
"connect_signals"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L192-L200 | [
"def",
"disconnect_signals",
"(",
"self",
")",
":",
"for",
"task",
"in",
"self",
":",
"try",
":",
"dispatcher",
".",
"disconnect",
"(",
"self",
".",
"on_ok",
",",
"signal",
"=",
"task",
".",
"S_OK",
",",
"sender",
"=",
"task",
")",
"except",
"dispatche... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BaseWork.on_ok | This callback is called when one task reaches status `S_OK`.
It executes on_all_ok when all tasks in self have reached `S_OK`. | pymatgen/io/abinit/works.py | def on_ok(self, sender):
"""
This callback is called when one task reaches status `S_OK`.
It executes on_all_ok when all tasks in self have reached `S_OK`.
"""
logger.debug("in on_ok with sender %s" % sender)
if self.all_ok:
if self.finalized:
... | def on_ok(self, sender):
"""
This callback is called when one task reaches status `S_OK`.
It executes on_all_ok when all tasks in self have reached `S_OK`.
"""
logger.debug("in on_ok with sender %s" % sender)
if self.all_ok:
if self.finalized:
... | [
"This",
"callback",
"is",
"called",
"when",
"one",
"task",
"reaches",
"status",
"S_OK",
".",
"It",
"executes",
"on_all_ok",
"when",
"all",
"tasks",
"in",
"self",
"have",
"reached",
"S_OK",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L207-L234 | [
"def",
"on_ok",
"(",
"self",
",",
"sender",
")",
":",
"logger",
".",
"debug",
"(",
"\"in on_ok with sender %s\"",
"%",
"sender",
")",
"if",
"self",
".",
"all_ok",
":",
"if",
"self",
".",
"finalized",
":",
"return",
"AttrDict",
"(",
"returncode",
"=",
"0"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_scf_task | Register a Scf task. | pymatgen/io/abinit/works.py | def register_scf_task(self, *args, **kwargs):
"""Register a Scf task."""
kwargs["task_class"] = ScfTask
return self.register_task(*args, **kwargs) | def register_scf_task(self, *args, **kwargs):
"""Register a Scf task."""
kwargs["task_class"] = ScfTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"Scf",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L374-L377 | [
"def",
"register_scf_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"ScfTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_collinear_then_noncollinear_scf_task | Register a Scf task that perform a SCF run first with nsppol = 2 and then nspinor = 2 | pymatgen/io/abinit/works.py | def register_collinear_then_noncollinear_scf_task(self, *args, **kwargs):
"""Register a Scf task that perform a SCF run first with nsppol = 2 and then nspinor = 2"""
kwargs["task_class"] = CollinearThenNonCollinearScfTask
return self.register_task(*args, **kwargs) | def register_collinear_then_noncollinear_scf_task(self, *args, **kwargs):
"""Register a Scf task that perform a SCF run first with nsppol = 2 and then nspinor = 2"""
kwargs["task_class"] = CollinearThenNonCollinearScfTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"Scf",
"task",
"that",
"perform",
"a",
"SCF",
"run",
"first",
"with",
"nsppol",
"=",
"2",
"and",
"then",
"nspinor",
"=",
"2"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L379-L382 | [
"def",
"register_collinear_then_noncollinear_scf_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"CollinearThenNonCollinearScfTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_nscf_task | Register a nscf task. | pymatgen/io/abinit/works.py | def register_nscf_task(self, *args, **kwargs):
"""Register a nscf task."""
kwargs["task_class"] = NscfTask
return self.register_task(*args, **kwargs) | def register_nscf_task(self, *args, **kwargs):
"""Register a nscf task."""
kwargs["task_class"] = NscfTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"nscf",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L384-L387 | [
"def",
"register_nscf_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"NscfTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_relax_task | Register a task for structural optimization. | pymatgen/io/abinit/works.py | def register_relax_task(self, *args, **kwargs):
"""Register a task for structural optimization."""
kwargs["task_class"] = RelaxTask
return self.register_task(*args, **kwargs) | def register_relax_task(self, *args, **kwargs):
"""Register a task for structural optimization."""
kwargs["task_class"] = RelaxTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"task",
"for",
"structural",
"optimization",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L389-L392 | [
"def",
"register_relax_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"RelaxTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_phonon_task | Register a phonon task. | pymatgen/io/abinit/works.py | def register_phonon_task(self, *args, **kwargs):
"""Register a phonon task."""
kwargs["task_class"] = PhononTask
return self.register_task(*args, **kwargs) | def register_phonon_task(self, *args, **kwargs):
"""Register a phonon task."""
kwargs["task_class"] = PhononTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"phonon",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L394-L397 | [
"def",
"register_phonon_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"PhononTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_elastic_task | Register an elastic task. | pymatgen/io/abinit/works.py | def register_elastic_task(self, *args, **kwargs):
"""Register an elastic task."""
kwargs["task_class"] = ElasticTask
return self.register_task(*args, **kwargs) | def register_elastic_task(self, *args, **kwargs):
"""Register an elastic task."""
kwargs["task_class"] = ElasticTask
return self.register_task(*args, **kwargs) | [
"Register",
"an",
"elastic",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L399-L402 | [
"def",
"register_elastic_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"ElasticTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_ddk_task | Register a ddk task. | pymatgen/io/abinit/works.py | def register_ddk_task(self, *args, **kwargs):
"""Register a ddk task."""
kwargs["task_class"] = DdkTask
return self.register_task(*args, **kwargs) | def register_ddk_task(self, *args, **kwargs):
"""Register a ddk task."""
kwargs["task_class"] = DdkTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"ddk",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L404-L407 | [
"def",
"register_ddk_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"DdkTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_scr_task | Register a screening task. | pymatgen/io/abinit/works.py | def register_scr_task(self, *args, **kwargs):
"""Register a screening task."""
kwargs["task_class"] = ScrTask
return self.register_task(*args, **kwargs) | def register_scr_task(self, *args, **kwargs):
"""Register a screening task."""
kwargs["task_class"] = ScrTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"screening",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L409-L412 | [
"def",
"register_scr_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"ScrTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_sigma_task | Register a sigma task. | pymatgen/io/abinit/works.py | def register_sigma_task(self, *args, **kwargs):
"""Register a sigma task."""
kwargs["task_class"] = SigmaTask
return self.register_task(*args, **kwargs) | def register_sigma_task(self, *args, **kwargs):
"""Register a sigma task."""
kwargs["task_class"] = SigmaTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"sigma",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L414-L417 | [
"def",
"register_sigma_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"SigmaTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_dde_task | Register a Dde task. | pymatgen/io/abinit/works.py | def register_dde_task(self, *args, **kwargs):
"""Register a Dde task."""
kwargs["task_class"] = DdeTask
return self.register_task(*args, **kwargs) | def register_dde_task(self, *args, **kwargs):
"""Register a Dde task."""
kwargs["task_class"] = DdeTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"Dde",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L419-L422 | [
"def",
"register_dde_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"DdeTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_dte_task | Register a Dte task. | pymatgen/io/abinit/works.py | def register_dte_task(self, *args, **kwargs):
"""Register a Dte task."""
kwargs["task_class"] = DteTask
return self.register_task(*args, **kwargs) | def register_dte_task(self, *args, **kwargs):
"""Register a Dte task."""
kwargs["task_class"] = DteTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"Dte",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L424-L427 | [
"def",
"register_dte_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"DteTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_bec_task | Register a BEC task. | pymatgen/io/abinit/works.py | def register_bec_task(self, *args, **kwargs):
"""Register a BEC task."""
kwargs["task_class"] = BecTask
return self.register_task(*args, **kwargs) | def register_bec_task(self, *args, **kwargs):
"""Register a BEC task."""
kwargs["task_class"] = BecTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"BEC",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L429-L432 | [
"def",
"register_bec_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"BecTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_bse_task | Register a Bethe-Salpeter task. | pymatgen/io/abinit/works.py | def register_bse_task(self, *args, **kwargs):
"""Register a Bethe-Salpeter task."""
kwargs["task_class"] = BseTask
return self.register_task(*args, **kwargs) | def register_bse_task(self, *args, **kwargs):
"""Register a Bethe-Salpeter task."""
kwargs["task_class"] = BseTask
return self.register_task(*args, **kwargs) | [
"Register",
"a",
"Bethe",
"-",
"Salpeter",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L434-L437 | [
"def",
"register_bse_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"BseTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.register_eph_task | Register an electron-phonon task. | pymatgen/io/abinit/works.py | def register_eph_task(self, *args, **kwargs):
"""Register an electron-phonon task."""
kwargs["task_class"] = EphTask
return self.register_task(*args, **kwargs) | def register_eph_task(self, *args, **kwargs):
"""Register an electron-phonon task."""
kwargs["task_class"] = EphTask
return self.register_task(*args, **kwargs) | [
"Register",
"an",
"electron",
"-",
"phonon",
"task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L439-L442 | [
"def",
"register_eph_task",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"\"task_class\"",
"]",
"=",
"EphTask",
"return",
"self",
".",
"register_task",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NodeContainer.walknset_vars | Set the values of the ABINIT variables in the input files of the nodes
Args:
task_class: If not None, only the input files of the tasks belonging
to class `task_class` are modified.
Example:
flow.walknset_vars(ecut=10, kptopt=4) | pymatgen/io/abinit/works.py | def walknset_vars(self, task_class=None, *args, **kwargs):
"""
Set the values of the ABINIT variables in the input files of the nodes
Args:
task_class: If not None, only the input files of the tasks belonging
to class `task_class` are modified.
Example:
... | def walknset_vars(self, task_class=None, *args, **kwargs):
"""
Set the values of the ABINIT variables in the input files of the nodes
Args:
task_class: If not None, only the input files of the tasks belonging
to class `task_class` are modified.
Example:
... | [
"Set",
"the",
"values",
"of",
"the",
"ABINIT",
"variables",
"in",
"the",
"input",
"files",
"of",
"the",
"nodes"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L444-L471 | [
"def",
"walknset_vars",
"(",
"self",
",",
"task_class",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"change_task",
"(",
"task",
")",
":",
"if",
"task_class",
"is",
"not",
"None",
"and",
"task",
".",
"__class__",
"is",
"no... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Work.set_manager | Set the :class:`TaskManager` to use to launch the :class:`Task`. | pymatgen/io/abinit/works.py | def set_manager(self, manager):
"""Set the :class:`TaskManager` to use to launch the :class:`Task`."""
self.manager = manager.deepcopy()
for task in self:
task.set_manager(manager) | def set_manager(self, manager):
"""Set the :class:`TaskManager` to use to launch the :class:`Task`."""
self.manager = manager.deepcopy()
for task in self:
task.set_manager(manager) | [
"Set",
"the",
":",
"class",
":",
"TaskManager",
"to",
"use",
"to",
"launch",
"the",
":",
"class",
":",
"Task",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/works.py#L494-L498 | [
"def",
"set_manager",
"(",
"self",
",",
"manager",
")",
":",
"self",
".",
"manager",
"=",
"manager",
".",
"deepcopy",
"(",
")",
"for",
"task",
"in",
"self",
":",
"task",
".",
"set_manager",
"(",
"manager",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.