diff --git a/.bumpversion.cfg b/.bumpversion.cfg index a24fcb38d..1819302a0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.1 +current_version = 0.7.2 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/CHANGELOG.md b/CHANGELOG.md index 1beb6c6a6..6c6ff2bde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +# v.0.7.2 +[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.7.1...v0.7.2) + +### Bugfixes +- Fixed regression in ``set_atomgroup_label`` and ``set_species_label``. These functions could be used in previous versions with atom labels, that do not exist. This is not possible in ``v.0.7.1``. Since some parts of the ``aiida-fleur`` plugin relied on this the behaviour has to be kept. + # v.0.7.1 [full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.7.0...v0.7.1) diff --git a/masci_tools/__init__.py b/masci_tools/__init__.py index 7f96db30b..a4f45db27 100644 --- a/masci_tools/__init__.py +++ b/masci_tools/__init__.py @@ -12,6 +12,6 @@ ''' import logging -__version__ = '0.7.1' +__version__ = '0.7.2' logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/masci_tools/util/xml/xml_setters_names.py b/masci_tools/util/xml/xml_setters_names.py index d0845967c..4817834c6 100644 --- a/masci_tools/util/xml/xml_setters_names.py +++ b/masci_tools/util/xml/xml_setters_names.py @@ -682,7 +682,8 @@ def set_species_label(xmltree: XMLLike, '=': f'{atom_label: >20}' } }}, - list_return=True)) + list_return=True, + optional=True)) for species_name in species_to_set: xmltree = set_species(xmltree, schema_dict, species_name, attributedict, create=create) @@ -881,20 +882,28 @@ def set_atomgroup_label(xmltree: XMLLike, 'attributedict': {'nocoParams': {'beta': val}} """ - from masci_tools.util.schema_dict_util import tag_exists + from masci_tools.util.schema_dict_util import tag_exists, evaluate_attribute if atom_label == 'all': return set_atomgroup(xmltree, schema_dict, attributedict, species='all') film = tag_exists(xmltree, schema_dict, 'filmPos') label_path = f"/{'filmPos' if film else 'relPos'}/@label" - return set_atomgroup(xmltree, - schema_dict, - attributedict, - filters={'atomGroup': { - label_path: { - '=': f'{atom_label: >20}' - } - }}) + species_to_set = set( + evaluate_attribute(xmltree, + schema_dict, + 'species', + filters={'atomGroup': { + label_path: { + '=': f'{atom_label: >20}' + } + }}, + list_return=True, + optional=True)) + + for species_name in species_to_set: + xmltree = set_atomgroup(xmltree, schema_dict, attributedict, species=species_name) + + return xmltree def set_atomgroup(xmltree: XMLLike, @@ -946,14 +955,7 @@ def set_atomgroup(xmltree: XMLLike, attributedict = {k: v for k, v in attributedict.items() if k != 'species'} xmltree = switch_species(xmltree, schema_dict, species_change, position=position, species=species) - xmltree = xml_set_complex_tag(xmltree, - schema_dict, - atomgroup_xpath, - atomgroup_base_path, - attributedict, - create=create) - - return xmltree + return xml_set_complex_tag(xmltree, schema_dict, atomgroup_xpath, atomgroup_base_path, attributedict, create=create) def switch_species_label(xmltree: XMLLike, diff --git a/pyproject.toml b/pyproject.toml index 29eaa01c1..baa1c856f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"] [tool.poetry] name = "masci_tools" -version = "0.7.1" +version = "0.7.2" description = "Tools for Materials science. Vis contains wrapers of matplotlib functionality to visualalize common material science data. Plus wrapers of visualisation for aiida-fleur workflow nodes" readme = "README.md" authors = ["Jens Bröder ", diff --git a/setup.py b/setup.py index 6efe4bcf6..9ecbbc061 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ if __name__ == '__main__': setup( name='masci_tools', - version='0.7.1', + version='0.7.2', description= 'Tools for Materials science. Vis contains wrappers of matplotlib functionality to visualize common material science data. Plus wrappers of visualisation for aiida-fleur workflow nodes', # add long_description from readme.md: