Skip to content

Commit

Permalink
Merge pull request #168 from JuDFTteam/develop
Browse files Browse the repository at this point in the history
Update to latest released version
  • Loading branch information
PhilippRue authored Nov 21, 2024
2 parents b9906e4 + 3144c3a commit 2ae32ce
Show file tree
Hide file tree
Showing 76 changed files with 1,253 additions and 312 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.1.0
current_version = 2.2.1
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
Expand Down
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Next release

## Description of important changes

... Add here ...

## Checklist for next release

- [ ] finish your development and merge it into the `develop` branch
- [ ] update documentation
- [ ] update / fix tests
- [ ] bump version numbers (in files `aiida_kkr/__init__.py`, `pyproject.toml`, `.bumpversion.cfg`)

If everything is done, you can merge your changes from `develop` back into `master` and create a tag for the new version number. Creating a new tag always triggers publication to pypi (see `.github/workflows/cd.yml` for the definition of this github action).
40 changes: 20 additions & 20 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-docs-${{ hashFiles('**/setup.json') }}
Expand Down Expand Up @@ -53,21 +53,21 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/setup.json') }}
restore-keys: |
pip-pre-commit-
- name: Set up Python 3.8
uses: actions/setup-python@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install python dependencies
run: |
Expand All @@ -93,8 +93,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
aiida: [{version: 'aiida-core==2.3.0', name: '2.3.0'}]
python-version: ["3.10", "3.11", "3.12"]
aiida: [{version: 'aiida-core==2.5.2', name: '2.5.2'}]
masci-tools: [{version: 'git+https://github.com/JuDFTteam/masci-tools.git@develop', name: '-masci-develop'}]
allowed-to-fail: [false]

Expand Down Expand Up @@ -122,10 +122,10 @@ jobs:
- 5001:22

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand All @@ -143,7 +143,7 @@ jobs:
- name: Install aiida-kkr
run: |
pip install ${{ matrix.aiida.version }} ${{ matrix.masci-tools.version }}
pip install git+https://github.com/JuDFTteam/aiida-testing.git@4ddb0e48a8a720e8fca5f8d09576c5aff8c36dbf
pip install git+https://github.com/PhilippRue/aiida-test-cache.git@change_aiida-core_version
pip install .[testing]
pip install reentry
reentry scan
Expand Down Expand Up @@ -176,14 +176,14 @@ jobs:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12
- name: Install flit
run: |
pip install flit~=3.4
pip install flit~=3.10
- name: Build and publish to PyPi
run: |
flit publish
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-docs-${{ hashFiles('**/setup.json') }}
Expand Down Expand Up @@ -47,21 +47,21 @@ jobs:
timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/setup.json') }}
restore-keys: |
pip-pre-commit-
- name: Set up Python 3.8
uses: actions/setup-python@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install python dependencies
run: |
Expand All @@ -87,8 +87,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
aiida: [{version: 'aiida-core==2.3.0', name: '2.3.0'}]
python-version: ["3.10", "3.11", "3.12"]
aiida: [{version: 'aiida-core==2.5.2', name: '2.5.2'}]
masci-tools: [{version: 'git+https://github.com/JuDFTteam/masci-tools.git@develop', name: '-masci-develop'}]
allowed-to-fail: [false]

Expand Down Expand Up @@ -116,10 +116,10 @@ jobs:
- 5001:22

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand All @@ -137,7 +137,7 @@ jobs:
- name: Install aiida-kkr
run: |
pip install ${{ matrix.aiida.version }} ${{ matrix.masci-tools.version }}
pip install git+https://github.com/JuDFTteam/aiida-testing.git@4ddb0e48a8a720e8fca5f8d09576c5aff8c36dbf
pip install git+https://github.com/PhilippRue/aiida-test-cache.git@change_aiida-core_version
pip install .[testing]
pip install reentry
reentry scan
Expand Down Expand Up @@ -174,14 +174,14 @@ jobs:
GITHUB_SUITE=True ./run_all.sh || exit 0
- name: Archive test output artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results-AIIDA__${{ matrix.aiida.name }}__MASCI__${{ matrix.masci-tools.name }}
path: tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./tests/coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,19 @@ $ reentry scan -r aiida

# Usage and Documentation

* see http://aiida-kkr.readthedocs.io for user's guide and API reference.
* see http://aiida-kkr.readthedocs.io for user's and developer's guides and API reference
* check out http://judft.de and https://jukkr.fz-juelich.de for information of the KKR codes used by the plugin

# Contributing

