Skip to content

Commit

Permalink
Merge pull request #1 from Crivella/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Crivella authored Oct 4, 2023
2 parents f1c2033 + 2520680 commit 4448544
Show file tree
Hide file tree
Showing 132 changed files with 7,778 additions and 7,351 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: ci

on:
push:
branches:
- master
paths:
- "qepppy/**"
- "tests/**"
- "pyproject.toml"
- ".github/workflows/ci.yml"
- ".pre-commit-config.yaml"
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Cache Python dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }}
restore-keys: pip-pre-commit-

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"

- name: Install Python dependencies
run: pip install -e .[pre-commit,tests]

- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

tests:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v3

- name: Cache Python dependencies
uses: actions/cache@v3
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@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install Python dependencies
run: pip install -e .[tests]

- name: Run pytest
run: pytest -sv tests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ venv.bak/

__manual.py
failed_img

.vscode
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: double-quote-string-fixer
- id: end-of-file-fixer
exclude: &exclude >-
(?x)^(
tests/.*fixtures/.*|
tests/.*baseline/.*|
tests/.*/.*test_files/.*|
.*\.json|
.*\.txt
)$
- id: mixed-line-ending
- id: trailing-whitespace
exclude: *exclude

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

- repo: https://github.com/pycqa/isort
rev: "5.12.0"
hooks:
- id: isort
exclude: *exclude

# - repo: local
# hooks:
# - id: pylint
# name: pylint
# entry: pylint
# language: system
# types: [python]
# exclude: >
# (?x)^(
# manage\.py|
# mysite/.*|
# .*/migrations/.*|
# docs/.*|
# tests/.*(?<!\.py)$
# )$
Empty file removed LICENSE
Empty file.
9 changes: 9 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


Copyright 2023 - Davide Grassano

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
99 changes: 99 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[build-system]
# build the package with [flit](https://flit.readthedocs.io)
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[project]
# See https://www.python.org/dev/peps/pep-0621/
name = "qepppy"
dynamic = ["version"] # read from qepppy/__init__.py
description = "Python post-processing and input-output handling library for Quantum ESPRESSO"
authors = [
{ name = "Davide Grassano" },
]
readme = "README.md"
license = { file = "LICENSE.txt" }
classifiers = [
'License :: OSI Approved :: MIT License',
"Development Status :: 4 - Beta",
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.11',
]
keywords = ["DFT", "post-processing", "linear algebra"]
requires-python = ">=3.10"
dependencies = [
"numpy~=1.26.0",
"matplotlib~=3.5.1",
"scipy~=1.11.3",
]

[project.urls]
Source = "https://github.com/crivella/QEPPpy"

[project.optional-dependencies]
tests = [
"pytest",
"pytest-cov",
"pytest-mpl",
# "pytest-regressions~=2.4",
]
pre-commit = [
"pre-commit~=3.3.3",
"pylint~=2.17.4",
"pylint-pytest~=1.1.2",
]
release = [
"flit",
]

[project.scripts]
pdos_char = "qepppy.tools.pdos_char:main"
broad = "qepppy.tools.broad:main"
sum_pdos = "qepppy.tools.sum_pdos:main"
kk = "qepppy.tools.kk:main"

[tool.flit.module]
name = "qepppy"

[tool.flit.sdist]
exclude = [
".gitignore", ".github", ".pre-commit-config.yaml",
"tests/", "tests/*",
"docs/", "docs/*"
]

[tool.pytest.ini_options]
testpaths = ["tests"]
log_cli = 1
addopts = "--mpl --mpl-baseline-path=tests/baseline"

[tool.pylint.main]
load-plugins = [
"pylint_pytest"
]

[tool.pylint.messages_control]
# disable = [
# "logging-fstring-interpolation",
# "global-statement",
# "broad-exception-caught",
# "too-few-public-methods",
# ]


[tool.pylint.format]
max-line-length = 120
good-names = [
"_",
"l", "r", "b", "t",
"l1", "r1", "b1", "t1",
"l2", "r2", "b2", "t2",
"i", "j",
"k", "v",
"f",
]

[tool.pylint.design]
max-args = 10
max-locals = 20
max-attributes = 12
5 changes: 5 additions & 0 deletions qepppy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from . import qe, tools

VERSION = (0, 7, 0)

__version__ = '.'.join(map(str, VERSION))
Loading

0 comments on commit 4448544

Please sign in to comment.