Skip to content

Commit

Permalink
Merge pull request #746 from janosh/fix-pypi-page
Browse files Browse the repository at this point in the history
Fix PyPI page
  • Loading branch information
itsduowang authored Feb 8, 2022
2 parents 6c07edc + dd8126a commit 6ca81a7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
args: [--in-place, --remove-all-unused-imports, --remove-unused-variable, --ignore-init-module-imports]

- repo: https://github.com/psf/black
rev: 21.11b1
rev: 22.1.0
hooks:
- id: black

Expand All @@ -19,7 +19,7 @@ repos:
args: [--max-line-length=125]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand Down
2 changes: 1 addition & 1 deletion atomate/qchem/firetasks/critic2.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def run_task(self, fw_spec):
coords.append((val + centering_vector[jj]) * bohr_to_ang)
if str(molecule[ii].specie) != specie:
raise RuntimeError("Atom ordering different!")
if molecule[ii].distance_from_point(coords) > 1 * 10 ** -5:
if molecule[ii].distance_from_point(coords) > 1 * 10**-5:
raise RuntimeError("Atom position " + str(ii) + " inconsistent!")

if (
Expand Down
8 changes: 2 additions & 6 deletions atomate/qchem/workflows/tests/test_FF_and_critic.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,8 @@ def test_FFopt_and_critic(self):
# use powerup to replace run with fake run
alph_formula = initial_mol.composition.alphabetical_formula
ref_dirs = {
f"{alph_formula}:FFopt_testing": os.path.join(
test_files, "FFopt"
),
f"{alph_formula}:CC2_testing": os.path.join(
test_files, "critic_example"
),
f"{alph_formula}:FFopt_testing": os.path.join(test_files, "FFopt"),
f"{alph_formula}:CC2_testing": os.path.join(test_files, "critic_example"),
}
fake_wf = use_fake_qchem(real_wf, ref_dirs)
self.lp.add_wf(fake_wf)
Expand Down
16 changes: 8 additions & 8 deletions atomate/vasp/analysis/linear_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def det_deriv(matrix, i, j):
kk, ll = k - 1 if k > j else k, l - 1 if l > i else l
minor_p = (-1) ** (i + j) * det_deriv(mji, kk, ll)

j_matrix[k, l] = (minor_p * det - minor * det_p) / det ** 2
j_matrix[k, l] = (minor_p * det - minor * det_p) / det**2

jacobians[i].append(j_matrix)

Expand Down Expand Up @@ -312,7 +312,7 @@ def chi_inverse(chi, chi_err, method="full"):
)

# Assume cross-covariances are zero
chi_covar = np.diag(np.reshape(chi_err_block ** 2, [n_response * n_response]))
chi_covar = np.diag(np.reshape(chi_err_block**2, [n_response * n_response]))

