Skip to content

Commit

Permalink
Merge pull request #103 from JuDFTteam/support-0.7.x
Browse files Browse the repository at this point in the history
Release 0.7.2
  • Loading branch information
janssenhenning authored Jan 19, 2022
2 parents a950564 + 7c536d9 commit a087093
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 22 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 = 0.7.1
current_version = 0.7.2
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion masci_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
'''
import logging

__version__ = '0.7.1'
__version__ = '0.7.2'

logging.getLogger(__name__).addHandler(logging.NullHandler())
38 changes: 20 additions & 18 deletions masci_tools/util/xml/xml_setters_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a087093

Please sign in to comment.