Skip to content

Commit

Permalink
Merge pull request #98 from JuDFTteam/develop
Browse files Browse the repository at this point in the history
Merge develop into master for release v1.1.2
  • Loading branch information
broeder-j authored Oct 30, 2020
2 parents 21124ed + 2088174 commit 786f067
Show file tree
Hide file tree
Showing 328 changed files with 8,289 additions and 388 deletions.
2 changes: 1 addition & 1 deletion .ci/test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ case "$TEST_TYPE" in
unittests)
# make sure we have the correct pg_ctl in our path for pgtest, to prevent issue #1722
# this must match the version request in travis.yml
cd ./aiida_fleur/tests/ && ./run_all_cov.sh
cd ./tests/ && ./run_all_cov.sh
esac
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:

- name: Install python dependencies
run:
pip install .[pre-commit]
pip install git+https://github.com/aiidateam/aiida-testing@export_cache
pip install .[pre-commit,testing]
pip freeze

- name: Run pre-commit
Expand Down Expand Up @@ -108,14 +109,14 @@ jobs:
pip install PyCifRW~=4.4
# install aiida-testing manually
#pip install git+https://github.com/broeder-j/aiida-testing.git@fa44c3ba4e57192fdbdee1cf3581576acc93800c
#pip install git+https://github.com/aiidateam/aiida-testing.git@export_cache
pip install git+https://github.com/aiidateam/aiida-testing.git@export_cache
pip install .[testing]
reentry scan
- name: Run pytest
run: |
# create fake codes for tests to work on ci
cd ./aiida_fleur/tests/
cd ./tests/
touch local_exe/inpgen && chmod +x local_exe/inpgen
touch local_exe/fleur && chmod +x local_exe/fleur
./run_all_cov.sh
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cache: pip
# - sudo updatedb

install:
- pip install -U pip==18.1 wheel setuptools
- pip install -U pip wheel setuptools
- pip install -e git+https://github.com/aiidateam/aiida_core@develop#egg=aiida-core[testing,docs]
- if [ "$TEST_TYPE" == "docs" ]; then pip install . && pip install -r docs/requirements_for_rtd.txt; else pip install .; fi
env:
Expand Down
5 changes: 3 additions & 2 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Current active developers:

Jens Broeder ([email protected]) 2015-today
Vasily Tseplyaev ([email protected]) 2018-today

Anoop Chandran ([email protected]) 2019-today
Henning Janssen ([email protected]) 2020-today

We would also like to thank the following people for their contibution:

Expand All @@ -12,4 +13,4 @@ We ackowledge discussions (non-code related) input from:

Daniel Wortmann ([email protected])
Gregor Michalicek ([email protected])
The AiiDAteam
The AiiDAteam and other aiida plugin developers
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@

## v1.1.2
### release compatible with AiiDA-core 1.3.0
- still support of Fleur MaX4 version (release branch) with inpgen
- downdgraded aiida-core dependency, do release does not depend on aiida-testing
- Added userfriendly LDA+U support
- SCF workchain can generate kpoints from a given density
- Base fleur has now time limit error handler
- Relax workchain can now run a final scf
- Update documentation for corehole, initial CLS and create magnetic workchains
- Various bug fixes and robustness improvements of magnetic workchains
- For devs: Enforced pre-commit, tests dir moved out of source

## v1.1.1
### release compatible with AiiDA-core 1.4.0
- still support of Fleur MaX4 version (release branch) with inpgen
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

