From 84552008f416b6396c45d76fbe5a624b54cabd8b Mon Sep 17 00:00:00 2001 From: Kamal Choudhary Date: Mon, 18 Jul 2022 16:11:41 -0400 Subject: [PATCH] Develop (#249) * Image augmentation. * Augment images. * Augment images. * Specie update. * Add Latt2D, STM image (b-1) fix, image augmentation fix. * Add Latt2D, STM image (b-1) fix, image augmentation fix. * Update conf.py * Update conf.py * Multi-output graph bacthing. * Add EDOS dataset. * Temp. * Add circuit maker. * Add circuit maker. * NELECT update. * Version update, more DBs added. * Fix CHGCAR vasp. * Added volumetric reshape for CHGCAR. * Tmp * Tershoff Hamman update, specie update. * Add crop from center in STM. * Add Fourier transfor in STM. * Update STM pytest. * Add DPI to STM. * Zeo++ added, Atoms cif update, STM update, random vacancy maker added. * Atoms tempfile fix, Potcar from atoms module added. * Test for docs. * C2DB link update, docs Atoms update. * C2DB link update, docs Atoms update. * Version update, COD DB, QM9 JCTC DB added. * Compostion bug fix, elemental descriptor added. * Develop (#186) * Update outputs.py I added the calculation of the Raman intensities inside parse_raman_dat * Update outputs.py * Update outputs.py * Update outputs.py * Update cfid.py * Delete __init__.py * stylecss added. * stylecss added. * Adding extra Makefile/ * Remove examples from docs. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Tutorials update. * Tutorials docs update. * Docs update,pdb reader updated. * Update action_build.yml * Update action_build.yml * Remove pytraj strong dependencies. * Update docs, Added PDBBind and HPOV datasets. * Docs update. * Add thcikness to surface builder. * Surface builder update, Chemical only magpie descriptors added, pdb_core dataset added, zeopp tempfile bugfix. * Typo fix. * Add names to chem descs. * Lessen hermsolver pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * No DFT3D * Exclude dft_3d dataset for memory issue. * Update figshare test. * Update figshare test. * Exclude db from coverage. * Exclude db from coverage. * Add magpie.json. * Add magpie.json. * Wien2k bands bug fix. * Wien2k bands bug fix. * Update JARVIS-FF,Elastictensor,LAMMPS parse folder, VASP bandstructure plot code. * JFF update. * Add JQE_TB3 and hMOF dataset. * Update LAMMPS module. * Update LAMMPS module. * Fix elastic tensor module. * Figshare update, docs db name update. * Substitutions. * Update figshare dft_3d, cfid_3d. * Docs data update. * Generate substitutions. * Lint fix. * Update DOS. * Update DOS. * Adding folders for nexus setup. * Update QMOF and hMOF info. * Fixing auto klength error. * Adding zeopp surface area. * Vacancy bug fix, added hmof to docs. * vacancy update. * QE inputs update. * Pyhon 3.9 test, added QE el-ph, VASP XANES, modified hmof db details. * Update Contribution.rst * Minor lint fix. * Update action_build.yml * Update action_build.yml * Fix qiskit requirements. * Fix phonopy requirements. * Fix all requirements. * Fix phonopy requirements. * QE test. * QE test. * Update action_build. * Try other python versions. * Try other python versions. * README updates. * Adding nexus. (#197) * Develop (#196) * Image augmentation. * Augment images. * Augment images. * Specie update. * Add Latt2D, STM image (b-1) fix, image augmentation fix. * Add Latt2D, STM image (b-1) fix, image augmentation fix. * Update conf.py * Update conf.py * Multi-output graph bacthing. * Add EDOS dataset. * Temp. * Add circuit maker. * Add circuit maker. * NELECT update. * Version update, more DBs added. * Fix CHGCAR vasp. * Added volumetric reshape for CHGCAR. * Tmp * Tershoff Hamman update, specie update. * Add crop from center in STM. * Add Fourier transfor in STM. * Update STM pytest. * Add DPI to STM. * Zeo++ added, Atoms cif update, STM update, random vacancy maker added. * Atoms tempfile fix, Potcar from atoms module added. * Test for docs. * C2DB link update, docs Atoms update. * C2DB link update, docs Atoms update. * Version update, COD DB, QM9 JCTC DB added. * Compostion bug fix, elemental descriptor added. * Develop (#186) * Update outputs.py I added the calculation of the Raman intensities inside parse_raman_dat * Update outputs.py * Update outputs.py * Update outputs.py * Update cfid.py * Delete __init__.py * stylecss added. * stylecss added. * Adding extra Makefile/ * Remove examples from docs. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Tutorials update. * Tutorials docs update. * Docs update,pdb reader updated. * Update action_build.yml * Update action_build.yml * Remove pytraj strong dependencies. * Update docs, Added PDBBind and HPOV datasets. * Docs update. * Add thcikness to surface builder. * Surface builder update, Chemical only magpie descriptors added, pdb_core dataset added, zeopp tempfile bugfix. * Typo fix. * Add names to chem descs. * Lessen hermsolver pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * No DFT3D * Exclude dft_3d dataset for memory issue. * Update figshare test. * Update figshare test. * Exclude db from coverage. * Exclude db from coverage. * Add magpie.json. * Add magpie.json. * Wien2k bands bug fix. * Wien2k bands bug fix. * Update JARVIS-FF,Elastictensor,LAMMPS parse folder, VASP bandstructure plot code. * JFF update. * Add JQE_TB3 and hMOF dataset. * Update LAMMPS module. * Update LAMMPS module. * Fix elastic tensor module. * Figshare update, docs db name update. * Substitutions. * Update figshare dft_3d, cfid_3d. * Docs data update. * Generate substitutions. * Lint fix. * Update DOS. * Update DOS. Co-authored-by: tavazza Co-authored-by: knc6 Co-authored-by: KAMAL CHOUDHARY * First input. * added black * Example folder. Co-authored-by: Kamal Choudhary Co-authored-by: tavazza Co-authored-by: knc6 Co-authored-by: KAMAL CHOUDHARY * Revert back. * Update .readthedocs.yaml * Update dev-requirements.txt * Docs requirements update. * Update .readthedocs.yaml * Update requirements.txt * Update .readthedocs.yaml * Update requirements.txt * Update .readthedocs.yaml * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update atoms.py * Fixe pbc in ase_to_Atoms. * Add installation tests (#214) * QE inputs, XANES, GHAction updates. (#210) * Image augmentation. * Augment images. * Augment images. * Specie update. * Add Latt2D, STM image (b-1) fix, image augmentation fix. * Add Latt2D, STM image (b-1) fix, image augmentation fix. * Update conf.py * Update conf.py * Multi-output graph bacthing. * Add EDOS dataset. * Temp. * Add circuit maker. * Add circuit maker. * NELECT update. * Version update, more DBs added. * Fix CHGCAR vasp. * Added volumetric reshape for CHGCAR. * Tmp * Tershoff Hamman update, specie update. * Add crop from center in STM. * Add Fourier transfor in STM. * Update STM pytest. * Add DPI to STM. * Zeo++ added, Atoms cif update, STM update, random vacancy maker added. * Atoms tempfile fix, Potcar from atoms module added. * Test for docs. * C2DB link update, docs Atoms update. * C2DB link update, docs Atoms update. * Version update, COD DB, QM9 JCTC DB added. * Compostion bug fix, elemental descriptor added. * Develop (#186) * Update outputs.py I added the calculation of the Raman intensities inside parse_raman_dat * Update outputs.py * Update outputs.py * Update outputs.py * Update cfid.py * Delete __init__.py * stylecss added. * stylecss added. * Adding extra Makefile/ * Remove examples from docs. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Tutorials update. * Tutorials docs update. * Docs update,pdb reader updated. * Update action_build.yml * Update action_build.yml * Remove pytraj strong dependencies. * Update docs, Added PDBBind and HPOV datasets. * Docs update. * Add thcikness to surface builder. * Surface builder update, Chemical only magpie descriptors added, pdb_core dataset added, zeopp tempfile bugfix. * Typo fix. * Add names to chem descs. * Lessen hermsolver pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * No DFT3D * Exclude dft_3d dataset for memory issue. * Update figshare test. * Update figshare test. * Exclude db from coverage. * Exclude db from coverage. * Add magpie.json. * Add magpie.json. * Wien2k bands bug fix. * Wien2k bands bug fix. * Update JARVIS-FF,Elastictensor,LAMMPS parse folder, VASP bandstructure plot code. * JFF update. * Add JQE_TB3 and hMOF dataset. * Update LAMMPS module. * Update LAMMPS module. * Fix elastic tensor module. * Figshare update, docs db name update. * Substitutions. * Update figshare dft_3d, cfid_3d. * Docs data update. * Generate substitutions. * Lint fix. * Update DOS. * Update DOS. * Adding folders for nexus setup. * Update QMOF and hMOF info. * Fixing auto klength error. * Adding zeopp surface area. * Vacancy bug fix, added hmof to docs. * vacancy update. * QE inputs update. * Pyhon 3.9 test, added QE el-ph, VASP XANES, modified hmof db details. * Update Contribution.rst * Minor lint fix. * Update action_build.yml * Update action_build.yml * Fix qiskit requirements. * Fix phonopy requirements. * Fix all requirements. * Fix phonopy requirements. * QE test. * QE test. * Update action_build. * Try other python versions. * Try other python versions. * README updates. * Adding nexus. (#197) * Develop (#196) * Image augmentation. * Augment images. * Augment images. * Specie update. * Add Latt2D, STM image (b-1) fix, image augmentation fix. * Add Latt2D, STM image (b-1) fix, image augmentation fix. * Update conf.py * Update conf.py * Multi-output graph bacthing. * Add EDOS dataset. * Temp. * Add circuit maker. * Add circuit maker. * NELECT update. * Version update, more DBs added. * Fix CHGCAR vasp. * Added volumetric reshape for CHGCAR. * Tmp * Tershoff Hamman update, specie update. * Add crop from center in STM. * Add Fourier transfor in STM. * Update STM pytest. * Add DPI to STM. * Zeo++ added, Atoms cif update, STM update, random vacancy maker added. * Atoms tempfile fix, Potcar from atoms module added. * Test for docs. * C2DB link update, docs Atoms update. * C2DB link update, docs Atoms update. * Version update, COD DB, QM9 JCTC DB added. * Compostion bug fix, elemental descriptor added. * Develop (#186) * Update outputs.py I added the calculation of the Raman intensities inside parse_raman_dat * Update outputs.py * Update outputs.py * Update outputs.py * Update cfid.py * Delete __init__.py * stylecss added. * stylecss added. * Adding extra Makefile/ * Remove examples from docs. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Docs update. * Tutorials update. * Tutorials docs update. * Docs update,pdb reader updated. * Update action_build.yml * Update action_build.yml * Remove pytraj strong dependencies. * Update docs, Added PDBBind and HPOV datasets. * Docs update. * Add thcikness to surface builder. * Surface builder update, Chemical only magpie descriptors added, pdb_core dataset added, zeopp tempfile bugfix. * Typo fix. * Add names to chem descs. * Lessen hermsolver pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * Reduced pytest. * No DFT3D * Exclude dft_3d dataset for memory issue. * Update figshare test. * Update figshare test. * Exclude db from coverage. * Exclude db from coverage. * Add magpie.json. * Add magpie.json. * Wien2k bands bug fix. * Wien2k bands bug fix. * Update JARVIS-FF,Elastictensor,LAMMPS parse folder, VASP bandstructure plot code. * JFF update. * Add JQE_TB3 and hMOF dataset. * Update LAMMPS module. * Update LAMMPS module. * Fix elastic tensor module. * Figshare update, docs db name update. * Substitutions. * Update figshare dft_3d, cfid_3d. * Docs data update. * Generate substitutions. * Lint fix. * Update DOS. * Update DOS. Co-authored-by: tavazza Co-authored-by: knc6 Co-authored-by: KAMAL CHOUDHARY * First input. * added black * Example folder. Co-authored-by: Kamal Choudhary Co-authored-by: tavazza Co-authored-by: knc6 Co-authored-by: KAMAL CHOUDHARY * Revert back. * Update .readthedocs.yaml * Update dev-requirements.txt * Docs requirements update. * Update .readthedocs.yaml * Update requirements.txt * Update .readthedocs.yaml * Update requirements.txt * Update .readthedocs.yaml * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update atoms.py * Fixe pbc in ase_to_Atoms. Co-authored-by: tavazza Co-authored-by: knc6 Co-authored-by: KAMAL CHOUDHARY Co-authored-by: wines1 <74620550+wines1@users.noreply.github.com> * Add installation tests * Fix codestyle * Fix codestyle with black * Add docstrings * Fix pydocstyle error * Update __init__.py * Update __init__.py Co-authored-by: Kamal Choudhary Co-authored-by: tavazza Co-authored-by: knc6 Co-authored-by: KAMAL CHOUDHARY Co-authored-by: wines1 <74620550+wines1@users.noreply.github.com> * Adding QE super. * Minor changes to QE module, atoms xyz fix. * Adding qe_tb info, and version update. * Update __init__.py * WIP super QE. * Working version of ScSi. * QE inputs and task update. * Add master super. * Add master super. * Lint fix. * Lint fix. * Minor fix. * ET update. * Fix ET test. * Update sanitize atoms. * Additonal checks on supercond. * Debye bug fix. * Pressure in QE Super. * Version fix, publication update, supercond workflow update. * Lint fix. * Tensorboard fix. * Tensorboard fix. * Tensorboard fix. * Melting temp fix. * Update vasp.py (#234) * Local tetra tmp. * Version update. * Lint fix. * HSE06 * Tmp. * Vacancy update, Optimade structureand other minor lint updates. * STEM pytest fix. * Minor lint fix. * Fixed selectrive dynamics issue in Poscar, force reading for single atom system in Vasprun, np.array in core.graps, num_atoms for single atom systems in core.Atoms * Lint fix. Co-authored-by: tavazza Co-authored-by: knc6 Co-authored-by: KAMAL CHOUDHARY Co-authored-by: wines1 <74620550+wines1@users.noreply.github.com> Co-authored-by: Saurav Maheshkar --- jarvis/__init__.py | 2 +- jarvis/core/atoms.py | 6 +++--- jarvis/core/graphs.py | 15 ++++----------- jarvis/io/vasp/inputs.py | 9 +++++---- jarvis/io/vasp/outputs.py | 21 ++++++++++++--------- setup.py | 2 +- 6 files changed, 26 insertions(+), 29 deletions(-) diff --git a/jarvis/__init__.py b/jarvis/__init__.py index 6c2c48b5..0ea4372e 100644 --- a/jarvis/__init__.py +++ b/jarvis/__init__.py @@ -1,5 +1,5 @@ """Version number.""" -__version__ = "2022.05.20" +__version__ = "2022.07.17" import os diff --git a/jarvis/core/atoms.py b/jarvis/core/atoms.py index 7df503a2..006c9992 100644 --- a/jarvis/core/atoms.py +++ b/jarvis/core/atoms.py @@ -873,9 +873,7 @@ def atomwise_angle_and_radial_distribution( and nbor_info["dist"][in1][i] * nbor_info["dist"][in2][i] != 0 ] ang_hist, ang_bins = np.histogram( - angles, - bins=np.arange(1, nbins + 2, 1), - density=False, + angles, bins=np.arange(1, nbins + 2, 1), density=False, ) for jj, j in enumerate(angles): actual_pangs[i, jj] = j @@ -1021,6 +1019,8 @@ def atomic_numbers(self): @property def num_atoms(self): """Get number of atoms.""" + if np.squeeze(self.coords).ndim == 1: + return 1 return len(self.coords) @property diff --git a/jarvis/core/graphs.py b/jarvis/core/graphs.py index ce0b3a92..8229ffa0 100644 --- a/jarvis/core/graphs.py +++ b/jarvis/core/graphs.py @@ -22,10 +22,7 @@ def canonize_edge( - src_id, - dst_id, - src_image, - dst_image, + src_id, dst_id, src_image, dst_image, ): """Compute canonical edge representation. @@ -49,11 +46,7 @@ def canonize_edge( def nearest_neighbor_edges( - atoms=None, - cutoff=8, - max_neighbors=12, - id=None, - use_canonize=False, + atoms=None, cutoff=8, max_neighbors=12, id=None, use_canonize=False, ): """Construct k-NN edge list.""" # returns List[List[Tuple[site, distance, index, image]]] @@ -125,8 +118,7 @@ def nearest_neighbor_edges( def build_undirected_edgedata( - atoms=None, - edges={}, + atoms=None, edges={}, ): """Build undirected graph data from edge set. @@ -153,6 +145,7 @@ def build_undirected_edgedata( v.append(vv) r.append(dd) + u, v, r = (np.array(x) for x in (u, v, r)) u = torch.tensor(u) v = torch.tensor(v) r = torch.tensor(r).type(torch.get_default_dtype()) diff --git a/jarvis/io/vasp/inputs.py b/jarvis/io/vasp/inputs.py index ecabdb0c..13f8380a 100644 --- a/jarvis/io/vasp/inputs.py +++ b/jarvis/io/vasp/inputs.py @@ -177,7 +177,9 @@ def from_string(lines): lattice_mat.append([float(i) for i in text[3].split()]) lattice_mat.append([float(i) for i in text[4].split()]) lattice_mat = scale * np.array(lattice_mat) - + begin = 5 + if "S" in text[7] and "s" in text[7]: + begin = 6 uniq_elements = text[5].split() element_count = np.array([int(i) for i in text[6].split()]) elements = [] @@ -185,13 +187,12 @@ def from_string(lines): for j in range(ii): elements.append(uniq_elements[i]) cartesian = True - if "d" in text[7] or "D" in text[7]: + if "d" in text[begin + 2] or "D" in text[begin + 2]: cartesian = False - # print ('cartesian poscar=',cartesian,text[7]) num_atoms = int(np.sum(element_count)) coords = [] for i in range(num_atoms): - coords.append([float(i) for i in text[8 + i].split()[0:3]]) + coords.append([float(i) for i in text[begin + 3 + i].split()[0:3]]) coords = np.array(coords) atoms = Atoms( lattice_mat=lattice_mat, diff --git a/jarvis/io/vasp/outputs.py b/jarvis/io/vasp/outputs.py index 84cbc390..2a9f7741 100644 --- a/jarvis/io/vasp/outputs.py +++ b/jarvis/io/vasp/outputs.py @@ -1130,12 +1130,9 @@ def gvectors(self, ikpt=1): % (Gvec.shape[0], self._nplws[ikpt - 1], np.prod(self._ngrid)) ) else: - assert ( - Gvec.shape[0] == self._nplws[ikpt - 1] - ), "No. of planewaves not consistent! %d %d %d" % ( - Gvec.shape[0], - self._nplws[ikpt - 1], - np.prod(self._ngrid), + assert Gvec.shape[0] == self._nplws[ikpt - 1], ( + "No. of planewaves not consistent! %d %d %d" + % (Gvec.shape[0], self._nplws[ikpt - 1], np.prod(self._ngrid),) ) self._gvec = np.asarray(Gvec, dtype=int) @@ -1672,9 +1669,15 @@ def all_forces(self): """Get all forces.""" forces = [] for m in self.ionic_steps: - force = np.array( - [[float(j) for j in i.split()] for i in m["varray"][0]["v"]] - ) + if self.all_structures[-1].num_atoms == 1: + force = np.array(m["varray"][0]["v"].split(), dtype="float") + else: + force = np.array( + [ + [float(j) for j in i.split()] + for i in m["varray"][0]["v"] + ] + ) forces.append(force) return np.array(forces) diff --git a/setup.py b/setup.py index fca9196f..992e3cb0 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name="jarvis-tools", - version="2022.05.20", + version="2022.07.17", long_description=long_d, install_requires=[ "numpy>=1.19.5",