Thank you for your interest in contributing to aiida-kkr.
Check out our [contributing guide](CONTRIBUTING.md) for some information.

# Releasing new versions

To create a new release follow these steps:
- finish your development and merge it into the `develop` branch
- update documentation
- update / fix tests
- bump version numbers (in files `aiida_kkr/__init__.py`, `pyproject.toml`, `.bumpversion.cfg`)
- merge changes from `develop` back into `master` and create a tag for the new version number (this triggers publication to pypi)
2 changes: 1 addition & 1 deletion aiida_kkr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
AiiDA KKR
"""

__version__ = '2.1.0'
__version__ = '2.2.1'
1 change: 1 addition & 0 deletions aiida_kkr/calculations/kkrimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def _get_and_verify_hostfiles(self, tempfolder):
parent_calc = parent_calcs.first().node
# extract impurity_info
found_impurity_inputnode = False
found_host_parent = False
if 'impurity_info' in self.inputs:
imp_info_inputnode = self.inputs.impurity_info
if not isinstance(imp_info_inputnode, Dict):
Expand Down
6 changes: 3 additions & 3 deletions aiida_kkr/calculations/kkrnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def prepare_for_submission(self, tempfolder):

else:
raise InputValidationError(
'Either `strucwithpot` or a `parent_folder` has to be provided.\ If necessary remove one of the inputs.'
'Either `strucwithpot` or a `parent_folder` has to be provided. If necessary remove one of the inputs.'
)

print('passed lattice constant=', passed_lattice_const)
Expand Down Expand Up @@ -278,7 +278,7 @@ def prepare_for_submission(self, tempfolder):

if noco:
with tempfolder.open(self._DEFAULT_NOCO_INPUT_FILE, u'w') as nonco_angles_handle:
self._write_nonco_angles(nonco_angles_handle, nonco_angles, structure)
self._write_nonco_angles(nonco_angles_handle, nonco_angles, structure) # pylint: disable=possibly-used-before-assignment

# Prepare rbasis.xyz and input.conf from Structure and input parameter data unless convert mode
if not convert:
Expand All @@ -288,7 +288,7 @@ def prepare_for_submission(self, tempfolder):
self._write_rbasis(rbasis_handle, structure, passed_lattice_const)
if write_efermi:
with tempfolder.open(self._DEFAULT_EFERMI_FILE, u'w') as efermi_file_handle:
self._write_efermi_file(efermi_file_handle, fermi)
self._write_efermi_file(efermi_file_handle, fermi) # pylint: disable=used-before-assignment

# Prepare potential and shapefun file from strucwithpot, if necessary
if use_strucwithpot:
Expand Down
14 changes: 10 additions & 4 deletions aiida_kkr/calculations/voro.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def prepare_for_submission(self, tempfolder):
vca_structure = False
if found_structure:
# for VCA: check if input structure and parameter node define VCA structure
vca_structure = vca_check(structure, parameters)
vca_structure = vca_check(structure, parameters) # pylint: disable=used-before-assignment

code = self.inputs.code

Expand All @@ -120,7 +120,7 @@ def prepare_for_submission(self, tempfolder):

if found_parent:
# check if parent is either Voronoi or previous KKR calculation
overwrite_potential, parent_calc = self._check_valid_parent(parent_calc_folder)
overwrite_potential, parent_calc = self._check_valid_parent(parent_calc_folder) # pylint: disable=possibly-used-before-assignment

#cross check if no structure was given and extract structure from parent
if found_structure and not vca_structure:
Expand Down Expand Up @@ -188,7 +188,7 @@ def prepare_for_submission(self, tempfolder):
outfolder = parent_calc.outputs.retrieved # copy from remote folder
copylist = [parent_calc.process_class._OUT_POTENTIAL]
elif has_potfile_overwrite:
outfolder = potfile_overwrite # copy from potential sfd
outfolder = potfile_overwrite # copy from potential sfd # pylint: disable=possibly-used-before-assignment
copylist = [potfile_overwrite.filename]
else:
copylist = []
Expand All @@ -197,7 +197,13 @@ def prepare_for_submission(self, tempfolder):
filename = file1
if (found_parent or has_potfile_overwrite) and file1 == copylist[0]:
filename = self._POTENTIAL_IN_OVERWRITE
local_copy_list.append((outfolder.uuid, file1, filename))
local_copy_list.append((outfolder.uuid, file1, filename)) # pylint: disable=possibly-used-before-assignment

# add shapefun to overwrite
if 'shapefun_overwrite' in self.inputs:
shapefun_overwrite = self.inputs.shapefun_overwrite
filename = shapefun_overwrite.filename
local_copy_list.append((shapefun_overwrite.uuid, filename, 'shapefun_overwrite'))

# add shapefun to overwrite
if 'shapefun_overwrite' in self.inputs:
Expand Down
2 changes: 1 addition & 1 deletion aiida_kkr/parsers/kkrnano.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _findSimpleEntries(self, string2find, retrieved_folder, output_file_name, li
array = np.genfromtxt(StringIO(keyvalue.replace('D', 'e')), delimiter=' ', dtype=None) #[0]

try:
returnlist.append(array.item()[0])
returnlist.append(array.item()[0]) # pylint: disable=possibly-used-before-assignment
except TypeError:
returnlist.append(array.item())

Expand Down
2 changes: 1 addition & 1 deletion aiida_kkr/tools/imp_cluster_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def create_combined_imp_info(

# set zimp in scoef file (not used by the code but makes it easier to read the files / debug)
if single_single:
clust1[0][4] = zimp1
clust1[0][4] = zimp1 # pylint: disable=possibly-used-before-assignment
clust2[0][4] = zimp2
#if debug:
# print('cls1:', clust1)
Expand Down
12 changes: 6 additions & 6 deletions aiida_kkr/tools/ldau.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ def get_ldaumatrices(retrieved):
iphi = ii
ii += 1
# save matrices to output dict
txt_dict_ldaumats['wldau'] = txt[iwldau + 1:iuldau]
txt_dict_ldaumats['uldau'] = txt[iuldau + 1:iphi]
txt_dict_ldaumats['phi'] = txt[iphi + 1:]
txt_dict_ldaumats['wldau'] = txt[iwldau + 1:iuldau] # pylint: disable=possibly-used-before-assignment
txt_dict_ldaumats['uldau'] = txt[iuldau + 1:iphi] # pylint: disable=possibly-used-before-assignment
txt_dict_ldaumats['phi'] = txt[iphi + 1:] # pylint: disable=possibly-used-before-assignment

return has_ldaupot_file, txt_dict_ldaumats

Expand Down Expand Up @@ -164,8 +164,8 @@ def get_LDAU_initmatrices_dict(txts_ldaumat1, offset=0):
# Fill the dictionary with atom-wise information
for iatom in range(len(iatoms)):
LDAU_initmatrices_dict[f'iatom={int(iatoms[iatom])-1+offset}'] = {}
LDAU_initmatrices_dict[f'iatom={int(iatoms[iatom])-1+offset}']['wldau'] = wldaumat[iatom]
LDAU_initmatrices_dict[f'iatom={int(iatoms[iatom])-1+offset}']['uldau'] = uldaumat[iatom]
LDAU_initmatrices_dict[f'iatom={int(iatoms[iatom])-1+offset}']['phi'] = phimat[iatom]
LDAU_initmatrices_dict[f'iatom={int(iatoms[iatom])-1+offset}']['wldau'] = wldaumat[iatom] # pylint: disable=possibly-used-before-assignment
LDAU_initmatrices_dict[f'iatom={int(iatoms[iatom])-1+offset}']['uldau'] = uldaumat[iatom] # pylint: disable=used-before-assignment
LDAU_initmatrices_dict[f'iatom={int(iatoms[iatom])-1+offset}']['phi'] = phimat[iatom] # pylint: disable=used-before-assignment

return LDAU_initmatrices_dict
4 changes: 2 additions & 2 deletions aiida_kkr/tools/plot_kkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ def plot_kkrimp_dos_wc(self, node, **kwargs):
from aiida_kkr.tools import find_parent_structure
natoms = get_natyp(find_parent_structure(calcnode))
self.dosplot(
d,
d, # pylint: disable=possibly-used-before-assignment
natoms,
nofig,
all_atoms,
Expand Down Expand Up @@ -1536,7 +1536,7 @@ def plot_kkr_startpot(self, node, **kwargs):
tit_add = ''
if emin is not None:
axvline(emin, color='r', ls='--', label='emin')
if ef_Ry is not None and len(ecore_max) > 0:
if ef_Ry is not None and len(ecore_max) > 0: # pylint: disable=possibly-used-before-assignment
if abs((ecore_max[0] - ef_Ry) * get_Ry2eV() - emin) < 20:
axvline((ecore_max[0] - ef_Ry) * get_Ry2eV(), color='b', ls='--', label='ecore_max')
else:
Expand Down
Loading

0 comments on commit 2ae32ce

Please sign in to comment.