Skip to content

Commit f10f32c

Browse files
committed
Merge commit '9cc63ca' into molmd_fix_3-9
2 parents 1575d5c + 9cc63ca commit f10f32c

File tree

900 files changed

+64039
-147389
lines changed

Some content is hidden

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

900 files changed

+64039
-147389
lines changed

.github/workflows/lint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7+
# prevent this action from running on forks
8+
if: github.repository == 'materialsproject/pymatgen'
79
runs-on: ubuntu-latest
810
strategy:
911
max-parallel: 1
@@ -17,6 +19,12 @@ jobs:
1719
uses: actions/setup-python@v2
1820
with:
1921
python-version: ${{ matrix.python-version }}
22+
- uses: actions/cache@v2
23+
with:
24+
path: ~/.cache/pip
25+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
26+
restore-keys: |
27+
${{ runner.os }}-pip-
2028
- name: Install dependencies
2129
run: |
2230
python -m pip install --upgrade pip

.github/workflows/release.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77

88
jobs:
99
test:
10+
# prevent this action from running on forks
11+
if: github.repository == 'materialsproject/pymatgen'
1012

1113
strategy:
1214
max-parallel: 20
@@ -32,15 +34,14 @@ jobs:
3234

3335
steps:
3436
- uses: actions/checkout@v2
35-
- name: Set up Python 3.8
37+
- name: Set up Python 3.9
3638
uses: actions/setup-python@v2
3739
with:
38-
python-version: 3.8
40+
python-version: 3.9
3941
- uses: actions/cache@v2
40-
if: startsWith(runner.os, 'macOS')
4142
with:
42-
path: ~/Library/Caches/pip
43-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
43+
path: ~/Library/Caches/pip # needs to change if `runs-on: macos` changes
44+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
4445
restore-keys: |
4546
${{ runner.os }}-pip-
4647
- name: Install dependencies
@@ -59,7 +60,7 @@ jobs:
5960
max-parallel: 2
6061
matrix:
6162
os: [ macos-latest, windows-latest ]
62-
python-version: [ 3.7, 3.8 ]
63+
python-version: [ '3.8', '3.9', '3.10' ]
6364
runs-on: ${{ matrix.os }}
6465

