Skip to content

Commit

Permalink
Merge develop into master for release v1.1.3
Browse files Browse the repository at this point in the history
Merge pull request #103 from JuDFTteam/develop

From CHANGELOG.md
## v1.1.3
### release compatible with AiiDA-core 1.3.0
- still support of Fleur MaXR4 version with inpgen
- Does not support yet for Fleur MaXR5 and new inpgen
- Set_kpoints was moved from fleurinp to fleurinpmodifier
- Break_symmetry of a structure was refactored
- Implemented feature in fleurinputCalculation to set significant figures
- Implemented feature scf can now use default queues specified in code extras
- First implementation of relax type None, which cases the relax workchain to skip the
relaxation, becoming a usual scf wc,  which might make it easier to switch relaxation on
and off in other workchains.
- Fleur parser parses now the total magnetic moment of the cell
- Introduced common constants, for bohr and htr, increased precision
- Command line interface (CLI) `aiida-fleur` with various functionalities exposed
- For devs: Increased test coverage, codecov is now added to CI and linked to badge
removed some older outdated code
  • Loading branch information
broeder-j authored Dec 15, 2020
2 parents 786f067 + f6716ac commit df33e9a
Show file tree
Hide file tree
Showing 167 changed files with 15,164 additions and 3,823 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:

docs:

runs-on: ubuntu-latest
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:

pre-commit:

runs-on: ubuntu-latest
runs-on: ubuntu-18.04
timeout-minutes: 30

steps:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:

tests:

runs-on: ubuntu-latest
runs-on: ubuntu-18.04
timeout-minutes: 30

strategy:
Expand Down Expand Up @@ -120,3 +120,9 @@ jobs:
touch local_exe/inpgen && chmod +x local_exe/inpgen
touch local_exe/fleur && chmod +x local_exe/fleur
./run_all_cov.sh
- name: Upload report to Codecov
uses: codecov/codecov-action@v1
with:
file: ./tests/coverage.xml
fail_ci_if_error: False
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# Created by https://www.gitignore.io/api/python,linux,macos

#
.aiida/
submit_test/

### Python ###
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## v1.1.3
### release compatible with AiiDA-core 1.3.0
- still support of Fleur MaXR4 version with inpgen
- Does not support yet for Fleur MaXR5 and new inpgen
- Set_kpoints was moved from fleurinp to fleurinpmodifier
- Break_symmetry of a structure was refactored
- Implemented feature in fleurinputCalculation to set significant figures
- Implemented feature scf can now use default queues specified in code extras
- First implementation of relax type None, which cases the relax workchain to skip the
relaxation, becoming a usual scf wc, which might make it easier to switch relaxation on
and off in other workchains.
- Fleur parser parses now the total magnetic moment of the cell
- Introduced common constants, for bohr and htr, increased precision
- Command line interface (CLI) `aiida-fleur` with various functionalities exposed
- For devs: Increased test coverage, codecov is now added to CI and linked to badge
removed some older outdated code

