Skip to content

Commit ac89978

Browse files
authored
Merge pull request #738 from janosh/py38+
Drop py37 support
2 parents a5ff517 + 291e931 commit ac89978

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+159
-290
lines changed

.circleci/config.yml

Lines changed: 14 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,30 @@
1-
version: 2
1+
version: 2.1
22
jobs:
3-
py3test:
3+
test:
44
working_directory: ~/atomate
55
docker:
6-
- image: materialsvirtuallab/circle-ci-pmg-py3:3.7.3
7-
- image: circleci/mongo:latest
6+
- image: continuumio/miniconda3
7+
- image: circleci/mongo
88
steps:
99
- checkout
1010
- restore_cache:
11-
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
11+
key: deps-{{ checksum "requirements-ci.txt" }}-{{ checksum "setup.py" }}
1212
- run:
13+
name: Install dependencies
1314
command: |
1415
export PATH=$HOME/miniconda3/bin:$PATH
15-
conda create --quiet --yes --name test_env python=3.7
16+
conda create --name test_env python=3.8
1617
source activate test_env
17-
conda install --quiet --yes numpy scipy matplotlib sympy pandas
18-
conda install --quiet --yes -c conda-forge openbabel
19-
# conda install --quiet --yes -c clinicalgraphics vtk
20-
conda install --quiet --yes -c conda-forge python-igraph
21-
conda update --quiet --all
22-
wget https://vampire.york.ac.uk/resources/release-5/vampire-5.0-linux.tar.gz
23-
tar -zxvf vampire-5.0-linux.tar.gz
24-
export PATH=/root/atomate/linux/:$PATH
25-
pip install --quiet -r requirements.txt -r requirements-ci.txt
26-
# Add executables and path.
27-
for EXEPATH in `pwd`/cmd_line/*/Linux_64bit; do export PATH=$PATH:$EXEPATH; done
28-
pip install --quiet -e .
29-
pytest --ignore=atomate/qchem/test_files --cov=atomate --cov-report html:coverage_reports atomate
30-
no_output_timeout: 3600
31-
- store_artifacts:
32-
path: coverage_reports/
33-
destination: tr1
34-
- store_test_results:
35-
path: coverage_reports/
36-
py3devtest:
37-
working_directory: ~/atomate
38-
docker:
39-
- image: materialsvirtuallab/circle-ci-pmg-py3:3.7.3
40-
- image: circleci/mongo:latest
41-
steps:
42-
- checkout
43-
- restore_cache:
44-
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
18+
conda install -c conda-forge openbabel pymatgen
19+
pip install -r requirements-ci.txt
20+
pip install .
21+
no_output_timeout: 1h
4522
- run:
23+
name: pytest
4624
command: |
47-
export PATH=$HOME/miniconda3/bin:$PATH
48-
conda create --quiet --yes --name test_env python=3.7
4925
source activate test_env
50-
conda install --quiet --yes numpy scipy matplotlib sympy pandas
51-
conda install --quiet --yes -c conda-forge openbabel
52-
# conda install --quiet --yes -c clinicalgraphics vtk
53-
conda install --quiet --yes -c conda-forge python-igraph
54-
conda update --quiet --all
55-
wget https://vampire.york.ac.uk/resources/release-5/vampire-5.0-linux.tar.gz
56-
tar -zxvf vampire-5.0-linux.tar.gz
57-
export PATH=/root/atomate/linux/:$PATH
58-
pip install --quiet -r requirements.txt -r requirements-ci.txt
59-
# Add executables and path.
60-
for EXEPATH in `pwd`/cmd_line/*/Linux_64bit; do export PATH=$PATH:$EXEPATH; done
61-
pip install --quiet -e .
6226
pytest --ignore=atomate/qchem/test_files --cov=atomate --cov-report html:coverage_reports atomate
63-
no_output_timeout: 3600
27+
no_output_timeout: 1h
6428
- store_artifacts:
6529
path: coverage_reports/
6630
destination: tr1
@@ -71,9 +35,4 @@ workflows:
7135
version: 2
7236
build_and_test:
7337
jobs:
74-
- py3test
75-
- py3devtest:
76-
filters: # don't run dev tests on main branch
77-
branches:
78-
ignore:
79-
main
38+
- test

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Python
2424
uses: actions/setup-python@v2
2525
with:
26-
python-version: 3.7
26+
python-version: 3.8
2727

