Skip to content

Commit

Permalink
Merge branch 'trunk' into read_tbdat
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaojunfeng authored Aug 29, 2022
2 parents f5ce135 + 1b0f07a commit 9686791
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 27 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Continuous Integration
on: [push, pull_request]
on: [pull_request]
jobs:
docs:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -29,9 +29,7 @@ jobs:
INSTALL_TYPE: ${{ matrix.install-type }}
run: .ci/install_script.sh
- name: Build documentation
env:
READTHEDOCS: 'True'
run: SPHINXOPTS='-nW' make -C doc html
run: make SPHINXOPTS='-nW' -C doc html
- uses: actions/upload-artifact@v2
with:
name: doc-build
Expand Down Expand Up @@ -70,7 +68,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: ['3.7', '3.8', '3.9', '3.10']
install-type: [dev]
include:
- python-version: 3.8
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows_source/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Continuous Integration

on: [push, pull_request]
on: [pull_request]

_anchors:
checkout: &CHECKOUT
Expand Down Expand Up @@ -46,9 +46,7 @@ jobs:
- *PYTHON_SETUP
- *INSTALL_PROJECT
- name: Build documentation
env:
READTHEDOCS: "True"
run: SPHINXOPTS='-nW' make -C doc html
run: make SPHINXOPTS='-nW' -C doc html
- uses: actions/upload-artifact@v2
with:
name: doc-build
Expand All @@ -72,7 +70,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: ["3.7", "3.8", "3.9", "3.10"]
install-type: [dev]
include:
- python-version: 3.8
Expand Down
6 changes: 6 additions & 0 deletions clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# (c) 2015-2018, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <[email protected]>

find -name "*.pyc" -delete;
find -name "*.pyo" -delete;
find -name "__pycache__" -delete;
7 changes: 6 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"symmetry-representation": ("http://z2pack.ethz.ch/symmetry-representation/", None),
"numpy": ("https://numpy.org/devdocs/", None),
"symmetry-representation": (
"http://symmetry-representation.greschd.ch/en/latest",
None,
),
"fsc.hdf5-io": ("http://frescolinogroup.github.io/frescolino/pyhdf5io/0.5/", None),
}

nitpick_ignore = [("py:class", "array")]
nitpick_ignore_regex = [("py:class", "numpy.*"), ("py:class", "ty.*")]
ipython_warning_is_error = False

# Add any paths that contain templates here, relative to this directory.
Expand Down
10 changes: 6 additions & 4 deletions doc/source/symmetrize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The model is located in the ``examples`` directory of the TBmodels source. You w
.. ipython::

In [0]: model_nosym = tbmodels.io.load(
...: EXAMPLES_DIR / 'symmetrization' / 'nonsymmorphic_Si'/'data' / 'model_nosym.hdf5'
...: EXAMPLES_DIR / 'symmetrization' / 'nonsymmorphic_Si' / 'data' / 'model_nosym.hdf5'
...: )


Expand Down Expand Up @@ -114,14 +114,16 @@ Note that we use the ``numeric=True`` flag here. This keyword is used to switch
Next, we use ``pymatgen`` to determine the space group symmetries of our crystal:

.. ipython::
:okwarning:

In [0]: import pymatgen as mg
In [0]: from pymatgen.core import Structure
...: from pymatgen.symmetry.analyzer import SpacegroupAnalyzer

In [0]: structure = mg.Structure(
In [0]: structure = Structure(
...: lattice=model_nosym.uc, species=['Si', 'Si'], coords=np.array(coords)
...: )

In [0]: analyzer = mg.symmetry.analyzer.SpacegroupAnalyzer(structure)
In [0]: analyzer = SpacegroupAnalyzer(structure)

In [0]: sym_ops = analyzer.get_symmetry_operations(cartesian=False)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ packages = find:
kwant =
kwant
dev =
kwant
# kwant
pytest~=6.0
pytest-cov
pythtb
Expand Down
4 changes: 2 additions & 2 deletions tbmodels/_tb_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def to_kwant_lattice(self):
.. note :: The TBmodels - Kwant interface is experimental. Use it with caution.
"""
import kwant # pylint: disable=import-outside-toplevel
import kwant # pylint: disable=import-outside-toplevel,import-error

sublattices = self._get_sublattices()
uc = self.uc if self.uc is not None else np.eye(self.dim)
Expand All @@ -1017,7 +1017,7 @@ def add_hoppings_kwant(self, kwant_sys, kwant_sublattices=None):
.. note :: The TBmodels - Kwant interface is experimental. Use it with caution.
"""
import kwant # pylint: disable=import-outside-toplevel
import kwant # pylint: disable=import-outside-toplevel,import-error

sublattices = self._get_sublattices()
if kwant_sublattices is None:
Expand Down
5 changes: 0 additions & 5 deletions tests/requirements_test.txt

This file was deleted.

16 changes: 12 additions & 4 deletions tests/test_to_kwant.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@
import numpy as np
import scipy.linalg as la

with warnings.catch_warnings():
warnings.simplefilter("ignore")
import kwant
from kwant import wraparound
pytestmark = pytest.mark.xfail(
reason="Kwant tests are disabled since kwant pip installation is broken."
)

try:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import kwant
from kwant import wraparound
except ImportError:
# allow test collection
pass

from parameters import T_VALUES, KPT

Expand Down

0 comments on commit 9686791

Please sign in to comment.