Skip to content

Commit

Permalink
Merge pull request #167 from JuDFTteam/release-1.3.1
Browse files Browse the repository at this point in the history
🚀 Release 1.3.1
  • Loading branch information
janssenhenning authored Apr 7, 2022
2 parents bf6d5f5 + ce43753 commit f75627a
Show file tree
Hide file tree
Showing 168 changed files with 109,144 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"upload_type": "software",
"language": "eng",
"title": "JuDFTteam/aiida-fleur: AiiDA-FLEUR release v1.2.1",
"title": "JuDFTteam/aiida-fleur: AiiDA-FLEUR",
"license": {
"id": "MIT"
},
Expand Down Expand Up @@ -75,5 +75,5 @@
"identifier": "https://www.wikidata.org/wiki/Q6786605"
}
],
"description": "<p><strong> This software contains a plugin that enables the usage of the all-electron DFT FLEUR program with the AiiDA framework.</strong></p>\n\n<p>Feel free to contribute.</p>\n\nThe code is hosted on GitHub at: https://github.com/JuDFTteam/aiida-fleur</p>\n\n<p>The documentation is hosted on https://aiida-fleur.readthedocs.io.</p>\n\n<p>Most functionality and workflows was developed for the use with the DFT program FLEUR developed at the Forschungszentrum J&uuml;lich (see http://judft.de, https://flapw.de for further information on the codes) and in the context of the AiiDA framework (https://aiida.net).</p>\n\n<p><strong>Installation</strong></p>\n\n<blockquote>\n<p><br>\npip install aiida-core<br>\n&nbsp;</p>\n</blockquote>\n\n<p><strong>Dependencies</strong></p>\n\n<p>These python packages are needed:</p>\n\n<ul>\n\t<li>`aiida-core[atomic_tools]`</li>\n\t<li>`masci-tools`</li>\n\t<li>`lxml`</li>\n\t<li>`pyhull` &nbsp;</li>\n\t<li>`sympy`</li>\n\t<li>`numpy`</li>\n\t<li>`future`</li>\n\t<li>`pyhull`</li>\n\t<li>`sqlalchemy<1.4`</li>\n</ul>\n\n<p><strong>Layout of aiida-fleur</strong></p>\n\n<ul>\n\t<li>&nbsp;`calculation`: Contains AiiDA job calculation plugins for the inpgen code and the FLEUR code.\n\t<ul>\n\t<li>`cmdline`: Contains files for the commandline interface.</li>\n\t</ul>\n\t</li>\n\t<li>`tests`: auto tests of `aiida-fleur` functions</li>\n\t<li>`common`: Contains base classes and constants which are used throughout the package.</li>\n\t<li>`data`: Contains AiiDA data plugins specific to FLEUR.</li>\n\t<li>`parsers`: Contains parser AiiDA plugins for the job calculation plugins.</li>\n\t<li>`tools`: Contains basic utility and high level utility which is rather complete</li>\n\t<li>`workflows`: Contains a collection of AiiDA workchains (workflows) specific to FLEUR which have HPC and HTC capabilties with full provenance tracking. </li>\n</ul>\n\n<p><strong>License</strong>:<br>\naiida-fleur is distributed under the terms and conditions of the MIT license which is specified in the `LICENSE` file.</p>"
"description": "<p><strong> This software contains a plugin that enables the usage of the all-electron DFT FLEUR program with the AiiDA framework.</strong></p>\n\n<p>Feel free to contribute.</p>\n\nThe code is hosted on GitHub at: https://github.com/JuDFTteam/aiida-fleur</p>\n\n<p>The documentation is hosted on https://aiida-fleur.readthedocs.io.</p>\n\n<p>Most functionality and workflows was developed for the use with the DFT program FLEUR developed at the Forschungszentrum J&uuml;lich (see http://judft.de, https://flapw.de for further information on the codes) and in the context of the AiiDA framework (https://aiida.net).</p>\n\n<p><strong>Installation</strong></p>\n\n<blockquote>\n<p><br>\npip install aiida-fleur<br>\n&nbsp;</p>\n</blockquote>\n\n<p><strong>Dependencies</strong></p>\n\n<p>These python packages are needed:</p>\n\n<ul>\n\t<li>`aiida-core[atomic_tools]`</li>\n\t<li>`masci-tools`</li>\n\t<li>`lxml`</li>\n\t<li>`pyhull` &nbsp;</li>\n\t<li>`sympy`</li>\n\t<li>`numpy`</li>\n\t<li>`future`</li>\n\t<li>`pyhull`</li>\n\t<li>`sqlalchemy<1.4`</li>\n</ul>\n\n<p><strong>Layout of aiida-fleur</strong></p>\n\n<ul>\n\t<li>&nbsp;`calculation`: Contains AiiDA job calculation plugins for the inpgen code and the FLEUR code.\n\t<ul>\n\t<li>`cmdline`: Contains files for the commandline interface.</li>\n\t</ul>\n\t</li>\n\t<li>`tests`: auto tests of `aiida-fleur` functions</li>\n\t<li>`common`: Contains base classes and constants which are used throughout the package.</li>\n\t<li>`data`: Contains AiiDA data plugins specific to FLEUR.</li>\n\t<li>`parsers`: Contains parser AiiDA plugins for the job calculation plugins.</li>\n\t<li>`tools`: Contains basic utility and high level utility which is rather complete</li>\n\t<li>`workflows`: Contains a collection of AiiDA workchains (workflows) specific to FLEUR which have HPC and HTC capabilties with full provenance tracking. </li>\n</ul>\n\n<p><strong>License</strong>:<br>\naiida-fleur is distributed under the terms and conditions of the MIT license which is specified in the `LICENSE` file.</p>"
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v.1.3.1
### release compatible with AiiDA-core 1.3.0+
- Fix for masci-tools dependency constraint. The constraint would previously reject the next minor version of masci-tools (i.e `0.10.0`)
- Small fixes in zenodo metadata
- Added `convert_inpxml` method to `FleurinpData` to convert to different file versions