## v1.1.2
### release compatible with AiiDA-core 1.3.0
Expand Down
59 changes: 54 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![GitHub release](https://img.shields.io/github/release/JuDFTteam/aiida-fleur.svg)](https://github.com/JuDFTteam/aiida-fleur/releases)
[![PyPI version](https://badge.fury.io/py/aiida-fleur.svg)](https://badge.fury.io/py/aiida-fleur)
[![Build develop](https://travis-ci.org/JuDFTteam/aiida-fleur.svg?branch=master)](https://travis-ci.org/JuDFTteam/aiida-fleur)
[![Coveralls github branch](https://github.com/JuDFTteam/aiida-fleur/blob/develop/aiida_fleur/tests/coverage.svg)](https://github.com/JuDFTteam/aiida-fleur/tree/develop)
[![Code quality pylint](https://github.com/JuDFTteam/aiida-fleur/blob/develop/aiida_fleur/tests/pylint.svg)](https://github.com/JuDFTteam/aiida-fleur/tree/develop)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-fleur.svg)](https://pypi.python.org/pypi/aiida-fleur)
[![Build status](https://github.com/JuDFTteam/aiida-fleur/workflows/aiida-fleur/badge.svg?branch=develop&event=push)](https://github.com/JuDFTteam/aiida-fleur/actions)
[![Documentation Status](https://readthedocs.org/projects/aiida-fleur/badge/?version=develop)](https://aiida-fleur.readthedocs.io/en/develop/?badge=develop)
[![codecov](https://codecov.io/gh/JuDFTteam/aiida-fleur/branch/develop/graph/badge.svg)](https://codecov.io/gh/JuDFTteam/aiida-fleur)


This software contains a plugin that enables the usage of the all-electron
DFT [FLEUR code](http://www.flapw.de) with the [AiiDA framework](http://www.aiida.net).

Developed at [Forschungszentrum Jülich GmbH](http://www.fz-juelich.de/pgi/pgi-1/DE/Home/home_node.html)

## Compatibility matrix

| FLEUR Plugin | AiiDA CORE | Python | FLEUR |
|-|-|-|-|
| `v1.0.0 < v2.0.0` | <img class="svg-badge" title="Compatible with aiida-core >=1.3.0,<2.0.0" src="https://img.shields.io/badge/AiiDA->=1.3.0,<2.0.0-007ec6.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACMAAAAhCAYAAABTERJSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAFhgAABYYBG6Yz4AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUbSURBVFiFzZhrbFRVEMd%2Fc%2B5uu6UUbIFC%2FUAUVEQCLbQJBIiBDyiImJiIhmohYNCkqJAQxASLF8tDgYRHBLXRhIcKNtFEhVDgAxBJqgmVh4JEKg3EIn2QYqBlt917xg%2BFss%2ByaDHOtzsz5z%2B%2FuZl7ztmF%2F5HJvxVQN6cPYX8%2FPLnOmsvNAvqfwuib%2FbNIk9cQeQnLcKRL5xLIV%2Fic9eJeunjPYbRs4FjQSpTB3aS1IpRKeeOOewajy%2FKKEO8Q0DuVdKy8IqsbPulxGHUfCBBu%2BwUYGuFuBTK7wQnht6PEbf4tlRomVRjCbXNjQEB0AyrFQOL5ENIJm7dTLZE6DPJCnEtFZVXDLny%2B4Sjv0PmmYu1ZdUek9RiMgo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OL305nV9aonvsQeT2L0gVk4OwOJqXXVRW7naaxswDKVdlYLyMXAnntteYmws2xcVVZzq%2BtHPAooQggmJkc6TLSusOiL4RKgwzzYU1iFQgiUBA1H7E8yPau%2BZl9P7AblVNebtHqTgxLfRqrNvZWjsHZFuqMqKcDWdlFjF7UGvX8Jn24DyEAykJwNcdg0OvJ4p5pQ9tV6SMlP4A0PNh8aYze1ArROyUNTNouy8tNF3Rt0CSXb6bRFl4%2FIfQzNMjaE9WwpYOWQnOdEF%2BTdJNO0iFh7%2BI0kfORzQZb6P2kymS9oTxzBiM9rUqLWr1WE5G6ODhycQd%2FUnNVeMbcH68hYkGycNoUNWc8fxaxfwhDbHpfwM5oeTY7rUX8QAAAABJRU5ErkJggg%3D%3D"> | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-fleur.svg)](https://pypi.org/project/aiida-fleur.svg) | MaXR1 < MaXR5 (v0.29)|
| `< v0.6.3` | <img class="svg-badge" title="Compatible with aiida-core >=0.12,<1.0.0" src="https://img.shields.io/badge/AiiDA->=0.12,<1.0.0-007ec6.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACMAAAAhCAYAAABTERJSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAFhgAABYYBG6Yz4AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUbSURBVFiFzZhrbFRVEMd%2Fc%2B5uu6UUbIFC%2FUAUVEQCLbQJBIiBDyiImJiIhmohYNCkqJAQxASLF8tDgYRHBLXRhIcKNtFEhVDgAxBJqgmVh4JEKg3EIn2QYqBlt917xg%2BFss%2ByaDHOtzsz5z%2B%2FuZl7ztmF%2F5HJvxVQN6cPYX8%2FPLnOmsvNAvqfwuib%2FbNIk9cQeQnLcKRL5xLIV%2Fic9eJeunjPYbRs4FjQSpTB3aS1IpRKeeOOewajy%2FKKEO8Q0DuVdKy8IqsbPulxGHUfCBBu%2BwUYGu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B1LH2aE9ViejiFs%2BXn6bTjng3MlIhJ1I1TkuLdg6OcAbD7Xx%2Bc3y9TrWAiSHqVkbZ2v9ilCo6s4AjwZCzFyD9mOL305nV9aonvsQeT2L0gVk4OwOJqXXVRW7naaxswDKVdlYLyMXAnntteYmws2xcVVZzq%2BtHPAooQggmJkc6TLSusOiL4RKgwzzYU1iFQgiUBA1H7E8yPau%2BZl9P7AblVNebtHqTgxLfRqrNvZWjsHZFuqMqKcDWdlFjF7UGvX8Jn24DyEAykJwNcdg0OvJ4p5pQ9tV6SMlP4A0PNh8aYze1ArROyUNTNouy8tNF3Rt0CSXb6bRFl4%2FIfQzNMjaE9WwpYOWQnOdEF%2BTdJNO0iFh7%2BI0kfORzQZb6P2kymS9oTxzBiM9rUqLWr1WE5G6ODhycQd%2FUnNVeMbcH68hYkGycNoUNWc8fxaxfwhDbHpfwM5oeTY7rUX8QAAAABJRU5ErkJggg%3D%3D"> | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-fleur/0.6.svg)](https://pypi.python.org/pypi/aiida-fleur/0.6.3/) | MaXR1 < MaXR3 (v0.28)|

### Documentation

Expand All @@ -37,7 +43,7 @@ In Extreme Data Workshop 2018 Proceedings, 2019, vol 40, p 43-48

### Comments/Disclaimer:

The plug-in and the workflows will only work with a Fleur version using xml files as I/O.
The plug-in and the workflows will only work with a Fleur version using xml files as I/O, i.e >v0.27.


### Contents
Expand Down Expand Up @@ -94,6 +100,49 @@ read_cif.py | This can be used as stand-alone to create StructureData nodes from
Utility and tools, which are independend of AiiDA are moved to the [masci-tools](https://github.com/JuDFTteam/masci-tools) (material science tools) repository,
which is a dependency of aiida-fleur.


### Command line interface (CLI)

Besides the python API, aiida-fleur comes with a builtin CLI: `aiida-fleur`.
This interface is built using the click library and supports tab-completion.

To enable tab-completion, add the following to your shell loading script, e.g. the .bashrc or virtual environment activate script:

eval "$(_AIIDA_FLEUR_COMPLETE=source aiida-fleur)"

the main subcommands include:

data: Commands to create and inspect data nodes
fleurinp Commands to handle `FleurinpData` nodes.
parameter Commands to create and inspect `Dict` nodes containing FLAPW parameters
structure Commands to create and inspect `StructureData` nodes.
launch: Commands to launch workflows and calcjobs of aiida-fleur

banddos Launch a banddos workchain
corehole Launch a corehole workchain
create_magnetic Launch a create_magnetic workchain
dmi Launch a dmi workchain
eos Launch a eos workchain
fleur Launch a base_fleur workchain.
init_cls Launch an init_cls workchain
inpgen Launch an inpgen calcjob on given input If no code is...
mae Launch a mae workchain
relax Launch a base relax workchain # TODO final scf input
scf Launch a scf workchain
ssdisp Launch a ssdisp workchain

plot: Invoke the plot_fleur command on given nodes

workflow: Commands to inspect aiida-fleur workchains and prepare inputs

for example to launch an scf workchain on a given structure execute:

$ aiida-fleur launch scf -i <inpgenpk> -f <fleurpk> -S <structurepk>

the command can also process structures in any format `ase` can handle, this includes `Cif`, `xsf` and `poscar` files. In such a case simply parse the path to the file:

$ aiida-fleur launch scf -i <inpgenpk> -f <fleurpk> -S ./structure/Cu.cif

## Installation Instructions <a name="Installation"></a>

From the aiida-fleur folder (after downloading the code, recommended) use:
Expand Down Expand Up @@ -154,7 +203,7 @@ Mainly AiiDA:
Easy plotting and other useful routines that do not depend on aiida_core are part of
the [masci-tools](https://github.com/JuDFTteam/masci-tools) (material science tools) repository.

For easy ploting we recommend using 'plot_methods' from masci-tools, which are also deployed by the 'plot_fleur(<node(s)>)' function.
For easy plotting we recommend using 'plot_methods' from masci-tools, which are also deployed by the 'plot_fleur(<node(s)>)' function.

## Further Information <a name="FurtherInfo"></a>

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.2'
__version__ = '1.1.3'
2 changes: 1 addition & 1 deletion aiida_fleur/calculation/fleur.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class FleurCalculation(CalcJob):

@classmethod
def define(cls, spec):
super(FleurCalculation, cls).define(spec)
super().define(spec)

# spec.input('metadata.options.input_filename', valid_type=six.string_types,
# default=cls._INPXML_FILE_NAME)
Expand Down
57 changes: 34 additions & 23 deletions aiida_fleur/calculation/fleurinputgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from aiida_fleur.data.fleurinp import FleurinpData
from aiida_fleur.tools.StructureData_util import abs_to_rel_f, abs_to_rel
from aiida_fleur.tools.xml_util import convert_to_fortran_bool, convert_to_fortran_string
from aiida_fleur.common.constants import bohr_a
from aiida_fleur.common.constants import BOHR_A


class FleurinputgenCalculation(CalcJob):
Expand All @@ -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.1'
__version__ = '1.2.2'

# Default input and output files
_INPUT_FILE = 'aiida.in' # will be shown with inputcat
Expand All @@ -51,7 +51,10 @@ class FleurinputgenCalculation(CalcJob):
_ERROR_FILE_NAME = 'out.error'
_STRUCT_FILE_NAME = 'struct.xsf'

_settings_keys = ['additional_retrieve_list', 'remove_from_retrieve_list', 'cmdline']
_settings_keys = [
'additional_retrieve_list', 'remove_from_retrieve_list', 'cmdline', 'significant_figures_cell',
'significant_figures_positions'
]
# TODO switch all these to init_internal_params?
_OUTPUT_SUBFOLDER = './fleur_inp_out/'
_PREFIX = 'aiida'
Expand Down Expand Up @@ -97,7 +100,7 @@ class FleurinputgenCalculation(CalcJob):

@classmethod
def define(cls, spec):
super(FleurinputgenCalculation, cls).define(spec)
super().define(spec)

spec.input('metadata.options.input_filename', valid_type=six.string_types, default=cls._INPUT_FILE)
spec.input('metadata.options.output_filename', valid_type=six.string_types, default=cls._INPXML_FILE_NAME)
Expand Down Expand Up @@ -136,7 +139,7 @@ def define(cls, spec):
'ERROR_FLEURINPDATA_INPUT_NOT_VALID',
message=('During parsing: FleurinpData could not be initialized, see log. '
'Maybe no Schemafile was found or the Fleurinput is not valid.'))
spec.exit_code(309, 'ERROR_FLEURINPDATE_NOT_VALID', message='During parsing: FleurinpData failed validation.')
spec.exit_code(309, 'ERROR_FLEURINPDATA_NOT_VALID', message='During parsing: FleurinpData failed validation.')

def prepare_for_submission(self, folder):
"""
Expand Down Expand Up @@ -170,7 +173,7 @@ def prepare_for_submission(self, folder):
# but we have to convert from Angstrom to a.u (bohr radii)
scaling_factors = [1.0, 1.0, 1.0]
scaling_lat = 1. # /bohr_to_ang = 0.52917720859
scaling_pos = 1. / bohr_a # Angstrom to atomic
scaling_pos = 1. / BOHR_A # Angstrom to atomic
own_lattice = False # not self._use_aiida_structure

##########################################
Expand Down Expand Up @@ -258,7 +261,8 @@ def prepare_for_submission(self, folder):
if self._use_aiida_structure:
input_params.pop('lattice', {})
own_lattice = False

#TODO check if input parameter dict is consistent to given structure.
# if not issue warnings.
# TODO allow only usual kpt meshes and use therefore Aiida kpointData
# if self._use_kpoints:
# try:
Expand Down Expand Up @@ -301,14 +305,18 @@ def prepare_for_submission(self, folder):

scaling_factor_card = ''
cell_parameters_card = ''

# We allow to set the significant figures format, because sometimes
# inpgen has numerical problems which are not there with less precise formatting
sf_c = str(settings_dict.get('significant_figures_cell', 9))
sf_p = str(settings_dict.get('significant_figure_positions', 10))
if not own_lattice:
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.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]))
reg_string = '{0:18.' + sf_c + 'f} {1:18.' + sf_c + 'f} {2:18.' + sf_c + 'f}\n'
cell_parameters_card += (reg_string.format(scaled[0], scaled[1], scaled[2]))
reg_string = '{0:18.' + sf_c + 'f} {1:18.' + sf_c + 'f} {2:18.' + sf_c + 'f}\n'
scaling_factor_card += (reg_string.format(scaling_factors[0], scaling_factors[1], scaling_factors[2]))

#### ATOMIC_POSITIONS ####

Expand Down Expand Up @@ -348,24 +356,27 @@ def prepare_for_submission(self, folder):
vector_rel = abs_to_rel_f(pos, cell, structure.pbc)
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!
if site_symbol != kind_name: # This is an important fact, if user renames it becomes a new atomtype or species!
try:
# Kind names can be more then numbers now, this might need to be reworked
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')
#if int(kind_name[len(head)]) > 4:
# raise InputValidationError('New specie name/label should start with a digit smaller than 4')
except ValueError:
pass
self.report(
'Warning: Kind name {} will be ignored by the FleurinputgenCalculation and not set a charge number.'
.format(kind_name))
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}'
'\n'.format(atomic_number_name, vector_rel[0], vector_rel[1],
vector_rel[2], kind_namet))
reg_string = ' {0:7} {1:18.' + sf_p + 'f} {2:18.' + sf_p + 'f} {3:18.' + sf_p + 'f} {4}\n'
atomic_positions_card_listtmp.append(
reg_string.format(atomic_number_name, vector_rel[0], vector_rel[1], vector_rel[2], kind_namet))
else:
atomic_positions_card_listtmp.append(' {0:7} {1:18.10f} {2:18.10f} {3:18.10f}'
'\n'.format(atomic_number_name, vector_rel[0], vector_rel[1],
vector_rel[2]))
reg_string = ' {0:7} {1:18.' + sf_p + 'f} {2:18.' + sf_p + 'f} {3:18.' + sf_p + 'f}\n'
atomic_positions_card_listtmp.append(
reg_string.format(atomic_number_name, vector_rel[0], vector_rel[1], vector_rel[2]))
# TODO check format
# we write it later, since we do not know what natoms is before the loop...
atomic_positions_card_list.append(' {0:3}\n'.format(natoms))
Expand Down Expand Up @@ -557,8 +568,8 @@ def get_input_data_text(key, val, value_only, mapping=None):
for elemk, itemval in six.iteritems(val):
try:
idx = mapping[elemk]
except KeyError:
raise ValueError("Unable to find the key '{}' in the mapping " 'dictionary'.format(elemk))
except KeyError as exc:
raise ValueError("Unable to find the key '{}' in the mapping " 'dictionary'.format(elemk)) from exc

list_of_strings.append((idx, ' {0}({2})={1} '.format(key, conv_to_fortran(itemval), idx)))
# changed {0}({2}) = {1}\n".format
Expand Down
Loading

0 comments on commit df33e9a

Please sign in to comment.