Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ jobs:

tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: ${{ matrix.python-version }}

- name: Install python dependencies
run: |
Expand Down
32 changes: 20 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
exclude: ^seekpath/hpkot/band_path_data

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: double-quote-string-fixer

- repo: https://github.com/ikamensh/flynt/
rev: 1.0.1
hooks:
- id: flynt

- repo: https://github.com/ambv/black
rev: 23.3.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
hooks:
- id: black
- id: ruff-format
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]

#- repo: local
# hooks:
# - id: prospector
# language: system
# types: [file, python]
# name: prospector
# description: "This hook runs Prospector: https://github.com/landscapeio/prospector"
# entry: prospector
- repo: https://github.com/PyCQA/prospector
rev: v1.11.0
hooks:
- id: prospector
language: system
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build/
build/
156 changes: 78 additions & 78 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,48 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.mathjax",
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
# 'sphinx.ext.intersphinx',
"sphinx.ext.viewcode",
'sphinx.ext.viewcode',
]

intersphinx_mapping = {
# 'python': ('https://docs.python.org/2.7', None),
}

nitpick_ignore = [("py:obj", "module")]
nitpick_ignore = [('py:obj', 'module')]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = ".rst"
source_suffix = '.rst'

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
# ~ master_doc = 'index'
master_doc = "index"
master_doc = 'index'

# General information about the project.
project = "seekpath"
project = 'seekpath'
copyright = (
"2016-{}, Giovanni Pizzi, PAUL SCHERRER INSTITUT (Laboratory "
"for Materials Simulations), ECOLE POLYTECHNIQUE FEDERALE DE "
"LAUSANNE (Theory and Simulation of Materials (THEOS) and National Centre for "
"Computational Design and Discovery of Novel Materials (NCCR MARVEL)), "
"Switzerland. "
"All rights reserved.".format(time.localtime().tm_year)
'2016-{}, Giovanni Pizzi, PAUL SCHERRER INSTITUT (Laboratory '
'for Materials Simulations), ECOLE POLYTECHNIQUE FEDERALE DE '
'LAUSANNE (Theory and Simulation of Materials (THEOS) and National Centre for '
'Computational Design and Discovery of Novel Materials (NCCR MARVEL)), '
'Switzerland. '
'All rights reserved.'.format(time.localtime().tm_year)
)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ".".join(seekpath.__version__.split(".")[:2])
version = '.'.join(seekpath.__version__.split('.')[:2])
# The full version, including alpha/beta/rc tags.
release = seekpath.__version__

Expand All @@ -77,7 +77,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["doc.rst"]
exclude_patterns = ['doc.rst']
# ~ exclude_patterns = ['index.rst']

# The reST default role (used for this markup: `text`) to use for all
Expand All @@ -96,7 +96,7 @@
show_authors = True

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand Down Expand Up @@ -185,7 +185,7 @@
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
html_use_opensearch = "http://seekpath.readthedocs.io"
html_use_opensearch = 'http://seekpath.readthedocs.io'

# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
Expand All @@ -194,7 +194,7 @@
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
html_search_language = "en"
html_search_language = 'en'

# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
Expand All @@ -205,7 +205,7 @@
# html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = "seekpathdoc"
htmlhelp_basename = 'seekpathdoc'

# -- Options for LaTeX output ---------------------------------------------

Expand Down Expand Up @@ -277,13 +277,13 @@
# texinfo_no_detailmenu = False