## v.1.3.0
### release compatible with AiiDA-core 1.3.0+
- Guraranteed support for Fleur versions up to Max6
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![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)

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5531549.svg)](https://doi.org/10.5281/zenodo.5531549)

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).
Expand Down
2 changes: 1 addition & 1 deletion aiida_fleur/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
'''
AiiDA-FLEUR
'''
__version__ = '1.3.0'
__version__ = '1.3.1'
50 changes: 48 additions & 2 deletions aiida_fleur/data/fleurinp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
# TODO: 2D cell get kpoints and get structure also be carefull with tria = T!!!
# TODO : maybe save when get_structure or get_kpoints was executed on fleurinp,
# because otherwise return this node instead of creating a new one!

import os
import io
import re

from lxml import etree
import warnings

from aiida import orm
from aiida.orm import Data, Node, load_node, CalcJobNode, Bool
from aiida.common.exceptions import InputValidationError, ValidationError
from aiida.engine.processes.functions import calcfunction as cf
Expand Down Expand Up @@ -98,7 +98,7 @@ class FleurinpData(Data):
FleurinpData that way and start a new calculation from it.
"""

__version__ = '0.5.0'
__version__ = '0.6.0'

def __init__(self, **kwargs):
"""
Expand Down Expand Up @@ -655,3 +655,49 @@ def get_tag(self, xpath):
root = xmltree.getroot()

return eval_xpath(root, xpath)

@cf
def convert_inpxml(self, to_version: orm.Str) -> 'FleurinpData':
"""
Convert the fleurinp data node to a different inp.xml version
and return a clone of the node
.. note::
If the Fleurinp contains included xml trees the resulting
FleurinpData will contain only the combined inp.xml
"""
return self.convert_inpxml_ncf(to_version.value)

def convert_inpxml_ncf(self, to_version: str) -> 'FleurinpData':
"""
Convert the fleurinp data node to a different inp.xml version
and return a clone of the node
.. note::
If the Fleurinp contains included xml trees the resulting
FleurinpData will contain only the combined inp.xml
"""
from masci_tools.tools.fleur_inpxml_converter import convert_inpxml
import tempfile
clone = self.clone()

xmltree, schema_dict = clone.load_inpxml(remove_blank_text=True)
try:
converted_tree = convert_inpxml(xmltree, schema_dict, to_version)
except FileNotFoundError as exc:
raise ValueError(
f"No conversion available from version {schema_dict['inp_version']} to {to_version}\n"
'Please create the conversion by running\n'
f" masci-tools generate-conversion {schema_dict['inp_version']} {to_version}\n") from exc

clone.del_file('inp.xml')
with tempfile.TemporaryDirectory() as td:
inpxml_path = os.path.join(td, 'inp.xml')
converted_tree.write(inpxml_path, encoding='utf-8', pretty_print=True)
clone.set_file(inpxml_path, 'inp.xml')

# default label and description
clone.label = 'fleurinp_converted'
clone.description = f"Fleurinpdata converted from version {schema_dict['inp_version']} to {to_version}"

return clone
4 changes: 2 additions & 2 deletions setup.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.0",
"version": "1.3.1",
"name": "aiida-fleur",
"url": "https://github.com/JuDFTteam/aiida-fleur",
"license": "MIT License, see LICENSE.txt file.",
Expand Down Expand Up @@ -33,7 +33,7 @@
"lxml~=4.8",
"numpy~=1.16,>=1.16.4",
"sympy",
"masci-tools ~= 0.9.0,>=0.9.1",
"masci-tools~=0.9,>=0.9.1",
"future",
"pyhull",
"more_itertools",
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ def fleur_local_code(mock_code_factory, pytestconfig, request):
entry_point='fleur.fleur',
ignore_files=[
'_aiidasubmit.sh', 'cdnc', 'out', 'FleurInputSchema.xsd', 'FleurOutputSchema.xsd',
'cdn.hdf', 'usage.json', 'cdn*', 'mixing_history.*', 'juDFT_times.json',
'cdn.hdf', 'usage.json', 'cdn*', 'mixing_history*', 'juDFT_times.json',
'*.config', '*.econfig', 'struct*.xsf', 'band.gnu'
])

Expand Down
17 changes: 17 additions & 0 deletions tests/data/test_fleurinp.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,23 @@ def test_get_tag(create_fleurinp, inpxmlfilepath):
assert tag != []


def test_fleurinp_convert_inpxml(create_fleurinp):
"""
Test that the convert_inpxml method works correctly
"""
inpxmlfilepath = os.path.abspath(os.path.join(inpxmlfilefolder, '../files/inpxml/FePt/31/inp.xml'))

fleurinp = create_fleurinp(inpxmlfilepath)

fleurinp_converted = fleurinp.convert_inpxml_ncf('0.34')

assert fleurinp_converted.files == ['inp.xml']
assert fleurinp_converted.inp_version == '0.34'

#Random check that the bzintegration tag has moved
assert 'bzIntegration' in fleurinp_converted.inp_dict['cell']


folderlist = [
os.path.abspath(os.path.join(inpxmlfilefolder, '../files/inpxml/Fe_1l_SOCXML/files')),
os.path.abspath(os.path.join(inpxmlfilefolder, '../files/inpxml/FePt')),
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/n
Loading

0 comments on commit f75627a

Please sign in to comment.