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 | Pseudo.hint_for_accuracy | Returns a :class:`Hint` object with the suggested value of ecut [Ha] and
pawecutdg [Ha] for the given accuracy.
ecut and pawecutdg are set to zero if no hint is available.
Args:
accuracy: ["low", "normal", "high"] | pymatgen/io/abinit/pseudos.py | def hint_for_accuracy(self, accuracy="normal"):
"""
Returns a :class:`Hint` object with the suggested value of ecut [Ha] and
pawecutdg [Ha] for the given accuracy.
ecut and pawecutdg are set to zero if no hint is available.
Args:
accuracy: ["low", "normal", "high"]
... | def hint_for_accuracy(self, accuracy="normal"):
"""
Returns a :class:`Hint` object with the suggested value of ecut [Ha] and
pawecutdg [Ha] for the given accuracy.
ecut and pawecutdg are set to zero if no hint is available.
Args:
accuracy: ["low", "normal", "high"]
... | [
"Returns",
"a",
":",
"class",
":",
"Hint",
"object",
"with",
"the",
"suggested",
"value",
"of",
"ecut",
"[",
"Ha",
"]",
"and",
"pawecutdg",
"[",
"Ha",
"]",
"for",
"the",
"given",
"accuracy",
".",
"ecut",
"and",
"pawecutdg",
"are",
"set",
"to",
"zero",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L308-L325 | [
"def",
"hint_for_accuracy",
"(",
"self",
",",
"accuracy",
"=",
"\"normal\"",
")",
":",
"if",
"not",
"self",
".",
"has_dojo_report",
":",
"return",
"Hint",
"(",
"ecut",
"=",
"0.",
",",
"pawecutdg",
"=",
"0.",
")",
"# Get hints from dojoreport. Try first in hints ... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Pseudo.has_hints | True if self provides hints on the cutoff energy. | pymatgen/io/abinit/pseudos.py | def has_hints(self):
"""
True if self provides hints on the cutoff energy.
"""
for acc in ["low", "normal", "high"]:
try:
if self.hint_for_accuracy(acc) is None:
return False
except KeyError:
return False
... | def has_hints(self):
"""
True if self provides hints on the cutoff energy.
"""
for acc in ["low", "normal", "high"]:
try:
if self.hint_for_accuracy(acc) is None:
return False
except KeyError:
return False
... | [
"True",
"if",
"self",
"provides",
"hints",
"on",
"the",
"cutoff",
"energy",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L328-L338 | [
"def",
"has_hints",
"(",
"self",
")",
":",
"for",
"acc",
"in",
"[",
"\"low\"",
",",
"\"normal\"",
",",
"\"high\"",
"]",
":",
"try",
":",
"if",
"self",
".",
"hint_for_accuracy",
"(",
"acc",
")",
"is",
"None",
":",
"return",
"False",
"except",
"KeyError"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Pseudo.open_pspsfile | Calls Abinit to compute the internal tables for the application of the
pseudopotential part. Returns :class:`PspsFile` object providing methods
to plot and analyze the data or None if file is not found or it's not readable.
Args:
ecut: Cutoff energy in Hartree.
pawecutdg... | pymatgen/io/abinit/pseudos.py | def open_pspsfile(self, ecut=20, pawecutdg=None):
"""
Calls Abinit to compute the internal tables for the application of the
pseudopotential part. Returns :class:`PspsFile` object providing methods
to plot and analyze the data or None if file is not found or it's not readable.
A... | def open_pspsfile(self, ecut=20, pawecutdg=None):
"""
Calls Abinit to compute the internal tables for the application of the
pseudopotential part. Returns :class:`PspsFile` object providing methods
to plot and analyze the data or None if file is not found or it's not readable.
A... | [
"Calls",
"Abinit",
"to",
"compute",
"the",
"internal",
"tables",
"for",
"the",
"application",
"of",
"the",
"pseudopotential",
"part",
".",
"Returns",
":",
"class",
":",
"PspsFile",
"object",
"providing",
"methods",
"to",
"plot",
"and",
"analyze",
"the",
"data"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L340-L379 | [
"def",
"open_pspsfile",
"(",
"self",
",",
"ecut",
"=",
"20",
",",
"pawecutdg",
"=",
"None",
")",
":",
"from",
"pymatgen",
".",
"io",
".",
"abinit",
".",
"tasks",
"import",
"AbinitTask",
"from",
"abipy",
".",
"core",
".",
"structure",
"import",
"Structure... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NcAbinitHeader.fhi_header | Parse the FHI abinit header. Example:
Troullier-Martins psp for element Sc Thu Oct 27 17:33:22 EDT 1994
21.00000 3.00000 940714 zatom, zion, pspdat
1 1 2 0 2001 .00000 pspcod,pspxc,lmax,lloc,mmax,r2well
1.80626423934776 .22824404... | pymatgen/io/abinit/pseudos.py | def fhi_header(filename, ppdesc):
"""
Parse the FHI abinit header. Example:
Troullier-Martins psp for element Sc Thu Oct 27 17:33:22 EDT 1994
21.00000 3.00000 940714 zatom, zion, pspdat
1 1 2 0 2001 .00000 pspcod,pspxc,lmax,l... | def fhi_header(filename, ppdesc):
"""
Parse the FHI abinit header. Example:
Troullier-Martins psp for element Sc Thu Oct 27 17:33:22 EDT 1994
21.00000 3.00000 940714 zatom, zion, pspdat
1 1 2 0 2001 .00000 pspcod,pspxc,lmax,l... | [
"Parse",
"the",
"FHI",
"abinit",
"header",
".",
"Example",
":"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L702-L721 | [
"def",
"fhi_header",
"(",
"filename",
",",
"ppdesc",
")",
":",
"lines",
"=",
"_read_nlines",
"(",
"filename",
",",
"4",
")",
"try",
":",
"header",
"=",
"_dict_from_lines",
"(",
"lines",
"[",
":",
"4",
"]",
",",
"[",
"0",
",",
"3",
",",
"6",
",",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NcAbinitHeader.hgh_header | Parse the HGH abinit header. Example:
Hartwigsen-Goedecker-Hutter psp for Ne, from PRB58, 3641 (1998)
10 8 010605 zatom,zion,pspdat
3 1 1 0 2001 0 pspcod,pspxc,lmax,lloc,mmax,r2well | pymatgen/io/abinit/pseudos.py | def hgh_header(filename, ppdesc):
"""
Parse the HGH abinit header. Example:
Hartwigsen-Goedecker-Hutter psp for Ne, from PRB58, 3641 (1998)
10 8 010605 zatom,zion,pspdat
3 1 1 0 2001 0 pspcod,pspxc,lmax,lloc,mmax,r2well
"""
lines = _read_nlines(filenam... | def hgh_header(filename, ppdesc):
"""
Parse the HGH abinit header. Example:
Hartwigsen-Goedecker-Hutter psp for Ne, from PRB58, 3641 (1998)
10 8 010605 zatom,zion,pspdat
3 1 1 0 2001 0 pspcod,pspxc,lmax,lloc,mmax,r2well
"""
lines = _read_nlines(filenam... | [
"Parse",
"the",
"HGH",
"abinit",
"header",
".",
"Example",
":"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L724-L737 | [
"def",
"hgh_header",
"(",
"filename",
",",
"ppdesc",
")",
":",
"lines",
"=",
"_read_nlines",
"(",
"filename",
",",
"3",
")",
"header",
"=",
"_dict_from_lines",
"(",
"lines",
"[",
":",
"3",
"]",
",",
"[",
"0",
",",
"3",
",",
"6",
"]",
")",
"summary"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NcAbinitHeader.oncvpsp_header | Parse the ONCVPSP abinit header. Example:
Li ONCVPSP r_core= 2.01 3.02
3.0000 3.0000 140504 zatom,zion,pspd
8 2 1 4 600 0 pspcod,pspxc,lmax,lloc,mmax,r2well
5.99000000 0.00000000 0.00000000 rchrg fchrg qchrg
2 2 ... | pymatgen/io/abinit/pseudos.py | def oncvpsp_header(filename, ppdesc):
"""
Parse the ONCVPSP abinit header. Example:
Li ONCVPSP r_core= 2.01 3.02
3.0000 3.0000 140504 zatom,zion,pspd
8 2 1 4 600 0 pspcod,pspxc,lmax,lloc,mmax,r2well
5.99000000 0.00000... | def oncvpsp_header(filename, ppdesc):
"""
Parse the ONCVPSP abinit header. Example:
Li ONCVPSP r_core= 2.01 3.02
3.0000 3.0000 140504 zatom,zion,pspd
8 2 1 4 600 0 pspcod,pspxc,lmax,lloc,mmax,r2well
5.99000000 0.00000... | [
"Parse",
"the",
"ONCVPSP",
"abinit",
"header",
".",
"Example",
":"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L760-L786 | [
"def",
"oncvpsp_header",
"(",
"filename",
",",
"ppdesc",
")",
":",
"lines",
"=",
"_read_nlines",
"(",
"filename",
",",
"6",
")",
"header",
"=",
"_dict_from_lines",
"(",
"lines",
"[",
":",
"3",
"]",
",",
"[",
"0",
",",
"3",
",",
"6",
"]",
")",
"summ... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | NcAbinitHeader.tm_header | Parse the TM abinit header. Example:
Troullier-Martins psp for element Fm Thu Oct 27 17:28:39 EDT 1994
100.00000 14.00000 940714 zatom, zion, pspdat
1 1 3 0 2001 .00000 pspcod,pspxc,lmax,lloc,mmax,r2well
0 4.085 6.246 0 2.8... | pymatgen/io/abinit/pseudos.py | def tm_header(filename, ppdesc):
"""
Parse the TM abinit header. Example:
Troullier-Martins psp for element Fm Thu Oct 27 17:28:39 EDT 1994
100.00000 14.00000 940714 zatom, zion, pspdat
1 1 3 0 2001 .00000 pspcod,pspxc,lmax,llo... | def tm_header(filename, ppdesc):
"""
Parse the TM abinit header. Example:
Troullier-Martins psp for element Fm Thu Oct 27 17:28:39 EDT 1994
100.00000 14.00000 940714 zatom, zion, pspdat
1 1 3 0 2001 .00000 pspcod,pspxc,lmax,llo... | [
"Parse",
"the",
"TM",
"abinit",
"header",
".",
"Example",
":"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L789-L841 | [
"def",
"tm_header",
"(",
"filename",
",",
"ppdesc",
")",
":",
"lines",
"=",
"_read_nlines",
"(",
"filename",
",",
"-",
"1",
")",
"header",
"=",
"[",
"]",
"for",
"lineno",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"header",
".",
"append"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawAbinitHeader.paw_header | Parse the PAW abinit header. Examples:
Paw atomic data for element Ni - Generated by AtomPAW (N. Holzwarth) + AtomPAW2Abinit v3.0.5
28.000 18.000 20061204 : zatom,zion,pspdat
7 7 2 0 350 0. : pspcod,pspxc,lmax,lloc,mmax,r2well
paw3 1305 ... | pymatgen/io/abinit/pseudos.py | def paw_header(filename, ppdesc):
"""
Parse the PAW abinit header. Examples:
Paw atomic data for element Ni - Generated by AtomPAW (N. Holzwarth) + AtomPAW2Abinit v3.0.5
28.000 18.000 20061204 : zatom,zion,pspdat
7 7 2 0 350 0. : pspcod,... | def paw_header(filename, ppdesc):
"""
Parse the PAW abinit header. Examples:
Paw atomic data for element Ni - Generated by AtomPAW (N. Holzwarth) + AtomPAW2Abinit v3.0.5
28.000 18.000 20061204 : zatom,zion,pspdat
7 7 2 0 350 0. : pspcod,... | [
"Parse",
"the",
"PAW",
"abinit",
"header",
".",
"Examples",
":"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L896-L974 | [
"def",
"paw_header",
"(",
"filename",
",",
"ppdesc",
")",
":",
"supported_formats",
"=",
"[",
"\"paw3\"",
",",
"\"paw4\"",
",",
"\"paw5\"",
"]",
"if",
"ppdesc",
".",
"format",
"not",
"in",
"supported_formats",
":",
"raise",
"NotImplementedError",
"(",
"\"forma... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoParser.scan_directory | Analyze the files contained in directory dirname.
Args:
dirname: directory path
exclude_exts: list of file extensions that should be skipped.
exclude_fnames: list of file names that should be skipped.
Returns:
List of pseudopotential objects. | pymatgen/io/abinit/pseudos.py | def scan_directory(self, dirname, exclude_exts=(), exclude_fnames=()):
"""
Analyze the files contained in directory dirname.
Args:
dirname: directory path
exclude_exts: list of file extensions that should be skipped.
exclude_fnames: list of file names that sh... | def scan_directory(self, dirname, exclude_exts=(), exclude_fnames=()):
"""
Analyze the files contained in directory dirname.
Args:
dirname: directory path
exclude_exts: list of file extensions that should be skipped.
exclude_fnames: list of file names that sh... | [
"Analyze",
"the",
"files",
"contained",
"in",
"directory",
"dirname",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1020-L1059 | [
"def",
"scan_directory",
"(",
"self",
",",
"dirname",
",",
"exclude_exts",
"=",
"(",
")",
",",
"exclude_fnames",
"=",
"(",
")",
")",
":",
"for",
"i",
",",
"ext",
"in",
"enumerate",
"(",
"exclude_exts",
")",
":",
"if",
"not",
"ext",
".",
"strip",
"(",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoParser.read_ppdesc | Read the pseudopotential descriptor from file filename.
Returns:
Pseudopotential descriptor. None if filename is not a valid pseudopotential file.
Raises:
`PseudoParserError` if fileformat is not supported. | pymatgen/io/abinit/pseudos.py | def read_ppdesc(self, filename):
"""
Read the pseudopotential descriptor from file filename.
Returns:
Pseudopotential descriptor. None if filename is not a valid pseudopotential file.
Raises:
`PseudoParserError` if fileformat is not supported.
"""
... | def read_ppdesc(self, filename):
"""
Read the pseudopotential descriptor from file filename.
Returns:
Pseudopotential descriptor. None if filename is not a valid pseudopotential file.
Raises:
`PseudoParserError` if fileformat is not supported.
"""
... | [
"Read",
"the",
"pseudopotential",
"descriptor",
"from",
"file",
"filename",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1061-L1111 | [
"def",
"read_ppdesc",
"(",
"self",
",",
"filename",
")",
":",
"if",
"filename",
".",
"endswith",
"(",
"\".xml\"",
")",
":",
"raise",
"self",
".",
"Error",
"(",
"\"XML pseudo not supported yet\"",
")",
"else",
":",
"# Assume file with the abinit header.",
"lines",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoParser.parse | Read and parse a pseudopotential file. Main entry point for client code.
Returns:
pseudopotential object or None if filename is not a valid pseudopotential file. | pymatgen/io/abinit/pseudos.py | def parse(self, filename):
"""
Read and parse a pseudopotential file. Main entry point for client code.
Returns:
pseudopotential object or None if filename is not a valid pseudopotential file.
"""
path = os.path.abspath(filename)
# Only PAW supports XML at p... | def parse(self, filename):
"""
Read and parse a pseudopotential file. Main entry point for client code.
Returns:
pseudopotential object or None if filename is not a valid pseudopotential file.
"""
path = os.path.abspath(filename)
# Only PAW supports XML at p... | [
"Read",
"and",
"parse",
"a",
"pseudopotential",
"file",
".",
"Main",
"entry",
"point",
"for",
"client",
"code",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1113-L1157 | [
"def",
"parse",
"(",
"self",
",",
"filename",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"filename",
")",
"# Only PAW supports XML at present.",
"if",
"filename",
".",
"endswith",
"(",
"\".xml\"",
")",
":",
"return",
"PawXmlSetup",
"(",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup._eval_grid | This function receives a dictionary with the parameters defining the
radial mesh and returns a `ndarray` with the mesh | pymatgen/io/abinit/pseudos.py | def _eval_grid(grid_params):
"""
This function receives a dictionary with the parameters defining the
radial mesh and returns a `ndarray` with the mesh
"""
eq = grid_params.get("eq").replace(" ", "")
istart, iend = int(grid_params.get("istart")), int(grid_params.get("iend... | def _eval_grid(grid_params):
"""
This function receives a dictionary with the parameters defining the
radial mesh and returns a `ndarray` with the mesh
"""
eq = grid_params.get("eq").replace(" ", "")
istart, iend = int(grid_params.get("istart")), int(grid_params.get("iend... | [
"This",
"function",
"receives",
"a",
"dictionary",
"with",
"the",
"parameters",
"defining",
"the",
"radial",
"mesh",
"and",
"returns",
"a",
"ndarray",
"with",
"the",
"mesh"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1278-L1310 | [
"def",
"_eval_grid",
"(",
"grid_params",
")",
":",
"eq",
"=",
"grid_params",
".",
"get",
"(",
"\"eq\"",
")",
".",
"replace",
"(",
"\" \"",
",",
"\"\"",
")",
"istart",
",",
"iend",
"=",
"int",
"(",
"grid_params",
".",
"get",
"(",
"\"istart\"",
")",
")... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup._parse_radfunc | Parse the first occurence of func_name in the XML file. | pymatgen/io/abinit/pseudos.py | def _parse_radfunc(self, func_name):
"""Parse the first occurence of func_name in the XML file."""
node = self.root.find(func_name)
grid = node.attrib["grid"]
values = np.array([float(s) for s in node.text.split()])
return self.rad_grids[grid], values, node.attrib | def _parse_radfunc(self, func_name):
"""Parse the first occurence of func_name in the XML file."""
node = self.root.find(func_name)
grid = node.attrib["grid"]
values = np.array([float(s) for s in node.text.split()])
return self.rad_grids[grid], values, node.attrib | [
"Parse",
"the",
"first",
"occurence",
"of",
"func_name",
"in",
"the",
"XML",
"file",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1312-L1318 | [
"def",
"_parse_radfunc",
"(",
"self",
",",
"func_name",
")",
":",
"node",
"=",
"self",
".",
"root",
".",
"find",
"(",
"func_name",
")",
"grid",
"=",
"node",
".",
"attrib",
"[",
"\"grid\"",
"]",
"values",
"=",
"np",
".",
"array",
"(",
"[",
"float",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup._parse_all_radfuncs | Parse all the nodes with tag func_name in the XML file. | pymatgen/io/abinit/pseudos.py | def _parse_all_radfuncs(self, func_name):
"""Parse all the nodes with tag func_name in the XML file."""
for node in self.root.findall(func_name):
grid = node.attrib["grid"]
values = np.array([float(s) for s in node.text.split()])
yield self.rad_grids[grid], values, n... | def _parse_all_radfuncs(self, func_name):
"""Parse all the nodes with tag func_name in the XML file."""
for node in self.root.findall(func_name):
grid = node.attrib["grid"]
values = np.array([float(s) for s in node.text.split()])
yield self.rad_grids[grid], values, n... | [
"Parse",
"all",
"the",
"nodes",
"with",
"tag",
"func_name",
"in",
"the",
"XML",
"file",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1320-L1326 | [
"def",
"_parse_all_radfuncs",
"(",
"self",
",",
"func_name",
")",
":",
"for",
"node",
"in",
"self",
".",
"root",
".",
"findall",
"(",
"func_name",
")",
":",
"grid",
"=",
"node",
".",
"attrib",
"[",
"\"grid\"",
"]",
"values",
"=",
"np",
".",
"array",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.ae_core_density | The all-electron radial density. | pymatgen/io/abinit/pseudos.py | def ae_core_density(self):
"""The all-electron radial density."""
mesh, values, attrib = self._parse_radfunc("ae_core_density")
return RadialFunction(mesh, values) | def ae_core_density(self):
"""The all-electron radial density."""
mesh, values, attrib = self._parse_radfunc("ae_core_density")
return RadialFunction(mesh, values) | [
"The",
"all",
"-",
"electron",
"radial",
"density",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1329-L1332 | [
"def",
"ae_core_density",
"(",
"self",
")",
":",
"mesh",
",",
"values",
",",
"attrib",
"=",
"self",
".",
"_parse_radfunc",
"(",
"\"ae_core_density\"",
")",
"return",
"RadialFunction",
"(",
"mesh",
",",
"values",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.pseudo_core_density | The pseudized radial density. | pymatgen/io/abinit/pseudos.py | def pseudo_core_density(self):
"""The pseudized radial density."""
mesh, values, attrib = self._parse_radfunc("pseudo_core_density")
return RadialFunction(mesh, values) | def pseudo_core_density(self):
"""The pseudized radial density."""
mesh, values, attrib = self._parse_radfunc("pseudo_core_density")
return RadialFunction(mesh, values) | [
"The",
"pseudized",
"radial",
"density",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1335-L1338 | [
"def",
"pseudo_core_density",
"(",
"self",
")",
":",
"mesh",
",",
"values",
",",
"attrib",
"=",
"self",
".",
"_parse_radfunc",
"(",
"\"pseudo_core_density\"",
")",
"return",
"RadialFunction",
"(",
"mesh",
",",
"values",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.ae_partial_waves | Dictionary with the AE partial waves indexed by state. | pymatgen/io/abinit/pseudos.py | def ae_partial_waves(self):
"""Dictionary with the AE partial waves indexed by state."""
ae_partial_waves = OrderedDict()
for mesh, values, attrib in self._parse_all_radfuncs("ae_partial_wave"):
state = attrib["state"]
#val_state = self.valence_states[state]
a... | def ae_partial_waves(self):
"""Dictionary with the AE partial waves indexed by state."""
ae_partial_waves = OrderedDict()
for mesh, values, attrib in self._parse_all_radfuncs("ae_partial_wave"):
state = attrib["state"]
#val_state = self.valence_states[state]
a... | [
"Dictionary",
"with",
"the",
"AE",
"partial",
"waves",
"indexed",
"by",
"state",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1341-L1349 | [
"def",
"ae_partial_waves",
"(",
"self",
")",
":",
"ae_partial_waves",
"=",
"OrderedDict",
"(",
")",
"for",
"mesh",
",",
"values",
",",
"attrib",
"in",
"self",
".",
"_parse_all_radfuncs",
"(",
"\"ae_partial_wave\"",
")",
":",
"state",
"=",
"attrib",
"[",
"\"s... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.pseudo_partial_waves | Dictionary with the pseudo partial waves indexed by state. | pymatgen/io/abinit/pseudos.py | def pseudo_partial_waves(self):
"""Dictionary with the pseudo partial waves indexed by state."""
pseudo_partial_waves = OrderedDict()
for (mesh, values, attrib) in self._parse_all_radfuncs("pseudo_partial_wave"):
state = attrib["state"]
#val_state = self.valence_states[st... | def pseudo_partial_waves(self):
"""Dictionary with the pseudo partial waves indexed by state."""
pseudo_partial_waves = OrderedDict()
for (mesh, values, attrib) in self._parse_all_radfuncs("pseudo_partial_wave"):
state = attrib["state"]
#val_state = self.valence_states[st... | [
"Dictionary",
"with",
"the",
"pseudo",
"partial",
"waves",
"indexed",
"by",
"state",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1352-L1360 | [
"def",
"pseudo_partial_waves",
"(",
"self",
")",
":",
"pseudo_partial_waves",
"=",
"OrderedDict",
"(",
")",
"for",
"(",
"mesh",
",",
"values",
",",
"attrib",
")",
"in",
"self",
".",
"_parse_all_radfuncs",
"(",
"\"pseudo_partial_wave\"",
")",
":",
"state",
"=",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.projector_functions | Dictionary with the PAW projectors indexed by state. | pymatgen/io/abinit/pseudos.py | def projector_functions(self):
"""Dictionary with the PAW projectors indexed by state."""
projector_functions = OrderedDict()
for (mesh, values, attrib) in self._parse_all_radfuncs("projector_function"):
state = attrib["state"]
#val_state = self.valence_states[state]
... | def projector_functions(self):
"""Dictionary with the PAW projectors indexed by state."""
projector_functions = OrderedDict()
for (mesh, values, attrib) in self._parse_all_radfuncs("projector_function"):
state = attrib["state"]
#val_state = self.valence_states[state]
... | [
"Dictionary",
"with",
"the",
"PAW",
"projectors",
"indexed",
"by",
"state",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1363-L1371 | [
"def",
"projector_functions",
"(",
"self",
")",
":",
"projector_functions",
"=",
"OrderedDict",
"(",
")",
"for",
"(",
"mesh",
",",
"values",
",",
"attrib",
")",
"in",
"self",
".",
"_parse_all_radfuncs",
"(",
"\"projector_function\"",
")",
":",
"state",
"=",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.yield_figs | This function *generates* a predefined list of matplotlib figures with minimal input from the user. | pymatgen/io/abinit/pseudos.py | def yield_figs(self, **kwargs): # pragma: no cover
"""
This function *generates* a predefined list of matplotlib figures with minimal input from the user.
"""
yield self.plot_densities(title="PAW densities", show=False)
yield self.plot_waves(title="PAW waves", show=False)
... | def yield_figs(self, **kwargs): # pragma: no cover
"""
This function *generates* a predefined list of matplotlib figures with minimal input from the user.
"""
yield self.plot_densities(title="PAW densities", show=False)
yield self.plot_waves(title="PAW waves", show=False)
... | [
"This",
"function",
"*",
"generates",
"*",
"a",
"predefined",
"list",
"of",
"matplotlib",
"figures",
"with",
"minimal",
"input",
"from",
"the",
"user",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1373-L1379 | [
"def",
"yield_figs",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# pragma: no cover",
"yield",
"self",
".",
"plot_densities",
"(",
"title",
"=",
"\"PAW densities\"",
",",
"show",
"=",
"False",
")",
"yield",
"self",
".",
"plot_waves",
"(",
"title",
"="... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.plot_densities | Plot the PAW densities.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
Returns:
`matplotlib` figure | pymatgen/io/abinit/pseudos.py | def plot_densities(self, ax=None, **kwargs):
"""
Plot the PAW densities.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
Returns:
`matplotlib` figure
"""
ax, fig, plt = get_ax_fig_plt(ax)
ax.grid(True)
... | def plot_densities(self, ax=None, **kwargs):
"""
Plot the PAW densities.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
Returns:
`matplotlib` figure
"""
ax, fig, plt = get_ax_fig_plt(ax)
ax.grid(True)
... | [
"Plot",
"the",
"PAW",
"densities",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1383-L1406 | [
"def",
"plot_densities",
"(",
"self",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
",",
"fig",
",",
"plt",
"=",
"get_ax_fig_plt",
"(",
"ax",
")",
"ax",
".",
"grid",
"(",
"True",
")",
"ax",
".",
"set_xlabel",
"(",
"'r [Bohr]'",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.plot_waves | Plot the AE and the pseudo partial waves.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
fontsize: fontsize for legends and titles
Returns: `matplotlib` figure | pymatgen/io/abinit/pseudos.py | def plot_waves(self, ax=None, fontsize=12, **kwargs):
"""
Plot the AE and the pseudo partial waves.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
fontsize: fontsize for legends and titles
Returns: `matplotlib` figure
"""
... | def plot_waves(self, ax=None, fontsize=12, **kwargs):
"""
Plot the AE and the pseudo partial waves.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
fontsize: fontsize for legends and titles
Returns: `matplotlib` figure
"""
... | [
"Plot",
"the",
"AE",
"and",
"the",
"pseudo",
"partial",
"waves",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1409-L1436 | [
"def",
"plot_waves",
"(",
"self",
",",
"ax",
"=",
"None",
",",
"fontsize",
"=",
"12",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
",",
"fig",
",",
"plt",
"=",
"get_ax_fig_plt",
"(",
"ax",
")",
"ax",
".",
"grid",
"(",
"True",
")",
"ax",
".",
"set_x... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PawXmlSetup.plot_projectors | Plot the PAW projectors.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
Returns: `matplotlib` figure | pymatgen/io/abinit/pseudos.py | def plot_projectors(self, ax=None, fontsize=12, **kwargs):
"""
Plot the PAW projectors.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
Returns: `matplotlib` figure
"""
ax, fig, plt = get_ax_fig_plt(ax)
title = kwargs.po... | def plot_projectors(self, ax=None, fontsize=12, **kwargs):
"""
Plot the PAW projectors.
Args:
ax: matplotlib :class:`Axes` or None if a new figure should be created.
Returns: `matplotlib` figure
"""
ax, fig, plt = get_ax_fig_plt(ax)
title = kwargs.po... | [
"Plot",
"the",
"PAW",
"projectors",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1439-L1462 | [
"def",
"plot_projectors",
"(",
"self",
",",
"ax",
"=",
"None",
",",
"fontsize",
"=",
"12",
",",
"*",
"*",
"kwargs",
")",
":",
"ax",
",",
"fig",
",",
"plt",
"=",
"get_ax_fig_plt",
"(",
"ax",
")",
"title",
"=",
"kwargs",
".",
"pop",
"(",
"\"title\"",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.from_dir | Find all pseudos in the directory tree starting from top.
Args:
top: Top of the directory tree
exts: List of files extensions. if exts == "all_files"
we try to open all files in top
exclude_dirs: Wildcard used to exclude directories.
return: :cla... | pymatgen/io/abinit/pseudos.py | def from_dir(cls, top, exts=None, exclude_dirs="_*"):
"""
Find all pseudos in the directory tree starting from top.
Args:
top: Top of the directory tree
exts: List of files extensions. if exts == "all_files"
we try to open all files in top
... | def from_dir(cls, top, exts=None, exclude_dirs="_*"):
"""
Find all pseudos in the directory tree starting from top.
Args:
top: Top of the directory tree
exts: List of files extensions. if exts == "all_files"
we try to open all files in top
... | [
"Find",
"all",
"pseudos",
"in",
"the",
"directory",
"tree",
"starting",
"from",
"top",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1531-L1570 | [
"def",
"from_dir",
"(",
"cls",
",",
"top",
",",
"exts",
"=",
"None",
",",
"exclude_dirs",
"=",
"\"_*\"",
")",
":",
"pseudos",
"=",
"[",
"]",
"if",
"exts",
"==",
"\"all_files\"",
":",
"for",
"f",
"in",
"[",
"os",
".",
"path",
".",
"join",
"(",
"to... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.is_complete | True if table is complete i.e. all elements with Z < zmax have at least on pseudopotential | pymatgen/io/abinit/pseudos.py | def is_complete(self, zmax=118):
"""
True if table is complete i.e. all elements with Z < zmax have at least on pseudopotential
"""
for z in range(1, zmax):
if not self[z]: return False
return True | def is_complete(self, zmax=118):
"""
True if table is complete i.e. all elements with Z < zmax have at least on pseudopotential
"""
for z in range(1, zmax):
if not self[z]: return False
return True | [
"True",
"if",
"table",
"is",
"complete",
"i",
".",
"e",
".",
"all",
"elements",
"with",
"Z",
"<",
"zmax",
"have",
"at",
"least",
"on",
"pseudopotential"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1675-L1681 | [
"def",
"is_complete",
"(",
"self",
",",
"zmax",
"=",
"118",
")",
":",
"for",
"z",
"in",
"range",
"(",
"1",
",",
"zmax",
")",
":",
"if",
"not",
"self",
"[",
"z",
"]",
":",
"return",
"False",
"return",
"True"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.all_combinations_for_elements | Return a list with all the the possible combination of pseudos
for the given list of element_symbols.
Each item is a list of pseudopotential objects.
Example::
table.all_combinations_for_elements(["Li", "F"]) | pymatgen/io/abinit/pseudos.py | def all_combinations_for_elements(self, element_symbols):
"""
Return a list with all the the possible combination of pseudos
for the given list of element_symbols.
Each item is a list of pseudopotential objects.
Example::
table.all_combinations_for_elements(["Li", "... | def all_combinations_for_elements(self, element_symbols):
"""
Return a list with all the the possible combination of pseudos
for the given list of element_symbols.
Each item is a list of pseudopotential objects.
Example::
table.all_combinations_for_elements(["Li", "... | [
"Return",
"a",
"list",
"with",
"all",
"the",
"the",
"possible",
"combination",
"of",
"pseudos",
"for",
"the",
"given",
"list",
"of",
"element_symbols",
".",
"Each",
"item",
"is",
"a",
"list",
"of",
"pseudopotential",
"objects",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1683-L1698 | [
"def",
"all_combinations_for_elements",
"(",
"self",
",",
"element_symbols",
")",
":",
"d",
"=",
"OrderedDict",
"(",
")",
"for",
"symbol",
"in",
"element_symbols",
":",
"d",
"[",
"symbol",
"]",
"=",
"self",
".",
"select_symbols",
"(",
"symbol",
",",
"ret_lis... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.pseudo_with_symbol | Return the pseudo with the given chemical symbol.
Args:
symbols: String with the chemical symbol of the element
allow_multi: By default, the method raises ValueError
if multiple occurrences are found. Use allow_multi to prevent this.
Raises:
ValueErr... | pymatgen/io/abinit/pseudos.py | def pseudo_with_symbol(self, symbol, allow_multi=False):
"""
Return the pseudo with the given chemical symbol.
Args:
symbols: String with the chemical symbol of the element
allow_multi: By default, the method raises ValueError
if multiple occurrences are ... | def pseudo_with_symbol(self, symbol, allow_multi=False):
"""
Return the pseudo with the given chemical symbol.
Args:
symbols: String with the chemical symbol of the element
allow_multi: By default, the method raises ValueError
if multiple occurrences are ... | [
"Return",
"the",
"pseudo",
"with",
"the",
"given",
"chemical",
"symbol",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1700-L1719 | [
"def",
"pseudo_with_symbol",
"(",
"self",
",",
"symbol",
",",
"allow_multi",
"=",
"False",
")",
":",
"pseudos",
"=",
"self",
".",
"select_symbols",
"(",
"symbol",
",",
"ret_list",
"=",
"True",
")",
"if",
"not",
"pseudos",
"or",
"(",
"len",
"(",
"pseudos"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.pseudos_with_symbols | Return the pseudos with the given chemical symbols.
Raises:
ValueError if one of the symbols is not found or multiple occurences are present. | pymatgen/io/abinit/pseudos.py | def pseudos_with_symbols(self, symbols):
"""
Return the pseudos with the given chemical symbols.
Raises:
ValueError if one of the symbols is not found or multiple occurences are present.
"""
pseudos = self.select_symbols(symbols, ret_list=True)
found_symbols ... | def pseudos_with_symbols(self, symbols):
"""
Return the pseudos with the given chemical symbols.
Raises:
ValueError if one of the symbols is not found or multiple occurences are present.
"""
pseudos = self.select_symbols(symbols, ret_list=True)
found_symbols ... | [
"Return",
"the",
"pseudos",
"with",
"the",
"given",
"chemical",
"symbols",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1721-L1739 | [
"def",
"pseudos_with_symbols",
"(",
"self",
",",
"symbols",
")",
":",
"pseudos",
"=",
"self",
".",
"select_symbols",
"(",
"symbols",
",",
"ret_list",
"=",
"True",
")",
"found_symbols",
"=",
"[",
"p",
".",
"symbol",
"for",
"p",
"in",
"pseudos",
"]",
"dupl... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.select_symbols | Return a :class:`PseudoTable` with the pseudopotentials with the given list of chemical symbols.
Args:
symbols: str or list of symbols
Prepend the symbol string with "-", to exclude pseudos.
ret_list: if True a list of pseudos is returned instead of a :class:`PseudoTable... | pymatgen/io/abinit/pseudos.py | def select_symbols(self, symbols, ret_list=False):
"""
Return a :class:`PseudoTable` with the pseudopotentials with the given list of chemical symbols.
Args:
symbols: str or list of symbols
Prepend the symbol string with "-", to exclude pseudos.
ret_list:... | def select_symbols(self, symbols, ret_list=False):
"""
Return a :class:`PseudoTable` with the pseudopotentials with the given list of chemical symbols.
Args:
symbols: str or list of symbols
Prepend the symbol string with "-", to exclude pseudos.
ret_list:... | [
"Return",
"a",
":",
"class",
":",
"PseudoTable",
"with",
"the",
"pseudopotentials",
"with",
"the",
"given",
"list",
"of",
"chemical",
"symbols",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1741-L1771 | [
"def",
"select_symbols",
"(",
"self",
",",
"symbols",
",",
"ret_list",
"=",
"False",
")",
":",
"symbols",
"=",
"list_strings",
"(",
"symbols",
")",
"exclude",
"=",
"symbols",
"[",
"0",
"]",
".",
"startswith",
"(",
"\"-\"",
")",
"if",
"exclude",
":",
"i... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.print_table | A pretty ASCII printer for the periodic table, based on some filter_function.
Args:
stream: file-like object
filter_function:
A filtering function that take a Pseudo as input and returns a boolean.
For example, setting filter_function = lambda p: p.Z_val ... | pymatgen/io/abinit/pseudos.py | def print_table(self, stream=sys.stdout, filter_function=None):
"""
A pretty ASCII printer for the periodic table, based on some filter_function.
Args:
stream: file-like object
filter_function:
A filtering function that take a Pseudo as input and returns ... | def print_table(self, stream=sys.stdout, filter_function=None):
"""
A pretty ASCII printer for the periodic table, based on some filter_function.
Args:
stream: file-like object
filter_function:
A filtering function that take a Pseudo as input and returns ... | [
"A",
"pretty",
"ASCII",
"printer",
"for",
"the",
"periodic",
"table",
"based",
"on",
"some",
"filter_function",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1786-L1797 | [
"def",
"print_table",
"(",
"self",
",",
"stream",
"=",
"sys",
".",
"stdout",
",",
"filter_function",
"=",
"None",
")",
":",
"print",
"(",
"self",
".",
"to_table",
"(",
"filter_function",
"=",
"filter_function",
")",
",",
"file",
"=",
"stream",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.to_table | Return string with data in tabular form. | pymatgen/io/abinit/pseudos.py | def to_table(self, filter_function=None):
"""Return string with data in tabular form."""
table = []
for p in self:
if filter_function is not None and filter_function(p): continue
table.append([p.basename, p.symbol, p.Z_val, p.l_max, p.l_local, p.xc, p.type])
retur... | def to_table(self, filter_function=None):
"""Return string with data in tabular form."""
table = []
for p in self:
if filter_function is not None and filter_function(p): continue
table.append([p.basename, p.symbol, p.Z_val, p.l_max, p.l_local, p.xc, p.type])
retur... | [
"Return",
"string",
"with",
"data",
"in",
"tabular",
"form",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1799-L1806 | [
"def",
"to_table",
"(",
"self",
",",
"filter_function",
"=",
"None",
")",
":",
"table",
"=",
"[",
"]",
"for",
"p",
"in",
"self",
":",
"if",
"filter_function",
"is",
"not",
"None",
"and",
"filter_function",
"(",
"p",
")",
":",
"continue",
"table",
".",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.sorted | Sort the table according to the value of attribute attrname.
Return:
New class:`PseudoTable` object | pymatgen/io/abinit/pseudos.py | def sorted(self, attrname, reverse=False):
"""
Sort the table according to the value of attribute attrname.
Return:
New class:`PseudoTable` object
"""
attrs = []
for i, pseudo in self:
try:
a = getattr(pseudo, attrname)
... | def sorted(self, attrname, reverse=False):
"""
Sort the table according to the value of attribute attrname.
Return:
New class:`PseudoTable` object
"""
attrs = []
for i, pseudo in self:
try:
a = getattr(pseudo, attrname)
... | [
"Sort",
"the",
"table",
"according",
"to",
"the",
"value",
"of",
"attribute",
"attrname",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1808-L1824 | [
"def",
"sorted",
"(",
"self",
",",
"attrname",
",",
"reverse",
"=",
"False",
")",
":",
"attrs",
"=",
"[",
"]",
"for",
"i",
",",
"pseudo",
"in",
"self",
":",
"try",
":",
"a",
"=",
"getattr",
"(",
"pseudo",
",",
"attrname",
")",
"except",
"AttributeE... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.sort_by_z | Return a new :class:`PseudoTable` with pseudos sorted by Z | pymatgen/io/abinit/pseudos.py | def sort_by_z(self):
"""Return a new :class:`PseudoTable` with pseudos sorted by Z"""
return self.__class__(sorted(self, key=lambda p: p.Z)) | def sort_by_z(self):
"""Return a new :class:`PseudoTable` with pseudos sorted by Z"""
return self.__class__(sorted(self, key=lambda p: p.Z)) | [
"Return",
"a",
"new",
":",
"class",
":",
"PseudoTable",
"with",
"pseudos",
"sorted",
"by",
"Z"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1826-L1828 | [
"def",
"sort_by_z",
"(",
"self",
")",
":",
"return",
"self",
".",
"__class__",
"(",
"sorted",
"(",
"self",
",",
"key",
"=",
"lambda",
"p",
":",
"p",
".",
"Z",
")",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.select | Select only those pseudopotentials for which condition is True.
Return new class:`PseudoTable` object.
Args:
condition:
Function that accepts a :class:`Pseudo` object and returns True or False. | pymatgen/io/abinit/pseudos.py | def select(self, condition):
"""
Select only those pseudopotentials for which condition is True.
Return new class:`PseudoTable` object.
Args:
condition:
Function that accepts a :class:`Pseudo` object and returns True or False.
"""
return self.... | def select(self, condition):
"""
Select only those pseudopotentials for which condition is True.
Return new class:`PseudoTable` object.
Args:
condition:
Function that accepts a :class:`Pseudo` object and returns True or False.
"""
return self.... | [
"Select",
"only",
"those",
"pseudopotentials",
"for",
"which",
"condition",
"is",
"True",
".",
"Return",
"new",
"class",
":",
"PseudoTable",
"object",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1830-L1839 | [
"def",
"select",
"(",
"self",
",",
"condition",
")",
":",
"return",
"self",
".",
"__class__",
"(",
"[",
"p",
"for",
"p",
"in",
"self",
"if",
"condition",
"(",
"p",
")",
"]",
")"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | PseudoTable.select_rows | Return new class:`PseudoTable` object with pseudos in the given rows of the periodic table.
rows can be either a int or a list of integers. | pymatgen/io/abinit/pseudos.py | def select_rows(self, rows):
"""
Return new class:`PseudoTable` object with pseudos in the given rows of the periodic table.
rows can be either a int or a list of integers.
"""
if not isinstance(rows, (list, tuple)): rows = [rows]
return self.__class__([p for p in self if... | def select_rows(self, rows):
"""
Return new class:`PseudoTable` object with pseudos in the given rows of the periodic table.
rows can be either a int or a list of integers.
"""
if not isinstance(rows, (list, tuple)): rows = [rows]
return self.__class__([p for p in self if... | [
"Return",
"new",
"class",
":",
"PseudoTable",
"object",
"with",
"pseudos",
"in",
"the",
"given",
"rows",
"of",
"the",
"periodic",
"table",
".",
"rows",
"can",
"be",
"either",
"a",
"int",
"or",
"a",
"list",
"of",
"integers",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/pseudos.py#L1845-L1851 | [
"def",
"select_rows",
"(",
"self",
",",
"rows",
")",
":",
"if",
"not",
"isinstance",
"(",
"rows",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"rows",
"=",
"[",
"rows",
"]",
"return",
"self",
".",
"__class__",
"(",
"[",
"p",
"for",
"p",
"in",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_data | Flexible method to get any data using the Materials Project REST
interface. Generally used by other methods for more specific queries.
Format of REST return is *always* a list of dict (regardless of the
number of pieces of data returned. The general format is as follows:
[{"material_id... | pymatgen/ext/matproj.py | def get_data(self, chemsys_formula_id, data_type="vasp", prop=""):
"""
Flexible method to get any data using the Materials Project REST
interface. Generally used by other methods for more specific queries.
Format of REST return is *always* a list of dict (regardless of the
numbe... | def get_data(self, chemsys_formula_id, data_type="vasp", prop=""):
"""
Flexible method to get any data using the Materials Project REST
interface. Generally used by other methods for more specific queries.
Format of REST return is *always* a list of dict (regardless of the
numbe... | [
"Flexible",
"method",
"to",
"get",
"any",
"data",
"using",
"the",
"Materials",
"Project",
"REST",
"interface",
".",
"Generally",
"used",
"by",
"other",
"methods",
"for",
"more",
"specific",
"queries",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L203-L229 | [
"def",
"get_data",
"(",
"self",
",",
"chemsys_formula_id",
",",
"data_type",
"=",
"\"vasp\"",
",",
"prop",
"=",
"\"\"",
")",
":",
"sub_url",
"=",
"\"/materials/%s/%s\"",
"%",
"(",
"chemsys_formula_id",
",",
"data_type",
")",
"if",
"prop",
":",
"sub_url",
"+=... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_task_data | Flexible method to get any data using the Materials Project REST
interface. Generally used by other methods for more specific queries.
Unlike the :func:`get_data`_, this method queries the task collection
for specific run information.
Format of REST return is *always* a list of dict (re... | pymatgen/ext/matproj.py | def get_task_data(self, chemsys_formula_id, prop=""):
"""
Flexible method to get any data using the Materials Project REST
interface. Generally used by other methods for more specific queries.
Unlike the :func:`get_data`_, this method queries the task collection
for specific run ... | def get_task_data(self, chemsys_formula_id, prop=""):
"""
Flexible method to get any data using the Materials Project REST
interface. Generally used by other methods for more specific queries.
Unlike the :func:`get_data`_, this method queries the task collection
for specific run ... | [
"Flexible",
"method",
"to",
"get",
"any",
"data",
"using",
"the",
"Materials",
"Project",
"REST",
"interface",
".",
"Generally",
"used",
"by",
"other",
"methods",
"for",
"more",
"specific",
"queries",
".",
"Unlike",
"the",
":",
"func",
":",
"get_data",
"_",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L261-L283 | [
"def",
"get_task_data",
"(",
"self",
",",
"chemsys_formula_id",
",",
"prop",
"=",
"\"\"",
")",
":",
"sub_url",
"=",
"\"/tasks/%s\"",
"%",
"chemsys_formula_id",
"if",
"prop",
":",
"sub_url",
"+=",
"\"/\"",
"+",
"prop",
"return",
"self",
".",
"_make_request",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_structures | Get a list of Structures corresponding to a chemical system, formula,
or materials_id.
Args:
chemsys_formula_id (str): A chemical system (e.g., Li-Fe-O),
or formula (e.g., Fe2O3) or materials_id (e.g., mp-1234).
final (bool): Whether to get the final structure, o... | pymatgen/ext/matproj.py | def get_structures(self, chemsys_formula_id, final=True):
"""
Get a list of Structures corresponding to a chemical system, formula,
or materials_id.
Args:
chemsys_formula_id (str): A chemical system (e.g., Li-Fe-O),
or formula (e.g., Fe2O3) or materials_id (e... | def get_structures(self, chemsys_formula_id, final=True):
"""
Get a list of Structures corresponding to a chemical system, formula,
or materials_id.
Args:
chemsys_formula_id (str): A chemical system (e.g., Li-Fe-O),
or formula (e.g., Fe2O3) or materials_id (e... | [
"Get",
"a",
"list",
"of",
"Structures",
"corresponding",
"to",
"a",
"chemical",
"system",
"formula",
"or",
"materials_id",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L285-L301 | [
"def",
"get_structures",
"(",
"self",
",",
"chemsys_formula_id",
",",
"final",
"=",
"True",
")",
":",
"prop",
"=",
"\"final_structure\"",
"if",
"final",
"else",
"\"initial_structure\"",
"data",
"=",
"self",
".",
"get_data",
"(",
"chemsys_formula_id",
",",
"prop"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.find_structure | Finds matching structures on the Materials Project site.
Args:
filename_or_structure: filename or Structure object
Returns:
A list of matching structures.
Raises:
MPRestError | pymatgen/ext/matproj.py | def find_structure(self, filename_or_structure):
"""
Finds matching structures on the Materials Project site.
Args:
filename_or_structure: filename or Structure object
Returns:
A list of matching structures.
Raises:
MPRestError
"""
... | def find_structure(self, filename_or_structure):
"""
Finds matching structures on the Materials Project site.
Args:
filename_or_structure: filename or Structure object
Returns:
A list of matching structures.
Raises:
MPRestError
"""
... | [
"Finds",
"matching",
"structures",
"on",
"the",
"Materials",
"Project",
"site",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L303-L336 | [
"def",
"find_structure",
"(",
"self",
",",
"filename_or_structure",
")",
":",
"try",
":",
"if",
"isinstance",
"(",
"filename_or_structure",
",",
"str",
")",
":",
"s",
"=",
"Structure",
".",
"from_file",
"(",
"filename_or_structure",
")",
"elif",
"isinstance",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_entries | Get a list of ComputedEntries or ComputedStructureEntries corresponding
to a chemical system, formula, or materials_id or full criteria.
Args:
chemsys_formula_id_criteria (str/dict): A chemical system
(e.g., Li-Fe-O), or formula (e.g., Fe2O3) or materials_id
... | pymatgen/ext/matproj.py | def get_entries(self, chemsys_formula_id_criteria, compatible_only=True,
inc_structure=None, property_data=None,
conventional_unit_cell=False, sort_by_e_above_hull=False):
"""
Get a list of ComputedEntries or ComputedStructureEntries corresponding
to a che... | def get_entries(self, chemsys_formula_id_criteria, compatible_only=True,
inc_structure=None, property_data=None,
conventional_unit_cell=False, sort_by_e_above_hull=False):
"""
Get a list of ComputedEntries or ComputedStructureEntries corresponding
to a che... | [
"Get",
"a",
"list",
"of",
"ComputedEntries",
"or",
"ComputedStructureEntries",
"corresponding",
"to",
"a",
"chemical",
"system",
"formula",
"or",
"materials_id",
"or",
"full",
"criteria",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L338-L430 | [
"def",
"get_entries",
"(",
"self",
",",
"chemsys_formula_id_criteria",
",",
"compatible_only",
"=",
"True",
",",
"inc_structure",
"=",
"None",
",",
"property_data",
"=",
"None",
",",
"conventional_unit_cell",
"=",
"False",
",",
"sort_by_e_above_hull",
"=",
"False",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_pourbaix_entries | A helper function to get all entries necessary to generate
a pourbaix diagram from the rest interface.
Args:
chemsys ([str]): A list of elements comprising the chemical
system, e.g. ['Li', 'Fe'] | pymatgen/ext/matproj.py | def get_pourbaix_entries(self, chemsys):
"""
A helper function to get all entries necessary to generate
a pourbaix diagram from the rest interface.
Args:
chemsys ([str]): A list of elements comprising the chemical
system, e.g. ['Li', 'Fe']
"""
... | def get_pourbaix_entries(self, chemsys):
"""
A helper function to get all entries necessary to generate
a pourbaix diagram from the rest interface.
Args:
chemsys ([str]): A list of elements comprising the chemical
system, e.g. ['Li', 'Fe']
"""
... | [
"A",
"helper",
"function",
"to",
"get",
"all",
"entries",
"necessary",
"to",
"generate",
"a",
"pourbaix",
"diagram",
"from",
"the",
"rest",
"interface",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L432-L497 | [
"def",
"get_pourbaix_entries",
"(",
"self",
",",
"chemsys",
")",
":",
"from",
"pymatgen",
".",
"analysis",
".",
"pourbaix_diagram",
"import",
"PourbaixEntry",
",",
"IonEntry",
"from",
"pymatgen",
".",
"analysis",
".",
"phase_diagram",
"import",
"PhaseDiagram",
"fr... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_structure_by_material_id | Get a Structure corresponding to a material_id.
Args:
material_id (str): Materials Project material_id (a string,
e.g., mp-1234).
final (bool): Whether to get the final structure, or the initial
(pre-relaxation) structure. Defaults to True.
co... | pymatgen/ext/matproj.py | def get_structure_by_material_id(self, material_id, final=True,
conventional_unit_cell=False):
"""
Get a Structure corresponding to a material_id.
Args:
material_id (str): Materials Project material_id (a string,
e.g., mp-1234).
... | def get_structure_by_material_id(self, material_id, final=True,
conventional_unit_cell=False):
"""
Get a Structure corresponding to a material_id.
Args:
material_id (str): Materials Project material_id (a string,
e.g., mp-1234).
... | [
"Get",
"a",
"Structure",
"corresponding",
"to",
"a",
"material_id",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L499-L520 | [
"def",
"get_structure_by_material_id",
"(",
"self",
",",
"material_id",
",",
"final",
"=",
"True",
",",
"conventional_unit_cell",
"=",
"False",
")",
":",
"prop",
"=",
"\"final_structure\"",
"if",
"final",
"else",
"\"initial_structure\"",
"data",
"=",
"self",
".",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_entry_by_material_id | Get a ComputedEntry corresponding to a material_id.
Args:
material_id (str): Materials Project material_id (a string,
e.g., mp-1234).
compatible_only (bool): Whether to return only "compatible"
entries. Compatible entries are entries that have been
... | pymatgen/ext/matproj.py | def get_entry_by_material_id(self, material_id, compatible_only=True,
inc_structure=None, property_data=None,
conventional_unit_cell=False):
"""
Get a ComputedEntry corresponding to a material_id.
Args:
material_id (s... | def get_entry_by_material_id(self, material_id, compatible_only=True,
inc_structure=None, property_data=None,
conventional_unit_cell=False):
"""
Get a ComputedEntry corresponding to a material_id.
Args:
material_id (s... | [
"Get",
"a",
"ComputedEntry",
"corresponding",
"to",
"a",
"material_id",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L522-L555 | [
"def",
"get_entry_by_material_id",
"(",
"self",
",",
"material_id",
",",
"compatible_only",
"=",
"True",
",",
"inc_structure",
"=",
"None",
",",
"property_data",
"=",
"None",
",",
"conventional_unit_cell",
"=",
"False",
")",
":",
"data",
"=",
"self",
".",
"get... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_bandstructure_by_material_id | Get a BandStructure corresponding to a material_id.
REST Endpoint: https://www.materialsproject.org/rest/v2/materials/<mp-id>/vasp/bandstructure or
https://www.materialsproject.org/rest/v2/materials/<mp-id>/vasp/bandstructure_uniform
Args:
material_id (str): Materials Project mater... | pymatgen/ext/matproj.py | def get_bandstructure_by_material_id(self, material_id, line_mode=True):
"""
Get a BandStructure corresponding to a material_id.
REST Endpoint: https://www.materialsproject.org/rest/v2/materials/<mp-id>/vasp/bandstructure or
https://www.materialsproject.org/rest/v2/materials/<mp-id>/vas... | def get_bandstructure_by_material_id(self, material_id, line_mode=True):
"""
Get a BandStructure corresponding to a material_id.
REST Endpoint: https://www.materialsproject.org/rest/v2/materials/<mp-id>/vasp/bandstructure or
https://www.materialsproject.org/rest/v2/materials/<mp-id>/vas... | [
"Get",
"a",
"BandStructure",
"corresponding",
"to",
"a",
"material_id",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L573-L590 | [
"def",
"get_bandstructure_by_material_id",
"(",
"self",
",",
"material_id",
",",
"line_mode",
"=",
"True",
")",
":",
"prop",
"=",
"\"bandstructure\"",
"if",
"line_mode",
"else",
"\"bandstructure_uniform\"",
"data",
"=",
"self",
".",
"get_data",
"(",
"material_id",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_entries_in_chemsys | Helper method to get a list of ComputedEntries in a chemical system.
For example, elements = ["Li", "Fe", "O"] will return a list of all
entries in the Li-Fe-O chemical system, i.e., all LixOy,
FexOy, LixFey, LixFeyOz, Li, Fe and O phases. Extremely useful for
creating phase diagrams of ... | pymatgen/ext/matproj.py | def get_entries_in_chemsys(self, elements, compatible_only=True,
inc_structure=None, property_data=None,
conventional_unit_cell=False):
"""
Helper method to get a list of ComputedEntries in a chemical system.
For example, elements = [... | def get_entries_in_chemsys(self, elements, compatible_only=True,
inc_structure=None, property_data=None,
conventional_unit_cell=False):
"""
Helper method to get a list of ComputedEntries in a chemical system.
For example, elements = [... | [
"Helper",
"method",
"to",
"get",
"a",
"list",
"of",
"ComputedEntries",
"in",
"a",
"chemical",
"system",
".",
"For",
"example",
"elements",
"=",
"[",
"Li",
"Fe",
"O",
"]",
"will",
"return",
"a",
"list",
"of",
"all",
"entries",
"in",
"the",
"Li",
"-",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L629-L671 | [
"def",
"get_entries_in_chemsys",
"(",
"self",
",",
"elements",
",",
"compatible_only",
"=",
"True",
",",
"inc_structure",
"=",
"None",
",",
"property_data",
"=",
"None",
",",
"conventional_unit_cell",
"=",
"False",
")",
":",
"entries",
"=",
"[",
"]",
"for",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.submit_structures | Submits a list of structures to the Materials Project as SNL files.
The argument list mirrors the arguments for the StructureNL object,
except that a list of structures with the same metadata is used as an
input.
.. note::
As of now, this MP REST feature is open only to a s... | pymatgen/ext/matproj.py | def submit_structures(self, structures, authors, projects=None,
references='', remarks=None, data=None,
histories=None, created_at=None):
"""
Submits a list of structures to the Materials Project as SNL files.
The argument list mirrors the argu... | def submit_structures(self, structures, authors, projects=None,
references='', remarks=None, data=None,
histories=None, created_at=None):
"""
Submits a list of structures to the Materials Project as SNL files.
The argument list mirrors the argu... | [
"Submits",
"a",
"list",
"of",
"structures",
"to",
"the",
"Materials",
"Project",
"as",
"SNL",
"files",
".",
"The",
"argument",
"list",
"mirrors",
"the",
"arguments",
"for",
"the",
"StructureNL",
"object",
"except",
"that",
"a",
"list",
"of",
"structures",
"w... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L814-L855 | [
"def",
"submit_structures",
"(",
"self",
",",
"structures",
",",
"authors",
",",
"projects",
"=",
"None",
",",
"references",
"=",
"''",
",",
"remarks",
"=",
"None",
",",
"data",
"=",
"None",
",",
"histories",
"=",
"None",
",",
"created_at",
"=",
"None",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.submit_snl | Submits a list of StructureNL to the Materials Project site.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:
snl (StructureNL/[StructureNL]): A... | pymatgen/ext/matproj.py | def submit_snl(self, snl):
"""
Submits a list of StructureNL to the Materials Project site.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:... | def submit_snl(self, snl):
"""
Submits a list of StructureNL to the Materials Project site.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:... | [
"Submits",
"a",
"list",
"of",
"StructureNL",
"to",
"the",
"Materials",
"Project",
"site",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L857-L896 | [
"def",
"submit_snl",
"(",
"self",
",",
"snl",
")",
":",
"try",
":",
"snl",
"=",
"snl",
"if",
"isinstance",
"(",
"snl",
",",
"list",
")",
"else",
"[",
"snl",
"]",
"jsondata",
"=",
"[",
"s",
".",
"as_dict",
"(",
")",
"for",
"s",
"in",
"snl",
"]",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.delete_snl | Delete earlier submitted SNLs.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:
snl_ids: List of SNL ids.
Raises:
MPRestErr... | pymatgen/ext/matproj.py | def delete_snl(self, snl_ids):
"""
Delete earlier submitted SNLs.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:
snl_ids: List... | def delete_snl(self, snl_ids):
"""
Delete earlier submitted SNLs.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:
snl_ids: List... | [
"Delete",
"earlier",
"submitted",
"SNLs",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L898-L932 | [
"def",
"delete_snl",
"(",
"self",
",",
"snl_ids",
")",
":",
"try",
":",
"payload",
"=",
"{",
"\"ids\"",
":",
"json",
".",
"dumps",
"(",
"snl_ids",
")",
"}",
"response",
"=",
"self",
".",
"session",
".",
"post",
"(",
"\"{}/snl/delete\"",
".",
"format",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.query_snl | Query for submitted SNLs.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:
criteria (dict): Query criteria.
Returns:
A dict... | pymatgen/ext/matproj.py | def query_snl(self, criteria):
"""
Query for submitted SNLs.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:
criteria (dict): Q... | def query_snl(self, criteria):
"""
Query for submitted SNLs.
.. note::
As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.
Args:
criteria (dict): Q... | [
"Query",
"for",
"submitted",
"SNLs",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L934-L970 | [
"def",
"query_snl",
"(",
"self",
",",
"criteria",
")",
":",
"try",
":",
"payload",
"=",
"{",
"\"criteria\"",
":",
"json",
".",
"dumps",
"(",
"criteria",
")",
"}",
"response",
"=",
"self",
".",
"session",
".",
"post",
"(",
"\"{}/snl/query\"",
".",
"form... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.submit_vasp_directory | Assimilates all vasp run directories beneath a particular
directory using BorgQueen to obtain structures, and then submits thhem
to the Materials Project as SNL files. VASP related meta data like
initial structure and final energies are automatically incorporated.
.. note::
... | pymatgen/ext/matproj.py | def submit_vasp_directory(self, rootdir, authors, projects=None,
references='', remarks=None, master_data=None,
master_history=None, created_at=None,
ncpus=None):
"""
Assimilates all vasp run directories beneath a ... | def submit_vasp_directory(self, rootdir, authors, projects=None,
references='', remarks=None, master_data=None,
master_history=None, created_at=None,
ncpus=None):
"""
Assimilates all vasp run directories beneath a ... | [
"Assimilates",
"all",
"vasp",
"run",
"directories",
"beneath",
"a",
"particular",
"directory",
"using",
"BorgQueen",
"to",
"obtain",
"structures",
"and",
"then",
"submits",
"thhem",
"to",
"the",
"Materials",
"Project",
"as",
"SNL",
"files",
".",
"VASP",
"related... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L972-L1041 | [
"def",
"submit_vasp_directory",
"(",
"self",
",",
"rootdir",
",",
"authors",
",",
"projects",
"=",
"None",
",",
"references",
"=",
"''",
",",
"remarks",
"=",
"None",
",",
"master_data",
"=",
"None",
",",
"master_history",
"=",
"None",
",",
"created_at",
"=... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_cohesive_energy | Gets the cohesive for a material (eV per formula unit). Cohesive energy
is defined as the difference between the bulk energy and the sum of
total DFT energy of isolated atoms for atom elements in the bulk.
Args:
material_id (str): Materials Project material_id, e.g. 'mp-123'.... | pymatgen/ext/matproj.py | def get_cohesive_energy(self, material_id, per_atom=False):
"""
Gets the cohesive for a material (eV per formula unit). Cohesive energy
is defined as the difference between the bulk energy and the sum of
total DFT energy of isolated atoms for atom elements in the bulk.
Ar... | def get_cohesive_energy(self, material_id, per_atom=False):
"""
Gets the cohesive for a material (eV per formula unit). Cohesive energy
is defined as the difference between the bulk energy and the sum of
total DFT energy of isolated atoms for atom elements in the bulk.
Ar... | [
"Gets",
"the",
"cohesive",
"for",
"a",
"material",
"(",
"eV",
"per",
"formula",
"unit",
")",
".",
"Cohesive",
"energy",
"is",
"defined",
"as",
"the",
"difference",
"between",
"the",
"bulk",
"energy",
"and",
"the",
"sum",
"of",
"total",
"DFT",
"energy",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L1064-L1087 | [
"def",
"get_cohesive_energy",
"(",
"self",
",",
"material_id",
",",
"per_atom",
"=",
"False",
")",
":",
"entry",
"=",
"self",
".",
"get_entry_by_material_id",
"(",
"material_id",
")",
"ebulk",
"=",
"entry",
".",
"energy",
"/",
"entry",
".",
"composition",
".... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_reaction | Gets a reaction from the Materials Project.
Args:
reactants ([str]): List of formulas
products ([str]): List of formulas
Returns:
rxn | pymatgen/ext/matproj.py | def get_reaction(self, reactants, products):
"""
Gets a reaction from the Materials Project.
Args:
reactants ([str]): List of formulas
products ([str]): List of formulas
Returns:
rxn
"""
return self._make_request("/reaction",
... | def get_reaction(self, reactants, products):
"""
Gets a reaction from the Materials Project.
Args:
reactants ([str]): List of formulas
products ([str]): List of formulas
Returns:
rxn
"""
return self._make_request("/reaction",
... | [
"Gets",
"a",
"reaction",
"from",
"the",
"Materials",
"Project",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L1089-L1102 | [
"def",
"get_reaction",
"(",
"self",
",",
"reactants",
",",
"products",
")",
":",
"return",
"self",
".",
"_make_request",
"(",
"\"/reaction\"",
",",
"payload",
"=",
"{",
"\"reactants[]\"",
":",
"reactants",
",",
"\"products[]\"",
":",
"products",
"}",
",",
"m... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_substrates | Get a substrate list for a material id. The list is in order of
increasing elastic energy if a elastic tensor is available for
the material_id. Otherwise the list is in order of increasing
matching area.
Args:
material_id (str): Materials Project material_id, e.g. 'mp-123'.
... | pymatgen/ext/matproj.py | def get_substrates(self, material_id, number=50, orient=None):
"""
Get a substrate list for a material id. The list is in order of
increasing elastic energy if a elastic tensor is available for
the material_id. Otherwise the list is in order of increasing
matching area.
... | def get_substrates(self, material_id, number=50, orient=None):
"""
Get a substrate list for a material id. The list is in order of
increasing elastic energy if a elastic tensor is available for
the material_id. Otherwise the list is in order of increasing
matching area.
... | [
"Get",
"a",
"substrate",
"list",
"for",
"a",
"material",
"id",
".",
"The",
"list",
"is",
"in",
"order",
"of",
"increasing",
"elastic",
"energy",
"if",
"a",
"elastic",
"tensor",
"is",
"available",
"for",
"the",
"material_id",
".",
"Otherwise",
"the",
"list"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L1104-L1122 | [
"def",
"get_substrates",
"(",
"self",
",",
"material_id",
",",
"number",
"=",
"50",
",",
"orient",
"=",
"None",
")",
":",
"req",
"=",
"\"/materials/{}/substrates?n={}\"",
".",
"format",
"(",
"material_id",
",",
"number",
")",
"if",
"orient",
":",
"req",
"+... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_surface_data | Gets surface data for a material. Useful for Wulff shapes.
Reference for surface data:
Tran, R., Xu, Z., Radhakrishnan, B., Winston, D., Sun, W., Persson, K.
A., & Ong, S. P. (2016). Data Descripter: Surface energies of elemental
crystals. Scientific Data, 3(160080), 1–13.
http... | pymatgen/ext/matproj.py | def get_surface_data(self, material_id, inc_structures=False):
"""
Gets surface data for a material. Useful for Wulff shapes.
Reference for surface data:
Tran, R., Xu, Z., Radhakrishnan, B., Winston, D., Sun, W., Persson, K.
A., & Ong, S. P. (2016). Data Descripter: Surface ene... | def get_surface_data(self, material_id, inc_structures=False):
"""
Gets surface data for a material. Useful for Wulff shapes.
Reference for surface data:
Tran, R., Xu, Z., Radhakrishnan, B., Winston, D., Sun, W., Persson, K.
A., & Ong, S. P. (2016). Data Descripter: Surface ene... | [
"Gets",
"surface",
"data",
"for",
"a",
"material",
".",
"Useful",
"for",
"Wulff",
"shapes",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L1135-L1156 | [
"def",
"get_surface_data",
"(",
"self",
",",
"material_id",
",",
"inc_structures",
"=",
"False",
")",
":",
"req",
"=",
"\"/materials/{}/surfaces\"",
".",
"format",
"(",
"material_id",
")",
"if",
"inc_structures",
":",
"req",
"+=",
"\"?include_structures=true\"",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_wulff_shape | Constructs a Wulff shape for a material.
Args:
material_id (str): Materials Project material_id, e.g. 'mp-123'.
Returns:
pymatgen.analysis.wulff.WulffShape | pymatgen/ext/matproj.py | def get_wulff_shape(self, material_id):
"""
Constructs a Wulff shape for a material.
Args:
material_id (str): Materials Project material_id, e.g. 'mp-123'.
Returns:
pymatgen.analysis.wulff.WulffShape
"""
from pymatgen.symmetry.analyzer import Spac... | def get_wulff_shape(self, material_id):
"""
Constructs a Wulff shape for a material.
Args:
material_id (str): Materials Project material_id, e.g. 'mp-123'.
Returns:
pymatgen.analysis.wulff.WulffShape
"""
from pymatgen.symmetry.analyzer import Spac... | [
"Constructs",
"a",
"Wulff",
"shape",
"for",
"a",
"material",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L1158-L1181 | [
"def",
"get_wulff_shape",
"(",
"self",
",",
"material_id",
")",
":",
"from",
"pymatgen",
".",
"symmetry",
".",
"analyzer",
"import",
"SpacegroupAnalyzer",
"from",
"pymatgen",
".",
"analysis",
".",
"wulff",
"import",
"WulffShape",
",",
"hkl_tuple_to_str",
"structur... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.get_interface_reactions | Gets critical reactions between two reactants.
Get critical reactions ("kinks" in the mixing ratio where
reaction products change) between two reactants. See the
`pymatgen.analysis.interface_reactions` module for more info.
Args:
reactant1 (str): Chemical formula for reacta... | pymatgen/ext/matproj.py | def get_interface_reactions(self, reactant1, reactant2,
open_el=None, relative_mu=None,
use_hull_energy=False):
"""
Gets critical reactions between two reactants.
Get critical reactions ("kinks" in the mixing ratio where
re... | def get_interface_reactions(self, reactant1, reactant2,
open_el=None, relative_mu=None,
use_hull_energy=False):
"""
Gets critical reactions between two reactants.
Get critical reactions ("kinks" in the mixing ratio where
re... | [
"Gets",
"critical",
"reactions",
"between",
"two",
"reactants",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L1183-L1217 | [
"def",
"get_interface_reactions",
"(",
"self",
",",
"reactant1",
",",
"reactant2",
",",
"open_el",
"=",
"None",
",",
"relative_mu",
"=",
"None",
",",
"use_hull_energy",
"=",
"False",
")",
":",
"payload",
"=",
"{",
"\"reactants\"",
":",
"\" \"",
".",
"join",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MPRester.parse_criteria | Parses a powerful and simple string criteria and generates a proper
mongo syntax criteria.
Args:
criteria_string (str): A string representing a search criteria.
Also supports wild cards. E.g.,
something like "*2O" gets converted to
{'pretty_fo... | pymatgen/ext/matproj.py | def parse_criteria(criteria_string):
"""
Parses a powerful and simple string criteria and generates a proper
mongo syntax criteria.
Args:
criteria_string (str): A string representing a search criteria.
Also supports wild cards. E.g.,
something... | def parse_criteria(criteria_string):
"""
Parses a powerful and simple string criteria and generates a proper
mongo syntax criteria.
Args:
criteria_string (str): A string representing a search criteria.
Also supports wild cards. E.g.,
something... | [
"Parses",
"a",
"powerful",
"and",
"simple",
"string",
"criteria",
"and",
"generates",
"a",
"proper",
"mongo",
"syntax",
"criteria",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/ext/matproj.py#L1220-L1293 | [
"def",
"parse_criteria",
"(",
"criteria_string",
")",
":",
"toks",
"=",
"criteria_string",
".",
"split",
"(",
")",
"def",
"parse_sym",
"(",
"sym",
")",
":",
"if",
"sym",
"==",
"\"*\"",
":",
"return",
"[",
"el",
".",
"symbol",
"for",
"el",
"in",
"Elemen... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MolecularOrbitals.max_electronegativity | returns the maximum pairwise electronegativity difference | pymatgen/core/molecular_orbitals.py | def max_electronegativity(self):
'''
returns the maximum pairwise electronegativity difference
'''
maximum = 0
for e1, e2 in combinations(self.elements, 2):
if abs(Element(e1).X - Element(e2).X) > maximum:
maximum = abs(Element(e1).X - Element(e2).X)
... | def max_electronegativity(self):
'''
returns the maximum pairwise electronegativity difference
'''
maximum = 0
for e1, e2 in combinations(self.elements, 2):
if abs(Element(e1).X - Element(e2).X) > maximum:
maximum = abs(Element(e1).X - Element(e2).X)
... | [
"returns",
"the",
"maximum",
"pairwise",
"electronegativity",
"difference"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/molecular_orbitals.py#L65-L73 | [
"def",
"max_electronegativity",
"(",
"self",
")",
":",
"maximum",
"=",
"0",
"for",
"e1",
",",
"e2",
"in",
"combinations",
"(",
"self",
".",
"elements",
",",
"2",
")",
":",
"if",
"abs",
"(",
"Element",
"(",
"e1",
")",
".",
"X",
"-",
"Element",
"(",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MolecularOrbitals.aos_as_list | Returns a list of atomic orbitals, sorted from lowest to highest energy | pymatgen/core/molecular_orbitals.py | def aos_as_list(self):
'''
Returns a list of atomic orbitals, sorted from lowest to highest energy
'''
return sorted(chain.from_iterable(
[self.aos[el] * int(self.composition[el]) for el in self.elements]
), key=lambda x: x[2]) | def aos_as_list(self):
'''
Returns a list of atomic orbitals, sorted from lowest to highest energy
'''
return sorted(chain.from_iterable(
[self.aos[el] * int(self.composition[el]) for el in self.elements]
), key=lambda x: x[2]) | [
"Returns",
"a",
"list",
"of",
"atomic",
"orbitals",
"sorted",
"from",
"lowest",
"to",
"highest",
"energy"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/molecular_orbitals.py#L75-L81 | [
"def",
"aos_as_list",
"(",
"self",
")",
":",
"return",
"sorted",
"(",
"chain",
".",
"from_iterable",
"(",
"[",
"self",
".",
"aos",
"[",
"el",
"]",
"*",
"int",
"(",
"self",
".",
"composition",
"[",
"el",
"]",
")",
"for",
"el",
"in",
"self",
".",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | MolecularOrbitals.obtain_band_edges | Fill up the atomic orbitals with available electrons.
Return HOMO, LUMO, and whether it's a metal. | pymatgen/core/molecular_orbitals.py | def obtain_band_edges(self):
'''
Fill up the atomic orbitals with available electrons.
Return HOMO, LUMO, and whether it's a metal.
'''
orbitals = self.aos_as_list()
electrons = Composition(self.composition).total_electrons
partial_filled = []
for orbital ... | def obtain_band_edges(self):
'''
Fill up the atomic orbitals with available electrons.
Return HOMO, LUMO, and whether it's a metal.
'''
orbitals = self.aos_as_list()
electrons = Composition(self.composition).total_electrons
partial_filled = []
for orbital ... | [
"Fill",
"up",
"the",
"atomic",
"orbitals",
"with",
"available",
"electrons",
".",
"Return",
"HOMO",
"LUMO",
"and",
"whether",
"it",
"s",
"a",
"metal",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/core/molecular_orbitals.py#L83-L119 | [
"def",
"obtain_band_edges",
"(",
"self",
")",
":",
"orbitals",
"=",
"self",
".",
"aos_as_list",
"(",
")",
"electrons",
"=",
"Composition",
"(",
"self",
".",
"composition",
")",
".",
"total_electrons",
"partial_filled",
"=",
"[",
"]",
"for",
"orbital",
"in",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | group_entries_by_structure | Given a sequence of ComputedStructureEntries, use structure fitter to group
them by structural similarity.
Args:
entries: Sequence of ComputedStructureEntries.
species_to_remove: Sometimes you want to compare a host framework
(e.g., in Li-ion battery analysis). This allows you to sp... | pymatgen/entries/entry_tools.py | def group_entries_by_structure(entries, species_to_remove=None,
ltol=0.2, stol=.4, angle_tol=5,
primitive_cell=True, scale=True,
comparator=SpeciesComparator(),
ncpus=None):
"""
Given a se... | def group_entries_by_structure(entries, species_to_remove=None,
ltol=0.2, stol=.4, angle_tol=5,
primitive_cell=True, scale=True,
comparator=SpeciesComparator(),
ncpus=None):
"""
Given a se... | [
"Given",
"a",
"sequence",
"of",
"ComputedStructureEntries",
"use",
"structure",
"fitter",
"to",
"group",
"them",
"by",
"structural",
"similarity",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/entries/entry_tools.py#L83-L147 | [
"def",
"group_entries_by_structure",
"(",
"entries",
",",
"species_to_remove",
"=",
"None",
",",
"ltol",
"=",
"0.2",
",",
"stol",
"=",
".4",
",",
"angle_tol",
"=",
"5",
",",
"primitive_cell",
"=",
"True",
",",
"scale",
"=",
"True",
",",
"comparator",
"=",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | EntrySet.chemsys | Returns:
set representing the chemical system, e.g., {"Li", "Fe", "P", "O"} | pymatgen/entries/entry_tools.py | def chemsys(self) -> set:
"""
Returns:
set representing the chemical system, e.g., {"Li", "Fe", "P", "O"}
"""
chemsys = set()
for e in self.entries:
chemsys.update([el.symbol for el in e.composition.keys()])
return chemsys | def chemsys(self) -> set:
"""
Returns:
set representing the chemical system, e.g., {"Li", "Fe", "P", "O"}
"""
chemsys = set()
for e in self.entries:
chemsys.update([el.symbol for el in e.composition.keys()])
return chemsys | [
"Returns",
":",
"set",
"representing",
"the",
"chemical",
"system",
"e",
".",
"g",
".",
"{",
"Li",
"Fe",
"P",
"O",
"}"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/entries/entry_tools.py#L179-L187 | [
"def",
"chemsys",
"(",
"self",
")",
"->",
"set",
":",
"chemsys",
"=",
"set",
"(",
")",
"for",
"e",
"in",
"self",
".",
"entries",
":",
"chemsys",
".",
"update",
"(",
"[",
"el",
".",
"symbol",
"for",
"el",
"in",
"e",
".",
"composition",
".",
"keys"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | EntrySet.remove_non_ground_states | Removes all non-ground state entries, i.e., only keep the lowest energy
per atom entry at each composition. | pymatgen/entries/entry_tools.py | def remove_non_ground_states(self):
"""
Removes all non-ground state entries, i.e., only keep the lowest energy
per atom entry at each composition.
"""
group_func = lambda e: e.composition.reduced_formula
entries = sorted(self.entries, key=group_func)
ground_state... | def remove_non_ground_states(self):
"""
Removes all non-ground state entries, i.e., only keep the lowest energy
per atom entry at each composition.
"""
group_func = lambda e: e.composition.reduced_formula
entries = sorted(self.entries, key=group_func)
ground_state... | [
"Removes",
"all",
"non",
"-",
"ground",
"state",
"entries",
"i",
".",
"e",
".",
"only",
"keep",
"the",
"lowest",
"energy",
"per",
"atom",
"entry",
"at",
"each",
"composition",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/entries/entry_tools.py#L189-L199 | [
"def",
"remove_non_ground_states",
"(",
"self",
")",
":",
"group_func",
"=",
"lambda",
"e",
":",
"e",
".",
"composition",
".",
"reduced_formula",
"entries",
"=",
"sorted",
"(",
"self",
".",
"entries",
",",
"key",
"=",
"group_func",
")",
"ground_states",
"=",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | EntrySet.get_subset_in_chemsys | Returns an EntrySet containing only the set of entries belonging to
a particular chemical system (in this definition, it includes all sub
systems). For example, if the entries are from the
Li-Fe-P-O system, and chemsys=["Li", "O"], only the Li, O,
and Li-O entries are returned.
... | pymatgen/entries/entry_tools.py | def get_subset_in_chemsys(self, chemsys: List[str]):
"""
Returns an EntrySet containing only the set of entries belonging to
a particular chemical system (in this definition, it includes all sub
systems). For example, if the entries are from the
Li-Fe-P-O system, and chemsys=["Li... | def get_subset_in_chemsys(self, chemsys: List[str]):
"""
Returns an EntrySet containing only the set of entries belonging to
a particular chemical system (in this definition, it includes all sub
systems). For example, if the entries are from the
Li-Fe-P-O system, and chemsys=["Li... | [
"Returns",
"an",
"EntrySet",
"containing",
"only",
"the",
"set",
"of",
"entries",
"belonging",
"to",
"a",
"particular",
"chemical",
"system",
"(",
"in",
"this",
"definition",
"it",
"includes",
"all",
"sub",
"systems",
")",
".",
"For",
"example",
"if",
"the",... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/entries/entry_tools.py#L201-L225 | [
"def",
"get_subset_in_chemsys",
"(",
"self",
",",
"chemsys",
":",
"List",
"[",
"str",
"]",
")",
":",
"chemsys",
"=",
"set",
"(",
"chemsys",
")",
"if",
"not",
"chemsys",
".",
"issubset",
"(",
"self",
".",
"chemsys",
")",
":",
"raise",
"ValueError",
"(",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | EntrySet.to_csv | Exports PDEntries to a csv
Args:
filename: Filename to write to.
entries: PDEntries to export.
latexify_names: Format entry names to be LaTex compatible,
e.g., Li_{2}O | pymatgen/entries/entry_tools.py | def to_csv(self, filename: str, latexify_names: bool = False):
"""
Exports PDEntries to a csv
Args:
filename: Filename to write to.
entries: PDEntries to export.
latexify_names: Format entry names to be LaTex compatible,
e.g., Li_{2}O
... | def to_csv(self, filename: str, latexify_names: bool = False):
"""
Exports PDEntries to a csv
Args:
filename: Filename to write to.
entries: PDEntries to export.
latexify_names: Format entry names to be LaTex compatible,
e.g., Li_{2}O
... | [
"Exports",
"PDEntries",
"to",
"a",
"csv"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/entries/entry_tools.py#L232-L256 | [
"def",
"to_csv",
"(",
"self",
",",
"filename",
":",
"str",
",",
"latexify_names",
":",
"bool",
"=",
"False",
")",
":",
"elements",
"=",
"set",
"(",
")",
"for",
"entry",
"in",
"self",
".",
"entries",
":",
"elements",
".",
"update",
"(",
"entry",
".",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | EntrySet.from_csv | Imports PDEntries from a csv.
Args:
filename: Filename to import from.
Returns:
List of Elements, List of PDEntries | pymatgen/entries/entry_tools.py | def from_csv(cls, filename: str):
"""
Imports PDEntries from a csv.
Args:
filename: Filename to import from.
Returns:
List of Elements, List of PDEntries
"""
with open(filename, "r", encoding="utf-8") as f:
reader = csv.reader(f, deli... | def from_csv(cls, filename: str):
"""
Imports PDEntries from a csv.
Args:
filename: Filename to import from.
Returns:
List of Elements, List of PDEntries
"""
with open(filename, "r", encoding="utf-8") as f:
reader = csv.reader(f, deli... | [
"Imports",
"PDEntries",
"from",
"a",
"csv",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/entries/entry_tools.py#L259-L288 | [
"def",
"from_csv",
"(",
"cls",
",",
"filename",
":",
"str",
")",
":",
"with",
"open",
"(",
"filename",
",",
"\"r\"",
",",
"encoding",
"=",
"\"utf-8\"",
")",
"as",
"f",
":",
"reader",
"=",
"csv",
".",
"reader",
"(",
"f",
",",
"delimiter",
"=",
"unic... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | _parse_parameters | Helper function to convert a Vasprun parameter into the proper type.
Boolean, int and float types are converted.
Args:
val_type: Value type parsed from vasprun.xml.
val: Actual string value parsed for vasprun.xml. | pymatgen/io/vasp/outputs.py | def _parse_parameters(val_type, val):
"""
Helper function to convert a Vasprun parameter into the proper type.
Boolean, int and float types are converted.
Args:
val_type: Value type parsed from vasprun.xml.
val: Actual string value parsed for vasprun.xml.
"""
if val_type == "log... | def _parse_parameters(val_type, val):
"""
Helper function to convert a Vasprun parameter into the proper type.
Boolean, int and float types are converted.
Args:
val_type: Value type parsed from vasprun.xml.
val: Actual string value parsed for vasprun.xml.
"""
if val_type == "log... | [
"Helper",
"function",
"to",
"convert",
"a",
"Vasprun",
"parameter",
"into",
"the",
"proper",
"type",
".",
"Boolean",
"int",
"and",
"float",
"types",
"are",
"converted",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L61-L77 | [
"def",
"_parse_parameters",
"(",
"val_type",
",",
"val",
")",
":",
"if",
"val_type",
"==",
"\"logical\"",
":",
"return",
"val",
"==",
"\"T\"",
"elif",
"val_type",
"==",
"\"int\"",
":",
"return",
"int",
"(",
"val",
")",
"elif",
"val_type",
"==",
"\"string\"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | _parse_v_parameters | Helper function to convert a Vasprun array-type parameter into the proper
type. Boolean, int and float types are converted.
Args:
val_type: Value type parsed from vasprun.xml.
val: Actual string value parsed for vasprun.xml.
filename: Fullpath of vasprun.xml. Used for robust error handl... | pymatgen/io/vasp/outputs.py | def _parse_v_parameters(val_type, val, filename, param_name):
"""
Helper function to convert a Vasprun array-type parameter into the proper
type. Boolean, int and float types are converted.
Args:
val_type: Value type parsed from vasprun.xml.
val: Actual string value parsed for vasprun.x... | def _parse_v_parameters(val_type, val, filename, param_name):
"""
Helper function to convert a Vasprun array-type parameter into the proper
type. Boolean, int and float types are converted.
Args:
val_type: Value type parsed from vasprun.xml.
val: Actual string value parsed for vasprun.x... | [
"Helper",
"function",
"to",
"convert",
"a",
"Vasprun",
"array",
"-",
"type",
"parameter",
"into",
"the",
"proper",
"type",
".",
"Boolean",
"int",
"and",
"float",
"types",
"are",
"converted",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L80-L119 | [
"def",
"_parse_v_parameters",
"(",
"val_type",
",",
"val",
",",
"filename",
",",
"param_name",
")",
":",
"if",
"val_type",
"==",
"\"logical\"",
":",
"val",
"=",
"[",
"i",
"==",
"\"T\"",
"for",
"i",
"in",
"val",
".",
"split",
"(",
")",
"]",
"elif",
"v... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | _parse_from_incar | Helper function to parse a parameter from the INCAR. | pymatgen/io/vasp/outputs.py | def _parse_from_incar(filename, key):
"""
Helper function to parse a parameter from the INCAR.
"""
dirname = os.path.dirname(filename)
for f in os.listdir(dirname):
if re.search(r"INCAR", f):
warnings.warn("INCAR found. Using " + key + " from INCAR.")
incar = Incar.fr... | def _parse_from_incar(filename, key):
"""
Helper function to parse a parameter from the INCAR.
"""
dirname = os.path.dirname(filename)
for f in os.listdir(dirname):
if re.search(r"INCAR", f):
warnings.warn("INCAR found. Using " + key + " from INCAR.")
incar = Incar.fr... | [
"Helper",
"function",
"to",
"parse",
"a",
"parameter",
"from",
"the",
"INCAR",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L130-L143 | [
"def",
"_parse_from_incar",
"(",
"filename",
",",
"key",
")",
":",
"dirname",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"filename",
")",
"for",
"f",
"in",
"os",
".",
"listdir",
"(",
"dirname",
")",
":",
"if",
"re",
".",
"search",
"(",
"r\"INCAR\""... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | _vasprun_float | Large numbers are often represented as ********* in the vasprun.
This function parses these values as np.nan | pymatgen/io/vasp/outputs.py | def _vasprun_float(f):
"""
Large numbers are often represented as ********* in the vasprun.
This function parses these values as np.nan
"""
try:
return float(f)
except ValueError as e:
f = f.strip()
if f == '*' * len(f):
warnings.warn('Float overflow (*******)... | def _vasprun_float(f):
"""
Large numbers are often represented as ********* in the vasprun.
This function parses these values as np.nan
"""
try:
return float(f)
except ValueError as e:
f = f.strip()
if f == '*' * len(f):
warnings.warn('Float overflow (*******)... | [
"Large",
"numbers",
"are",
"often",
"represented",
"as",
"*********",
"in",
"the",
"vasprun",
".",
"This",
"function",
"parses",
"these",
"values",
"as",
"np",
".",
"nan"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L146-L158 | [
"def",
"_vasprun_float",
"(",
"f",
")",
":",
"try",
":",
"return",
"float",
"(",
"f",
")",
"except",
"ValueError",
"as",
"e",
":",
"f",
"=",
"f",
".",
"strip",
"(",
")",
"if",
"f",
"==",
"'*'",
"*",
"len",
"(",
"f",
")",
":",
"warnings",
".",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | get_band_structure_from_vasp_multiple_branches | This method is used to get band structure info from a VASP directory. It
takes into account that the run can be divided in several branches named
"branch_x". If the run has not been divided in branches the method will
turn to parsing vasprun.xml directly.
The method returns None is there"s a parsing er... | pymatgen/io/vasp/outputs.py | def get_band_structure_from_vasp_multiple_branches(dir_name, efermi=None,
projections=False):
"""
This method is used to get band structure info from a VASP directory. It
takes into account that the run can be divided in several branches named
"branch_x... | def get_band_structure_from_vasp_multiple_branches(dir_name, efermi=None,
projections=False):
"""
This method is used to get band structure info from a VASP directory. It
takes into account that the run can be divided in several branches named
"branch_x... | [
"This",
"method",
"is",
"used",
"to",
"get",
"band",
"structure",
"info",
"from",
"a",
"VASP",
"directory",
".",
"It",
"takes",
"into",
"account",
"that",
"the",
"run",
"can",
"be",
"divided",
"in",
"several",
"branches",
"named",
"branch_x",
".",
"If",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L3491-L3542 | [
"def",
"get_band_structure_from_vasp_multiple_branches",
"(",
"dir_name",
",",
"efermi",
"=",
"None",
",",
"projections",
"=",
"False",
")",
":",
"# TODO: Add better error handling!!!",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"os",
".",
"path",
".",
"join",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | get_adjusted_fermi_level | When running a band structure computations the fermi level needs to be
take from the static run that gave the charge density used for the non-self
consistent band structure run. Sometimes this fermi level is however a
little too low because of the mismatch between the uniform grid used in
the static run... | pymatgen/io/vasp/outputs.py | def get_adjusted_fermi_level(efermi, cbm, band_structure):
"""
When running a band structure computations the fermi level needs to be
take from the static run that gave the charge density used for the non-self
consistent band structure run. Sometimes this fermi level is however a
little too low beca... | def get_adjusted_fermi_level(efermi, cbm, band_structure):
"""
When running a band structure computations the fermi level needs to be
take from the static run that gave the charge density used for the non-self
consistent band structure run. Sometimes this fermi level is however a
little too low beca... | [
"When",
"running",
"a",
"band",
"structure",
"computations",
"the",
"fermi",
"level",
"needs",
"to",
"be",
"take",
"from",
"the",
"static",
"run",
"that",
"gave",
"the",
"charge",
"density",
"used",
"for",
"the",
"non",
"-",
"self",
"consistent",
"band",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L3837-L3867 | [
"def",
"get_adjusted_fermi_level",
"(",
"efermi",
",",
"cbm",
",",
"band_structure",
")",
":",
"# make a working copy of band_structure",
"bs_working",
"=",
"BandStructureSymmLine",
".",
"from_dict",
"(",
"band_structure",
".",
"as_dict",
"(",
")",
")",
"if",
"bs_work... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.optical_absorption_coeff | Calculate the optical absorption coefficient
from the dielectric constants. Note that this method is only
implemented for optical properties calculated with GGA and BSE.
Returns:
optical absorption coefficient in list | pymatgen/io/vasp/outputs.py | def optical_absorption_coeff(self):
"""
Calculate the optical absorption coefficient
from the dielectric constants. Note that this method is only
implemented for optical properties calculated with GGA and BSE.
Returns:
optical absorption coefficient in list
"""
... | def optical_absorption_coeff(self):
"""
Calculate the optical absorption coefficient
from the dielectric constants. Note that this method is only
implemented for optical properties calculated with GGA and BSE.
Returns:
optical absorption coefficient in list
"""
... | [
"Calculate",
"the",
"optical",
"absorption",
"coefficient",
"from",
"the",
"dielectric",
"constants",
".",
"Note",
"that",
"this",
"method",
"is",
"only",
"implemented",
"for",
"optical",
"properties",
"calculated",
"with",
"GGA",
"and",
"BSE",
".",
"Returns",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L522-L550 | [
"def",
"optical_absorption_coeff",
"(",
"self",
")",
":",
"if",
"self",
".",
"dielectric_data",
"[",
"\"density\"",
"]",
":",
"real_avg",
"=",
"[",
"sum",
"(",
"self",
".",
"dielectric_data",
"[",
"\"density\"",
"]",
"[",
"1",
"]",
"[",
"i",
"]",
"[",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.converged_electronic | Checks that electronic step convergence has been reached in the final
ionic step | pymatgen/io/vasp/outputs.py | def converged_electronic(self):
"""
Checks that electronic step convergence has been reached in the final
ionic step
"""
final_esteps = self.ionic_steps[-1]["electronic_steps"]
if 'LEPSILON' in self.incar and self.incar['LEPSILON']:
i = 1
to_check ... | def converged_electronic(self):
"""
Checks that electronic step convergence has been reached in the final
ionic step
"""
final_esteps = self.ionic_steps[-1]["electronic_steps"]
if 'LEPSILON' in self.incar and self.incar['LEPSILON']:
i = 1
to_check ... | [
"Checks",
"that",
"electronic",
"step",
"convergence",
"has",
"been",
"reached",
"in",
"the",
"final",
"ionic",
"step"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L561-L573 | [
"def",
"converged_electronic",
"(",
"self",
")",
":",
"final_esteps",
"=",
"self",
".",
"ionic_steps",
"[",
"-",
"1",
"]",
"[",
"\"electronic_steps\"",
"]",
"if",
"'LEPSILON'",
"in",
"self",
".",
"incar",
"and",
"self",
".",
"incar",
"[",
"'LEPSILON'",
"]"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.converged_ionic | Checks that ionic step convergence has been reached, i.e. that vasp
exited before reaching the max ionic steps for a relaxation run | pymatgen/io/vasp/outputs.py | def converged_ionic(self):
"""
Checks that ionic step convergence has been reached, i.e. that vasp
exited before reaching the max ionic steps for a relaxation run
"""
nsw = self.parameters.get("NSW", 0)
return nsw <= 1 or len(self.ionic_steps) < nsw | def converged_ionic(self):
"""
Checks that ionic step convergence has been reached, i.e. that vasp
exited before reaching the max ionic steps for a relaxation run
"""
nsw = self.parameters.get("NSW", 0)
return nsw <= 1 or len(self.ionic_steps) < nsw | [
"Checks",
"that",
"ionic",
"step",
"convergence",
"has",
"been",
"reached",
"i",
".",
"e",
".",
"that",
"vasp",
"exited",
"before",
"reaching",
"the",
"max",
"ionic",
"steps",
"for",
"a",
"relaxation",
"run"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L576-L582 | [
"def",
"converged_ionic",
"(",
"self",
")",
":",
"nsw",
"=",
"self",
".",
"parameters",
".",
"get",
"(",
"\"NSW\"",
",",
"0",
")",
"return",
"nsw",
"<=",
"1",
"or",
"len",
"(",
"self",
".",
"ionic_steps",
")",
"<",
"nsw"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.final_energy | Final energy from the vasp run. | pymatgen/io/vasp/outputs.py | def final_energy(self):
"""
Final energy from the vasp run.
"""
try:
final_istep = self.ionic_steps[-1]
if final_istep["e_wo_entrp"] != final_istep[
'electronic_steps'][-1]["e_0_energy"]:
warnings.warn("Final e_wo_entrp differs from... | def final_energy(self):
"""
Final energy from the vasp run.
"""
try:
final_istep = self.ionic_steps[-1]
if final_istep["e_wo_entrp"] != final_istep[
'electronic_steps'][-1]["e_0_energy"]:
warnings.warn("Final e_wo_entrp differs from... | [
"Final",
"energy",
"from",
"the",
"vasp",
"run",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L593-L612 | [
"def",
"final_energy",
"(",
"self",
")",
":",
"try",
":",
"final_istep",
"=",
"self",
".",
"ionic_steps",
"[",
"-",
"1",
"]",
"if",
"final_istep",
"[",
"\"e_wo_entrp\"",
"]",
"!=",
"final_istep",
"[",
"'electronic_steps'",
"]",
"[",
"-",
"1",
"]",
"[",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.complete_dos | A complete dos object which incorporates the total dos and all
projected dos. | pymatgen/io/vasp/outputs.py | def complete_dos(self):
"""
A complete dos object which incorporates the total dos and all
projected dos.
"""
final_struct = self.final_structure
pdoss = {final_struct[i]: pdos for i, pdos in enumerate(self.pdos)}
return CompleteDos(self.final_structure, self.tdos... | def complete_dos(self):
"""
A complete dos object which incorporates the total dos and all
projected dos.
"""
final_struct = self.final_structure
pdoss = {final_struct[i]: pdos for i, pdos in enumerate(self.pdos)}
return CompleteDos(self.final_structure, self.tdos... | [
"A",
"complete",
"dos",
"object",
"which",
"incorporates",
"the",
"total",
"dos",
"and",
"all",
"projected",
"dos",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L615-L622 | [
"def",
"complete_dos",
"(",
"self",
")",
":",
"final_struct",
"=",
"self",
".",
"final_structure",
"pdoss",
"=",
"{",
"final_struct",
"[",
"i",
"]",
":",
"pdos",
"for",
"i",
",",
"pdos",
"in",
"enumerate",
"(",
"self",
".",
"pdos",
")",
"}",
"return",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.hubbards | Hubbard U values used if a vasprun is a GGA+U run. {} otherwise. | pymatgen/io/vasp/outputs.py | def hubbards(self):
"""
Hubbard U values used if a vasprun is a GGA+U run. {} otherwise.
"""
symbols = [s.split()[1] for s in self.potcar_symbols]
symbols = [re.split(r"_", s)[0] for s in symbols]
if not self.incar.get("LDAU", False):
return {}
us = se... | def hubbards(self):
"""
Hubbard U values used if a vasprun is a GGA+U run. {} otherwise.
"""
symbols = [s.split()[1] for s in self.potcar_symbols]
symbols = [re.split(r"_", s)[0] for s in symbols]
if not self.incar.get("LDAU", False):
return {}
us = se... | [
"Hubbard",
"U",
"values",
"used",
"if",
"a",
"vasprun",
"is",
"a",
"GGA",
"+",
"U",
"run",
".",
"{}",
"otherwise",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L625-L643 | [
"def",
"hubbards",
"(",
"self",
")",
":",
"symbols",
"=",
"[",
"s",
".",
"split",
"(",
")",
"[",
"1",
"]",
"for",
"s",
"in",
"self",
".",
"potcar_symbols",
"]",
"symbols",
"=",
"[",
"re",
".",
"split",
"(",
"r\"_\"",
",",
"s",
")",
"[",
"0",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.run_type | Returns the run type. Currently supports LDA, GGA, vdW-DF and HF calcs.
TODO: Fix for other functional types like PW91, other vdW types, etc. | pymatgen/io/vasp/outputs.py | def run_type(self):
"""
Returns the run type. Currently supports LDA, GGA, vdW-DF and HF calcs.
TODO: Fix for other functional types like PW91, other vdW types, etc.
"""
METAGGA_TYPES = {"TPSS", "RTPSS", "M06L", "MBJL", "SCAN", "MS0", "MS1", "MS2"}
if self.parameters.g... | def run_type(self):
"""
Returns the run type. Currently supports LDA, GGA, vdW-DF and HF calcs.
TODO: Fix for other functional types like PW91, other vdW types, etc.
"""
METAGGA_TYPES = {"TPSS", "RTPSS", "M06L", "MBJL", "SCAN", "MS0", "MS1", "MS2"}
if self.parameters.g... | [
"Returns",
"the",
"run",
"type",
".",
"Currently",
"supports",
"LDA",
"GGA",
"vdW",
"-",
"DF",
"and",
"HF",
"calcs",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L646-L670 | [
"def",
"run_type",
"(",
"self",
")",
":",
"METAGGA_TYPES",
"=",
"{",
"\"TPSS\"",
",",
"\"RTPSS\"",
",",
"\"M06L\"",
",",
"\"MBJL\"",
",",
"\"SCAN\"",
",",
"\"MS0\"",
",",
"\"MS1\"",
",",
"\"MS2\"",
"}",
"if",
"self",
".",
"parameters",
".",
"get",
"(",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.is_hubbard | True if run is a DFT+U run. | pymatgen/io/vasp/outputs.py | def is_hubbard(self):
"""
True if run is a DFT+U run.
"""
if len(self.hubbards) == 0:
return False
return sum(self.hubbards.values()) > 1e-8 | def is_hubbard(self):
"""
True if run is a DFT+U run.
"""
if len(self.hubbards) == 0:
return False
return sum(self.hubbards.values()) > 1e-8 | [
"True",
"if",
"run",
"is",
"a",
"DFT",
"+",
"U",
"run",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L673-L679 | [
"def",
"is_hubbard",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"hubbards",
")",
"==",
"0",
":",
"return",
"False",
"return",
"sum",
"(",
"self",
".",
"hubbards",
".",
"values",
"(",
")",
")",
">",
"1e-8"
] | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.get_computed_entry | Returns a ComputedStructureEntry from the vasprun.
Args:
inc_structure (bool): Set to True if you want
ComputedStructureEntries to be returned instead of
ComputedEntries.
parameters (list): Input parameters to include. It has to be one of
... | pymatgen/io/vasp/outputs.py | def get_computed_entry(self, inc_structure=True, parameters=None,
data=None):
"""
Returns a ComputedStructureEntry from the vasprun.
Args:
inc_structure (bool): Set to True if you want
ComputedStructureEntries to be returned instead of
... | def get_computed_entry(self, inc_structure=True, parameters=None,
data=None):
"""
Returns a ComputedStructureEntry from the vasprun.
Args:
inc_structure (bool): Set to True if you want
ComputedStructureEntries to be returned instead of
... | [
"Returns",
"a",
"ComputedStructureEntry",
"from",
"the",
"vasprun",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L688-L721 | [
"def",
"get_computed_entry",
"(",
"self",
",",
"inc_structure",
"=",
"True",
",",
"parameters",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"param_names",
"=",
"{",
"\"is_hubbard\"",
",",
"\"hubbards\"",
",",
"\"potcar_symbols\"",
",",
"\"potcar_spec\"",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.get_band_structure | Returns the band structure as a BandStructure object
Args:
kpoints_filename (str): Full path of the KPOINTS file from which
the band structure is generated.
If none is provided, the code will try to intelligently
determine the appropriate KPOINTS file... | pymatgen/io/vasp/outputs.py | def get_band_structure(self, kpoints_filename=None, efermi=None,
line_mode=False, force_hybrid_mode=False):
"""
Returns the band structure as a BandStructure object
Args:
kpoints_filename (str): Full path of the KPOINTS file from which
the ... | def get_band_structure(self, kpoints_filename=None, efermi=None,
line_mode=False, force_hybrid_mode=False):
"""
Returns the band structure as a BandStructure object
Args:
kpoints_filename (str): Full path of the KPOINTS file from which
the ... | [
"Returns",
"the",
"band",
"structure",
"as",
"a",
"BandStructure",
"object"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L723-L856 | [
"def",
"get_band_structure",
"(",
"self",
",",
"kpoints_filename",
"=",
"None",
",",
"efermi",
"=",
"None",
",",
"line_mode",
"=",
"False",
",",
"force_hybrid_mode",
"=",
"False",
")",
":",
"if",
"not",
"kpoints_filename",
":",
"kpoints_filename",
"=",
"zpath"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.eigenvalue_band_properties | Band properties from the eigenvalues as a tuple,
(band gap, cbm, vbm, is_band_gap_direct). | pymatgen/io/vasp/outputs.py | def eigenvalue_band_properties(self):
"""
Band properties from the eigenvalues as a tuple,
(band gap, cbm, vbm, is_band_gap_direct).
"""
vbm = -float("inf")
vbm_kpoint = None
cbm = float("inf")
cbm_kpoint = None
for spin, d in self.eigenvalues.item... | def eigenvalue_band_properties(self):
"""
Band properties from the eigenvalues as a tuple,
(band gap, cbm, vbm, is_band_gap_direct).
"""
vbm = -float("inf")
vbm_kpoint = None
cbm = float("inf")
cbm_kpoint = None
for spin, d in self.eigenvalues.item... | [
"Band",
"properties",
"from",
"the",
"eigenvalues",
"as",
"a",
"tuple",
"(",
"band",
"gap",
"cbm",
"vbm",
"is_band_gap_direct",
")",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L859-L877 | [
"def",
"eigenvalue_band_properties",
"(",
"self",
")",
":",
"vbm",
"=",
"-",
"float",
"(",
"\"inf\"",
")",
"vbm_kpoint",
"=",
"None",
"cbm",
"=",
"float",
"(",
"\"inf\"",
")",
"cbm_kpoint",
"=",
"None",
"for",
"spin",
",",
"d",
"in",
"self",
".",
"eige... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Vasprun.as_dict | Json-serializable dict representation. | pymatgen/io/vasp/outputs.py | def as_dict(self):
"""
Json-serializable dict representation.
"""
d = {"vasp_version": self.vasp_version,
"has_vasp_completed": self.converged,
"nsites": len(self.final_structure)}
comp = self.final_structure.composition
d["unit_cell_formula"] = ... | def as_dict(self):
"""
Json-serializable dict representation.
"""
d = {"vasp_version": self.vasp_version,
"has_vasp_completed": self.converged,
"nsites": len(self.final_structure)}
comp = self.final_structure.composition
d["unit_cell_formula"] = ... | [
"Json",
"-",
"serializable",
"dict",
"representation",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L935-L1004 | [
"def",
"as_dict",
"(",
"self",
")",
":",
"d",
"=",
"{",
"\"vasp_version\"",
":",
"self",
".",
"vasp_version",
",",
"\"has_vasp_completed\"",
":",
"self",
".",
"converged",
",",
"\"nsites\"",
":",
"len",
"(",
"self",
".",
"final_structure",
")",
"}",
"comp"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | BSVasprun.as_dict | Json-serializable dict representation. | pymatgen/io/vasp/outputs.py | def as_dict(self):
"""
Json-serializable dict representation.
"""
d = {"vasp_version": self.vasp_version,
"has_vasp_completed": True,
"nsites": len(self.final_structure)}
comp = self.final_structure.composition
d["unit_cell_formula"] = comp.as_di... | def as_dict(self):
"""
Json-serializable dict representation.
"""
d = {"vasp_version": self.vasp_version,
"has_vasp_completed": True,
"nsites": len(self.final_structure)}
comp = self.final_structure.composition
d["unit_cell_formula"] = comp.as_di... | [
"Json",
"-",
"serializable",
"dict",
"representation",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1305-L1365 | [
"def",
"as_dict",
"(",
"self",
")",
":",
"d",
"=",
"{",
"\"vasp_version\"",
":",
"self",
".",
"vasp_version",
",",
"\"has_vasp_completed\"",
":",
"True",
",",
"\"nsites\"",
":",
"len",
"(",
"self",
".",
"final_structure",
")",
"}",
"comp",
"=",
"self",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_pattern | General pattern reading. Uses monty's regrep method. Takes the same
arguments.
Args:
patterns (dict): A dict of patterns, e.g.,
{"energy": r"energy\\(sigma->0\\)\\s+=\\s+([\\d\\-.]+)"}.
reverse (bool): Read files in reverse. Defaults to false. Useful for
... | pymatgen/io/vasp/outputs.py | def read_pattern(self, patterns, reverse=False, terminate_on_match=False,
postprocess=str):
"""
General pattern reading. Uses monty's regrep method. Takes the same
arguments.
Args:
patterns (dict): A dict of patterns, e.g.,
{"energy": r"e... | def read_pattern(self, patterns, reverse=False, terminate_on_match=False,
postprocess=str):
"""
General pattern reading. Uses monty's regrep method. Takes the same
arguments.
Args:
patterns (dict): A dict of patterns, e.g.,
{"energy": r"e... | [
"General",
"pattern",
"reading",
".",
"Uses",
"monty",
"s",
"regrep",
"method",
".",
"Takes",
"the",
"same",
"arguments",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1691-L1719 | [
"def",
"read_pattern",
"(",
"self",
",",
"patterns",
",",
"reverse",
"=",
"False",
",",
"terminate_on_match",
"=",
"False",
",",
"postprocess",
"=",
"str",
")",
":",
"matches",
"=",
"regrep",
"(",
"self",
".",
"filename",
",",
"patterns",
",",
"reverse",
... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_table_pattern | Parse table-like data. A table composes of three parts: header,
main body, footer. All the data matches "row pattern" in the main body
will be returned.
Args:
header_pattern (str): The regular expression pattern matches the
table header. This pattern should match all... | pymatgen/io/vasp/outputs.py | def read_table_pattern(self, header_pattern, row_pattern, footer_pattern,
postprocess=str, attribute_name=None,
last_one_only=True):
"""
Parse table-like data. A table composes of three parts: header,
main body, footer. All the data matches "... | def read_table_pattern(self, header_pattern, row_pattern, footer_pattern,
postprocess=str, attribute_name=None,
last_one_only=True):
"""
Parse table-like data. A table composes of three parts: header,
main body, footer. All the data matches "... | [
"Parse",
"table",
"-",
"like",
"data",
".",
"A",
"table",
"composes",
"of",
"three",
"parts",
":",
"header",
"main",
"body",
"footer",
".",
"All",
"the",
"data",
"matches",
"row",
"pattern",
"in",
"the",
"main",
"body",
"will",
"be",
"returned",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1721-L1782 | [
"def",
"read_table_pattern",
"(",
"self",
",",
"header_pattern",
",",
"row_pattern",
",",
"footer_pattern",
",",
"postprocess",
"=",
"str",
",",
"attribute_name",
"=",
"None",
",",
"last_one_only",
"=",
"True",
")",
":",
"with",
"zopen",
"(",
"self",
".",
"f... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_electrostatic_potential | Parses the eletrostatic potential for the last ionic step | pymatgen/io/vasp/outputs.py | def read_electrostatic_potential(self):
"""
Parses the eletrostatic potential for the last ionic step
"""
pattern = {"ngf": r"\s+dimension x,y,z NGXF=\s+([\.\-\d]+)\sNGYF=\s+([\.\-\d]+)\sNGZF=\s+([\.\-\d]+)"}
self.read_pattern(pattern, postprocess=int)
self.ngf = self.dat... | def read_electrostatic_potential(self):
"""
Parses the eletrostatic potential for the last ionic step
"""
pattern = {"ngf": r"\s+dimension x,y,z NGXF=\s+([\.\-\d]+)\sNGYF=\s+([\.\-\d]+)\sNGZF=\s+([\.\-\d]+)"}
self.read_pattern(pattern, postprocess=int)
self.ngf = self.dat... | [
"Parses",
"the",
"eletrostatic",
"potential",
"for",
"the",
"last",
"ionic",
"step"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1784-L1806 | [
"def",
"read_electrostatic_potential",
"(",
"self",
")",
":",
"pattern",
"=",
"{",
"\"ngf\"",
":",
"r\"\\s+dimension x,y,z NGXF=\\s+([\\.\\-\\d]+)\\sNGYF=\\s+([\\.\\-\\d]+)\\sNGZF=\\s+([\\.\\-\\d]+)\"",
"}",
"self",
".",
"read_pattern",
"(",
"pattern",
",",
"postprocess",
"="... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_freq_dielectric | Parses the frequency dependent dielectric function (obtained with
LOPTICS). Frequencies (in eV) are in self.frequencies, and dielectric
tensor function is given as self.dielectric_tensor_function. | pymatgen/io/vasp/outputs.py | def read_freq_dielectric(self):
"""
Parses the frequency dependent dielectric function (obtained with
LOPTICS). Frequencies (in eV) are in self.frequencies, and dielectric
tensor function is given as self.dielectric_tensor_function.
"""
plasma_pattern = r"plasma frequenc... | def read_freq_dielectric(self):
"""
Parses the frequency dependent dielectric function (obtained with
LOPTICS). Frequencies (in eV) are in self.frequencies, and dielectric
tensor function is given as self.dielectric_tensor_function.
"""
plasma_pattern = r"plasma frequenc... | [
"Parses",
"the",
"frequency",
"dependent",
"dielectric",
"function",
"(",
"obtained",
"with",
"LOPTICS",
")",
".",
"Frequencies",
"(",
"in",
"eV",
")",
"are",
"in",
"self",
".",
"frequencies",
"and",
"dielectric",
"tensor",
"function",
"is",
"given",
"as",
"... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1808-L1859 | [
"def",
"read_freq_dielectric",
"(",
"self",
")",
":",
"plasma_pattern",
"=",
"r\"plasma frequency squared.*\"",
"dielectric_pattern",
"=",
"r\"frequency dependent\\s+IMAGINARY \"",
"r\"DIELECTRIC FUNCTION \\(independent particle, \"",
"r\"no local field effects\\)(\\sdensity-density)*$\"",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_chemical_shielding | Parse the NMR chemical shieldings data. Only the second part "absolute, valence and core"
will be parsed. And only the three right most field (ISO_SHIELDING, SPAN, SKEW) will be retrieved.
Returns:
List of chemical shieldings in the order of atoms from the OUTCAR. Maryland notation is adopt... | pymatgen/io/vasp/outputs.py | def read_chemical_shielding(self):
"""
Parse the NMR chemical shieldings data. Only the second part "absolute, valence and core"
will be parsed. And only the three right most field (ISO_SHIELDING, SPAN, SKEW) will be retrieved.
Returns:
List of chemical shieldings in the ord... | def read_chemical_shielding(self):
"""
Parse the NMR chemical shieldings data. Only the second part "absolute, valence and core"
will be parsed. And only the three right most field (ISO_SHIELDING, SPAN, SKEW) will be retrieved.
Returns:
List of chemical shieldings in the ord... | [
"Parse",
"the",
"NMR",
"chemical",
"shieldings",
"data",
".",
"Only",
"the",
"second",
"part",
"absolute",
"valence",
"and",
"core",
"will",
"be",
"parsed",
".",
"And",
"only",
"the",
"three",
"right",
"most",
"field",
"(",
"ISO_SHIELDING",
"SPAN",
"SKEW",
... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1866-L1898 | [
"def",
"read_chemical_shielding",
"(",
"self",
")",
":",
"header_pattern",
"=",
"r\"\\s+CSA tensor \\(J\\. Mason, Solid State Nucl\\. Magn\\. Reson\\. 2, \"",
"r\"285 \\(1993\\)\\)\\s+\"",
"r\"\\s+-{50,}\\s+\"",
"r\"\\s+EXCLUDING G=0 CONTRIBUTION\\s+INCLUDING G=0 CONTRIBUTION\\s+\"",
"r\"\\s... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_cs_g0_contribution | Parse the G0 contribution of NMR chemical shielding.
Returns:
G0 contribution matrix as list of list. | pymatgen/io/vasp/outputs.py | def read_cs_g0_contribution(self):
"""
Parse the G0 contribution of NMR chemical shielding.
Returns:
G0 contribution matrix as list of list.
"""
header_pattern = r'^\s+G\=0 CONTRIBUTION TO CHEMICAL SHIFT \(field along BDIR\)\s+$\n' \
... | def read_cs_g0_contribution(self):
"""
Parse the G0 contribution of NMR chemical shielding.
Returns:
G0 contribution matrix as list of list.
"""
header_pattern = r'^\s+G\=0 CONTRIBUTION TO CHEMICAL SHIFT \(field along BDIR\)\s+$\n' \
... | [
"Parse",
"the",
"G0",
"contribution",
"of",
"NMR",
"chemical",
"shielding",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1900-L1914 | [
"def",
"read_cs_g0_contribution",
"(",
"self",
")",
":",
"header_pattern",
"=",
"r'^\\s+G\\=0 CONTRIBUTION TO CHEMICAL SHIFT \\(field along BDIR\\)\\s+$\\n'",
"r'^\\s+-{50,}$\\n'",
"r'^\\s+BDIR\\s+X\\s+Y\\s+Z\\s*$\\n'",
"r'^\\s+-{50,}\\s*$\\n'",
"row_pattern",
"=",
"r'(?:\\d+)\\s+'",
"... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_cs_core_contribution | Parse the core contribution of NMR chemical shielding.
Returns:
G0 contribution matrix as list of list. | pymatgen/io/vasp/outputs.py | def read_cs_core_contribution(self):
"""
Parse the core contribution of NMR chemical shielding.
Returns:
G0 contribution matrix as list of list.
"""
header_pattern = r'^\s+Core NMR properties\s*$\n' \
r'\n' \
... | def read_cs_core_contribution(self):
"""
Parse the core contribution of NMR chemical shielding.
Returns:
G0 contribution matrix as list of list.
"""
header_pattern = r'^\s+Core NMR properties\s*$\n' \
r'\n' \
... | [
"Parse",
"the",
"core",
"contribution",
"of",
"NMR",
"chemical",
"shielding",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1916-L1933 | [
"def",
"read_cs_core_contribution",
"(",
"self",
")",
":",
"header_pattern",
"=",
"r'^\\s+Core NMR properties\\s*$\\n'",
"r'\\n'",
"r'^\\s+typ\\s+El\\s+Core shift \\(ppm\\)\\s*$\\n'",
"r'^\\s+-{20,}$\\n'",
"row_pattern",
"=",
"r'\\d+\\s+(?P<element>[A-Z][a-z]?\\w?)\\s+(?P<shift>[-]?\\d+\... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_cs_raw_symmetrized_tensors | Parse the matrix form of NMR tensor before corrected to table.
Returns:
nsymmetrized tensors list in the order of atoms. | pymatgen/io/vasp/outputs.py | def read_cs_raw_symmetrized_tensors(self):
"""
Parse the matrix form of NMR tensor before corrected to table.
Returns:
nsymmetrized tensors list in the order of atoms.
"""
header_pattern = r"\s+-{50,}\s+" \
r"\s+Absolute Chemical Shift tensors\s+... | def read_cs_raw_symmetrized_tensors(self):
"""
Parse the matrix form of NMR tensor before corrected to table.
Returns:
nsymmetrized tensors list in the order of atoms.
"""
header_pattern = r"\s+-{50,}\s+" \
r"\s+Absolute Chemical Shift tensors\s+... | [
"Parse",
"the",
"matrix",
"form",
"of",
"NMR",
"tensor",
"before",
"corrected",
"to",
"table",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1935-L1976 | [
"def",
"read_cs_raw_symmetrized_tensors",
"(",
"self",
")",
":",
"header_pattern",
"=",
"r\"\\s+-{50,}\\s+\"",
"r\"\\s+Absolute Chemical Shift tensors\\s+\"",
"r\"\\s+-{50,}$\"",
"first_part_pattern",
"=",
"r\"\\s+UNSYMMETRIZED TENSORS\\s+$\"",
"row_pattern",
"=",
"r\"\\s+\"",
".",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_nmr_efg_tensor | Parses the NMR Electric Field Gradient Raw Tensors
Returns:
A list of Electric Field Gradient Tensors in the order of Atoms from OUTCAR | pymatgen/io/vasp/outputs.py | def read_nmr_efg_tensor(self):
"""
Parses the NMR Electric Field Gradient Raw Tensors
Returns:
A list of Electric Field Gradient Tensors in the order of Atoms from OUTCAR
"""
header_pattern = r'Electric field gradients \(V/A\^2\)\n' \
r'-*\n... | def read_nmr_efg_tensor(self):
"""
Parses the NMR Electric Field Gradient Raw Tensors
Returns:
A list of Electric Field Gradient Tensors in the order of Atoms from OUTCAR
"""
header_pattern = r'Electric field gradients \(V/A\^2\)\n' \
r'-*\n... | [
"Parses",
"the",
"NMR",
"Electric",
"Field",
"Gradient",
"Raw",
"Tensors"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1978-L1997 | [
"def",
"read_nmr_efg_tensor",
"(",
"self",
")",
":",
"header_pattern",
"=",
"r'Electric field gradients \\(V/A\\^2\\)\\n'",
"r'-*\\n'",
"r' ion\\s+V_xx\\s+V_yy\\s+V_zz\\s+V_xy\\s+V_xz\\s+V_yz\\n'",
"r'-*\\n'",
"row_pattern",
"=",
"r'\\d+\\s+([-\\d\\.]+)\\s+([-\\d\\.]+)\\s+([-\\d\\.]+)\\s... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_nmr_efg | Parse the NMR Electric Field Gradient interpretted values.
Returns:
Electric Field Gradient tensors as a list of dict in the order of atoms from OUTCAR.
Each dict key/value pair corresponds to a component of the tensors. | pymatgen/io/vasp/outputs.py | def read_nmr_efg(self):
"""
Parse the NMR Electric Field Gradient interpretted values.
Returns:
Electric Field Gradient tensors as a list of dict in the order of atoms from OUTCAR.
Each dict key/value pair corresponds to a component of the tensors.
"""
he... | def read_nmr_efg(self):
"""
Parse the NMR Electric Field Gradient interpretted values.
Returns:
Electric Field Gradient tensors as a list of dict in the order of atoms from OUTCAR.
Each dict key/value pair corresponds to a component of the tensors.
"""
he... | [
"Parse",
"the",
"NMR",
"Electric",
"Field",
"Gradient",
"interpretted",
"values",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L1999-L2018 | [
"def",
"read_nmr_efg",
"(",
"self",
")",
":",
"header_pattern",
"=",
"r'^\\s+NMR quadrupolar parameters\\s+$\\n'",
"r'^\\s+Cq : quadrupolar parameter\\s+Cq=e[*]Q[*]V_zz/h$\\n'",
"r'^\\s+eta: asymmetry parameters\\s+\\(V_yy - V_xx\\)/ V_zz$\\n'",
"r'^\\s+Q : nuclear electric quadrupole moment ... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_elastic_tensor | Parse the elastic tensor data.
Returns:
6x6 array corresponding to the elastic tensor from the OUTCAR. | pymatgen/io/vasp/outputs.py | def read_elastic_tensor(self):
"""
Parse the elastic tensor data.
Returns:
6x6 array corresponding to the elastic tensor from the OUTCAR.
"""
header_pattern = r"TOTAL ELASTIC MODULI \(kBar\)\s+" \
r"Direction\s+([X-Z][X-Z]\s+)+" \
... | def read_elastic_tensor(self):
"""
Parse the elastic tensor data.
Returns:
6x6 array corresponding to the elastic tensor from the OUTCAR.
"""
header_pattern = r"TOTAL ELASTIC MODULI \(kBar\)\s+" \
r"Direction\s+([X-Z][X-Z]\s+)+" \
... | [
"Parse",
"the",
"elastic",
"tensor",
"data",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L2020-L2034 | [
"def",
"read_elastic_tensor",
"(",
"self",
")",
":",
"header_pattern",
"=",
"r\"TOTAL ELASTIC MODULI \\(kBar\\)\\s+\"",
"r\"Direction\\s+([X-Z][X-Z]\\s+)+\"",
"r\"\\-+\"",
"row_pattern",
"=",
"r\"[X-Z][X-Z]\\s+\"",
"+",
"r\"\\s+\"",
".",
"join",
"(",
"[",
"r\"(\\-*[\\.\\d]+)\... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_piezo_tensor | Parse the piezo tensor data | pymatgen/io/vasp/outputs.py | def read_piezo_tensor(self):
"""
Parse the piezo tensor data
"""
header_pattern = r"PIEZOELECTRIC TENSOR for field in x, y, " \
r"z\s+\(C/m\^2\)\s+([X-Z][X-Z]\s+)+\-+"
row_pattern = r"[x-z]\s+" + r"\s+".join([r"(\-*[\.\d]+)"] * 6)
footer_pattern ... | def read_piezo_tensor(self):
"""
Parse the piezo tensor data
"""
header_pattern = r"PIEZOELECTRIC TENSOR for field in x, y, " \
r"z\s+\(C/m\^2\)\s+([X-Z][X-Z]\s+)+\-+"
row_pattern = r"[x-z]\s+" + r"\s+".join([r"(\-*[\.\d]+)"] * 6)
footer_pattern ... | [
"Parse",
"the",
"piezo",
"tensor",
"data"
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L2036-L2046 | [
"def",
"read_piezo_tensor",
"(",
"self",
")",
":",
"header_pattern",
"=",
"r\"PIEZOELECTRIC TENSOR for field in x, y, \"",
"r\"z\\s+\\(C/m\\^2\\)\\s+([X-Z][X-Z]\\s+)+\\-+\"",
"row_pattern",
"=",
"r\"[x-z]\\s+\"",
"+",
"r\"\\s+\"",
".",
"join",
"(",
"[",
"r\"(\\-*[\\.\\d]+)\"",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_neb | Reads NEB data. This only works with OUTCARs from both normal
VASP NEB calculations or from the CI NEB method implemented by
Henkelman et al.
Args:
reverse (bool): Read files in reverse. Defaults to false. Useful for
large files, esp OUTCARs, especially when used wit... | pymatgen/io/vasp/outputs.py | def read_neb(self, reverse=True, terminate_on_match=True):
"""
Reads NEB data. This only works with OUTCARs from both normal
VASP NEB calculations or from the CI NEB method implemented by
Henkelman et al.
Args:
reverse (bool): Read files in reverse. Defaults to false... | def read_neb(self, reverse=True, terminate_on_match=True):
"""
Reads NEB data. This only works with OUTCARs from both normal
VASP NEB calculations or from the CI NEB method implemented by
Henkelman et al.
Args:
reverse (bool): Read files in reverse. Defaults to false... | [
"Reads",
"NEB",
"data",
".",
"This",
"only",
"works",
"with",
"OUTCARs",
"from",
"both",
"normal",
"VASP",
"NEB",
"calculations",
"or",
"from",
"the",
"CI",
"NEB",
"method",
"implemented",
"by",
"Henkelman",
"et",
"al",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L2058-L2088 | [
"def",
"read_neb",
"(",
"self",
",",
"reverse",
"=",
"True",
",",
"terminate_on_match",
"=",
"True",
")",
":",
"patterns",
"=",
"{",
"\"energy\"",
":",
"r\"energy\\(sigma->0\\)\\s+=\\s+([\\d\\-\\.]+)\"",
",",
"\"tangent_force\"",
":",
"r\"(NEB: projections on to tangent... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_igpar | Renders accessible:
er_ev = e<r>_ev (dictionary with Spin.up/Spin.down as keys)
er_bp = e<r>_bp (dictionary with Spin.up/Spin.down as keys)
er_ev_tot = spin up + spin down summed
er_bp_tot = spin up + spin down summed
p_elc = spin up + spin down summed
... | pymatgen/io/vasp/outputs.py | def read_igpar(self):
"""
Renders accessible:
er_ev = e<r>_ev (dictionary with Spin.up/Spin.down as keys)
er_bp = e<r>_bp (dictionary with Spin.up/Spin.down as keys)
er_ev_tot = spin up + spin down summed
er_bp_tot = spin up + spin down summed
... | def read_igpar(self):
"""
Renders accessible:
er_ev = e<r>_ev (dictionary with Spin.up/Spin.down as keys)
er_bp = e<r>_bp (dictionary with Spin.up/Spin.down as keys)
er_ev_tot = spin up + spin down summed
er_bp_tot = spin up + spin down summed
... | [
"Renders",
"accessible",
":",
"er_ev",
"=",
"e<r",
">",
"_ev",
"(",
"dictionary",
"with",
"Spin",
".",
"up",
"/",
"Spin",
".",
"down",
"as",
"keys",
")",
"er_bp",
"=",
"e<r",
">",
"_bp",
"(",
"dictionary",
"with",
"Spin",
".",
"up",
"/",
"Spin",
".... | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L2090-L2207 | [
"def",
"read_igpar",
"(",
"self",
")",
":",
"# variables to be filled",
"self",
".",
"er_ev",
"=",
"{",
"}",
"# will be dict (Spin.up/down) of array(3*float)",
"self",
".",
"er_bp",
"=",
"{",
"}",
"# will be dics (Spin.up/down) of array(3*float)",
"self",
".",
"er_e... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
train | Outcar.read_internal_strain_tensor | Reads the internal strain tensor and populates self.internal_strain_tensor with an array of voigt notation
tensors for each site. | pymatgen/io/vasp/outputs.py | def read_internal_strain_tensor(self):
"""
Reads the internal strain tensor and populates self.internal_strain_tensor with an array of voigt notation
tensors for each site.
"""
search = []
def internal_strain_start(results, match):
results.internal_strain... | def read_internal_strain_tensor(self):
"""
Reads the internal strain tensor and populates self.internal_strain_tensor with an array of voigt notation
tensors for each site.
"""
search = []
def internal_strain_start(results, match):
results.internal_strain... | [
"Reads",
"the",
"internal",
"strain",
"tensor",
"and",
"populates",
"self",
".",
"internal_strain_tensor",
"with",
"an",
"array",
"of",
"voigt",
"notation",
"tensors",
"for",
"each",
"site",
"."
] | materialsproject/pymatgen | python | https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/vasp/outputs.py#L2209-L2244 | [
"def",
"read_internal_strain_tensor",
"(",
"self",
")",
":",
"search",
"=",
"[",
"]",
"def",
"internal_strain_start",
"(",
"results",
",",
"match",
")",
":",
"results",
".",
"internal_strain_ion",
"=",
"int",
"(",
"match",
".",
"group",
"(",
"1",
")",
")",... | 4ca558cf72f8d5f8a1f21dfdfc0181a971c186da |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.