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
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Bug Report
description: Report a reproducible bug in VisualizePhonon
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thank you for reporting a bug. Please provide enough detail to reproduce the issue with a minimal OUTCAR when possible.
- type: input
id: title
attributes:
label: Bug Summary
placeholder: Short and descriptive summary of the bug
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to Reproduce
placeholder: |
1. Run `vaspvis generate -i OUTCAR -f xsf -m 0 -s 1.0`
2. Observe the error
description: Please provide a minimal, reproducible example.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
description: What did you expect to happen instead?
validations:
required: false
- type: textarea
id: logs
attributes:
label: Error Traceback or Logs
description: Include the traceback, command output, or relevant OUTCAR parser message.
render: shell
validations:
required: false
- type: input
id: environment
attributes:
label: Environment
placeholder: "e.g., macOS, Python 3.11, VisualizePhonon 0.0.2"
validations:
required: false
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Feature Request
description: Suggest a new feature or improvement
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Thank you for your suggestion. Please describe the workflow or visualization need you want VisualizePhonon to support.
- type: input
id: summary
attributes:
label: Summary
placeholder: e.g., Add support for exporting selected modes to another visualization format
validations:
required: true
- type: textarea
id: motivation
attributes:
label: Motivation
description: Why is this feature important? What problem does it solve?
validations:
required: false
- type: textarea
id: proposal
attributes:
label: Proposed Solution
description: Describe how you would like the feature to work.
validations:
required: false
- type: textarea
id: alternatives
attributes:
label: Alternatives
description: Any alternative solutions or tools you have considered?
validations:
required: false
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Question
description: Ask a question related to usage or development
labels: [question]
body:
- type: markdown
attributes:
value: |
If you have a question, please provide enough context about your VASP output, command, or development task.
- type: input
id: summary
attributes:
label: Question Summary
placeholder: e.g., How should I visualize one imaginary phonon mode from OUTCAR?
validations:
required: true
- type: textarea
id: context
attributes:
label: Context or Background
description: What are you trying to do? Include relevant commands, files, modes, formats, or errors.
validations:
required: false
20 changes: 20 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Python:
- changed-files:
- any-glob-to-any-file:
- src/VisualizePhonon/**/*
- pyproject.toml
- setup.py
Docs:
- changed-files:
- any-glob-to-any-file:
- "*.md"
- docs/**/*
Examples:
- changed-files:
- any-glob-to-any-file: examples/**/*
Test:
- changed-files:
- any-glob-to-any-file: test/**/*
CICD:
- changed-files:
- any-glob-to-any-file: .github/**/*
89 changes: 89 additions & 0 deletions .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Auto Release on Version Bump

on:
push:
branches:
- main

permissions:
contents: write
id-token: write

jobs:
autorelease:
name: Check version and create release
runs-on: ubuntu-latest
outputs:
tag_exists: ${{ steps.check_tag.outputs.exists }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Get current version
id: get_version
run: |
VERSION=$(python - <<'PY'
import tomllib

with open("pyproject.toml", "rb") as f:
print(tomllib.load(f)["project"]["version"])
PY
)
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Check if tag exists
id: check_tag
run: |
TAG_NAME="v${{ env.VERSION }}"
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
echo "Tag $TAG_NAME already exists. Skipping release."
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "Tag $TAG_NAME does not exist. A new release will be created."
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Create GitHub Release
if: steps.check_tag.outputs.exists == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="v${{ env.VERSION }}"
echo "Creating release for $TAG_NAME..."
gh release create "$TAG_NAME" \
--title "$TAG_NAME" \
--generate-notes

publish:
name: Build & Publish to PyPI
needs: autorelease
if: needs.autorelease.outputs.tag_exists == 'false'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/VisualizePhonon
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install build dependencies
run: pip install build

- name: Build sdist and wheel
run: python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
37 changes: 37 additions & 0 deletions .github/workflows/check_cmdline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test if cmdlines work

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
check-cmdline:
name: Check CLI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install package
run: |
python -m pip install --upgrade pip
pip install -e .

- name: Check vaspvis commands
run: |
vaspvis --help
vaspvis generate --help
tmpdir="$(mktemp -d)"
cp test/OUTCAR "$tmpdir/OUTCAR"
cd "$tmpdir"
vaspvis generate -i OUTCAR -f xsf -m 0 -s 1.0
test -f mode_0.xsf
15 changes: 15 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pull Request Labeler

on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
configuration-path: .github/labeler.yml
29 changes: 29 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: pre-commit

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit

- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test Suite

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
test:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run tests with coverage
run: pytest --cov=src/ --cov-report=xml

- name: Upload coverage reports to Codecov
if: ${{ matrix.python-version == '3.12' && env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ env.CODECOV_TOKEN }}

- name: Build package verification
if: ${{ matrix.python-version == '3.12' }}
run: |
pip install build
python -m build
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
exclude: ^(examples/(OUTCAR|POSCAR|\.latexmkrc|test\.py)|test/(OUTCAR|test_vibrationalanalysis\.py))$

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-added-large-files
args: ["--maxkb=2048"]
Loading
Loading