include aiida_fleur/tools/exp_bindingenergies.json
include aiida_fleur/fleur_schema/input/*/*.xsd
include aiida_fleur/tests/run*
recursive-include aiida_fleur/tests/files/ *
include ./tests/run*
recursive-include ./tests/files/ *
include setup.json
include setup_requirements.txt
include AUTHORS.txt
Expand Down
2 changes: 1 addition & 1 deletion aiida_fleur/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
'''
AiiDA-FLEUR
'''
__version__ = '1.1.1'
__version__ = '1.1.2'
36 changes: 32 additions & 4 deletions aiida_fleur/calculation/fleur.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class FleurCalculation(CalcJob):

# files for lda+U
_NMMPMAT_FILE_NAME = 'n_mmp_mat'
_NMMPMAT_HDF5_FILE_NAME = 'n_mmp_mat_out'

# files for hybrid functionals
_COULOMB1_FILE_NAME = 'coulomb1'
Expand Down Expand Up @@ -169,6 +170,11 @@ class FleurCalculation(CalcJob):
_WKF2_FILE_NAME, _MIX_HISTORY_FILE_NAME, _OUT_FILE_NAME, _POT_FILE_NAME
]

_copy_scf_ldau_nohdf = [[_CDN1_FILE_NAME, _CDN1_FILE_NAME], [_INPXML_FILE_NAME, _INPXML_FILE_NAME],
[_NMMPMAT_FILE_NAME, _NMMPMAT_FILE_NAME]]

_copy_scf_ldau_noinp_nohdf = [[_CDN1_FILE_NAME, _CDN1_FILE_NAME], [_NMMPMAT_FILE_NAME, _NMMPMAT_FILE_NAME]]

# files need for rerun
_copy_filelist_dos = [_INPXML_FILE_NAME, _CDN1_FILE_NAME]

Expand All @@ -183,7 +189,7 @@ class FleurCalculation(CalcJob):
'remove_from_remotecopy_list', 'cmdline'
]
# possible modes?
_fleur_modes = ['band', 'dos', 'forces', 'chargeDen', 'latticeCo', 'scf', 'force_theorem', 'gw']
_fleur_modes = ['band', 'dos', 'forces', 'chargeDen', 'latticeCo', 'scf', 'force_theorem', 'gw', 'ldau']

@classmethod
def define(cls, spec):
Expand Down Expand Up @@ -242,9 +248,13 @@ def define(cls, spec):
spec.exit_code(312, 'ERROR_MT_RADII', message='FLEUR calculation failed due to MT overlap.')
spec.exit_code(313, 'ERROR_MT_RADII_RELAX', message='Overlapping MT-spheres during relaxation.')
spec.exit_code(314, 'ERROR_DROP_CDN', message='Problem with cdn is suspected. Consider removing cdn')
spec.exit_code(315,
'ERROR_INVALID_ELEMENTS_MMPMAT',
message='The LDA+U density matrix contains invalid elements.')
spec.exit_code(316, 'ERROR_TIME_LIMIT', message='Calculation failed due to time limits.')

@classproperty
def _get_outut_folder(self):
def _get_output_folder(self):
return './'

def prepare_for_submission(self, folder):
Expand Down Expand Up @@ -392,7 +402,10 @@ def prepare_for_submission(self, folder):
# if l_f="T" retrieve relax.xml
mode_retrieved_filelist.append(self._RELAX_FILE_NAME)
if modes['ldau']:
mode_retrieved_filelist.append(self._NMMPMAT_FILE_NAME)
if with_hdf5:
mode_retrieved_filelist.append(self._NMMPMAT_HDF5_FILE_NAME)
else:
mode_retrieved_filelist.append(self._NMMPMAT_FILE_NAME)
if modes['force_theorem']:
if 'remove_from_retrieve_list' not in settings_dict:
settings_dict['remove_from_retrieve_list'] = []
Expand All @@ -411,13 +424,26 @@ def prepare_for_submission(self, folder):
outfolder_uuid = parent_calc.outputs.retrieved.uuid
self.logger.info('out folder path %s', outfolder_uuid)

outfolder_filenames = [x.name for x in parent_calc.outputs.retrieved.list_objects()]
has_nmmpmat_file = self._NMMPMAT_FILE_NAME in outfolder_filenames
if (self._NMMPMAT_FILE_NAME in outfolder_filenames or \
self._NMMPMAT_HDF5_FILE_NAME in outfolder_filenames):
if has_fleurinp:
if 'n_mmp_mat' in fleurinp.files:
self.logger.warning('Ingnoring n_mmp_mat from fleurinp. '
'There is already an n_mmp_mat file '
'for the parent calculation')
local_copy_list.remove((fleurinp.uuid, 'n_mmp_mat', 'n_mmp_mat'))

if fleurinpgen and (not has_fleurinp):
for file1 in self._copy_filelist_inpgen:
local_copy_list.append((outfolder_uuid, os.path.join(file1), os.path.join(file1)))
elif not fleurinpgen and (not has_fleurinp): # fleurCalc
# need to copy inp.xml from the parent calc
if with_hdf5:
copylist = self._copy_scf_hdf
elif has_nmmpmat_file:
copylist = self._copy_scf_ldau_nohdf
else:
copylist = self._copy_scf
for file1 in copylist:
Expand All @@ -430,6 +456,8 @@ def prepare_for_submission(self, folder):
# inp.xml will be copied from fleurinp
if with_hdf5:
copylist = self._copy_scf_noinp_hdf
elif has_nmmpmat_file:
copylist = self._copy_scf_ldau_noinp_nohdf
else:
copylist = self._copy_scf_noinp
for file1 in copylist:
Expand Down Expand Up @@ -458,7 +486,7 @@ def prepare_for_submission(self, folder):
for file1 in filelist_tocopy_remote:
remote_copy_list.append(
(parent_calc_folder.computer.uuid, os.path.join(parent_calc_folder.get_remote_path(),
file1), self._get_outut_folder))
file1), self._get_output_folder))

self.logger.info('remote copy file list %s', str(remote_copy_list))

Expand Down
16 changes: 8 additions & 8 deletions aiida_fleur/calculation/fleurinputgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FleurinputgenCalculation(CalcJob):
For more information about produced files and the FLEUR-code family, go to http://www.flapw.de/.
"""

__version__ = '1.2.0'
__version__ = '1.2.1'

# Default input and output files
_INPUT_FILE = 'aiida.in' # will be shown with inputcat
Expand Down Expand Up @@ -161,7 +161,7 @@ def prepare_for_submission(self, folder):
# convert these 'booleans' to the inpgen format.
replacer_values_bool = [True, False, 'True', 'False', 't', 'T', 'F', 'f']
# some keywords require a string " around them in the input file.
string_replace = ['econfig', 'lo', 'element', 'name']
string_replace = ['econfig', 'lo', 'element', 'name', 'xctyp']

# of some keys only the values are written to the file, specify them here.
val_only_namelist = ['soc', 'qss']
Expand Down Expand Up @@ -306,9 +306,8 @@ def prepare_for_submission(self, folder):
cell = structure.cell
for vector in cell:
scaled = [a * scaling_pos for a in vector] # scaling_pos=1./bohr_to_ang
cell_parameters_card += ('{0:18.10f} {1:18.10f} {2:18.10f}'
'\n'.format(scaled[0], scaled[1], scaled[2]))
scaling_factor_card += ('{0:18.10f} {1:18.10f} {2:18.10f}'
cell_parameters_card += ('{0:18.9f} {1:18.9f} {2:18.9f}' '\n'.format(scaled[0], scaled[1], scaled[2]))
scaling_factor_card += ('{0:18.9f} {1:18.9f} {2:18.9f}'
'\n'.format(scaling_factors[0], scaling_factors[1], scaling_factors[2]))

#### ATOMIC_POSITIONS ####
Expand Down Expand Up @@ -350,13 +349,14 @@ def prepare_for_submission(self, folder):
vector_rel[2] = vector_rel[2] * scaling_pos

if site_symbol != kind_name: # This is an important fact, if user renames it becomes a new specie!
suc = True
try:
head = kind_name.rstrip('0123456789')
kind_namet = int(kind_name[len(head):])
if int(kind_name[len(head)]) > 4:
raise InputValidationError('New specie name/label should start with a digit smaller than 4')
except ValueError:
suc = False
if suc:
pass
else:
atomic_number_name = '{}.{}'.format(atomic_number, kind_namet)
# append a label to the detached atom
atomic_positions_card_listtmp.append(' {0:7} {1:18.10f} {2:18.10f} {3:18.10f} {4}'
Expand Down
5 changes: 4 additions & 1 deletion aiida_fleur/common/workchain/base/restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def load_instance_state(self, saved_state, load_context):
self._load_error_handlers()

def _load_error_handlers(self):
# If an error handler entry point is defined, load them. If the plugin cannot be loaded log it and pass
"""
If an error handler entry point is defined, load them.
If the plugin cannot be loaded log it and pass
"""
if self._error_handler_entry_point is not None:
for entry_point_name in get_entry_point_names(self._error_handler_entry_point):
try:
Expand Down
7 changes: 4 additions & 3 deletions aiida_fleur/data/fleurinp.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,11 @@ def open(self, path='inp.xml', mode='r', key=None):
:param mode: the mode with which to open the file handle
:returns: A file handle in read mode
"""
from aiida.orm.nodes.node import WarnWhenNotEntered # deep import might change

if key is not None:
path = key

return WarnWhenNotEntered(self._repository.open(path, mode=mode), repr(self))
return self._repository.open(path, mode=mode)

def get_content(self, filename='inp.xml'):
"""
Expand Down Expand Up @@ -530,8 +529,10 @@ def get_fleur_modes(self):
fleur_modes['gw'] = int(self.inp_dict['calculationSetup']['expertModes']['gw']) != 0
except KeyError:
fleur_modes['gw'] = False
ldau = False # TODO test if ldau in inp_dict....
fleur_modes['ldau'] = False
for species in self.inp_dict['atomSpecies']['species']:
if 'ldaU' in species:
fleur_modes['ldau'] = True
return fleur_modes

def get_structuredata_ncf(self):
Expand Down
Loading

0 comments on commit 786f067

Please sign in to comment.