6566
steps:
@@ -68,10 +69,13 @@ jobs:
6869
uses: actions/setup-python@v2
6970
with:
7071
python-version: ${{ matrix.python-version }}
72+
- name: Get pip cache dir
73+
id: cache-dir
74+
run: |
75+
echo "::set-output name=dir::$(pip cache dir)"
7176
- uses: actions/cache@v2
72-
if: startsWith(runner.os, 'macOS')
7377
with:
74-
path: ~/Library/Caches/pip
78+
path: ${{ steps.cache-dir.outputs.dir }}
7579
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
7680
restore-keys: |
7781
${{ runner.os }}-pip-
@@ -86,6 +90,8 @@ jobs:
8690
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
8791
run: |
8892
pip install setuptools wheel twine
93+
rm -rf test_files
8994
python setup.py sdist bdist_wheel
90-
twine upload dist/*.whl
95+
twine upload --skip-existing dist/*.whl
9196
twine upload --skip-existing dist/*.tar.gz
97+
continue-on-error: true

.github/workflows/test.yml renamed to .github/workflows/test-linux.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# This workflow runs only on Ubuntu and aims to be more complete than the Mac and Windows workflows.
22
# In particular, Openbabel and many of the external command line dependencies are included for testing.defaults:
33
# The ext package is also only tested in this workflow. Coverage is also computed based on this platform.
4-
name: Testing
4+
name: Testing Linux
55

66
on: [ push, pull_request ]
77

88
jobs:
99

1010
test:
11+
# prevent this action from running on forks
12+
if: github.repository == 'materialsproject/pymatgen'
1113
strategy:
1214
max-parallel: 20
1315
matrix:
@@ -17,7 +19,7 @@ jobs:
1719
pkg_id: 1
1820
- pkg: pymatgen/analysis --ignore=pymatgen/analysis/defects --ignore=pymatgen/analysis/chemenv --ignore=pymatgen/analysis/elasticity --ignore=pymatgen/analysis/magnetism
1921
pkg_id: 2
20-
- pkg: pymatgen/electronic_structure pymatgen/symmetry pymatgen/ext pymatgen/command_line
22+
- pkg: pymatgen/electronic_structure pymatgen/symmetry pymatgen/command_line pymatgen/ext
2123
pkg_id: 3
2224
- pkg: pymatgen --ignore=pymatgen/analysis --ignore=pymatgen/electronic_structure --ignore=pymatgen/symmetry --ignore=pymatgen/ext --ignore=pymatgen/command_line
2325
pkg_id: 4
@@ -34,12 +36,12 @@ jobs:
3436
- uses: actions/checkout@v2
3537
- uses: conda-incubator/setup-miniconda@v2
3638
with:
37-
python-version: 3.8
39+
python-version: 3.9
3840
- name: Cache pip
3941
uses: actions/cache@v2
4042
with:
4143
path: ~/.cache/pip
42-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
44+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
4345
restore-keys: |
4446
${{ runner.os }}-pip-
4547
- name: Install OpenBabel and Libs
@@ -73,10 +75,10 @@ jobs:
7375
runs-on: ubuntu-latest
7476
steps:
7577
- uses: actions/checkout@v2
76-
- name: Set up Python 3.8
78+
- name: Set up Python 3.9
7779
uses: actions/setup-python@v1
7880
with:
79-
python-version: 3.8
81+
python-version: 3.9
8082
- name: Install deps
8183
run: |
8284
python -m pip install --upgrade pip

.github/workflows/test-macwin.yml renamed to .github/workflows/test-mac.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
name: Testing Mac Windows
1+
name: Testing Mac
22

33
on: [ pull_request ]
44

55
jobs:
66
test:
7+
# prevent this action from running on forks
8+
if: github.repository == 'materialsproject/pymatgen'
79

810
strategy:
911
max-parallel: 20
1012
matrix:
11-
os: [ macos-latest, windows-latest ]
12-
python-version: [ 3.8 ]
13+
os: [ macos-latest ]
14+
python-version: [ '3.10' ]
1315
# This distribution of tests is designed to ensure an approximately even time to finish for parallel jobs.
1416
pkg:
1517
- pymatgen/analysis/defects pymatgen/analysis/chemenv pymatgen/analysis/elasticity pymatgen/analysis/magnetism
1618
- pymatgen/analysis --ignore=pymatgen/analysis/defects --ignore=pymatgen/analysis/chemenv --ignore=pymatgen/analysis/elasticity --ignore=pymatgen/analysis/magnetism
17-
- pymatgen/electronic_structure pymatgen/symmetry pymatgen/ext pymatgen/command_line
19+
- pymatgen/electronic_structure pymatgen/symmetry pymatgen/command_line pymatgen/ext
1820
- pymatgen --ignore=pymatgen/analysis --ignore=pymatgen/electronic_structure --ignore=pymatgen/symmetry --ignore=pymatgen/ext --ignore=pymatgen/command_line
1921

2022
runs-on: ${{ matrix.os }}
@@ -32,24 +34,16 @@ jobs:
3234
with:
3335
python-version: ${{ matrix.python-version }}
3436
- uses: actions/cache@v2
35-
if: startsWith(runner.os, 'macOS')
3637
with:
37-
path: ~/Library/Caches/pip
38-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
39-
restore-keys: |
40-
${{ runner.os }}-pip-
41-
- uses: actions/cache@v2
42-
if: startsWith(runner.os, 'Windows')
43-
with:
44-
path: ~\AppData\Local\pip\Cache
45-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
38+
path: ~/Library/Caches/pip # needs to change if `runs-on: macos` changes
39+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements{,-dev}.txt') }}
4640
restore-keys: |
4741
${{ runner.os }}-pip-
4842
- name: Install dependencies
4943
run: |
5044
pip install --upgrade pip wheel
5145
pip install -r requirements.txt
52-
pip install -r requirements-optional.txt -r requirements-dev.txt
46+
pip install -r requirements-dev.txt
5347
pip install -e .
5448
- name: pytest ${{ matrix.pkg }}
5549
run: |

.github/workflows/test-win.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Testing Windows
2+
3+
on: [ pull_request ]
4+
5+
jobs:
6+
test:
7+
# prevent this action from running on forks
8+
if: github.repository == 'materialsproject/pymatgen'
9+
10+
strategy:
11+
max-parallel: 20
12+
matrix:
13+
os: [ windows-latest ]
14+
python-version: [ '3.9' ]
15+
# This distribution of tests is designed to ensure an approximately even time to finish for parallel jobs.
16+
pkg:
17+
- pymatgen/analysis/defects pymatgen/analysis/chemenv pymatgen/analysis/elasticity pymatgen/analysis/magnetism
18+
- pymatgen/analysis --ignore=pymatgen/analysis/defects --ignore=pymatgen/analysis/chemenv --ignore=pymatgen/analysis/elasticity --ignore=pymatgen/analysis/magnetism
19+
- pymatgen/electronic_structure pymatgen/symmetry pymatgen/command_line pymatgen/ext
20+
- pymatgen --ignore=pymatgen/analysis --ignore=pymatgen/electronic_structure --ignore=pymatgen/symmetry --ignore=pymatgen/ext --ignore=pymatgen/command_line
21+
22+
runs-on: ${{ matrix.os }}
23+
24+
env:
25+
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
26+
MPLBACKEND: "Agg"
27+
PMG_TEST_FILES_DIR: ${{ github.workspace }}/test_files
28+
GULP_LIB: ${{ github.workspace }}/cmd_line/gulp/Libraries
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
- uses: actions/cache@v2
37+
with:
38+
path: ~\AppData\Local\pip\Cache # needs to change if `runs-on: windows` changes
39+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements{,-dev}.txt') }}
40+
restore-keys: |
41+
${{ runner.os }}-pip-
42+
- name: Install dependencies
43+
run: |
44+
pip install --upgrade pip wheel
45+
pip install -r requirements.txt
46+
pip install -r requirements-dev.txt
47+
pip install -e .
48+
- name: pytest ${{ matrix.pkg }}
49+
run: |
50+
pytest ${{ matrix.pkg }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies/spglib*/build
1010
*.swp
1111
*.swo
1212
*.pyd
13+
*.c
1314
pymatgen/pymatgen.cfg
1415
dist
1516
_build