2828
- name: Install OpenBabel
2929
run: |

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
rev: v2.31.0
3030
hooks:
3131
- id: pyupgrade
32-
args: [--py37-plus]
32+
args: [--py38-plus]
3333

3434
- repo: https://github.com/PyCQA/isort
3535
rev: 5.10.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ atomate is a software for computational materials science that contains pre-buil
88

99
If you find atomate useful, please encourage its development by citing the following paper in your research output:
1010

11-
```
11+
```txt
1212
Mathew, K., Montoya, J. H., Faghaninia, A., Dwarakanath, S., Aykol,
1313
M., Tang, H., Chu, I., Smidt, T., Bocklund, B., Horton, M., Dagdelen,
1414
J., Wood, B., Liu, Z.-K., Neaton, J., Ong, S. P., Persson, K., Jain,

atomate/common/powerups.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
This module defines general powerups that can be used for all workflows
33
"""
4+
45
from importlib import import_module
56
from typing import List
67

atomate/feff/workflows/core.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ def get_wf_xas(
8787

8888
wf_metadata = dict(metadata) if metadata else {}
8989
wf_metadata["absorbing_atom_indices"] = list(ab_atom_indices)
90-
wfname = "{}:{}:{} edge".format(
91-
structure.composition.reduced_formula, f"{spectrum_type} spectroscopy", edge
92-
)
90+
formula = structure.composition.reduced_formula
91+
wfname = f"{formula}:{spectrum_type} spectroscopy:{edge} edge"
9392

9493
return Workflow(fws, name=wfname, metadata=wf_metadata)
9594

@@ -257,9 +256,8 @@ def get_wf_eels(
257256
)
258257
)
259258

260-
wfname = "{}:{}:{} edge".format(
261-
structure.composition.reduced_formula, f"{spectrum_type} spectroscopy", edge
262-
)
259+
formula = structure.composition.reduced_formula
260+
wfname = f"{formula}:{spectrum_type} spectroscopy:{edge} edge"
263261
wf_metadata = dict(metadata) if metadata else {}
264262
wf_metadata["absorbing_atom_indices"] = list(ab_atom_indices)
265263

atomate/lammps/firetasks/run_calc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def run_task(self, fw_spec):
9595
output_file=self.get("output_file", "packed_mol.xyz"),
9696
bin=self["packmol_cmd"],
9797
)
98-
logger.info("Running {}".format(self["packmol_cmd"]))
98+
logger.info(f"Running {self['packmol_cmd']}")
9999
packed_mol = pmr.run(site_property=self.get("site_property", None))
100100
logger.info("Packmol finished running.")
101101
return FWAction(mod_spec=[{"_set": {"packed_mol": packed_mol}}])

atomate/qchem/workflows/base/FF_and_critic.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ def get_wf_FFopt_and_critic(
6262
# FFopt
6363
fw1 = FrequencyFlatteningOptimizeFW(
6464
molecule=molecule,
65-
name="{}:{}".format(
66-
molecule.composition.alphabetical_formula, "FFopt_" + suffix
67-
),
65+
name=f"{molecule.composition.alphabetical_formula}:{'FFopt_' + suffix}",
6866
qchem_cmd=">>qchem_cmd<<",
6967
max_cores=">>max_cores<<",
7068
qchem_input_params=qchem_input_params,
@@ -74,7 +72,7 @@ def get_wf_FFopt_and_critic(
7472

7573
# Critic
7674
fw2 = CubeAndCritic2FW(
77-
name="{}:{}".format(molecule.composition.alphabetical_formula, "CC2_" + suffix),
75+
name=f"{molecule.composition.alphabetical_formula}:{'CC2_' + suffix}",
7876
qchem_cmd=">>qchem_cmd<<",
7977
max_cores=">>max_cores<<",
8078
qchem_input_params=qchem_input_params,
@@ -83,8 +81,6 @@ def get_wf_FFopt_and_critic(
8381
)
8482
fws = [fw1, fw2]
8583

86-
wfname = "{}:{}".format(
87-
molecule.composition.alphabetical_formula, "FFopt_CC2_WF_" + suffix
88-
)
84+
wfname = f"{molecule.composition.alphabetical_formula}:{'FFopt_CC2_WF_' + suffix}"
8985

9086
return Workflow(fws, name=wfname, **kwargs)

atomate/qchem/workflows/base/torsion_potential.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,8 @@ def get_wf_torsion_potential(
9898
rot_task = RotateTorsion(atom_indexes=atom_indexes, angle=angle)
9999
rot_opt_fw.tasks.insert(0, rot_task)
100100
# define opt section
101-
opt_line = "tors {a} {b} {c} {d} {ang}".format(
102-
a=atom_indexes[0],
103-
b=atom_indexes[1],
104-
c=atom_indexes[2],
105-
d=atom_indexes[3],
106-
ang=angle,
107-
)
101+
a, b, c, d = atom_indexes
102+
opt_line = f"tors {a} {b} {c} {d} {angle}"
108103
opt = {"CONSTRAINT": [opt_line]}
109104
for idx_t, t in enumerate(rot_opt_fw.tasks):
110105
if "WriteInputFromIOSet" in str(t):

atomate/qchem/workflows/tests/test_FF_and_critic.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ def test_FFopt_and_critic(self):
4949
},
5050
)
5151
# use powerup to replace run with fake run
52+
alph_formula = initial_mol.composition.alphabetical_formula
5253
ref_dirs = {
53-
"{}:{}".format(
54-
initial_mol.composition.alphabetical_formula, "FFopt_testing"
55-
): os.path.join(test_files, "FFopt"),
56-
"{}:{}".format(
57-
initial_mol.composition.alphabetical_formula, "CC2_testing"
58-
): os.path.join(test_files, "critic_example"),
54+
f"{alph_formula}:FFopt_testing": os.path.join(
55+
test_files, "FFopt"
56+
),
57+
f"{alph_formula}:CC2_testing": os.path.join(
58+
test_files, "critic_example"
59+
),
5960
}
6061
fake_wf = use_fake_qchem(real_wf, ref_dirs)
6162
self.lp.add_wf(fake_wf)
@@ -70,22 +71,14 @@ def test_FFopt_and_critic(self):
7071
self.assertTrue(all([s == "COMPLETED" for s in wf_test.fw_states.values()]))
7172

7273
FFopt = self.get_task_collection().find_one(
73-
{
74-
"task_label": "{}:{}".format(
75-
initial_mol.composition.alphabetical_formula, "FFopt_testing"
76-
)
77-
}
74+
{"task_label": f"{alph_formula}:FFopt_testing"}
7875
)
7976
self.assertEqual(FFopt["calcs_reversed"][0]["input"]["smx"]["solvent"], "other")
8077
self.assertEqual(FFopt["num_frequencies_flattened"], 0)
8178
FFopt_final_mol = Molecule.from_dict(FFopt["output"]["optimized_molecule"])
8279

8380
CC2 = self.get_task_collection().find_one(
84-
{
85-
"task_label": "{}:{}".format(
86-
initial_mol.composition.alphabetical_formula, "CC2_testing"
87-
)
88-
}
81+
{"task_label": f"{alph_formula}:CC2_testing"}
8982
)
9083
CC2_initial_mol = Molecule.from_dict(CC2["input"]["initial_molecule"])
9184

0 commit comments

Comments
 (0)