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
DLSVolumePredictor.get_predicted_structure
Given a structure, returns back the structure scaled to predicted volume. Args: structure (Structure): structure w/unknown volume Returns: a Structure object with predicted volume
pymatgen/analysis/structure_prediction/volume_predictor.py
def get_predicted_structure(self, structure, icsd_vol=False): """ Given a structure, returns back the structure scaled to predicted volume. Args: structure (Structure): structure w/unknown volume Returns: a Structure object with predicted volume "...
def get_predicted_structure(self, structure, icsd_vol=False): """ Given a structure, returns back the structure scaled to predicted volume. Args: structure (Structure): structure w/unknown volume Returns: a Structure object with predicted volume "...
[ "Given", "a", "structure", "returns", "back", "the", "structure", "scaled", "to", "predicted", "volume", ".", "Args", ":", "structure", "(", "Structure", ")", ":", "structure", "w", "/", "unknown", "volume" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/structure_prediction/volume_predictor.py#L244-L256
[ "def", "get_predicted_structure", "(", "self", ",", "structure", ",", "icsd_vol", "=", "False", ")", ":", "new_structure", "=", "structure", ".", "copy", "(", ")", "new_structure", ".", "scale_lattice", "(", "self", ".", "predict", "(", "structure", ",", "ic...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IsomorphismMolAtomMapper.uniform_labels
Pair the geometrically equivalent atoms of the molecules. Calculate RMSD on all possible isomorphism mappings and return mapping with the least RMSD Args: mol1: First molecule. OpenBabel OBMol or pymatgen Molecule object. mol2: Second molecule. OpenBabel OBMol or pymatge...
pymatgen/analysis/molecule_matcher.py
def uniform_labels(self, mol1, mol2): """ Pair the geometrically equivalent atoms of the molecules. Calculate RMSD on all possible isomorphism mappings and return mapping with the least RMSD Args: mol1: First molecule. OpenBabel OBMol or pymatgen Molecule object. ...
def uniform_labels(self, mol1, mol2): """ Pair the geometrically equivalent atoms of the molecules. Calculate RMSD on all possible isomorphism mappings and return mapping with the least RMSD Args: mol1: First molecule. OpenBabel OBMol or pymatgen Molecule object. ...
[ "Pair", "the", "geometrically", "equivalent", "atoms", "of", "the", "molecules", ".", "Calculate", "RMSD", "on", "all", "possible", "isomorphism", "mappings", "and", "return", "mapping", "with", "the", "least", "RMSD" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L100-L159
[ "def", "uniform_labels", "(", "self", ",", "mol1", ",", "mol2", ")", ":", "obmol1", "=", "BabelMolAdaptor", "(", "mol1", ")", ".", "openbabel_mol", "obmol2", "=", "BabelMolAdaptor", "(", "mol2", ")", ".", "openbabel_mol", "h1", "=", "self", ".", "get_molec...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
IsomorphismMolAtomMapper.get_molecule_hash
Return inchi as molecular hash
pymatgen/analysis/molecule_matcher.py
def get_molecule_hash(self, mol): """ Return inchi as molecular hash """ obconv = ob.OBConversion() obconv.SetOutFormat(str("inchi")) obconv.AddOption(str("X"), ob.OBConversion.OUTOPTIONS, str("DoNotAddH")) inchi_text = obconv.WriteString(mol) match = re.s...
def get_molecule_hash(self, mol): """ Return inchi as molecular hash """ obconv = ob.OBConversion() obconv.SetOutFormat(str("inchi")) obconv.AddOption(str("X"), ob.OBConversion.OUTOPTIONS, str("DoNotAddH")) inchi_text = obconv.WriteString(mol) match = re.s...
[ "Return", "inchi", "as", "molecular", "hash" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L161-L170
[ "def", "get_molecule_hash", "(", "self", ",", "mol", ")", ":", "obconv", "=", "ob", ".", "OBConversion", "(", ")", "obconv", ".", "SetOutFormat", "(", "str", "(", "\"inchi\"", ")", ")", "obconv", ".", "AddOption", "(", "str", "(", "\"X\"", ")", ",", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
InchiMolAtomMapper._inchi_labels
Get the inchi canonical labels of the heavy atoms in the molecule Args: mol: The molecule. OpenBabel OBMol object Returns: The label mappings. List of tuple of canonical label, original label List of equivalent atoms.
pymatgen/analysis/molecule_matcher.py
def _inchi_labels(mol): """ Get the inchi canonical labels of the heavy atoms in the molecule Args: mol: The molecule. OpenBabel OBMol object Returns: The label mappings. List of tuple of canonical label, original label List of equivalent...
def _inchi_labels(mol): """ Get the inchi canonical labels of the heavy atoms in the molecule Args: mol: The molecule. OpenBabel OBMol object Returns: The label mappings. List of tuple of canonical label, original label List of equivalent...
[ "Get", "the", "inchi", "canonical", "labels", "of", "the", "heavy", "atoms", "in", "the", "molecule" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L203-L234
[ "def", "_inchi_labels", "(", "mol", ")", ":", "obconv", "=", "ob", ".", "OBConversion", "(", ")", "obconv", ".", "SetOutFormat", "(", "str", "(", "\"inchi\"", ")", ")", "obconv", ".", "AddOption", "(", "str", "(", "\"a\"", ")", ",", "ob", ".", "OBCon...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
InchiMolAtomMapper._group_centroid
Calculate the centroids of a group atoms indexed by the labels of inchi Args: mol: The molecule. OpenBabel OBMol object ilabel: inchi label map Returns: Centroid. Tuple (x, y, z)
pymatgen/analysis/molecule_matcher.py
def _group_centroid(mol, ilabels, group_atoms): """ Calculate the centroids of a group atoms indexed by the labels of inchi Args: mol: The molecule. OpenBabel OBMol object ilabel: inchi label map Returns: Centroid. Tuple (x, y, z) """ ...
def _group_centroid(mol, ilabels, group_atoms): """ Calculate the centroids of a group atoms indexed by the labels of inchi Args: mol: The molecule. OpenBabel OBMol object ilabel: inchi label map Returns: Centroid. Tuple (x, y, z) """ ...
[ "Calculate", "the", "centroids", "of", "a", "group", "atoms", "indexed", "by", "the", "labels", "of", "inchi" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L237-L259
[ "def", "_group_centroid", "(", "mol", ",", "ilabels", ",", "group_atoms", ")", ":", "c1x", ",", "c1y", ",", "c1z", "=", "0.0", ",", "0.0", ",", "0.0", "for", "i", "in", "group_atoms", ":", "orig_idx", "=", "ilabels", "[", "i", "-", "1", "]", "oa1",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
InchiMolAtomMapper._virtual_molecule
Create a virtual molecule by unique atoms, the centriods of the equivalent atoms Args: mol: The molecule. OpenBabel OBMol object ilables: inchi label map eq_atoms: equivalent atom labels farthest_group_idx: The equivalent atom group index in which ...
pymatgen/analysis/molecule_matcher.py
def _virtual_molecule(self, mol, ilabels, eq_atoms): """ Create a virtual molecule by unique atoms, the centriods of the equivalent atoms Args: mol: The molecule. OpenBabel OBMol object ilables: inchi label map eq_atoms: equivalent atom labels ...
def _virtual_molecule(self, mol, ilabels, eq_atoms): """ Create a virtual molecule by unique atoms, the centriods of the equivalent atoms Args: mol: The molecule. OpenBabel OBMol object ilables: inchi label map eq_atoms: equivalent atom labels ...
[ "Create", "a", "virtual", "molecule", "by", "unique", "atoms", "the", "centriods", "of", "the", "equivalent", "atoms" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L261-L306
[ "def", "_virtual_molecule", "(", "self", ",", "mol", ",", "ilabels", ",", "eq_atoms", ")", ":", "vmol", "=", "ob", ".", "OBMol", "(", ")", "non_unique_atoms", "=", "set", "(", "[", "a", "for", "g", "in", "eq_atoms", "for", "a", "in", "g", "]", ")",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
InchiMolAtomMapper._align_heavy_atoms
Align the label of topologically identical atoms of second molecule towards first molecule Args: mol1: First molecule. OpenBabel OBMol object mol2: Second molecule. OpenBabel OBMol object vmol1: First virtual molecule constructed by centroids. OpenBabel ...
pymatgen/analysis/molecule_matcher.py
def _align_heavy_atoms(mol1, mol2, vmol1, vmol2, ilabel1, ilabel2, eq_atoms): """ Align the label of topologically identical atoms of second molecule towards first molecule Args: mol1: First molecule. OpenBabel OBMol object mol2: Second...
def _align_heavy_atoms(mol1, mol2, vmol1, vmol2, ilabel1, ilabel2, eq_atoms): """ Align the label of topologically identical atoms of second molecule towards first molecule Args: mol1: First molecule. OpenBabel OBMol object mol2: Second...
[ "Align", "the", "label", "of", "topologically", "identical", "atoms", "of", "second", "molecule", "towards", "first", "molecule" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L309-L390
[ "def", "_align_heavy_atoms", "(", "mol1", ",", "mol2", ",", "vmol1", ",", "vmol2", ",", "ilabel1", ",", "ilabel2", ",", "eq_atoms", ")", ":", "nvirtual", "=", "vmol1", ".", "NumAtoms", "(", ")", "nheavy", "=", "len", "(", "ilabel1", ")", "for", "i", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
InchiMolAtomMapper._align_hydrogen_atoms
Align the label of topologically identical atoms of second molecule towards first molecule Args: mol1: First molecule. OpenBabel OBMol object mol2: Second molecule. OpenBabel OBMol object heavy_indices1: inchi label map of the first molecule heavy_indices...
pymatgen/analysis/molecule_matcher.py
def _align_hydrogen_atoms(mol1, mol2, heavy_indices1, heavy_indices2): """ Align the label of topologically identical atoms of second molecule towards first molecule Args: mol1: First molecule. OpenBabel OBMol object mol2: Second mol...
def _align_hydrogen_atoms(mol1, mol2, heavy_indices1, heavy_indices2): """ Align the label of topologically identical atoms of second molecule towards first molecule Args: mol1: First molecule. OpenBabel OBMol object mol2: Second mol...
[ "Align", "the", "label", "of", "topologically", "identical", "atoms", "of", "second", "molecule", "towards", "first", "molecule" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L393-L459
[ "def", "_align_hydrogen_atoms", "(", "mol1", ",", "mol2", ",", "heavy_indices1", ",", "heavy_indices2", ")", ":", "num_atoms", "=", "mol2", ".", "NumAtoms", "(", ")", "all_atom", "=", "set", "(", "range", "(", "1", ",", "num_atoms", "+", "1", ")", ")", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
InchiMolAtomMapper._get_elements
The the elements of the atoms in the specified order Args: mol: The molecule. OpenBabel OBMol object. label: The atom indices. List of integers. Returns: Elements. List of integers.
pymatgen/analysis/molecule_matcher.py
def _get_elements(mol, label): """ The the elements of the atoms in the specified order Args: mol: The molecule. OpenBabel OBMol object. label: The atom indices. List of integers. Returns: Elements. List of integers. """ elements = [i...
def _get_elements(mol, label): """ The the elements of the atoms in the specified order Args: mol: The molecule. OpenBabel OBMol object. label: The atom indices. List of integers. Returns: Elements. List of integers. """ elements = [i...
[ "The", "the", "elements", "of", "the", "atoms", "in", "the", "specified", "order" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L462-L474
[ "def", "_get_elements", "(", "mol", ",", "label", ")", ":", "elements", "=", "[", "int", "(", "mol", ".", "GetAtom", "(", "i", ")", ".", "GetAtomicNum", "(", ")", ")", "for", "i", "in", "label", "]", "return", "elements" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
InchiMolAtomMapper._is_molecule_linear
Is the molecule a linear one Args: mol: The molecule. OpenBabel OBMol object. Returns: Boolean value.
pymatgen/analysis/molecule_matcher.py
def _is_molecule_linear(self, mol): """ Is the molecule a linear one Args: mol: The molecule. OpenBabel OBMol object. Returns: Boolean value. """ if mol.NumAtoms() < 3: return True a1 = mol.GetAtom(1) a2 = mol.GetAtom(...
def _is_molecule_linear(self, mol): """ Is the molecule a linear one Args: mol: The molecule. OpenBabel OBMol object. Returns: Boolean value. """ if mol.NumAtoms() < 3: return True a1 = mol.GetAtom(1) a2 = mol.GetAtom(...
[ "Is", "the", "molecule", "a", "linear", "one" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L476-L498
[ "def", "_is_molecule_linear", "(", "self", ",", "mol", ")", ":", "if", "mol", ".", "NumAtoms", "(", ")", "<", "3", ":", "return", "True", "a1", "=", "mol", ".", "GetAtom", "(", "1", ")", "a2", "=", "mol", ".", "GetAtom", "(", "2", ")", "for", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
InchiMolAtomMapper.get_molecule_hash
Return inchi as molecular hash
pymatgen/analysis/molecule_matcher.py
def get_molecule_hash(self, mol): """ Return inchi as molecular hash """ obmol = BabelMolAdaptor(mol).openbabel_mol inchi = self._inchi_labels(obmol)[2] return inchi
def get_molecule_hash(self, mol): """ Return inchi as molecular hash """ obmol = BabelMolAdaptor(mol).openbabel_mol inchi = self._inchi_labels(obmol)[2] return inchi
[ "Return", "inchi", "as", "molecular", "hash" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L539-L545
[ "def", "get_molecule_hash", "(", "self", ",", "mol", ")", ":", "obmol", "=", "BabelMolAdaptor", "(", "mol", ")", ".", "openbabel_mol", "inchi", "=", "self", ".", "_inchi_labels", "(", "obmol", ")", "[", "2", "]", "return", "inchi" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
MoleculeMatcher.fit
Fit two molecules. Args: mol1: First molecule. OpenBabel OBMol or pymatgen Molecule object mol2: Second molecule. OpenBabel OBMol or pymatgen Molecule object Returns: A boolean value indicates whether two molecules are the same.
pymatgen/analysis/molecule_matcher.py
def fit(self, mol1, mol2): """ Fit two molecules. Args: mol1: First molecule. OpenBabel OBMol or pymatgen Molecule object mol2: Second molecule. OpenBabel OBMol or pymatgen Molecule object Returns: A boolean value indicates whether two molecules are ...
def fit(self, mol1, mol2): """ Fit two molecules. Args: mol1: First molecule. OpenBabel OBMol or pymatgen Molecule object mol2: Second molecule. OpenBabel OBMol or pymatgen Molecule object Returns: A boolean value indicates whether two molecules are ...
[ "Fit", "two", "molecules", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L565-L576
[ "def", "fit", "(", "self", ",", "mol1", ",", "mol2", ")", ":", "return", "self", ".", "get_rmsd", "(", "mol1", ",", "mol2", ")", "<", "self", ".", "_tolerance" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
MoleculeMatcher.get_rmsd
Get RMSD between two molecule with arbitrary atom order. Returns: RMSD if topology of the two molecules are the same Infinite if the topology is different
pymatgen/analysis/molecule_matcher.py
def get_rmsd(self, mol1, mol2): """ Get RMSD between two molecule with arbitrary atom order. Returns: RMSD if topology of the two molecules are the same Infinite if the topology is different """ label1, label2 = self._mapper.uniform_labels(mol1, mol2) ...
def get_rmsd(self, mol1, mol2): """ Get RMSD between two molecule with arbitrary atom order. Returns: RMSD if topology of the two molecules are the same Infinite if the topology is different """ label1, label2 = self._mapper.uniform_labels(mol1, mol2) ...
[ "Get", "RMSD", "between", "two", "molecule", "with", "arbitrary", "atom", "order", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L578-L589
[ "def", "get_rmsd", "(", "self", ",", "mol1", ",", "mol2", ")", ":", "label1", ",", "label2", "=", "self", ".", "_mapper", ".", "uniform_labels", "(", "mol1", ",", "mol2", ")", "if", "label1", "is", "None", "or", "label2", "is", "None", ":", "return",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
MoleculeMatcher._calc_rms
Calculate the RMSD. Args: mol1: The first molecule. OpenBabel OBMol or pymatgen Molecule object mol2: The second molecule. OpenBabel OBMol or pymatgen Molecule object clabel1: The atom indices that can reorder the first molecule to ...
pymatgen/analysis/molecule_matcher.py
def _calc_rms(mol1, mol2, clabel1, clabel2): """ Calculate the RMSD. Args: mol1: The first molecule. OpenBabel OBMol or pymatgen Molecule object mol2: The second molecule. OpenBabel OBMol or pymatgen Molecule object clabel1: Th...
def _calc_rms(mol1, mol2, clabel1, clabel2): """ Calculate the RMSD. Args: mol1: The first molecule. OpenBabel OBMol or pymatgen Molecule object mol2: The second molecule. OpenBabel OBMol or pymatgen Molecule object clabel1: Th...
[ "Calculate", "the", "RMSD", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L592-L629
[ "def", "_calc_rms", "(", "mol1", ",", "mol2", ",", "clabel1", ",", "clabel2", ")", ":", "obmol1", "=", "BabelMolAdaptor", "(", "mol1", ")", ".", "openbabel_mol", "obmol2", "=", "BabelMolAdaptor", "(", "mol2", ")", ".", "openbabel_mol", "cmol1", "=", "ob", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
MoleculeMatcher.group_molecules
Group molecules by structural equality. Args: mol_list: List of OpenBabel OBMol or pymatgen objects Returns: A list of lists of matched molecules Assumption: if s1=s2 and s2=s3, then s1=s3 This may not be true for small tolerances.
pymatgen/analysis/molecule_matcher.py
def group_molecules(self, mol_list): """ Group molecules by structural equality. Args: mol_list: List of OpenBabel OBMol or pymatgen objects Returns: A list of lists of matched molecules Assumption: if s1=s2 and s2=s3, then s1=s3 This may...
def group_molecules(self, mol_list): """ Group molecules by structural equality. Args: mol_list: List of OpenBabel OBMol or pymatgen objects Returns: A list of lists of matched molecules Assumption: if s1=s2 and s2=s3, then s1=s3 This may...
[ "Group", "molecules", "by", "structural", "equality", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/analysis/molecule_matcher.py#L631-L678
[ "def", "group_molecules", "(", "self", ",", "mol_list", ")", ":", "mol_hash", "=", "[", "(", "i", ",", "self", ".", "_mapper", ".", "get_molecule_hash", "(", "m", ")", ")", "for", "i", ",", "m", "in", "enumerate", "(", "mol_list", ")", "]", "mol_hash...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
nmltostring
Convert a dictionary representing a Fortran namelist into a string.
pymatgen/io/abinit/tasks.py
def nmltostring(nml): """Convert a dictionary representing a Fortran namelist into a string.""" if not isinstance(nml,dict): raise ValueError("nml should be a dict !") curstr = "" for key,group in nml.items(): namelist = ["&" + key] for k, v in group.items(): if isinstance(...
def nmltostring(nml): """Convert a dictionary representing a Fortran namelist into a string.""" if not isinstance(nml,dict): raise ValueError("nml should be a dict !") curstr = "" for key,group in nml.items(): namelist = ["&" + key] for k, v in group.items(): if isinstance(...
[ "Convert", "a", "dictionary", "representing", "a", "Fortran", "namelist", "into", "a", "string", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L79-L98
[ "def", "nmltostring", "(", "nml", ")", ":", "if", "not", "isinstance", "(", "nml", ",", "dict", ")", ":", "raise", "ValueError", "(", "\"nml should be a dict !\"", ")", "curstr", "=", "\"\"", "for", "key", ",", "group", "in", "nml", ".", "items", "(", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskResults.from_node
Initialize an instance from an :class:`AbinitTask` instance.
pymatgen/io/abinit/tasks.py
def from_node(cls, task): """Initialize an instance from an :class:`AbinitTask` instance.""" new = super().from_node(task) new.update( executable=task.executable, #executable_version: #task_events= pseudos=[p.as_dict() for p in task.input.pseudos]...
def from_node(cls, task): """Initialize an instance from an :class:`AbinitTask` instance.""" new = super().from_node(task) new.update( executable=task.executable, #executable_version: #task_events= pseudos=[p.as_dict() for p in task.input.pseudos]...
[ "Initialize", "an", "instance", "from", "an", ":", "class", ":", "AbinitTask", "instance", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L109-L126
[ "def", "from_node", "(", "cls", ",", "task", ")", ":", "new", "=", "super", "(", ")", ".", "from_node", "(", "task", ")", "new", ".", "update", "(", "executable", "=", "task", ".", "executable", ",", "#executable_version:", "#task_events=", "pseudos", "=...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ParalHintsParser.parse
Read the `AutoParal` section (YAML format) from filename. Assumes the file contains only one section.
pymatgen/io/abinit/tasks.py
def parse(self, filename): """ Read the `AutoParal` section (YAML format) from filename. Assumes the file contains only one section. """ with abiinspect.YamlTokenizer(filename) as r: doc = r.next_doc_with_tag("!Autoparal") try: d = yaml.saf...
def parse(self, filename): """ Read the `AutoParal` section (YAML format) from filename. Assumes the file contains only one section. """ with abiinspect.YamlTokenizer(filename) as r: doc = r.next_doc_with_tag("!Autoparal") try: d = yaml.saf...
[ "Read", "the", "AutoParal", "section", "(", "YAML", "format", ")", "from", "filename", ".", "Assumes", "the", "file", "contains", "only", "one", "section", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L225-L241
[ "def", "parse", "(", "self", ",", "filename", ")", ":", "with", "abiinspect", ".", "YamlTokenizer", "(", "filename", ")", "as", "r", ":", "doc", "=", "r", ".", "next_doc_with_tag", "(", "\"!Autoparal\"", ")", "try", ":", "d", "=", "yaml", ".", "safe_lo...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ParalHints.from_mpi_omp_lists
Build a list of Parallel configurations from two lists containing the number of MPI processes and the number of OpenMP threads i.e. product(mpi_procs, omp_threads). The configuration have parallel efficiency set to 1.0 and no input variables. Mainly used for preparing benchmarks.
pymatgen/io/abinit/tasks.py
def from_mpi_omp_lists(cls, mpi_procs, omp_threads): """ Build a list of Parallel configurations from two lists containing the number of MPI processes and the number of OpenMP threads i.e. product(mpi_procs, omp_threads). The configuration have parallel efficiency set to 1.0 and ...
def from_mpi_omp_lists(cls, mpi_procs, omp_threads): """ Build a list of Parallel configurations from two lists containing the number of MPI processes and the number of OpenMP threads i.e. product(mpi_procs, omp_threads). The configuration have parallel efficiency set to 1.0 and ...
[ "Build", "a", "list", "of", "Parallel", "configurations", "from", "two", "lists", "containing", "the", "number", "of", "MPI", "processes", "and", "the", "number", "of", "OpenMP", "threads", "i", ".", "e", ".", "product", "(", "mpi_procs", "omp_threads", ")",...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L255-L267
[ "def", "from_mpi_omp_lists", "(", "cls", ",", "mpi_procs", ",", "omp_threads", ")", ":", "info", "=", "{", "}", "confs", "=", "[", "ParalConf", "(", "mpi_ncpus", "=", "p", ",", "omp_ncpus", "=", "p", ",", "efficiency", "=", "1.0", ")", "for", "p", ",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ParalHints.select_with_condition
Remove all the configurations that do not satisfy the given condition. Args: condition: dict or :class:`Condition` object with operators expressed with a Mongodb-like syntax key: Selects the sub-dictionary on which condition is applied, e.g. key="vars" if...
pymatgen/io/abinit/tasks.py
def select_with_condition(self, condition, key=None): """ Remove all the configurations that do not satisfy the given condition. Args: condition: dict or :class:`Condition` object with operators expressed with a Mongodb-like syntax key: Selects the sub-dictio...
def select_with_condition(self, condition, key=None): """ Remove all the configurations that do not satisfy the given condition. Args: condition: dict or :class:`Condition` object with operators expressed with a Mongodb-like syntax key: Selects the sub-dictio...
[ "Remove", "all", "the", "configurations", "that", "do", "not", "satisfy", "the", "given", "condition", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L316-L335
[ "def", "select_with_condition", "(", "self", ",", "condition", ",", "key", "=", "None", ")", ":", "condition", "=", "Condition", ".", "as_condition", "(", "condition", ")", "new_confs", "=", "[", "]", "for", "conf", "in", "self", ":", "# Select the object on...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ParalHints.sort_by_efficiency
Sort the configurations in place. items with highest efficiency come first
pymatgen/io/abinit/tasks.py
def sort_by_efficiency(self, reverse=True): """Sort the configurations in place. items with highest efficiency come first""" self._confs.sort(key=lambda c: c.efficiency, reverse=reverse) return self
def sort_by_efficiency(self, reverse=True): """Sort the configurations in place. items with highest efficiency come first""" self._confs.sort(key=lambda c: c.efficiency, reverse=reverse) return self
[ "Sort", "the", "configurations", "in", "place", ".", "items", "with", "highest", "efficiency", "come", "first" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L337-L340
[ "def", "sort_by_efficiency", "(", "self", ",", "reverse", "=", "True", ")", ":", "self", ".", "_confs", ".", "sort", "(", "key", "=", "lambda", "c", ":", "c", ".", "efficiency", ",", "reverse", "=", "reverse", ")", "return", "self" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ParalHints.sort_by_speedup
Sort the configurations in place. items with highest speedup come first
pymatgen/io/abinit/tasks.py
def sort_by_speedup(self, reverse=True): """Sort the configurations in place. items with highest speedup come first""" self._confs.sort(key=lambda c: c.speedup, reverse=reverse) return self
def sort_by_speedup(self, reverse=True): """Sort the configurations in place. items with highest speedup come first""" self._confs.sort(key=lambda c: c.speedup, reverse=reverse) return self
[ "Sort", "the", "configurations", "in", "place", ".", "items", "with", "highest", "speedup", "come", "first" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L342-L345
[ "def", "sort_by_speedup", "(", "self", ",", "reverse", "=", "True", ")", ":", "self", ".", "_confs", ".", "sort", "(", "key", "=", "lambda", "c", ":", "c", ".", "speedup", ",", "reverse", "=", "reverse", ")", "return", "self" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ParalHints.sort_by_mem_per_proc
Sort the configurations in place. items with lowest memory per proc come first.
pymatgen/io/abinit/tasks.py
def sort_by_mem_per_proc(self, reverse=False): """Sort the configurations in place. items with lowest memory per proc come first.""" # Avoid sorting if mem_per_cpu is not available. if any(c.mem_per_proc > 0.0 for c in self): self._confs.sort(key=lambda c: c.mem_per_proc, reverse=rev...
def sort_by_mem_per_proc(self, reverse=False): """Sort the configurations in place. items with lowest memory per proc come first.""" # Avoid sorting if mem_per_cpu is not available. if any(c.mem_per_proc > 0.0 for c in self): self._confs.sort(key=lambda c: c.mem_per_proc, reverse=rev...
[ "Sort", "the", "configurations", "in", "place", ".", "items", "with", "lowest", "memory", "per", "proc", "come", "first", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L347-L352
[ "def", "sort_by_mem_per_proc", "(", "self", ",", "reverse", "=", "False", ")", ":", "# Avoid sorting if mem_per_cpu is not available.", "if", "any", "(", "c", ".", "mem_per_proc", ">", "0.0", "for", "c", "in", "self", ")", ":", "self", ".", "_confs", ".", "s...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ParalHints.get_ordered_with_policy
Sort and return a new list of configurations ordered according to the :class:`TaskPolicy` policy.
pymatgen/io/abinit/tasks.py
def get_ordered_with_policy(self, policy, max_ncpus): """ Sort and return a new list of configurations ordered according to the :class:`TaskPolicy` policy. """ # Build new list since we are gonna change the object in place. hints = self.__class__(self.info, confs=[c for c in self...
def get_ordered_with_policy(self, policy, max_ncpus): """ Sort and return a new list of configurations ordered according to the :class:`TaskPolicy` policy. """ # Build new list since we are gonna change the object in place. hints = self.__class__(self.info, confs=[c for c in self...
[ "Sort", "and", "return", "a", "new", "list", "of", "configurations", "ordered", "according", "to", "the", ":", "class", ":", "TaskPolicy", "policy", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L385-L432
[ "def", "get_ordered_with_policy", "(", "self", ",", "policy", ",", "max_ncpus", ")", ":", "# Build new list since we are gonna change the object in place.", "hints", "=", "self", ".", "__class__", "(", "self", ".", "info", ",", "confs", "=", "[", "c", "for", "c", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskPolicy.as_policy
Converts an object obj into a `:class:`TaskPolicy. Accepts: * None * TaskPolicy * dict-like object
pymatgen/io/abinit/tasks.py
def as_policy(cls, obj): """ Converts an object obj into a `:class:`TaskPolicy. Accepts: * None * TaskPolicy * dict-like object """ if obj is None: # Use default policy. return TaskPolicy() else: if isinstan...
def as_policy(cls, obj): """ Converts an object obj into a `:class:`TaskPolicy. Accepts: * None * TaskPolicy * dict-like object """ if obj is None: # Use default policy. return TaskPolicy() else: if isinstan...
[ "Converts", "an", "object", "obj", "into", "a", ":", "class", ":", "TaskPolicy", ".", "Accepts", ":" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L444-L461
[ "def", "as_policy", "(", "cls", ",", "obj", ")", ":", "if", "obj", "is", "None", ":", "# Use default policy.", "return", "TaskPolicy", "(", ")", "else", ":", "if", "isinstance", "(", "obj", ",", "cls", ")", ":", "return", "obj", "elif", "isinstance", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.from_user_config
Initialize the :class:`TaskManager` from the YAML file 'manager.yaml'. Search first in the working directory and then in the AbiPy configuration directory. Raises: RuntimeError if file is not found.
pymatgen/io/abinit/tasks.py
def from_user_config(cls): """ Initialize the :class:`TaskManager` from the YAML file 'manager.yaml'. Search first in the working directory and then in the AbiPy configuration directory. Raises: RuntimeError if file is not found. """ global _USER_CONFIG_TASKM...
def from_user_config(cls): """ Initialize the :class:`TaskManager` from the YAML file 'manager.yaml'. Search first in the working directory and then in the AbiPy configuration directory. Raises: RuntimeError if file is not found. """ global _USER_CONFIG_TASKM...
[ "Initialize", "the", ":", "class", ":", "TaskManager", "from", "the", "YAML", "file", "manager", ".", "yaml", ".", "Search", "first", "in", "the", "working", "directory", "and", "then", "in", "the", "AbiPy", "configuration", "directory", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L574-L600
[ "def", "from_user_config", "(", "cls", ")", ":", "global", "_USER_CONFIG_TASKMANAGER", "if", "_USER_CONFIG_TASKMANAGER", "is", "not", "None", ":", "return", "_USER_CONFIG_TASKMANAGER", "# Try in the current directory then in user configuration directory.", "path", "=", "os", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.from_file
Read the configuration parameters from the Yaml file filename.
pymatgen/io/abinit/tasks.py
def from_file(cls, filename): """Read the configuration parameters from the Yaml file filename.""" try: with open(filename, "r") as fh: return cls.from_dict(yaml.safe_load(fh)) except Exception as exc: print("Error while reading TaskManager parameters from...
def from_file(cls, filename): """Read the configuration parameters from the Yaml file filename.""" try: with open(filename, "r") as fh: return cls.from_dict(yaml.safe_load(fh)) except Exception as exc: print("Error while reading TaskManager parameters from...
[ "Read", "the", "configuration", "parameters", "from", "the", "Yaml", "file", "filename", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L603-L610
[ "def", "from_file", "(", "cls", ",", "filename", ")", ":", "try", ":", "with", "open", "(", "filename", ",", "\"r\"", ")", "as", "fh", ":", "return", "cls", ".", "from_dict", "(", "yaml", ".", "safe_load", "(", "fh", ")", ")", "except", "Exception", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.as_manager
Convert obj into TaskManager instance. Accepts string, filepath, dictionary, `TaskManager` object. If obj is None, the manager is initialized from the user config file.
pymatgen/io/abinit/tasks.py
def as_manager(cls, obj): """ Convert obj into TaskManager instance. Accepts string, filepath, dictionary, `TaskManager` object. If obj is None, the manager is initialized from the user config file. """ if isinstance(obj, cls): return obj if obj is None: return cls.from_u...
def as_manager(cls, obj): """ Convert obj into TaskManager instance. Accepts string, filepath, dictionary, `TaskManager` object. If obj is None, the manager is initialized from the user config file. """ if isinstance(obj, cls): return obj if obj is None: return cls.from_u...
[ "Convert", "obj", "into", "TaskManager", "instance", ".", "Accepts", "string", "filepath", "dictionary", "TaskManager", "object", ".", "If", "obj", "is", "None", "the", "manager", "is", "initialized", "from", "the", "user", "config", "file", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L618-L635
[ "def", "as_manager", "(", "cls", ",", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "cls", ")", ":", "return", "obj", "if", "obj", "is", "None", ":", "return", "cls", ".", "from_user_config", "(", ")", "if", "is_string", "(", "obj", ")", ":...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.from_dict
Create an instance from a dictionary.
pymatgen/io/abinit/tasks.py
def from_dict(cls, d): """Create an instance from a dictionary.""" return cls(**{k: v for k, v in d.items() if k in cls.ENTRIES})
def from_dict(cls, d): """Create an instance from a dictionary.""" return cls(**{k: v for k, v in d.items() if k in cls.ENTRIES})
[ "Create", "an", "instance", "from", "a", "dictionary", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L638-L640
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "return", "cls", "(", "*", "*", "{", "k", ":", "v", "for", "k", ",", "v", "in", "d", ".", "items", "(", ")", "if", "k", "in", "cls", ".", "ENTRIES", "}", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.to_shell_manager
Returns a new `TaskManager` with the same parameters as self but replace the :class:`QueueAdapter` with a :class:`ShellAdapter` with mpi_procs so that we can submit the job without passing through the queue.
pymatgen/io/abinit/tasks.py
def to_shell_manager(self, mpi_procs=1): """ Returns a new `TaskManager` with the same parameters as self but replace the :class:`QueueAdapter` with a :class:`ShellAdapter` with mpi_procs so that we can submit the job without passing through the queue. """ my_kwargs = copy.deepco...
def to_shell_manager(self, mpi_procs=1): """ Returns a new `TaskManager` with the same parameters as self but replace the :class:`QueueAdapter` with a :class:`ShellAdapter` with mpi_procs so that we can submit the job without passing through the queue. """ my_kwargs = copy.deepco...
[ "Returns", "a", "new", "TaskManager", "with", "the", "same", "parameters", "as", "self", "but", "replace", "the", ":", "class", ":", "QueueAdapter", "with", "a", ":", "class", ":", "ShellAdapter", "with", "mpi_procs", "so", "that", "we", "can", "submit", "...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L698-L741
[ "def", "to_shell_manager", "(", "self", ",", "mpi_procs", "=", "1", ")", ":", "my_kwargs", "=", "copy", ".", "deepcopy", "(", "self", ".", "_kwargs", ")", "my_kwargs", "[", "\"policy\"", "]", "=", "TaskPolicy", "(", "autoparal", "=", "0", ")", "# On Blue...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.new_with_fixed_mpi_omp
Return a new `TaskManager` in which autoparal has been disabled. The jobs will be executed with `mpi_procs` MPI processes and `omp_threads` OpenMP threads. Useful for generating input files for benchmarks.
pymatgen/io/abinit/tasks.py
def new_with_fixed_mpi_omp(self, mpi_procs, omp_threads): """ Return a new `TaskManager` in which autoparal has been disabled. The jobs will be executed with `mpi_procs` MPI processes and `omp_threads` OpenMP threads. Useful for generating input files for benchmarks. """ ...
def new_with_fixed_mpi_omp(self, mpi_procs, omp_threads): """ Return a new `TaskManager` in which autoparal has been disabled. The jobs will be executed with `mpi_procs` MPI processes and `omp_threads` OpenMP threads. Useful for generating input files for benchmarks. """ ...
[ "Return", "a", "new", "TaskManager", "in", "which", "autoparal", "has", "been", "disabled", ".", "The", "jobs", "will", "be", "executed", "with", "mpi_procs", "MPI", "processes", "and", "omp_threads", "OpenMP", "threads", ".", "Useful", "for", "generating", "i...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L743-L753
[ "def", "new_with_fixed_mpi_omp", "(", "self", ",", "mpi_procs", ",", "omp_threads", ")", ":", "new", "=", "self", ".", "deepcopy", "(", ")", "new", ".", "policy", ".", "autoparal", "=", "0", "new", ".", "set_mpi_procs", "(", "mpi_procs", ")", "new", ".",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.select_qadapter
Given a list of parallel configurations, pconfs, this method select an `optimal` configuration according to some criterion as well as the :class:`QueueAdapter` to use. Args: pconfs: :class:`ParalHints` object with the list of parallel configurations Returns: :class:`Par...
pymatgen/io/abinit/tasks.py
def select_qadapter(self, pconfs): """ Given a list of parallel configurations, pconfs, this method select an `optimal` configuration according to some criterion as well as the :class:`QueueAdapter` to use. Args: pconfs: :class:`ParalHints` object with the list of parallel c...
def select_qadapter(self, pconfs): """ Given a list of parallel configurations, pconfs, this method select an `optimal` configuration according to some criterion as well as the :class:`QueueAdapter` to use. Args: pconfs: :class:`ParalHints` object with the list of parallel c...
[ "Given", "a", "list", "of", "parallel", "configurations", "pconfs", "this", "method", "select", "an", "optimal", "configuration", "according", "to", "some", "criterion", "as", "well", "as", "the", ":", "class", ":", "QueueAdapter", "to", "use", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L770-L817
[ "def", "select_qadapter", "(", "self", ",", "pconfs", ")", ":", "# Order the list of configurations according to policy.", "policy", ",", "max_ncpus", "=", "self", ".", "policy", ",", "self", ".", "max_cores", "pconfs", "=", "pconfs", ".", "get_ordered_with_policy", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager._use_qadpos_pconf
This function is called when we have accepted the :class:`ParalConf` pconf. Returns pconf
pymatgen/io/abinit/tasks.py
def _use_qadpos_pconf(self, qadpos, pconf): """ This function is called when we have accepted the :class:`ParalConf` pconf. Returns pconf """ self._qadpos = qadpos # Change the number of MPI/OMP cores. self.set_mpi_procs(pconf.mpi_procs) if self.has_omp: ...
def _use_qadpos_pconf(self, qadpos, pconf): """ This function is called when we have accepted the :class:`ParalConf` pconf. Returns pconf """ self._qadpos = qadpos # Change the number of MPI/OMP cores. self.set_mpi_procs(pconf.mpi_procs) if self.has_omp: ...
[ "This", "function", "is", "called", "when", "we", "have", "accepted", "the", ":", "class", ":", "ParalConf", "pconf", ".", "Returns", "pconf" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L819-L833
[ "def", "_use_qadpos_pconf", "(", "self", ",", "qadpos", ",", "pconf", ")", ":", "self", ".", "_qadpos", "=", "qadpos", "# Change the number of MPI/OMP cores.", "self", ".", "set_mpi_procs", "(", "pconf", ".", "mpi_procs", ")", "if", "self", ".", "has_omp", ":"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.write_jobfile
Write the submission script. Return the path of the script ================ ============================================ kwargs Meaning ================ ============================================ exec_args List of arguments passed to task.executable. ...
pymatgen/io/abinit/tasks.py
def write_jobfile(self, task, **kwargs): """ Write the submission script. Return the path of the script ================ ============================================ kwargs Meaning ================ ============================================ exec_args ...
def write_jobfile(self, task, **kwargs): """ Write the submission script. Return the path of the script ================ ============================================ kwargs Meaning ================ ============================================ exec_args ...
[ "Write", "the", "submission", "script", ".", "Return", "the", "path", "of", "the", "script" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L919-L947
[ "def", "write_jobfile", "(", "self", ",", "task", ",", "*", "*", "kwargs", ")", ":", "script", "=", "self", ".", "qadapter", ".", "get_script_str", "(", "job_name", "=", "task", ".", "name", ",", "launch_dir", "=", "task", ".", "workdir", ",", "executa...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskManager.launch
Build the input files and submit the task via the :class:`Qadapter` Args: task: :class:`TaskObject` Returns: Process object.
pymatgen/io/abinit/tasks.py
def launch(self, task, **kwargs): """ Build the input files and submit the task via the :class:`Qadapter` Args: task: :class:`TaskObject` Returns: Process object. """ if task.status == task.S_LOCKED: raise ValueError("You shall not su...
def launch(self, task, **kwargs): """ Build the input files and submit the task via the :class:`Qadapter` Args: task: :class:`TaskObject` Returns: Process object. """ if task.status == task.S_LOCKED: raise ValueError("You shall not su...
[ "Build", "the", "input", "files", "and", "submit", "the", "task", "via", "the", ":", "class", ":", "Qadapter" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L949-L990
[ "def", "launch", "(", "self", ",", "task", ",", "*", "*", "kwargs", ")", ":", "if", "task", ".", "status", "==", "task", ".", "S_LOCKED", ":", "raise", "ValueError", "(", "\"You shall not submit a locked task!\"", ")", "# Build the task", "task", ".", "build...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitBuild.compare_version
Compare Abinit version to `version_string` with operator `op`
pymatgen/io/abinit/tasks.py
def compare_version(self, version_string, op): """Compare Abinit version to `version_string` with operator `op`""" from pkg_resources import parse_version from monty.operator import operator_from_str op = operator_from_str(op) return op(parse_version(self.version), parse_version(...
def compare_version(self, version_string, op): """Compare Abinit version to `version_string` with operator `op`""" from pkg_resources import parse_version from monty.operator import operator_from_str op = operator_from_str(op) return op(parse_version(self.version), parse_version(...
[ "Compare", "Abinit", "version", "to", "version_string", "with", "operator", "op" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1186-L1191
[ "def", "compare_version", "(", "self", ",", "version_string", ",", "op", ")", ":", "from", "pkg_resources", "import", "parse_version", "from", "monty", ".", "operator", "import", "operator_from_str", "op", "=", "operator_from_str", "(", "op", ")", "return", "op"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
MyTimedelta.as_timedelta
Convert delta into a MyTimedelta object.
pymatgen/io/abinit/tasks.py
def as_timedelta(cls, delta): """Convert delta into a MyTimedelta object.""" # Cannot monkey patch the __class__ and must pass through __new__ as the object is immutable. if isinstance(delta, cls): return delta return cls(delta.days, delta.seconds, delta.microseconds)
def as_timedelta(cls, delta): """Convert delta into a MyTimedelta object.""" # Cannot monkey patch the __class__ and must pass through __new__ as the object is immutable. if isinstance(delta, cls): return delta return cls(delta.days, delta.seconds, delta.microseconds)
[ "Convert", "delta", "into", "a", "MyTimedelta", "object", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1230-L1234
[ "def", "as_timedelta", "(", "cls", ",", "delta", ")", ":", "# Cannot monkey patch the __class__ and must pass through __new__ as the object is immutable.", "if", "isinstance", "(", "delta", ",", "cls", ")", ":", "return", "delta", "return", "cls", "(", "delta", ".", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskDateTimes.get_runtime
:class:`timedelta` with the run-time, None if the Task is not running
pymatgen/io/abinit/tasks.py
def get_runtime(self): """:class:`timedelta` with the run-time, None if the Task is not running""" if self.start is None: return None if self.end is None: delta = datetime.datetime.now() - self.start else: delta = self.end - self.start return MyTimedelta...
def get_runtime(self): """:class:`timedelta` with the run-time, None if the Task is not running""" if self.start is None: return None if self.end is None: delta = datetime.datetime.now() - self.start else: delta = self.end - self.start return MyTimedelta...
[ ":", "class", ":", "timedelta", "with", "the", "run", "-", "time", "None", "if", "the", "Task", "is", "not", "running" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1267-L1276
[ "def", "get_runtime", "(", "self", ")", ":", "if", "self", ".", "start", "is", "None", ":", "return", "None", "if", "self", ".", "end", "is", "None", ":", "delta", "=", "datetime", ".", "datetime", ".", "now", "(", ")", "-", "self", ".", "start", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
TaskDateTimes.get_time_inqueue
:class:`timedelta` with the time spent in the Queue, None if the Task is not running .. note: This value is always greater than the real value computed by the resource manager as we start to count only when check_status sets the `Task` status to S_RUN.
pymatgen/io/abinit/tasks.py
def get_time_inqueue(self): """ :class:`timedelta` with the time spent in the Queue, None if the Task is not running .. note: This value is always greater than the real value computed by the resource manager as we start to count only when check_status sets the `Task` st...
def get_time_inqueue(self): """ :class:`timedelta` with the time spent in the Queue, None if the Task is not running .. note: This value is always greater than the real value computed by the resource manager as we start to count only when check_status sets the `Task` st...
[ ":", "class", ":", "timedelta", "with", "the", "time", "spent", "in", "the", "Queue", "None", "if", "the", "Task", "is", "not", "running" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1278-L1296
[ "def", "get_time_inqueue", "(", "self", ")", ":", "if", "self", ".", "submission", "is", "None", ":", "return", "None", "if", "self", ".", "start", "is", "None", ":", "delta", "=", "datetime", ".", "datetime", ".", "now", "(", ")", "-", "self", ".", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.set_workdir
Set the working directory. Cannot be set more than once unless chroot is True
pymatgen/io/abinit/tasks.py
def set_workdir(self, workdir, chroot=False): """Set the working directory. Cannot be set more than once unless chroot is True""" if not chroot and hasattr(self, "workdir") and self.workdir != workdir: raise ValueError("self.workdir != workdir: %s, %s" % (self.workdir, workdir)) se...
def set_workdir(self, workdir, chroot=False): """Set the working directory. Cannot be set more than once unless chroot is True""" if not chroot and hasattr(self, "workdir") and self.workdir != workdir: raise ValueError("self.workdir != workdir: %s, %s" % (self.workdir, workdir)) se...
[ "Set", "the", "working", "directory", ".", "Cannot", "be", "set", "more", "than", "once", "unless", "chroot", "is", "True" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1378-L1404
[ "def", "set_workdir", "(", "self", ",", "workdir", ",", "chroot", "=", "False", ")", ":", "if", "not", "chroot", "and", "hasattr", "(", "self", ",", "\"workdir\"", ")", "and", "self", ".", "workdir", "!=", "workdir", ":", "raise", "ValueError", "(", "\...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.set_work
Set the :class:`Work` associated to this `Task`.
pymatgen/io/abinit/tasks.py
def set_work(self, work): """Set the :class:`Work` associated to this `Task`.""" if not hasattr(self, "_work"): self._work = work else: if self._work != work: raise ValueError("self._work != work")
def set_work(self, work): """Set the :class:`Work` associated to this `Task`.""" if not hasattr(self, "_work"): self._work = work else: if self._work != work: raise ValueError("self._work != work")
[ "Set", "the", ":", "class", ":", "Work", "associated", "to", "this", "Task", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1415-L1421
[ "def", "set_work", "(", "self", ",", "work", ")", ":", "if", "not", "hasattr", "(", "self", ",", "\"_work\"", ")", ":", "self", ".", "_work", "=", "work", "else", ":", "if", "self", ".", "_work", "!=", "work", ":", "raise", "ValueError", "(", "\"se...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.pos
The position of the task in the :class:`Flow`
pymatgen/io/abinit/tasks.py
def pos(self): """The position of the task in the :class:`Flow`""" for i, task in enumerate(self.work): if self == task: return self.work.pos, i raise ValueError("Cannot find the position of %s in flow %s" % (self, self.flow))
def pos(self): """The position of the task in the :class:`Flow`""" for i, task in enumerate(self.work): if self == task: return self.work.pos, i raise ValueError("Cannot find the position of %s in flow %s" % (self, self.flow))
[ "The", "position", "of", "the", "task", "in", "the", ":", "class", ":", "Flow" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1429-L1434
[ "def", "pos", "(", "self", ")", ":", "for", "i", ",", "task", "in", "enumerate", "(", "self", ".", "work", ")", ":", "if", "self", "==", "task", ":", "return", "self", ".", "work", ".", "pos", ",", "i", "raise", "ValueError", "(", "\"Cannot find th...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.set_vars
Set the values of the ABINIT variables in the input file. Return dict with old values.
pymatgen/io/abinit/tasks.py
def set_vars(self, *args, **kwargs): """ Set the values of the ABINIT variables in the input file. Return dict with old values. """ kwargs.update(dict(*args)) old_values = {vname: self.input.get(vname) for vname in kwargs} self.input.set_vars(**kwargs) if kwargs o...
def set_vars(self, *args, **kwargs): """ Set the values of the ABINIT variables in the input file. Return dict with old values. """ kwargs.update(dict(*args)) old_values = {vname: self.input.get(vname) for vname in kwargs} self.input.set_vars(**kwargs) if kwargs o...
[ "Set", "the", "values", "of", "the", "ABINIT", "variables", "in", "the", "input", "file", ".", "Return", "dict", "with", "old", "values", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1458-L1469
[ "def", "set_vars", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "kwargs", ".", "update", "(", "dict", "(", "*", "args", ")", ")", "old_values", "=", "{", "vname", ":", "self", ".", "input", ".", "get", "(", "vname", ")", "f...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.make_input
Construct the input file of the calculation.
pymatgen/io/abinit/tasks.py
def make_input(self, with_header=False): """Construct the input file of the calculation.""" s = str(self.input) if with_header: s = str(self) + "\n" + s return s
def make_input(self, with_header=False): """Construct the input file of the calculation.""" s = str(self.input) if with_header: s = str(self) + "\n" + s return s
[ "Construct", "the", "input", "file", "of", "the", "calculation", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1476-L1480
[ "def", "make_input", "(", "self", ",", "with_header", "=", "False", ")", ":", "s", "=", "str", "(", "self", ".", "input", ")", "if", "with_header", ":", "s", "=", "str", "(", "self", ")", "+", "\"\\n\"", "+", "s", "return", "s" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.ipath_from_ext
Returns the path of the input file with extension ext. Use it when the file does not exist yet.
pymatgen/io/abinit/tasks.py
def ipath_from_ext(self, ext): """ Returns the path of the input file with extension ext. Use it when the file does not exist yet. """ return os.path.join(self.workdir, self.prefix.idata + "_" + ext)
def ipath_from_ext(self, ext): """ Returns the path of the input file with extension ext. Use it when the file does not exist yet. """ return os.path.join(self.workdir, self.prefix.idata + "_" + ext)
[ "Returns", "the", "path", "of", "the", "input", "file", "with", "extension", "ext", ".", "Use", "it", "when", "the", "file", "does", "not", "exist", "yet", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1482-L1487
[ "def", "ipath_from_ext", "(", "self", ",", "ext", ")", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "workdir", ",", "self", ".", "prefix", ".", "idata", "+", "\"_\"", "+", "ext", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.opath_from_ext
Returns the path of the output file with extension ext. Use it when the file does not exist yet.
pymatgen/io/abinit/tasks.py
def opath_from_ext(self, ext): """ Returns the path of the output file with extension ext. Use it when the file does not exist yet. """ return os.path.join(self.workdir, self.prefix.odata + "_" + ext)
def opath_from_ext(self, ext): """ Returns the path of the output file with extension ext. Use it when the file does not exist yet. """ return os.path.join(self.workdir, self.prefix.odata + "_" + ext)
[ "Returns", "the", "path", "of", "the", "output", "file", "with", "extension", "ext", ".", "Use", "it", "when", "the", "file", "does", "not", "exist", "yet", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1489-L1494
[ "def", "opath_from_ext", "(", "self", ",", "ext", ")", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "workdir", ",", "self", ".", "prefix", ".", "odata", "+", "\"_\"", "+", "ext", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.can_run
The task can run if its status is < S_SUB and all the other dependencies (if any) are done!
pymatgen/io/abinit/tasks.py
def can_run(self): """The task can run if its status is < S_SUB and all the other dependencies (if any) are done!""" all_ok = all(stat == self.S_OK for stat in self.deps_status) return self.status < self.S_SUB and self.status != self.S_LOCKED and all_ok
def can_run(self): """The task can run if its status is < S_SUB and all the other dependencies (if any) are done!""" all_ok = all(stat == self.S_OK for stat in self.deps_status) return self.status < self.S_SUB and self.status != self.S_LOCKED and all_ok
[ "The", "task", "can", "run", "if", "its", "status", "is", "<", "S_SUB", "and", "all", "the", "other", "dependencies", "(", "if", "any", ")", "are", "done!" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1536-L1539
[ "def", "can_run", "(", "self", ")", ":", "all_ok", "=", "all", "(", "stat", "==", "self", ".", "S_OK", "for", "stat", "in", "self", ".", "deps_status", ")", "return", "self", ".", "status", "<", "self", ".", "S_SUB", "and", "self", ".", "status", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.cancel
Cancel the job. Returns 1 if job was cancelled.
pymatgen/io/abinit/tasks.py
def cancel(self): """Cancel the job. Returns 1 if job was cancelled.""" if self.queue_id is None: return 0 if self.status >= self.S_DONE: return 0 exit_status = self.manager.cancel(self.queue_id) if exit_status != 0: logger.warning("manager.cancel returned exit_statu...
def cancel(self): """Cancel the job. Returns 1 if job was cancelled.""" if self.queue_id is None: return 0 if self.status >= self.S_DONE: return 0 exit_status = self.manager.cancel(self.queue_id) if exit_status != 0: logger.warning("manager.cancel returned exit_statu...
[ "Cancel", "the", "job", ".", "Returns", "1", "if", "job", "was", "cancelled", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1542-L1555
[ "def", "cancel", "(", "self", ")", ":", "if", "self", ".", "queue_id", "is", "None", ":", "return", "0", "if", "self", ".", "status", ">=", "self", ".", "S_DONE", ":", "return", "0", "exit_status", "=", "self", ".", "manager", ".", "cancel", "(", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.with_fixed_mpi_omp
Disable autoparal and force execution with `mpi_procs` MPI processes and `omp_threads` OpenMP threads. Useful for generating benchmarks.
pymatgen/io/abinit/tasks.py
def with_fixed_mpi_omp(self, mpi_procs, omp_threads): """ Disable autoparal and force execution with `mpi_procs` MPI processes and `omp_threads` OpenMP threads. Useful for generating benchmarks. """ manager = self.manager if hasattr(self, "manager") else self.flow.manager ...
def with_fixed_mpi_omp(self, mpi_procs, omp_threads): """ Disable autoparal and force execution with `mpi_procs` MPI processes and `omp_threads` OpenMP threads. Useful for generating benchmarks. """ manager = self.manager if hasattr(self, "manager") else self.flow.manager ...
[ "Disable", "autoparal", "and", "force", "execution", "with", "mpi_procs", "MPI", "processes", "and", "omp_threads", "OpenMP", "threads", ".", "Useful", "for", "generating", "benchmarks", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1557-L1563
[ "def", "with_fixed_mpi_omp", "(", "self", ",", "mpi_procs", ",", "omp_threads", ")", ":", "manager", "=", "self", ".", "manager", "if", "hasattr", "(", "self", ",", "\"manager\"", ")", "else", "self", ".", "flow", ".", "manager", "self", ".", "manager", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.fix_ofiles
This method is called when the task reaches S_OK. It changes the extension of particular output files produced by Abinit so that the 'official' extension is preserved e.g. out_1WF14 --> out_1WF
pymatgen/io/abinit/tasks.py
def fix_ofiles(self): """ This method is called when the task reaches S_OK. It changes the extension of particular output files produced by Abinit so that the 'official' extension is preserved e.g. out_1WF14 --> out_1WF """ filepaths = self.outdir.list_filepaths()...
def fix_ofiles(self): """ This method is called when the task reaches S_OK. It changes the extension of particular output files produced by Abinit so that the 'official' extension is preserved e.g. out_1WF14 --> out_1WF """ filepaths = self.outdir.list_filepaths()...
[ "This", "method", "is", "called", "when", "the", "task", "reaches", "S_OK", ".", "It", "changes", "the", "extension", "of", "particular", "output", "files", "produced", "by", "Abinit", "so", "that", "the", "official", "extension", "is", "preserved", "e", "."...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1603-L1617
[ "def", "fix_ofiles", "(", "self", ")", ":", "filepaths", "=", "self", ".", "outdir", ".", "list_filepaths", "(", ")", "#logger.info(\"in fix_ofiles with filepaths %s\" % list(filepaths))", "old2new", "=", "FilepathFixer", "(", ")", ".", "fix_paths", "(", "filepaths", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task._restart
Called by restart once we have finished preparing the task for restarting. Return: True if task has been restarted
pymatgen/io/abinit/tasks.py
def _restart(self, submit=True): """ Called by restart once we have finished preparing the task for restarting. Return: True if task has been restarted """ self.set_status(self.S_READY, msg="Restarted on %s" % time.asctime()) # Increase the counter. ...
def _restart(self, submit=True): """ Called by restart once we have finished preparing the task for restarting. Return: True if task has been restarted """ self.set_status(self.S_READY, msg="Restarted on %s" % time.asctime()) # Increase the counter. ...
[ "Called", "by", "restart", "once", "we", "have", "finished", "preparing", "the", "task", "for", "restarting", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1620-L1646
[ "def", "_restart", "(", "self", ",", "submit", "=", "True", ")", ":", "self", ".", "set_status", "(", "self", ".", "S_READY", ",", "msg", "=", "\"Restarted on %s\"", "%", "time", ".", "asctime", "(", ")", ")", "# Increase the counter.", "self", ".", "num...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.poll
Check if child process has terminated. Set and return returncode attribute.
pymatgen/io/abinit/tasks.py
def poll(self): """Check if child process has terminated. Set and return returncode attribute.""" self._returncode = self.process.poll() if self._returncode is not None: self.set_status(self.S_DONE, "status set to Done") return self._returncode
def poll(self): """Check if child process has terminated. Set and return returncode attribute.""" self._returncode = self.process.poll() if self._returncode is not None: self.set_status(self.S_DONE, "status set to Done") return self._returncode
[ "Check", "if", "child", "process", "has", "terminated", ".", "Set", "and", "return", "returncode", "attribute", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1661-L1668
[ "def", "poll", "(", "self", ")", ":", "self", ".", "_returncode", "=", "self", ".", "process", ".", "poll", "(", ")", "if", "self", ".", "_returncode", "is", "not", "None", ":", "self", ".", "set_status", "(", "self", ".", "S_DONE", ",", "\"status se...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.wait
Wait for child process to terminate. Set and return returncode attribute.
pymatgen/io/abinit/tasks.py
def wait(self): """Wait for child process to terminate. Set and return returncode attribute.""" self._returncode = self.process.wait() try: self.process.stderr.close() except: pass self.set_status(self.S_DONE, "status set to Done") return self._re...
def wait(self): """Wait for child process to terminate. Set and return returncode attribute.""" self._returncode = self.process.wait() try: self.process.stderr.close() except: pass self.set_status(self.S_DONE, "status set to Done") return self._re...
[ "Wait", "for", "child", "process", "to", "terminate", ".", "Set", "and", "return", "returncode", "attribute", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1670-L1679
[ "def", "wait", "(", "self", ")", ":", "self", ".", "_returncode", "=", "self", ".", "process", ".", "wait", "(", ")", "try", ":", "self", ".", "process", ".", "stderr", ".", "close", "(", ")", "except", ":", "pass", "self", ".", "set_status", "(", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.communicate
Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be sent to the child. communicate() returns a tupl...
pymatgen/io/abinit/tasks.py
def communicate(self, input=None): """ Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be s...
def communicate(self, input=None): """ Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional input argument should be a string to be sent to the child process, or None, if no data should be s...
[ "Interact", "with", "process", ":", "Send", "data", "to", "stdin", ".", "Read", "data", "from", "stdout", "and", "stderr", "until", "end", "-", "of", "-", "file", "is", "reached", ".", "Wait", "for", "process", "to", "terminate", ".", "The", "optional", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1681-L1693
[ "def", "communicate", "(", "self", ",", "input", "=", "None", ")", ":", "stdoutdata", ",", "stderrdata", "=", "self", ".", "process", ".", "communicate", "(", "input", "=", "input", ")", "self", ".", "_returncode", "=", "self", ".", "process", ".", "re...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.kill
Kill the child.
pymatgen/io/abinit/tasks.py
def kill(self): """Kill the child.""" self.process.kill() self.set_status(self.S_ERROR, "status set to Error by task.kill") self._returncode = self.process.returncode
def kill(self): """Kill the child.""" self.process.kill() self.set_status(self.S_ERROR, "status set to Error by task.kill") self._returncode = self.process.returncode
[ "Kill", "the", "child", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1695-L1699
[ "def", "kill", "(", "self", ")", ":", "self", ".", "process", ".", "kill", "(", ")", "self", ".", "set_status", "(", "self", ".", "S_ERROR", ",", "\"status set to Error by task.kill\"", ")", "self", ".", "_returncode", "=", "self", ".", "process", ".", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.reset
Reset the task status. Mainly used if we made a silly mistake in the initial setup of the queue manager and we want to fix it and rerun the task. Returns: 0 on success, 1 if reset failed.
pymatgen/io/abinit/tasks.py
def reset(self): """ Reset the task status. Mainly used if we made a silly mistake in the initial setup of the queue manager and we want to fix it and rerun the task. Returns: 0 on success, 1 if reset failed. """ # Can only reset tasks that are done. ...
def reset(self): """ Reset the task status. Mainly used if we made a silly mistake in the initial setup of the queue manager and we want to fix it and rerun the task. Returns: 0 on success, 1 if reset failed. """ # Can only reset tasks that are done. ...
[ "Reset", "the", "task", "status", ".", "Mainly", "used", "if", "we", "made", "a", "silly", "mistake", "in", "the", "initial", "setup", "of", "the", "queue", "manager", "and", "we", "want", "to", "fix", "it", "and", "rerun", "the", "task", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1713-L1744
[ "def", "reset", "(", "self", ")", ":", "# Can only reset tasks that are done.", "# One should be able to reset 'Submitted' tasks (sometimes, they are not in the queue", "# and we want to restart them)", "#if self.status != self.S_SUB and self.status < self.S_DONE: return 1", "# Remove output fil...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.lock
Lock the task, source is the :class:`Node` that applies the lock.
pymatgen/io/abinit/tasks.py
def lock(self, source_node): """Lock the task, source is the :class:`Node` that applies the lock.""" if self.status != self.S_INIT: raise ValueError("Trying to lock a task with status %s" % self.status) self._status = self.S_LOCKED self.history.info("Locked by node %s", sour...
def lock(self, source_node): """Lock the task, source is the :class:`Node` that applies the lock.""" if self.status != self.S_INIT: raise ValueError("Trying to lock a task with status %s" % self.status) self._status = self.S_LOCKED self.history.info("Locked by node %s", sour...
[ "Lock", "the", "task", "source", "is", "the", ":", "class", ":", "Node", "that", "applies", "the", "lock", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1796-L1802
[ "def", "lock", "(", "self", ",", "source_node", ")", ":", "if", "self", ".", "status", "!=", "self", ".", "S_INIT", ":", "raise", "ValueError", "(", "\"Trying to lock a task with status %s\"", "%", "self", ".", "status", ")", "self", ".", "_status", "=", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.unlock
Unlock the task, set its status to `S_READY` so that the scheduler can submit it. source_node is the :class:`Node` that removed the lock Call task.check_status if check_status is True.
pymatgen/io/abinit/tasks.py
def unlock(self, source_node, check_status=True): """ Unlock the task, set its status to `S_READY` so that the scheduler can submit it. source_node is the :class:`Node` that removed the lock Call task.check_status if check_status is True. """ if self.status != self.S_LOCK...
def unlock(self, source_node, check_status=True): """ Unlock the task, set its status to `S_READY` so that the scheduler can submit it. source_node is the :class:`Node` that removed the lock Call task.check_status if check_status is True. """ if self.status != self.S_LOCK...
[ "Unlock", "the", "task", "set", "its", "status", "to", "S_READY", "so", "that", "the", "scheduler", "can", "submit", "it", ".", "source_node", "is", "the", ":", "class", ":", "Node", "that", "removed", "the", "lock", "Call", "task", ".", "check_status", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1804-L1815
[ "def", "unlock", "(", "self", ",", "source_node", ",", "check_status", "=", "True", ")", ":", "if", "self", ".", "status", "!=", "self", ".", "S_LOCKED", ":", "raise", "RuntimeError", "(", "\"Trying to unlock a task with status %s\"", "%", "self", ".", "status...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.set_status
Set and return the status of the task. Args: status: Status object or string representation of the status msg: string with human-readable message used in the case of errors.
pymatgen/io/abinit/tasks.py
def set_status(self, status, msg): """ Set and return the status of the task. Args: status: Status object or string representation of the status msg: string with human-readable message used in the case of errors. """ # truncate string if it's long. msg wi...
def set_status(self, status, msg): """ Set and return the status of the task. Args: status: Status object or string representation of the status msg: string with human-readable message used in the case of errors. """ # truncate string if it's long. msg wi...
[ "Set", "and", "return", "the", "status", "of", "the", "task", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1818-L1888
[ "def", "set_status", "(", "self", ",", "status", ",", "msg", ")", ":", "# truncate string if it's long. msg will be logged in the object and we don't want to waste memory.", "if", "len", "(", "msg", ")", ">", "2000", ":", "msg", "=", "msg", "[", ":", "2000", "]", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.check_status
This function checks the status of the task by inspecting the output and the error files produced by the application and by the queue manager.
pymatgen/io/abinit/tasks.py
def check_status(self): """ This function checks the status of the task by inspecting the output and the error files produced by the application and by the queue manager. """ # 1) see it the job is blocked # 2) see if an error occured at submitting the job the job was sub...
def check_status(self): """ This function checks the status of the task by inspecting the output and the error files produced by the application and by the queue manager. """ # 1) see it the job is blocked # 2) see if an error occured at submitting the job the job was sub...
[ "This", "function", "checks", "the", "status", "of", "the", "task", "by", "inspecting", "the", "output", "and", "the", "error", "files", "produced", "by", "the", "application", "and", "by", "the", "queue", "manager", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L1890-L2052
[ "def", "check_status", "(", "self", ")", ":", "# 1) see it the job is blocked", "# 2) see if an error occured at submitting the job the job was submitted, TODO these problems can be solved", "# 3) see if there is output", "# 4) see if abinit reports problems", "# 5) see if both err files exist a...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.out_to_in
Move an output file to the output data directory of the `Task` and rename the file so that ABINIT will read it as an input data file. Returns: The absolute path of the new file in the indata directory.
pymatgen/io/abinit/tasks.py
def out_to_in(self, out_file): """ Move an output file to the output data directory of the `Task` and rename the file so that ABINIT will read it as an input data file. Returns: The absolute path of the new file in the indata directory. """ in_file = os.path....
def out_to_in(self, out_file): """ Move an output file to the output data directory of the `Task` and rename the file so that ABINIT will read it as an input data file. Returns: The absolute path of the new file in the indata directory. """ in_file = os.path....
[ "Move", "an", "output", "file", "to", "the", "output", "data", "directory", "of", "the", "Task", "and", "rename", "the", "file", "so", "that", "ABINIT", "will", "read", "it", "as", "an", "input", "data", "file", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2070-L2085
[ "def", "out_to_in", "(", "self", ",", "out_file", ")", ":", "in_file", "=", "os", ".", "path", ".", "basename", "(", "out_file", ")", ".", "replace", "(", "\"out\"", ",", "\"in\"", ",", "1", ")", "dest", "=", "os", ".", "path", ".", "join", "(", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.inlink_file
Create a symbolic link to the specified file in the directory containing the input files of the task.
pymatgen/io/abinit/tasks.py
def inlink_file(self, filepath): """ Create a symbolic link to the specified file in the directory containing the input files of the task. """ if not os.path.exists(filepath): logger.debug("Creating symbolic link to not existent file %s" % filepath) # Extract...
def inlink_file(self, filepath): """ Create a symbolic link to the specified file in the directory containing the input files of the task. """ if not os.path.exists(filepath): logger.debug("Creating symbolic link to not existent file %s" % filepath) # Extract...
[ "Create", "a", "symbolic", "link", "to", "the", "specified", "file", "in", "the", "directory", "containing", "the", "input", "files", "of", "the", "task", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2087-L2109
[ "def", "inlink_file", "(", "self", ",", "filepath", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "filepath", ")", ":", "logger", ".", "debug", "(", "\"Creating symbolic link to not existent file %s\"", "%", "filepath", ")", "# Extract the Abinit...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.make_links
Create symbolic links to the output files produced by the other tasks. .. warning:: This method should be called only when the calculation is READY because it uses a heuristic approach to find the file to link.
pymatgen/io/abinit/tasks.py
def make_links(self): """ Create symbolic links to the output files produced by the other tasks. .. warning:: This method should be called only when the calculation is READY because it uses a heuristic approach to find the file to link. """ for dep in se...
def make_links(self): """ Create symbolic links to the output files produced by the other tasks. .. warning:: This method should be called only when the calculation is READY because it uses a heuristic approach to find the file to link. """ for dep in se...
[ "Create", "symbolic", "links", "to", "the", "output", "files", "produced", "by", "the", "other", "tasks", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2111-L2149
[ "def", "make_links", "(", "self", ")", ":", "for", "dep", "in", "self", ".", "deps", ":", "filepaths", ",", "exts", "=", "dep", ".", "get_filepaths_and_exts", "(", ")", "for", "path", ",", "ext", "in", "zip", "(", "filepaths", ",", "exts", ")", ":", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.get_event_report
Analyzes the main logfile of the calculation for possible Errors or Warnings. If the ABINIT abort file is found, the error found in this file are added to the output report. Args: source: "output" for the main output file,"log" for the log file. Returns: :class:...
pymatgen/io/abinit/tasks.py
def get_event_report(self, source="log"): """ Analyzes the main logfile of the calculation for possible Errors or Warnings. If the ABINIT abort file is found, the error found in this file are added to the output report. Args: source: "output" for the main output file...
def get_event_report(self, source="log"): """ Analyzes the main logfile of the calculation for possible Errors or Warnings. If the ABINIT abort file is found, the error found in this file are added to the output report. Args: source: "output" for the main output file...
[ "Analyzes", "the", "main", "logfile", "of", "the", "calculation", "for", "possible", "Errors", "or", "Warnings", ".", "If", "the", "ABINIT", "abort", "file", "is", "found", "the", "error", "found", "in", "this", "file", "are", "added", "to", "the", "output...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2163-L2220
[ "def", "get_event_report", "(", "self", ",", "source", "=", "\"log\"", ")", ":", "# By default, we inspect the main log file.", "ofile", "=", "{", "\"output\"", ":", "self", ".", "output_file", ",", "\"log\"", ":", "self", ".", "log_file", "}", "[", "source", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.get_results
Returns :class:`NodeResults` instance. Subclasses should extend this method (if needed) by adding specialized code that performs some kind of post-processing.
pymatgen/io/abinit/tasks.py
def get_results(self, **kwargs): """ Returns :class:`NodeResults` instance. Subclasses should extend this method (if needed) by adding specialized code that performs some kind of post-processing. """ # Check whether the process completed. if self.returncode is Non...
def get_results(self, **kwargs): """ Returns :class:`NodeResults` instance. Subclasses should extend this method (if needed) by adding specialized code that performs some kind of post-processing. """ # Check whether the process completed. if self.returncode is Non...
[ "Returns", ":", "class", ":", "NodeResults", "instance", ".", "Subclasses", "should", "extend", "this", "method", "(", "if", "needed", ")", "by", "adding", "specialized", "code", "that", "performs", "some", "kind", "of", "post", "-", "processing", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2222-L2235
[ "def", "get_results", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# Check whether the process completed.", "if", "self", ".", "returncode", "is", "None", ":", "raise", "self", ".", "Error", "(", "\"return code is None, you should call wait, communicate or poll\"", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.rename
Rename a file located in datadir. src_basename and dest_basename are the basename of the source file and of the destination file, respectively.
pymatgen/io/abinit/tasks.py
def rename(self, src_basename, dest_basename, datadir="outdir"): """ Rename a file located in datadir. src_basename and dest_basename are the basename of the source file and of the destination file, respectively. """ directory = { "indir": self.indir, ...
def rename(self, src_basename, dest_basename, datadir="outdir"): """ Rename a file located in datadir. src_basename and dest_basename are the basename of the source file and of the destination file, respectively. """ directory = { "indir": self.indir, ...
[ "Rename", "a", "file", "located", "in", "datadir", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2267-L2283
[ "def", "rename", "(", "self", ",", "src_basename", ",", "dest_basename", ",", "datadir", "=", "\"outdir\"", ")", ":", "directory", "=", "{", "\"indir\"", ":", "self", ".", "indir", ",", "\"outdir\"", ":", "self", ".", "outdir", ",", "\"tmpdir\"", ":", "s...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.build
Creates the working directory and the input files of the :class:`Task`. It does not overwrite files if they already exist.
pymatgen/io/abinit/tasks.py
def build(self, *args, **kwargs): """ Creates the working directory and the input files of the :class:`Task`. It does not overwrite files if they already exist. """ # Create dirs for input, output and tmp data. self.indir.makedirs() self.outdir.makedirs() ...
def build(self, *args, **kwargs): """ Creates the working directory and the input files of the :class:`Task`. It does not overwrite files if they already exist. """ # Create dirs for input, output and tmp data. self.indir.makedirs() self.outdir.makedirs() ...
[ "Creates", "the", "working", "directory", "and", "the", "input", "files", "of", "the", ":", "class", ":", "Task", ".", "It", "does", "not", "overwrite", "files", "if", "they", "already", "exist", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2286-L2301
[ "def", "build", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Create dirs for input, output and tmp data.", "self", ".", "indir", ".", "makedirs", "(", ")", "self", ".", "outdir", ".", "makedirs", "(", ")", "self", ".", "tmpdir", "...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.remove_files
Remove all the files listed in filenames.
pymatgen/io/abinit/tasks.py
def remove_files(self, *filenames): """Remove all the files listed in filenames.""" filenames = list_strings(filenames) for dirpath, dirnames, fnames in os.walk(self.workdir): for fname in fnames: if fname in filenames: filepath = os.path.join(dir...
def remove_files(self, *filenames): """Remove all the files listed in filenames.""" filenames = list_strings(filenames) for dirpath, dirnames, fnames in os.walk(self.workdir): for fname in fnames: if fname in filenames: filepath = os.path.join(dir...
[ "Remove", "all", "the", "files", "listed", "in", "filenames", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2325-L2333
[ "def", "remove_files", "(", "self", ",", "*", "filenames", ")", ":", "filenames", "=", "list_strings", "(", "filenames", ")", "for", "dirpath", ",", "dirnames", ",", "fnames", "in", "os", ".", "walk", "(", "self", ".", "workdir", ")", ":", "for", "fnam...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.clean_output_files
This method is called when the task reaches S_OK. It removes all the output files produced by the task that are not needed by its children as well as the output files produced by its parents if no other node needs them. Args: follow_parents: If true, the output files of the parents ...
pymatgen/io/abinit/tasks.py
def clean_output_files(self, follow_parents=True): """ This method is called when the task reaches S_OK. It removes all the output files produced by the task that are not needed by its children as well as the output files produced by its parents if no other node needs them. Args...
def clean_output_files(self, follow_parents=True): """ This method is called when the task reaches S_OK. It removes all the output files produced by the task that are not needed by its children as well as the output files produced by its parents if no other node needs them. Args...
[ "This", "method", "is", "called", "when", "the", "task", "reaches", "S_OK", ".", "It", "removes", "all", "the", "output", "files", "produced", "by", "the", "task", "that", "are", "not", "needed", "by", "its", "children", "as", "well", "as", "the", "outpu...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2335-L2388
[ "def", "clean_output_files", "(", "self", ",", "follow_parents", "=", "True", ")", ":", "paths", "=", "[", "]", "if", "self", ".", "status", "!=", "self", ".", "S_OK", ":", "logger", ".", "warning", "(", "\"Calling task.clean_output_files on a task whose status ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.start
Starts the calculation by performing the following steps: - build dirs and files - call the _setup method - execute the job file by executing/submitting the job script. Main entry point for the `Launcher`. ============== ===========================================...
pymatgen/io/abinit/tasks.py
def start(self, **kwargs): """ Starts the calculation by performing the following steps: - build dirs and files - call the _setup method - execute the job file by executing/submitting the job script. Main entry point for the `Launcher`. ============...
def start(self, **kwargs): """ Starts the calculation by performing the following steps: - build dirs and files - call the _setup method - execute the job file by executing/submitting the job script. Main entry point for the `Launcher`. ============...
[ "Starts", "the", "calculation", "by", "performing", "the", "following", "steps", ":" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2394-L2475
[ "def", "start", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "status", ">=", "self", ".", "S_SUB", ":", "raise", "self", ".", "Error", "(", "\"Task status: %s\"", "%", "str", "(", "self", ".", "status", ")", ")", "if", "self",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.start_and_wait
Helper method to start the task and wait for completion. Mainly used when we are submitting the task via the shell without passing through a queue manager.
pymatgen/io/abinit/tasks.py
def start_and_wait(self, *args, **kwargs): """ Helper method to start the task and wait for completion. Mainly used when we are submitting the task via the shell without passing through a queue manager. """ self.start(*args, **kwargs) retcode = self.wait() return...
def start_and_wait(self, *args, **kwargs): """ Helper method to start the task and wait for completion. Mainly used when we are submitting the task via the shell without passing through a queue manager. """ self.start(*args, **kwargs) retcode = self.wait() return...
[ "Helper", "method", "to", "start", "the", "task", "and", "wait", "for", "completion", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2477-L2485
[ "def", "start_and_wait", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "start", "(", "*", "args", ",", "*", "*", "kwargs", ")", "retcode", "=", "self", ".", "wait", "(", ")", "return", "retcode" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
Task.get_graphviz
Generate task graph in the DOT language (only parents and children of this task). Args: engine: ['dot', 'neato', 'twopi', 'circo', 'fdp', 'sfdp', 'patchwork', 'osage'] graph_attr: Mapping of (attribute, value) pairs for the graph. node_attr: Mapping of (attribute, value) pai...
pymatgen/io/abinit/tasks.py
def get_graphviz(self, engine="automatic", graph_attr=None, node_attr=None, edge_attr=None): """ Generate task graph in the DOT language (only parents and children of this task). Args: engine: ['dot', 'neato', 'twopi', 'circo', 'fdp', 'sfdp', 'patchwork', 'osage'] graph_...
def get_graphviz(self, engine="automatic", graph_attr=None, node_attr=None, edge_attr=None): """ Generate task graph in the DOT language (only parents and children of this task). Args: engine: ['dot', 'neato', 'twopi', 'circo', 'fdp', 'sfdp', 'patchwork', 'osage'] graph_...
[ "Generate", "task", "graph", "in", "the", "DOT", "language", "(", "only", "parents", "and", "children", "of", "this", "task", ")", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2487-L2580
[ "def", "get_graphviz", "(", "self", ",", "engine", "=", "\"automatic\"", ",", "graph_attr", "=", "None", ",", "node_attr", "=", "None", ",", "edge_attr", "=", "None", ")", ":", "# https://www.graphviz.org/doc/info/", "from", "graphviz", "import", "Digraph", "fg"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.from_input
Create an instance of `AbinitTask` from an ABINIT input. Args: ainput: `AbinitInput` object. workdir: Path to the working directory. manager: :class:`TaskManager` object.
pymatgen/io/abinit/tasks.py
def from_input(cls, input, workdir=None, manager=None): """ Create an instance of `AbinitTask` from an ABINIT input. Args: ainput: `AbinitInput` object. workdir: Path to the working directory. manager: :class:`TaskManager` object. """ return c...
def from_input(cls, input, workdir=None, manager=None): """ Create an instance of `AbinitTask` from an ABINIT input. Args: ainput: `AbinitInput` object. workdir: Path to the working directory. manager: :class:`TaskManager` object. """ return c...
[ "Create", "an", "instance", "of", "AbinitTask", "from", "an", "ABINIT", "input", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2596-L2605
[ "def", "from_input", "(", "cls", ",", "input", ",", "workdir", "=", "None", ",", "manager", "=", "None", ")", ":", "return", "cls", "(", "input", ",", "workdir", "=", "workdir", ",", "manager", "=", "manager", ")" ]
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.temp_shell_task
Build a Task with a temporary workdir. The task is executed via the shell with 1 MPI proc. Mainly used for invoking Abinit to get important parameters needed to prepare the real task. Args: mpi_procs: Number of MPI processes to use.
pymatgen/io/abinit/tasks.py
def temp_shell_task(cls, inp, mpi_procs=1, workdir=None, manager=None): """ Build a Task with a temporary workdir. The task is executed via the shell with 1 MPI proc. Mainly used for invoking Abinit to get important parameters needed to prepare the real task. Args: mpi_procs...
def temp_shell_task(cls, inp, mpi_procs=1, workdir=None, manager=None): """ Build a Task with a temporary workdir. The task is executed via the shell with 1 MPI proc. Mainly used for invoking Abinit to get important parameters needed to prepare the real task. Args: mpi_procs...
[ "Build", "a", "Task", "with", "a", "temporary", "workdir", ".", "The", "task", "is", "executed", "via", "the", "shell", "with", "1", "MPI", "proc", ".", "Mainly", "used", "for", "invoking", "Abinit", "to", "get", "important", "parameters", "needed", "to", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2608-L2624
[ "def", "temp_shell_task", "(", "cls", ",", "inp", ",", "mpi_procs", "=", "1", ",", "workdir", "=", "None", ",", "manager", "=", "None", ")", ":", "# Build a simple manager to run the job in a shell subprocess", "import", "tempfile", "workdir", "=", "tempfile", "."...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.setup
Abinit has the very *bad* habit of changing the file extension by appending the characters in [A,B ..., Z] to the output file, and this breaks a lot of code that relies of the use of a unique file extension. Here we fix this issue by renaming run.abo to run.abo_[number] if the output file "run.abo" alre...
pymatgen/io/abinit/tasks.py
def setup(self): """ Abinit has the very *bad* habit of changing the file extension by appending the characters in [A,B ..., Z] to the output file, and this breaks a lot of code that relies of the use of a unique file extension. Here we fix this issue by renaming run.abo to run.abo_[numb...
def setup(self): """ Abinit has the very *bad* habit of changing the file extension by appending the characters in [A,B ..., Z] to the output file, and this breaks a lot of code that relies of the use of a unique file extension. Here we fix this issue by renaming run.abo to run.abo_[numb...
[ "Abinit", "has", "the", "very", "*", "bad", "*", "habit", "of", "changing", "the", "file", "extension", "by", "appending", "the", "characters", "in", "[", "A", "B", "...", "Z", "]", "to", "the", "output", "file", "and", "this", "breaks", "a", "lot", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2626-L2650
[ "def", "setup", "(", "self", ")", ":", "def", "rename_file", "(", "afile", ")", ":", "\"\"\"Helper function to rename :class:`File` objects. Return string for logging purpose.\"\"\"", "# Find the index of the last file (if any).", "# TODO: Maybe it's better to use run.abo --> run(1).abo"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.cycle_class
Return the subclass of ScfCycle associated to the task or None if no SCF algorithm if associated to the task.
pymatgen/io/abinit/tasks.py
def cycle_class(self): """ Return the subclass of ScfCycle associated to the task or None if no SCF algorithm if associated to the task. """ if isinstance(self, RelaxTask): return abiinspect.Relaxation elif isinstance(self, GsTask): return abiinspe...
def cycle_class(self): """ Return the subclass of ScfCycle associated to the task or None if no SCF algorithm if associated to the task. """ if isinstance(self, RelaxTask): return abiinspect.Relaxation elif isinstance(self, GsTask): return abiinspe...
[ "Return", "the", "subclass", "of", "ScfCycle", "associated", "to", "the", "task", "or", "None", "if", "no", "SCF", "algorithm", "if", "associated", "to", "the", "task", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2686-L2698
[ "def", "cycle_class", "(", "self", ")", ":", "if", "isinstance", "(", "self", ",", "RelaxTask", ")", ":", "return", "abiinspect", ".", "Relaxation", "elif", "isinstance", "(", "self", ",", "GsTask", ")", ":", "return", "abiinspect", ".", "GroundStateScfCycle...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.filesfile_string
String with the list of files and prefixes needed to execute ABINIT.
pymatgen/io/abinit/tasks.py
def filesfile_string(self): """String with the list of files and prefixes needed to execute ABINIT.""" lines = [] app = lines.append pj = os.path.join app(self.input_file.path) # Path to the input file app(self.output_file.path) # Path to t...
def filesfile_string(self): """String with the list of files and prefixes needed to execute ABINIT.""" lines = [] app = lines.append pj = os.path.join app(self.input_file.path) # Path to the input file app(self.output_file.path) # Path to t...
[ "String", "with", "the", "list", "of", "files", "and", "prefixes", "needed", "to", "execute", "ABINIT", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2701-L2732
[ "def", "filesfile_string", "(", "self", ")", ":", "lines", "=", "[", "]", "app", "=", "lines", ".", "append", "pj", "=", "os", ".", "path", ".", "join", "app", "(", "self", ".", "input_file", ".", "path", ")", "# Path to the input file", "app", "(", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.uses_paral_kgb
True if the task is a GS Task and uses paral_kgb with the given value.
pymatgen/io/abinit/tasks.py
def uses_paral_kgb(self, value=1): """True if the task is a GS Task and uses paral_kgb with the given value.""" paral_kgb = self.get_inpvar("paral_kgb", 0) # paral_kgb is used only in the GS part. return paral_kgb == value and isinstance(self, GsTask)
def uses_paral_kgb(self, value=1): """True if the task is a GS Task and uses paral_kgb with the given value.""" paral_kgb = self.get_inpvar("paral_kgb", 0) # paral_kgb is used only in the GS part. return paral_kgb == value and isinstance(self, GsTask)
[ "True", "if", "the", "task", "is", "a", "GS", "Task", "and", "uses", "paral_kgb", "with", "the", "given", "value", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2746-L2750
[ "def", "uses_paral_kgb", "(", "self", ",", "value", "=", "1", ")", ":", "paral_kgb", "=", "self", ".", "get_inpvar", "(", "\"paral_kgb\"", ",", "0", ")", "# paral_kgb is used only in the GS part.", "return", "paral_kgb", "==", "value", "and", "isinstance", "(", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask._change_structure
Change the input structure.
pymatgen/io/abinit/tasks.py
def _change_structure(self, new_structure): """Change the input structure.""" # Compare new and old structure for logging purpose. # TODO: Write method of structure to compare self and other and return a dictionary old_structure = self.input.structure old_lattice = old_structure....
def _change_structure(self, new_structure): """Change the input structure.""" # Compare new and old structure for logging purpose. # TODO: Write method of structure to compare self and other and return a dictionary old_structure = self.input.structure old_lattice = old_structure....
[ "Change", "the", "input", "structure", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2752-L2784
[ "def", "_change_structure", "(", "self", ",", "new_structure", ")", ":", "# Compare new and old structure for logging purpose.", "# TODO: Write method of structure to compare self and other and return a dictionary", "old_structure", "=", "self", ".", "input", ".", "structure", "old...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.autoparal_run
Find an optimal set of parameters for the execution of the task This method can change the ABINIT input variables and/or the submission parameters e.g. the number of CPUs for MPI and OpenMp. Set: self.pconfs where pconfs is a :class:`ParalHints` object with the configuration reported...
pymatgen/io/abinit/tasks.py
def autoparal_run(self): """ Find an optimal set of parameters for the execution of the task This method can change the ABINIT input variables and/or the submission parameters e.g. the number of CPUs for MPI and OpenMp. Set: self.pconfs where pconfs is a :class:`Paral...
def autoparal_run(self): """ Find an optimal set of parameters for the execution of the task This method can change the ABINIT input variables and/or the submission parameters e.g. the number of CPUs for MPI and OpenMp. Set: self.pconfs where pconfs is a :class:`Paral...
[ "Find", "an", "optimal", "set", "of", "parameters", "for", "the", "execution", "of", "the", "task", "This", "method", "can", "change", "the", "ABINIT", "input", "variables", "and", "/", "or", "the", "submission", "parameters", "e", ".", "g", ".", "the", ...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2787-L2877
[ "def", "autoparal_run", "(", "self", ")", ":", "policy", "=", "self", ".", "manager", ".", "policy", "if", "policy", ".", "autoparal", "==", "0", ":", "# or policy.max_ncpus in [None, 1]:", "logger", ".", "info", "(", "\"Nothing to do in autoparal, returning (None, ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.find_optconf
Find the optimal Parallel configuration.
pymatgen/io/abinit/tasks.py
def find_optconf(self, pconfs): """Find the optimal Parallel configuration.""" # Save pconfs for future reference. self.set_pconfs(pconfs) # Select the partition on which we'll be running and set MPI/OMP cores. optconf = self.manager.select_qadapter(pconfs) return optcon...
def find_optconf(self, pconfs): """Find the optimal Parallel configuration.""" # Save pconfs for future reference. self.set_pconfs(pconfs) # Select the partition on which we'll be running and set MPI/OMP cores. optconf = self.manager.select_qadapter(pconfs) return optcon...
[ "Find", "the", "optimal", "Parallel", "configuration", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2879-L2886
[ "def", "find_optconf", "(", "self", ",", "pconfs", ")", ":", "# Save pconfs for future reference.", "self", ".", "set_pconfs", "(", "pconfs", ")", "# Select the partition on which we'll be running and set MPI/OMP cores.", "optconf", "=", "self", ".", "manager", ".", "sele...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.select_files
Helper function used to select the files of a task. Args: what: string with the list of characters selecting the file type Possible choices: i ==> input_file, o ==> output_file, f ==> files_file, j ==>...
pymatgen/io/abinit/tasks.py
def select_files(self, what="o"): """ Helper function used to select the files of a task. Args: what: string with the list of characters selecting the file type Possible choices: i ==> input_file, o ==> output_file, ...
def select_files(self, what="o"): """ Helper function used to select the files of a task. Args: what: string with the list of characters selecting the file type Possible choices: i ==> input_file, o ==> output_file, ...
[ "Helper", "function", "used", "to", "select", "the", "files", "of", "a", "task", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2888-L2924
[ "def", "select_files", "(", "self", ",", "what", "=", "\"o\"", ")", ":", "choices", "=", "collections", ".", "OrderedDict", "(", "[", "(", "\"i\"", ",", "self", ".", "input_file", ")", ",", "(", "\"o\"", ",", "self", ".", "output_file", ")", ",", "("...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.fix_abicritical
method to fix crashes/error caused by abinit Returns: 1 if task has been fixed else 0.
pymatgen/io/abinit/tasks.py
def fix_abicritical(self): """ method to fix crashes/error caused by abinit Returns: 1 if task has been fixed else 0. """ event_handlers = self.event_handlers if not event_handlers: self.set_status(status=self.S_ERROR, msg='Empty list of event han...
def fix_abicritical(self): """ method to fix crashes/error caused by abinit Returns: 1 if task has been fixed else 0. """ event_handlers = self.event_handlers if not event_handlers: self.set_status(status=self.S_ERROR, msg='Empty list of event han...
[ "method", "to", "fix", "crashes", "/", "error", "caused", "by", "abinit" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L2972-L3013
[ "def", "fix_abicritical", "(", "self", ")", ":", "event_handlers", "=", "self", ".", "event_handlers", "if", "not", "event_handlers", ":", "self", ".", "set_status", "(", "status", "=", "self", ".", "S_ERROR", ",", "msg", "=", "'Empty list of event handlers. Can...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.fix_queue_critical
This function tries to fix critical events originating from the queue submission system. General strategy, first try to increase resources in order to fix the problem, if this is not possible, call a task specific method to attempt to decrease the demands. Returns: 1 if task has be...
pymatgen/io/abinit/tasks.py
def fix_queue_critical(self): """ This function tries to fix critical events originating from the queue submission system. General strategy, first try to increase resources in order to fix the problem, if this is not possible, call a task specific method to attempt to decrease the deman...
def fix_queue_critical(self): """ This function tries to fix critical events originating from the queue submission system. General strategy, first try to increase resources in order to fix the problem, if this is not possible, call a task specific method to attempt to decrease the deman...
[ "This", "function", "tries", "to", "fix", "critical", "events", "originating", "from", "the", "queue", "submission", "system", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3016-L3151
[ "def", "fix_queue_critical", "(", "self", ")", ":", "from", "pymatgen", ".", "io", ".", "abinit", ".", "scheduler_error_parsers", "import", "NodeFailureError", ",", "MemoryCancelError", ",", "TimeCancelError", "#assert isinstance(self.manager, TaskManager)", "self", ".", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
AbinitTask.parse_timing
Parse the timer data in the main output file of Abinit. Requires timopt /= 0 in the input file (usually timopt = -1) Return: :class:`AbinitTimerParser` instance, None if error.
pymatgen/io/abinit/tasks.py
def parse_timing(self): """ Parse the timer data in the main output file of Abinit. Requires timopt /= 0 in the input file (usually timopt = -1) Return: :class:`AbinitTimerParser` instance, None if error. """ from .abitimer import AbinitTimerParser parser = Abini...
def parse_timing(self): """ Parse the timer data in the main output file of Abinit. Requires timopt /= 0 in the input file (usually timopt = -1) Return: :class:`AbinitTimerParser` instance, None if error. """ from .abitimer import AbinitTimerParser parser = Abini...
[ "Parse", "the", "timer", "data", "in", "the", "main", "output", "file", "of", "Abinit", ".", "Requires", "timopt", "/", "=", "0", "in", "the", "input", "file", "(", "usually", "timopt", "=", "-", "1", ")" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3153-L3165
[ "def", "parse_timing", "(", "self", ")", ":", "from", ".", "abitimer", "import", "AbinitTimerParser", "parser", "=", "AbinitTimerParser", "(", ")", "read_ok", "=", "parser", ".", "parse", "(", "self", ".", "output_file", ".", "path", ")", "if", "read_ok", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ProduceHist.hist_path
Absolute path of the HIST file. Empty string if file is not present.
pymatgen/io/abinit/tasks.py
def hist_path(self): """Absolute path of the HIST file. Empty string if file is not present.""" # Lazy property to avoid multiple calls to has_abiext. try: return self._hist_path except AttributeError: path = self.outdir.has_abiext("HIST") if path: sel...
def hist_path(self): """Absolute path of the HIST file. Empty string if file is not present.""" # Lazy property to avoid multiple calls to has_abiext. try: return self._hist_path except AttributeError: path = self.outdir.has_abiext("HIST") if path: sel...
[ "Absolute", "path", "of", "the", "HIST", "file", ".", "Empty", "string", "if", "file", "is", "not", "present", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3174-L3182
[ "def", "hist_path", "(", "self", ")", ":", "# Lazy property to avoid multiple calls to has_abiext.", "try", ":", "return", "self", ".", "_hist_path", "except", "AttributeError", ":", "path", "=", "self", ".", "outdir", ".", "has_abiext", "(", "\"HIST\"", ")", "if"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ProduceHist.open_hist
Open the HIST file located in the in self.outdir. Returns :class:`HistFile` object, None if file could not be found or file is not readable.
pymatgen/io/abinit/tasks.py
def open_hist(self): """ Open the HIST file located in the in self.outdir. Returns :class:`HistFile` object, None if file could not be found or file is not readable. """ if not self.hist_path: if self.status == self.S_OK: logger.critical("%s reached S_...
def open_hist(self): """ Open the HIST file located in the in self.outdir. Returns :class:`HistFile` object, None if file could not be found or file is not readable. """ if not self.hist_path: if self.status == self.S_OK: logger.critical("%s reached S_...
[ "Open", "the", "HIST", "file", "located", "in", "the", "in", "self", ".", "outdir", ".", "Returns", ":", "class", ":", "HistFile", "object", "None", "if", "file", "could", "not", "be", "found", "or", "file", "is", "not", "readable", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3184-L3200
[ "def", "open_hist", "(", "self", ")", ":", "if", "not", "self", ".", "hist_path", ":", "if", "self", ".", "status", "==", "self", ".", "S_OK", ":", "logger", ".", "critical", "(", "\"%s reached S_OK but didn't produce a HIST file in %s\"", "%", "(", "self", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
GsTask.gsr_path
Absolute path of the GSR file. Empty string if file is not present.
pymatgen/io/abinit/tasks.py
def gsr_path(self): """Absolute path of the GSR file. Empty string if file is not present.""" # Lazy property to avoid multiple calls to has_abiext. try: return self._gsr_path except AttributeError: path = self.outdir.has_abiext("GSR") if path: self._g...
def gsr_path(self): """Absolute path of the GSR file. Empty string if file is not present.""" # Lazy property to avoid multiple calls to has_abiext. try: return self._gsr_path except AttributeError: path = self.outdir.has_abiext("GSR") if path: self._g...
[ "Absolute", "path", "of", "the", "GSR", "file", ".", "Empty", "string", "if", "file", "is", "not", "present", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3209-L3217
[ "def", "gsr_path", "(", "self", ")", ":", "# Lazy property to avoid multiple calls to has_abiext.", "try", ":", "return", "self", ".", "_gsr_path", "except", "AttributeError", ":", "path", "=", "self", ".", "outdir", ".", "has_abiext", "(", "\"GSR\"", ")", "if", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
GsTask.open_gsr
Open the GSR file located in the in self.outdir. Returns :class:`GsrFile` object, None if file could not be found or file is not readable.
pymatgen/io/abinit/tasks.py
def open_gsr(self): """ Open the GSR file located in the in self.outdir. Returns :class:`GsrFile` object, None if file could not be found or file is not readable. """ gsr_path = self.gsr_path if not gsr_path: if self.status == self.S_OK: logger...
def open_gsr(self): """ Open the GSR file located in the in self.outdir. Returns :class:`GsrFile` object, None if file could not be found or file is not readable. """ gsr_path = self.gsr_path if not gsr_path: if self.status == self.S_OK: logger...
[ "Open", "the", "GSR", "file", "located", "in", "the", "in", "self", ".", "outdir", ".", "Returns", ":", "class", ":", "GsrFile", "object", "None", "if", "file", "could", "not", "be", "found", "or", "file", "is", "not", "readable", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3219-L3236
[ "def", "open_gsr", "(", "self", ")", ":", "gsr_path", "=", "self", ".", "gsr_path", "if", "not", "gsr_path", ":", "if", "self", ".", "status", "==", "self", ".", "S_OK", ":", "logger", ".", "critical", "(", "\"%s reached S_OK but didn't produce a GSR file in %...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ScfTask.inspect
Plot the SCF cycle results with matplotlib. Returns `matplotlib` figure, None if some error occurred.
pymatgen/io/abinit/tasks.py
def inspect(self, **kwargs): """ Plot the SCF cycle results with matplotlib. Returns `matplotlib` figure, None if some error occurred. """ try: scf_cycle = abiinspect.GroundStateScfCycle.from_file(self.output_file.path) except IOError: ...
def inspect(self, **kwargs): """ Plot the SCF cycle results with matplotlib. Returns `matplotlib` figure, None if some error occurred. """ try: scf_cycle = abiinspect.GroundStateScfCycle.from_file(self.output_file.path) except IOError: ...
[ "Plot", "the", "SCF", "cycle", "results", "with", "matplotlib", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3270-L3286
[ "def", "inspect", "(", "self", ",", "*", "*", "kwargs", ")", ":", "try", ":", "scf_cycle", "=", "abiinspect", ".", "GroundStateScfCycle", ".", "from_file", "(", "self", ".", "output_file", ".", "path", ")", "except", "IOError", ":", "return", "None", "if...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
NscfTask.setup
NSCF calculations should use the same FFT mesh as the one employed in the GS task (in principle, it's possible to interpolate inside Abinit but tests revealed some numerical noise Here we change the input file of the NSCF task to have the same FFT mesh.
pymatgen/io/abinit/tasks.py
def setup(self): """ NSCF calculations should use the same FFT mesh as the one employed in the GS task (in principle, it's possible to interpolate inside Abinit but tests revealed some numerical noise Here we change the input file of the NSCF task to have the same FFT mesh. """ ...
def setup(self): """ NSCF calculations should use the same FFT mesh as the one employed in the GS task (in principle, it's possible to interpolate inside Abinit but tests revealed some numerical noise Here we change the input file of the NSCF task to have the same FFT mesh. """ ...
[ "NSCF", "calculations", "should", "use", "the", "same", "FFT", "mesh", "as", "the", "one", "employed", "in", "the", "GS", "task", "(", "in", "principle", "it", "s", "possible", "to", "interpolate", "inside", "Abinit", "but", "tests", "revealed", "some", "n...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3335-L3358
[ "def", "setup", "(", "self", ")", ":", "for", "dep", "in", "self", ".", "deps", ":", "if", "\"DEN\"", "in", "dep", ".", "exts", ":", "parent_task", "=", "dep", ".", "node", "break", "else", ":", "raise", "RuntimeError", "(", "\"Cannot find parent node pr...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
RelaxTask.restart
Restart the structural relaxation. Structure relaxations can be restarted only if we have the WFK file or the DEN or the GSR file from which we can read the last structure (mandatory) and the wavefunctions (not mandatory but useful). Prefer WFK over other files since we can reuse the wavefuncti...
pymatgen/io/abinit/tasks.py
def restart(self): """ Restart the structural relaxation. Structure relaxations can be restarted only if we have the WFK file or the DEN or the GSR file from which we can read the last structure (mandatory) and the wavefunctions (not mandatory but useful). Prefer WFK over other ...
def restart(self): """ Restart the structural relaxation. Structure relaxations can be restarted only if we have the WFK file or the DEN or the GSR file from which we can read the last structure (mandatory) and the wavefunctions (not mandatory but useful). Prefer WFK over other ...
[ "Restart", "the", "structural", "relaxation", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3409-L3477
[ "def", "restart", "(", "self", ")", ":", "restart_file", "=", "None", "# Try to restart from the WFK file if possible.", "# FIXME: This part has been disabled because WFK=IO is a mess if paral_kgb == 1", "# This is also the reason why I wrote my own MPI-IO code for the GW part!", "wfk_file",...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
RelaxTask.inspect
Plot the evolution of the structural relaxation with matplotlib. Args: what: Either "hist" or "scf". The first option (default) extracts data from the HIST file and plot the evolution of the structural parameters, forces, pressures and energies. The s...
pymatgen/io/abinit/tasks.py
def inspect(self, **kwargs): """ Plot the evolution of the structural relaxation with matplotlib. Args: what: Either "hist" or "scf". The first option (default) extracts data from the HIST file and plot the evolution of the structural parameters, forc...
def inspect(self, **kwargs): """ Plot the evolution of the structural relaxation with matplotlib. Args: what: Either "hist" or "scf". The first option (default) extracts data from the HIST file and plot the evolution of the structural parameters, forc...
[ "Plot", "the", "evolution", "of", "the", "structural", "relaxation", "with", "matplotlib", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3479-L3507
[ "def", "inspect", "(", "self", ",", "*", "*", "kwargs", ")", ":", "what", "=", "kwargs", ".", "pop", "(", "\"what\"", ",", "\"hist\"", ")", "if", "what", "==", "\"hist\"", ":", "# Read the hist file to get access to the structure.", "with", "self", ".", "ope...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
RelaxTask.fix_ofiles
Note that ABINIT produces lots of out_TIM1_DEN files for each step. Here we list all TIM*_DEN files, we select the last one and we rename it in out_DEN This change is needed so that we can specify dependencies with the syntax {node: "DEN"} without having to know the number of iterations needed ...
pymatgen/io/abinit/tasks.py
def fix_ofiles(self): """ Note that ABINIT produces lots of out_TIM1_DEN files for each step. Here we list all TIM*_DEN files, we select the last one and we rename it in out_DEN This change is needed so that we can specify dependencies with the syntax {node: "DEN"} without havin...
def fix_ofiles(self): """ Note that ABINIT produces lots of out_TIM1_DEN files for each step. Here we list all TIM*_DEN files, we select the last one and we rename it in out_DEN This change is needed so that we can specify dependencies with the syntax {node: "DEN"} without havin...
[ "Note", "that", "ABINIT", "produces", "lots", "of", "out_TIM1_DEN", "files", "for", "each", "step", ".", "Here", "we", "list", "all", "TIM", "*", "_DEN", "files", "we", "select", "the", "last", "one", "and", "we", "rename", "it", "in", "out_DEN" ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3525-L3545
[ "def", "fix_ofiles", "(", "self", ")", ":", "super", "(", ")", ".", "fix_ofiles", "(", ")", "# Find the last TIM?_DEN file.", "last_timden", "=", "self", ".", "outdir", ".", "find_last_timden_file", "(", ")", "if", "last_timden", "is", "None", ":", "logger", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
DfptTask.ddb_path
Absolute path of the DDB file. Empty string if file is not present.
pymatgen/io/abinit/tasks.py
def ddb_path(self): """Absolute path of the DDB file. Empty string if file is not present.""" # Lazy property to avoid multiple calls to has_abiext. try: return self._ddb_path except AttributeError: path = self.outdir.has_abiext("DDB") if path: self._d...
def ddb_path(self): """Absolute path of the DDB file. Empty string if file is not present.""" # Lazy property to avoid multiple calls to has_abiext. try: return self._ddb_path except AttributeError: path = self.outdir.has_abiext("DDB") if path: self._d...
[ "Absolute", "path", "of", "the", "DDB", "file", ".", "Empty", "string", "if", "file", "is", "not", "present", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3596-L3604
[ "def", "ddb_path", "(", "self", ")", ":", "# Lazy property to avoid multiple calls to has_abiext.", "try", ":", "return", "self", ".", "_ddb_path", "except", "AttributeError", ":", "path", "=", "self", ".", "outdir", ".", "has_abiext", "(", "\"DDB\"", ")", "if", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
DfptTask.make_links
Replace the default behaviour of make_links. More specifically, this method implements the logic required to connect DFPT calculation to `DDK` files. Remember that DDK is an extension introduced in AbiPy to deal with the irdddk input variable and the fact that the 3 files with du/dk produced by ...
pymatgen/io/abinit/tasks.py
def make_links(self): """ Replace the default behaviour of make_links. More specifically, this method implements the logic required to connect DFPT calculation to `DDK` files. Remember that DDK is an extension introduced in AbiPy to deal with the irdddk input variable and the fac...
def make_links(self): """ Replace the default behaviour of make_links. More specifically, this method implements the logic required to connect DFPT calculation to `DDK` files. Remember that DDK is an extension introduced in AbiPy to deal with the irdddk input variable and the fac...
[ "Replace", "the", "default", "behaviour", "of", "make_links", ".", "More", "specifically", "this", "method", "implements", "the", "logic", "required", "to", "connect", "DFPT", "calculation", "to", "DDK", "files", ".", "Remember", "that", "DDK", "is", "an", "ex...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3625-L3700
[ "def", "make_links", "(", "self", ")", ":", "for", "dep", "in", "self", ".", "deps", ":", "for", "d", "in", "dep", ".", "exts", ":", "if", "d", "==", "\"DDK\"", ":", "ddk_task", "=", "dep", ".", "node", "out_ddk", "=", "ddk_task", ".", "outdir", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
DfptTask.restart
DFPT calculations can be restarted only if we have the 1WF file or the 1DEN file. from which we can read the first-order wavefunctions or the first order density. Prefer 1WF over 1DEN since we can reuse the wavefunctions.
pymatgen/io/abinit/tasks.py
def restart(self): """ DFPT calculations can be restarted only if we have the 1WF file or the 1DEN file. from which we can read the first-order wavefunctions or the first order density. Prefer 1WF over 1DEN since we can reuse the wavefunctions. """ # Abinit adds the idir-...
def restart(self): """ DFPT calculations can be restarted only if we have the 1WF file or the 1DEN file. from which we can read the first-order wavefunctions or the first order density. Prefer 1WF over 1DEN since we can reuse the wavefunctions. """ # Abinit adds the idir-...
[ "DFPT", "calculations", "can", "be", "restarted", "only", "if", "we", "have", "the", "1WF", "file", "or", "the", "1DEN", "file", ".", "from", "which", "we", "can", "read", "the", "first", "-", "order", "wavefunctions", "or", "the", "first", "order", "den...
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3702-L3742
[ "def", "restart", "(", "self", ")", ":", "# Abinit adds the idir-ipert index at the end of the file and this breaks the extension", "# e.g. out_1WF4, out_DEN4. find_1wf_files and find_1den_files returns the list of files found", "restart_file", ",", "irdvars", "=", "None", ",", "None", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
PhononTask.inspect
Plot the Phonon SCF cycle results with matplotlib. Returns: `matplotlib` figure, None if some error occurred.
pymatgen/io/abinit/tasks.py
def inspect(self, **kwargs): """ Plot the Phonon SCF cycle results with matplotlib. Returns: `matplotlib` figure, None if some error occurred. """ scf_cycle = abiinspect.PhononScfCycle.from_file(self.output_file.path) if scf_cycle is not None: if ...
def inspect(self, **kwargs): """ Plot the Phonon SCF cycle results with matplotlib. Returns: `matplotlib` figure, None if some error occurred. """ scf_cycle = abiinspect.PhononScfCycle.from_file(self.output_file.path) if scf_cycle is not None: if ...
[ "Plot", "the", "Phonon", "SCF", "cycle", "results", "with", "matplotlib", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3805-L3815
[ "def", "inspect", "(", "self", ",", "*", "*", "kwargs", ")", ":", "scf_cycle", "=", "abiinspect", ".", "PhononScfCycle", ".", "from_file", "(", "self", ".", "output_file", ".", "path", ")", "if", "scf_cycle", "is", "not", "None", ":", "if", "\"title\"", ...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ManyBodyTask.reduce_memory_demand
Method that can be called by the scheduler to decrease the memory demand of a specific task. Returns True in case of success, False in case of Failure.
pymatgen/io/abinit/tasks.py
def reduce_memory_demand(self): """ Method that can be called by the scheduler to decrease the memory demand of a specific task. Returns True in case of success, False in case of Failure. """ # The first digit governs the storage of W(q), the second digit the storage of u(r) ...
def reduce_memory_demand(self): """ Method that can be called by the scheduler to decrease the memory demand of a specific task. Returns True in case of success, False in case of Failure. """ # The first digit governs the storage of W(q), the second digit the storage of u(r) ...
[ "Method", "that", "can", "be", "called", "by", "the", "scheduler", "to", "decrease", "the", "memory", "demand", "of", "a", "specific", "task", ".", "Returns", "True", "in", "case", "of", "success", "False", "in", "case", "of", "Failure", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3846-L3865
[ "def", "reduce_memory_demand", "(", "self", ")", ":", "# The first digit governs the storage of W(q), the second digit the storage of u(r)", "# Try to avoid the storage of u(r) first since reading W(q) from file will lead to a drammatic slowdown.", "prev_gwmem", "=", "int", "(", "self", "....
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da
train
ScrTask.scr_path
Absolute path of the SCR file. Empty string if file is not present.
pymatgen/io/abinit/tasks.py
def scr_path(self): """Absolute path of the SCR file. Empty string if file is not present.""" # Lazy property to avoid multiple calls to has_abiext. try: return self._scr_path except AttributeError: path = self.outdir.has_abiext("SCR.nc") if path: self...
def scr_path(self): """Absolute path of the SCR file. Empty string if file is not present.""" # Lazy property to avoid multiple calls to has_abiext. try: return self._scr_path except AttributeError: path = self.outdir.has_abiext("SCR.nc") if path: self...
[ "Absolute", "path", "of", "the", "SCR", "file", ".", "Empty", "string", "if", "file", "is", "not", "present", "." ]
materialsproject/pymatgen
python
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/tasks.py#L3877-L3885
[ "def", "scr_path", "(", "self", ")", ":", "# Lazy property to avoid multiple calls to has_abiext.", "try", ":", "return", "self", ".", "_scr_path", "except", "AttributeError", ":", "path", "=", "self", ".", "outdir", ".", "has_abiext", "(", "\"SCR.nc\"", ")", "if"...
4ca558cf72f8d5f8a1f21dfdfc0181a971c186da