.pre-commit-config.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 20.8b1 # Replace by any tag/version: https://github.com/psf/black/tags
3+
rev: 21.11b1
44
hooks:
5-
- id: black
6-
language_version: python3 # Should be a command that runs python3.6+
5+
- id: black
76
- repo: https://github.com/pre-commit/mirrors-pylint
8-
rev: '36ae6523465f8ba6936f6b63c3df94ab237eda00' # Use the sha / tag you want to point at
7+
rev: v3.0.0a4
98
hooks:
10-
- id: pylint
9+
- id: pylint
1110
- repo: https://github.com/pre-commit/pre-commit-hooks
1211
rev: v2.3.0
1312
hooks:
1413
- id: check-yaml
1514
- id: end-of-file-fixer
1615
- id: trailing-whitespace
1716
- id: flake8
18-
args: ["--max-line-length=120"]
17+
args: [--max-line-length=120]

ADMIN.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Introduction
22
============
33

4-
This docmentation provides a guide for pymatgen administrators. The following
4+
This documentation provides a guide for pymatgen administrators. The following
55
assumes you are using miniconda or Anaconda.
66

77
Releases
@@ -23,18 +23,18 @@ Install some conda tools first::
2323
conda install --yes conda-build anaconda-client
2424
conda config --add channels matsci
2525

