-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from JuDFTteam/release-0.14.0
🚀 Release `0.14.0`
- Loading branch information
Showing
64 changed files
with
1,663 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,13 +31,13 @@ jobs: | |
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4.2.0 | ||
uses: actions/setup-python@v4.3.0 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Cache python dependencies | ||
id: cache-pip | ||
uses: actions/[email protected].6 | ||
uses: actions/[email protected].9 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-docs-${{ hashFiles('**/pyproject.toml') }} | ||
|
@@ -82,15 +82,15 @@ jobs: | |
|
||
- name: Cache python dependencies | ||
id: cache-pip | ||
uses: actions/[email protected].6 | ||
uses: actions/[email protected].9 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
pip-pre-commit- | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4.2.0 | ||
uses: actions/setup-python@v4.3.0 | ||
with: | ||
python-version: 3.8 | ||
|
||
|
@@ -112,10 +112,12 @@ jobs: | |
matrix: | ||
python-version: ['3.10','3.9', '3.8'] | ||
experimental: [false] | ||
extra-dependencies: ['testing,bokeh-plots,cmdline-extras'] | ||
pytest-cmdline: [''] | ||
include: | ||
- python-version: '3.7' | ||
experimental: false | ||
extra-dependencies: 'testing,bokeh-plots' | ||
pytest-cmdline: '-o addopts="--cov=masci_tools --cov=tests --cov-report xml"' | ||
# include: | ||
# - python-version: '3.11-dev' | ||
|
@@ -130,22 +132,22 @@ jobs: | |
|
||
- name: Cache python dependencies | ||
id: cache-pip | ||
uses: actions/[email protected].6 | ||
uses: actions/[email protected].9 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
pip-${{ matrix.python-version }}-tests | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4.2.0 | ||
uses: actions/setup-python@v4.3.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
|
||
- name: Install python dependencies | ||
run: | | ||
pip install -e .[testing,bokeh-plots] | ||
pip install -e .[${{ matrix.extra-dependencies }}] | ||
pip install pyhull | ||
- name: Run pytest | ||
|
@@ -170,7 +172,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v4.2.0 | ||
uses: actions/setup-python@v4.3.0 | ||
with: | ||
python-version: 3.7 | ||
- name: Install flit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,13 @@ jobs: | |
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4.2.0 | ||
uses: actions/setup-python@v4.3.0 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Cache python dependencies | ||
id: cache-pip | ||
uses: actions/[email protected].6 | ||
uses: actions/[email protected].9 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-docs-${{ hashFiles('**/pyproject.toml') }} | ||
|
@@ -76,15 +76,15 @@ jobs: | |
|
||
- name: Cache python dependencies | ||
id: cache-pip | ||
uses: actions/[email protected].6 | ||
uses: actions/[email protected].9 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
pip-pre-commit- | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4.2.0 | ||
uses: actions/setup-python@v4.3.0 | ||
with: | ||
python-version: 3.8 | ||
|
||
|
@@ -107,10 +107,12 @@ jobs: | |
matrix: | ||
python-version: ['3.10','3.9', '3.8'] | ||
experimental: [false] | ||
extra-dependencies: ['testing,bokeh-plots,cmdline-extras'] | ||
pytest-cmdline: [""] | ||
include: | ||
- python-version: '3.7' | ||
experimental: false | ||
extra-dependencies: 'testing,bokeh-plots' | ||
pytest-cmdline: '-o addopts="--cov=masci_tools --cov=tests --cov-report xml"' | ||
#- python-version: '3.11.0-rc.2' | ||
# experimental: true | ||
|
@@ -125,15 +127,15 @@ jobs: | |
|
||
- name: Cache python dependencies | ||
id: cache-pip | ||
uses: actions/[email protected].6 | ||
uses: actions/[email protected].9 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
pip-${{ matrix.python-version }}-tests | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4.2.0 | ||
uses: actions/setup-python@v4.3.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
|
@@ -148,7 +150,7 @@ jobs: | |
- name: Install python dependencies | ||
run: | | ||
pip install -e .[testing,bokeh-plots] | ||
pip install -e .[${{ matrix.extra-dependencies }}] | ||
pip install pyhull | ||
- name: Run pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
""" | ||
Import all the command groups to include in the cli | ||
""" | ||
from . import (fleur_schema, parse, plot, tools) | ||
from . import (convert_inpgen, fleur_schema, parse, plot, tools) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
""" | ||
CLI commands for converting common structure definition formats to fleur inpgen files | ||
""" | ||
from .root import cli | ||
import click | ||
|
||
from pathlib import Path | ||
import os | ||
|
||
from masci_tools.cmdline.utils import echo | ||
|
||
try: | ||
import pymatgen | ||
from pymatgen.core import Structure | ||
except ImportError: | ||
pymatgen = None | ||
|
||
try: | ||
import ase | ||
from ase.io import read, write | ||
except ImportError: | ||
ase = None | ||
|
||
|
||
@cli.command('convert-inpgen') | ||
@click.argument('input-file', type=click.Path(exists=True, path_type=Path, resolve_path=True)) | ||
@click.argument('output-file', type=click.Path(path_type=Path, resolve_path=True)) | ||
@click.option('-c', | ||
'--converter', | ||
type=click.Choice(['ase', 'pymatgen']), | ||
help='Which library is used to read in the given file format', | ||
default='pymatgen') | ||
def convert_inpgen(input_file, output_file, converter): | ||
"""Convert the given file to an fleur inpgen file | ||
""" | ||
|
||
input_file = os.fspath(input_file) | ||
output_file = os.fspath(output_file) | ||
|
||
if converter == 'ase': | ||
if ase is None: | ||
echo.echo_critical('ase is not installed. Please install the packages ase and ase-fleur') | ||
|
||
atoms = read(input_file) | ||
write(output_file, atoms, format='fleur-inpgen') | ||
elif converter == 'pymatgen': | ||
if pymatgen is None: | ||
echo.echo_critical('pymatgen is not installed. Please install the packages pymatgen and pymatgen-io-fleur') | ||
|
||
struc = Structure.from_file(os.fspath(input_file)) | ||
struc.to(output_file, fmt='fleur-inpgen') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.