(chi_inv, chi_inv_var, chi_inv_jacobs) = inverse_matrix_uncertainty(
chi_block, chi_covar
Expand Down Expand Up @@ -359,12 +359,12 @@ def compute_uj_simple_two_by_two(
umat_err = f_matrix_err[2 * i : 2 * (i + 1), 2 * i : 2 * (i + 1)]

uval = 0.25 * np.sum(umat)
uval_err = 0.25 * np.sqrt(np.sum(umat_err ** 2))
uval_err = 0.25 * np.sqrt(np.sum(umat_err**2))

jmat = np.array([[-1, 1], [1, -1]]) * umat.copy()
jmat_err = umat_err.copy()
jval = 0.25 * np.sum(jmat)
jval_err = 0.25 * np.sqrt(np.sum(jmat_err ** 2))
jval_err = 0.25 * np.sqrt(np.sum(jmat_err**2))

return uval, uval_err, jval, jval_err

Expand Down Expand Up @@ -439,7 +439,7 @@ def fmat_deriv_nscf(kk, ll, ik, il):
uval_err = uval_err + np.sum(
np.dot(
np.transpose(jacob_vec),
np.dot(np.diag(np.reshape(chi_sub_scf_err ** 2, [4])), jacob_vec),
np.dot(np.diag(np.reshape(chi_sub_scf_err**2, [4])), jacob_vec),
)
)
# nscf component
Expand All @@ -460,7 +460,7 @@ def fmat_deriv_nscf(kk, ll, ik, il):
uval_err = uval_err + np.sum(
np.dot(
np.transpose(jacob_vec),
np.dot(np.diag(np.reshape(chi_sub_nscf_err ** 2, [4])), jacob_vec),
np.dot(np.diag(np.reshape(chi_sub_nscf_err**2, [4])), jacob_vec),
)
)
# compute std
Expand Down Expand Up @@ -501,7 +501,7 @@ def fmat_deriv_nscf(kk, ll, ik, il):
jval_err = jval_err + np.sum(
np.dot(
np.transpose(jacob_vec),
np.dot(np.diag(np.reshape(chi_sub_scf_err ** 2, [4])), jacob_vec),
np.dot(np.diag(np.reshape(chi_sub_scf_err**2, [4])), jacob_vec),
)
)
# nscf component
Expand All @@ -522,7 +522,7 @@ def fmat_deriv_nscf(kk, ll, ik, il):
jval_err = jval_err + np.sum(
np.dot(
np.transpose(jacob_vec),
np.dot(np.diag(np.reshape(chi_sub_nscf_err ** 2, [4])), jacob_vec),
np.dot(np.diag(np.reshape(chi_sub_nscf_err**2, [4])), jacob_vec),
)
)
# compute std
Expand Down
6 changes: 3 additions & 3 deletions atomate/vasp/builders/bandgap_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ def run(self):
] # electronic portion of eps ("eps_static") approximates eps_inf
n = math.sqrt(eps) # sqrt(eps_inf) to get refractive index
d = {}
d["gap_moss"] = (95 / n ** 4) if n > 0 else None
d["gap_moss"] = (95 / n**4) if n > 0 else None
d["gap_gupta-ravindra"] = (4.16 - n) / 0.85 if n <= 4.16 else None
d["gap_reddy-anjaneyulu"] = 36.3 / math.exp(n)
d["gap_reddy-ahamed"] = 154 / n ** 4 + 0.365 if n > 0 else None
d["gap_reddy-ahamed"] = 154 / n**4 + 0.365 if n > 0 else None
d["gap_herve_vandamme"] = (
13.47 / math.sqrt(n ** 2 - 1) - 3.47 if n > 1 else None
13.47 / math.sqrt(n**2 - 1) - 3.47 if n > 1 else None
)

d = {"bandgap_estimation": d}
Expand Down
24 changes: 5 additions & 19 deletions atomate/vasp/firetasks/tests/test_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
__email__ = "ajain@lbl.gov"

module_dir = os.path.dirname(os.path.abspath(__file__))
test_files = os.path.join(module_dir, "..", "..", "test_files")

DEBUG_MODE = False

Expand All @@ -16,31 +17,16 @@ class TestCopyVaspOutputs(AtomateTest):
@classmethod
def setUpClass(cls):
cls.plain_outdir = os.path.join(
module_dir,
"..",
"..",
"test_files",
"Si_structure_optimization_plain",
"outputs",
test_files, "Si_structure_optimization_plain", "outputs"
)
cls.gzip_outdir = os.path.join(
module_dir, "..", "..", "test_files", "Si_structure_optimization", "outputs"
test_files, "Si_structure_optimization", "outputs"
)
cls.relax2_outdir = os.path.join(
module_dir,
"..",
"..",
"test_files",
"Si_structure_optimization_relax2",
"outputs",
test_files, "Si_structure_optimization_relax2", "outputs"
)
cls.nokpts_outdir = os.path.join(
module_dir,
"..",
"..",
"test_files",
"Si_structure_optimization",
"outputs_no_kpts",
test_files, "Si_structure_optimization", "outputs_no_kpts"
)

def test_unittestsetup(self):
Expand Down
4 changes: 2 additions & 2 deletions dev_scripts/plot_raman.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def lorentzian(w, wj, delta_w=4.0):
return (
4.0
/ np.pi
* (w ** 2 * delta_w)
/ ((w ** 2 - wj ** 2) ** 2 + 4 * delta_w ** 2 * w ** 2)
* (w**2 * delta_w)
/ ((w**2 - wj**2) ** 2 + 4 * delta_w**2 * w**2)
)
# wolfram
# return 1./np.pi * (delta_w/2)/ ( (w - wj)**2 + (delta_w/2)**2 )
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
version="1.0.3",
description="atomate has implementations of FireWorks workflows for Materials Science",
long_description=open(join(module_dir, "README.md")).read(),
long_description_content_type="text/markdown",
url="https://github.com/hackingmaterials/atomate",
author="Anubhav Jain, Kiran Mathew",
author_email="anubhavster@gmail.com, kmathew@lbl.gov",
Expand Down

0 comments on commit 6ca81a7

Please sign in to comment.