26-
Pymatgen uses `invoke <http://www.pyinvoke.org/>`_ to automate releases. You will
26+
Pymatgen uses `invoke <http://www.pyinvoke.org/>`_ to automate releases. You will
2727
also need sphinx and doc2dash. Install these using::
2828

2929
pip install --upgrade invoke sphinx doc2dash
3030

31-
For 2018, we will release both py27 and py37 versions of pymatgen. Create
31+
For 2018, we will release both py27 and py37 versions of pymatgen. Create
3232
environments for py27 and py37 using conda::
3333

3434
conda create --yes -n py37 python=3.7
3535
conda create --yes -n py27 python=2.7
3636

37-
For each env, install some packages using conda followed by dev install for
37+
For each env, install some packages using conda followed by dev install for
3838
pymatgen::
3939

4040
conda activate py37
@@ -50,43 +50,43 @@ pymatgen::
5050
pip install invoke sphinx doc2dash
5151
python setup.py develop
5252

53-
Add your PyPI username and password and GITHUB_RELEASE_TOKEN into your
53+
Add your PyPI username and password and GITHUB_RELEASE_TOKEN into your
5454
environment::
5555

5656
export TWINE_USERNAME=PYPIUSERNAME
5757
export TWINE_PASSWORD=PYPIPASSWORD
5858
export GITHUB_RELEASES_TOKEN=TOKEN_YOU_GET_FROM_GITHUB
5959

60-
You may want to add these to your .bash_profile to avoid having to type these
60+
You may want to add these to your .bash_profile to avoid having to type these
6161
each time.
6262

6363
Machine-specific issues
6464
~~~~~~~~~~~~~~~~~~~~~~~
6565

66-
The above instructions are general, but there are some known issues that are
66+
The above instructions are general, but there are some known issues that are
6767
machine-specific:
6868

69-
* Installing lxml via pip required `STATIC_DEPS=true pip install lxml` on
69+
* Installing lxml via pip required `STATIC_DEPS=true pip install lxml` on
7070
macOS 10.13.
71-
* It can be useful to `pip install --upgrade pip twine setuptools` (this may
71+
* It can be useful to `pip install --upgrade pip twine setuptools` (this may
7272
be necessary if there are authentication errors when connecting to PyPI).
7373
* You may have to `brew install hdf5 netcdf` or similar to be able to pip
7474
install the optional requirement `netCDF4`.
7575

7676
Doing the release
7777
-----------------
7878

79-
Ensure appropriate environment variabels are set including `DISCOURSE_API_USERNAME`,
79+
Ensure appropriate environment variables are set including `DISCOURSE_API_USERNAME`,
8080
`DISCOURSE_API_KEY` and `GITHUB_RELEASES_TOKEN`.
8181

82-
First update the change log. The autogenerated change log is simply a list of
82+
First update the change log. The autogenerated change log is simply a list of
8383
commit messages since the last version. Make sure to edit the log for brevity
8484
and to attribute significant features to appropriate developers::
8585

8686
conda activate py37
8787
invoke update-changelog
8888

89-
Then, do the release with the following sequence of commands (you can put them
89+
Then, do the release with the following sequence of commands (you can put them
9090
in a bash script in your PATH somewhere)::
9191

9292
conda activate py37
@@ -97,7 +97,7 @@ in a bash script in your PATH somewhere)::
9797
python setup.py develop
9898

9999
Double check that the releases are properly done on Pypi. If you are releasing
100-
on a Mac, you should see a pymatgen.version.tar.gz and two wheels (Py37 and
100+
on a Mac, you should see a pymatgen.version.tar.gz and two wheels (Py37 and
101101
P). There will be a py37 wheel for Windows that is generated by Appveyor.
102102

103103
Materials.sh

0 commit comments

Comments
 (0)