# NOTE: it is needed to have these lines before load_dbenv()
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
# No sphinx_rtd_theme installed
Expand All @@ -292,60 +292,60 @@
# Warnings to ignore when using the -n (nitpicky) option
# We should ignore any python built-in exception, for instance
nitpick_ignore = [
("py:exc", "ArithmeticError"),
("py:exc", "AssertionError"),
("py:exc", "AttributeError"),
("py:exc", "BaseException"),
("py:exc", "BufferError"),
("py:exc", "DeprecationWarning"),
("py:exc", "EOFError"),
("py:exc", "EnvironmentError"),
("py:exc", "Exception"),
("py:exc", "FloatingPointError"),
("py:exc", "FutureWarning"),
("py:exc", "GeneratorExit"),
("py:exc", "IOError"),
("py:exc", "ImportError"),
("py:exc", "ImportWarning"),
("py:exc", "IndentationError"),
("py:exc", "IndexError"),
("py:exc", "KeyError"),
("py:exc", "KeyboardInterrupt"),
("py:exc", "LookupError"),
("py:exc", "MemoryError"),
("py:exc", "NameError"),
("py:exc", "NotImplementedError"),
("py:exc", "OSError"),
("py:exc", "OverflowError"),
("py:exc", "PendingDeprecationWarning"),
("py:exc", "ReferenceError"),
("py:exc", "RuntimeError"),
("py:exc", "RuntimeWarning"),
("py:exc", "StandardError"),
("py:exc", "StopIteration"),
("py:exc", "SyntaxError"),
("py:exc", "SyntaxWarning"),
("py:exc", "SystemError"),
("py:exc", "SystemExit"),
("py:exc", "TabError"),
("py:exc", "TypeError"),
("py:exc", "UnboundLocalError"),
("py:exc", "UnicodeDecodeError"),
("py:exc", "UnicodeEncodeError"),
("py:exc", "UnicodeError"),
("py:exc", "UnicodeTranslateError"),
("py:exc", "UnicodeWarning"),
("py:exc", "UserWarning"),
("py:exc", "VMSError"),
("py:exc", "ValueError"),
("py:exc", "Warning"),
("py:exc", "WindowsError"),
("py:exc", "ZeroDivisionError"),
("py:obj", "str"),
("py:obj", "list"),
("py:obj", "tuple"),
("py:obj", "int"),
("py:obj", "float"),
("py:obj", "bool"),
("py:obj", "Mapping"),
('py:exc', 'ArithmeticError'),
('py:exc', 'AssertionError'),
('py:exc', 'AttributeError'),
('py:exc', 'BaseException'),
('py:exc', 'BufferError'),
('py:exc', 'DeprecationWarning'),
('py:exc', 'EOFError'),
('py:exc', 'EnvironmentError'),
('py:exc', 'Exception'),
('py:exc', 'FloatingPointError'),
('py:exc', 'FutureWarning'),
('py:exc', 'GeneratorExit'),
('py:exc', 'IOError'),
('py:exc', 'ImportError'),
('py:exc', 'ImportWarning'),
('py:exc', 'IndentationError'),
('py:exc', 'IndexError'),
('py:exc', 'KeyError'),
('py:exc', 'KeyboardInterrupt'),
('py:exc', 'LookupError'),
('py:exc', 'MemoryError'),
('py:exc', 'NameError'),
('py:exc', 'NotImplementedError'),
('py:exc', 'OSError'),
('py:exc', 'OverflowError'),
('py:exc', 'PendingDeprecationWarning'),
('py:exc', 'ReferenceError'),
('py:exc', 'RuntimeError'),
('py:exc', 'RuntimeWarning'),
('py:exc', 'StandardError'),
('py:exc', 'StopIteration'),
('py:exc', 'SyntaxError'),
('py:exc', 'SyntaxWarning'),
('py:exc', 'SystemError'),
('py:exc', 'SystemExit'),
('py:exc', 'TabError'),
('py:exc', 'TypeError'),
('py:exc', 'UnboundLocalError'),
('py:exc', 'UnicodeDecodeError'),
('py:exc', 'UnicodeEncodeError'),
('py:exc', 'UnicodeError'),
('py:exc', 'UnicodeTranslateError'),
('py:exc', 'UnicodeWarning'),
('py:exc', 'UserWarning'),
('py:exc', 'VMSError'),
('py:exc', 'ValueError'),
('py:exc', 'Warning'),
('py:exc', 'WindowsError'),
('py:exc', 'ZeroDivisionError'),
('py:obj', 'str'),
('py:obj', 'list'),
('py:obj', 'tuple'),
('py:obj', 'int'),
('py:obj', 'float'),
('py:obj', 'bool'),
('py:obj', 'Mapping'),
]
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

1 change: 0 additions & 1 deletion docs/source/module_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ The HPKOT module

.. automodule:: seekpath.hpkot.tools
:members:

45 changes: 23 additions & 22 deletions seekpath/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=cyclic-import, wrong-import-position
# ruff: noqa: E402
"""
The seekpath module contains routines to get automatically the
path in a 3D Brillouin zone to plot band structures.
Expand All @@ -7,21 +9,21 @@
Licence: MIT License, see LICENSE.txt file
"""

__version__ = "2.1.0"
__author__ = "Giovanni Pizzi, PSI"
__version__ = '2.1.0'
__author__ = 'Giovanni Pizzi, PSI'
__copyright__ = (
"Copyright (c), 2016-2023, Giovanni Pizzi, PAUL SCHERRER INSTITUT "
"(Laboratory for Materials Simulations), EPFL "
"(Theory and Simulation of Materials (THEOS) and National Centre "
"for Computational Design and Discovery of Novel Materials "
"(NCCR MARVEL)), Switzerland."
'Copyright (c), 2016-2023, Giovanni Pizzi, PAUL SCHERRER INSTITUT '
'(Laboratory for Materials Simulations), EPFL '
'(Theory and Simulation of Materials (THEOS) and National Centre '
'for Computational Design and Discovery of Novel Materials '
'(NCCR MARVEL)), Switzerland.'
)
__credits__ = ["Yoyo Hinuma", "Jae-Mo Lihm"]
__license__ = "MIT license"
__credits__ = ['Yoyo Hinuma', 'Jae-Mo Lihm']
__license__ = 'MIT license'
__paper__ = (
"Y. Hinuma, G. Pizzi, Y. Kumagai, F. Oba, I. Tanaka, "
"Band structure diagram paths based on crystallography, "
"Comp. Mat. Sci. 128, 140 (2017). DOI: 10.1016/j.commatsci.2016.10.015"
'Y. Hinuma, G. Pizzi, Y. Kumagai, F. Oba, I. Tanaka, '
'Band structure diagram paths based on crystallography, '
'Comp. Mat. Sci. 128, 140 (2017). DOI: 10.1016/j.commatsci.2016.10.015'
)


Expand All @@ -32,8 +34,6 @@ class SupercellWarning(UserWarning):
original cell) is requested.
"""

pass


from .getpaths import (
get_path,
Expand All @@ -45,13 +45,14 @@ class SupercellWarning(UserWarning):
from .hpkot import EdgeCaseWarning, SymmetryDetectionError
from .brillouinzone import brillouinzone


__all__ = (
"get_path",
"get_explicit_k_path",
"get_path_orig_cell",
"get_explicit_k_path_orig_cell",
"EdgeCaseWarning",
"SymmetryDetectionError",
"SupercellWarning",
"brillouinzone",
'get_path',
'get_explicit_k_path',
'get_path_orig_cell',
'get_explicit_k_path_orig_cell',
'EdgeCaseWarning',
'SymmetryDetectionError',
'SupercellWarning',
'brillouinzone',
)
Loading