Skip to content

Commit 80a4c02

Browse files
committed
Merge remote-tracking branch 'hackmat/main' into qchem_update
2 parents d4906cd + b9ad04e commit 80a4c02

File tree

959 files changed

+2542795
-16202
lines changed

Some content is hidden

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

959 files changed

+2542795
-16202
lines changed

.circleci/config.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
working_directory: ~/atomate
55
docker:
66
- image: materialsvirtuallab/circle-ci-pmg-py3:3.7.3
7-
- image: circleci/mongo:3.4.15
7+
- image: circleci/mongo:latest
88
steps:
99
- checkout
1010
- restore_cache:
@@ -37,7 +37,7 @@ jobs:
3737
working_directory: ~/atomate
3838
docker:
3939
- image: materialsvirtuallab/circle-ci-pmg-py3:3.7.3
40-
- image: circleci/mongo:3.4.15
40+
- image: circleci/mongo:latest
4141
steps:
4242
- checkout
4343
- restore_cache:
@@ -56,9 +56,6 @@ jobs:
5656
tar -zxvf vampire-5.0-linux.tar.gz
5757
export PATH=/root/atomate/linux/:$PATH
5858
pip install --quiet -r requirements.txt -r requirements-ci.txt
59-
pip install git+https://github.com/materialsproject/pymatgen.git --upgrade
60-
pip install git+https://github.com/materialsproject/custodian.git --upgrade
61-
pip install git+https://github.com/materialsproject/fireworks.git --upgrade
6259
# Add executables and path.
6360
for EXEPATH in `pwd`/cmd_line/*/Linux_64bit; do export PATH=$PATH:$EXEPATH; done
6461
pip install --quiet -e .
@@ -76,9 +73,7 @@ workflows:
7673
jobs:
7774
- py3test
7875
- py3devtest:
79-
filters: # don't run dev tests on master branch
76+
filters: # don't run dev tests on main branch
8077
branches:
8178
ignore:
82-
master
83-
84-
79+
main

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v2
16+
17+
- name: Setup Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.7
21+
22+
- name: Install C++ dependencies
23+
run: |
24+
sudo apt-get install openbabel
25+
26+
- name: Cache pip
27+
uses: actions/cache@v2
28+
id: pip-cache
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-
34+
35+
- name: Install dependencies
36+
if: steps.pip-cache.outputs.cache-hit != 'true'
37+
run: |
38+
pip install -r requirements.txt
39+
pip install -r requirements-ci.txt
40+
pip install .[complete]
41+
42+
- name: pytest
43+
run: |
44+
pytest --ignore=atomate/qchem/test_files --cov=atomate --cov-report html:coverage_reports atomate

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ nosetests.xml
4444

4545
# Pycharm
4646
.idea/*
47-
4847
.eggs/*
48+
venv
4949

5050
# VS Code
5151
settings.json

.pre-commit-config.yaml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
repos:
2-
- repo: git@github.com:humitos/mirrors-autoflake.git
3-
rev: v1.1
2+
- repo: https://github.com/myint/autoflake
3+
rev: v1.4
44
hooks:
5-
- id: autoflake
6-
args: [ '--in-place', '--remove-all-unused-imports', '--remove-unused-variable' ]
7-
- repo: https://github.com/ambv/black
8-
rev: stable
5+
- id: autoflake
6+
args: [--in-place, --remove-all-unused-imports, --remove-unused-variable, --ignore-init-module-imports]
7+
8+
- repo: https://github.com/psf/black
9+
rev: 21.11b1
910
hooks:
10-
- id: black
11-
language_version: python3.7
11+
- id: black
12+
13+
- repo: https://github.com/pycqa/flake8
14+
rev: 4.0.1
15+
hooks:
16+
- id: flake8
17+
args: [--max-line-length=125]
18+
1219
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: v2.3.0
20+
rev: v4.0.1
1421
hooks:
1522
- id: check-yaml
1623
- id: end-of-file-fixer
1724
- id: trailing-whitespace
18-
- id: flake8
19-
args: ["--max-line-length=125"]
25+
26+
- repo: https://github.com/asottile/pyupgrade
27+
rev: v2.31.0
28+
hooks:
29+
- id: pyupgrade
30+
args: [--py37-plus]

CONTRIBUTING.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# Contributing to atomate
2+
23
We love your input! We want to make contributing to atomate as easy and transparent as possible, whether it's:
4+
35
* Reporting a bug
46
* Discussing the current state of the code
57
* Submitting a fix
68
* Proposing or implementing new features
79
* Becoming a maintainer
810

911
## Reporting bugs, getting help, and discussion
12+
1013
At any time, feel free to start a thread on our [Discourse forum](https://discuss.matsci.org/c/atomate).
1114

1215
If you are making a bug report, incorporate as many elements of the following as possible to ensure a timely response and avoid the need for followups:
16+
1317
* A quick summary and/or background
1418
* Steps to reproduce - be specific! **Provide sample code.**
1519
* What you expected would happen, compared to what actually happens
@@ -19,16 +23,19 @@ If you are making a bug report, incorporate as many elements of the following as
1923
We love thorough bug reports as this means the development team can make quick and meaningful fixes. When we confirm your bug report, we'll move it to the GitHub issues where its progress can be further tracked.
2024

2125
## Contributing code modifications or additions through Github
22-
We use github to host code, to track issues and feature requests, as well as accept pull requests. We maintain a list of all contributors to atomate [here.](https://atomate.org/contributors.html)
26+
27+
We use github to host code, to track issues and feature requests, as well as accept pull requests. We maintain a list of all contributors to atomate [here](https://atomate.org/contributors.html).
2328

2429
Pull requests are the best way to propose changes to the codebase. Follow the [Github flow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow) for more information on this procedure.
2530

2631
The basic procedure for making a PR is:
27-
* Fork the repo and create your branch from master.
32+
33+
* Fork the repo and create your branch from main.
2834
* Commit your improvements to your branch and push to your Github fork (repo).
2935
* When you're finished, go to your fork and make a Pull Request. It will automatically update if you need to make further changes.
3036

3137
### How to Make a **Great** Pull Request
38+
3239
We have a few tips for writing good PRs that are accepted into the main repo:
3340

3441
* Use the Google Code style for all of your code. Find an example [here.](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
@@ -41,4 +48,5 @@ When you submit your PR, our CI service will automatically run your tests.
4148
We welcome good discussion on the best ways to write your code, and the comments on your PR are an excellent area for discussion.
4249

4350
#### References
51+
4452
This document was adapted from the open-source contribution guidelines for Facebook's Draft, as well as briandk's [contribution template](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62).

atomate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.9.5"
1+
__version__ = "1.0.1"

atomate/common/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__author__ = 'Anubhav Jain <[email protected]>'
1+
__author__ = "Anubhav Jain <[email protected]>"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__author__ = 'Anubhav Jain <[email protected]>'
1+
__author__ = "Anubhav Jain <[email protected]>"

atomate/common/firetasks/glue_tasks.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# coding: utf-8
2-
3-
41
import os
52
import monty
63
import shutil
@@ -72,7 +69,7 @@ def get_calc_loc(target_name, calc_locs):
7269
for doc in reversed(calc_locs):
7370
if doc["name"] == target_name:
7471
return doc
75-
raise ValueError("Could not find the target_name: {}".format(target_name))
72+
raise ValueError(f"Could not find the target_name: {target_name}")
7673
else:
7774
return calc_locs[-1]
7875

atomate/common/firetasks/parse_outputs.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
# coding: utf-8
2-
3-
41
import json
52
import os
63

7-
from fireworks import explicit_serialize, FiretaskBase, FWAction
8-
from fireworks.utilities.fw_serializers import DATETIME_HANDLER
9-
10-
from atomate.utils.utils import env_chk, get_logger, load_class
114
from atomate.common.firetasks.glue_tasks import get_calc_loc
5+
from atomate.utils.utils import env_chk, get_logger, load_class
6+
from fireworks import FiretaskBase, FWAction, explicit_serialize
7+
from fireworks.utilities.fw_serializers import DATETIME_HANDLER
128

13-
__author__ = 'Shyam Dwaraknath <[email protected]>, Anubhav Jain <[email protected]>'
9+
__author__ = "Shyam Dwaraknath <[email protected]>, Anubhav Jain <[email protected]>"
1410

1511
logger = get_logger(__name__)
1612

@@ -37,7 +33,14 @@ class ToDbTask(FiretaskBase):
3733
"""
3834

3935
required_params = ["drone"]
40-
optional_params = ["mmdb", "db_file", "calc_dir", "calc_loc", "additional_fields", "options"]
36+
optional_params = [
37+
"mmdb",
38+
"db_file",
39+
"calc_dir",
40+
"calc_loc",
41+
"additional_fields",
42+
"options",
43+
]
4144

4245
def run_task(self, fw_spec):
4346
# get the directory that contains the dir to parse
@@ -48,12 +51,13 @@ def run_task(self, fw_spec):
4851
calc_dir = get_calc_loc(self["calc_loc"], fw_spec["calc_locs"])["path"]
4952

5053
# parse the calc directory
51-
logger.info("PARSING DIRECTORY: {} USING DRONE: {}".format(
52-
calc_dir, self['drone'].__class__.__name__))
54+
logger.info(
55+
f"PARSING DIRECTORY: {calc_dir} USING DRONE: {self['drone'].__class__.__name__}"
56+
)
5357
# get the database connection
54-
db_file = env_chk(self.get('db_file'), fw_spec)
58+
db_file = env_chk(self.get("db_file"), fw_spec)
5559

56-
drone = self['drone'].__class__()
60+
drone = self["drone"].__class__()
5761
task_doc = drone.assimilate(calc_dir)
5862
if not db_file:
5963
with open("task.json", "w") as f:
@@ -66,7 +70,9 @@ def run_task(self, fw_spec):
6670

6771
# insert the task document
6872
t_id = db.insert(task_doc)
69-
logger.info("Finished parsing with task_id: {}".format(t_id))
73+
logger.info(f"Finished parsing with task_id: {t_id}")
7074

71-
return FWAction(stored_data={"task_id": task_doc.get("task_id", None)},
72-
defuse_children=(task_doc["state"] != "successful"))
75+
return FWAction(
76+
stored_data={"task_id": task_doc.get("task_id", None)},
77+
defuse_children=(task_doc["state"] != "successful"),
78+
)

0 commit comments

Comments
 (0)