Skip to content

Commit c867ea2

Browse files
Merge pull request #154 from JuDFTteam/release-0.10.0
🚀 Release `0.10.0`
2 parents 9841edc + fff49f3 commit c867ea2

File tree

92 files changed

+6425
-2624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+6425
-2624
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/cd.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919

2020
- name: Set up Python 3.9
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v3.1.2
2222
with:
2323
python-version: 3.9
2424

2525
- name: Cache python dependencies
2626
id: cache-pip
27-
uses: actions/cache@v1
27+
uses: actions/cache@v3.0.2
2828
with:
2929
path: ~/.cache/pip
3030
key: pip-docs-${{ hashFiles('**/pyproject.toml') }}
@@ -64,19 +64,19 @@ jobs:
6464
continue-on-error: ${{ matrix.strict }}
6565

6666
steps:
67-
- uses: actions/checkout@v2
67+
- uses: actions/checkout@v3
6868

6969
- name: Cache python dependencies
7070
id: cache-pip
71-
uses: actions/cache@v1
71+
uses: actions/cache@v3.0.2
7272
with:
7373
path: ~/.cache/pip
7474
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }}
7575
restore-keys: |
7676
pip-pre-commit-
7777
7878
- name: Set up Python 3.8
79-
uses: actions/setup-python@v2
79+
uses: actions/setup-python@v3.1.2
8080
with:
8181
python-version: 3.8
8282

@@ -100,26 +100,27 @@ jobs:
100100
fail-fast: false
101101

102102
steps:
103-
- uses: actions/checkout@v2
103+
- uses: actions/checkout@v3
104104

105105
- name: Cache python dependencies
106106
id: cache-pip
107-
uses: actions/cache@v1
107+
uses: actions/cache@v3.0.2
108108
with:
109109
path: ~/.cache/pip
110110
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/pyproject.toml') }}
111111
restore-keys: |
112112
pip-${{ matrix.python-version }}-tests
113113
114114
- name: Set up Python ${{ matrix.python-version }}
115-
uses: actions/setup-python@v2
115+
uses: actions/setup-python@v3.1.2
116116
with:
117117
python-version: ${{ matrix.python-version }}
118118

119119

120120
- name: Install python dependencies
121121
run: |
122122
pip install -e .[testing,bokeh-plots]
123+
pip install pyhull
123124
124125
- name: Run pytest
125126
run: pytest
@@ -141,9 +142,9 @@ jobs:
141142
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
142143
runs-on: ubuntu-latest
143144
steps:
144-
- uses: actions/checkout@v2
145+
- uses: actions/checkout@v3
145146
- name: Set up Python 3.7
146-
uses: actions/setup-python@v2
147+
uses: actions/setup-python@v3.1.2
147148
with:
148149
python-version: 3.7
149150
- name: Install flit

.github/workflows/ci.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313

1414
- name: Set up Python 3.9
15-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v3.1.2
1616
with:
1717
python-version: 3.9
1818

1919
- name: Cache python dependencies
2020
id: cache-pip
21-
uses: actions/cache@v1
21+
uses: actions/cache@v3.0.2
2222
with:
2323
path: ~/.cache/pip
2424
key: pip-docs-${{ hashFiles('**/pyproject.toml') }}
@@ -58,19 +58,19 @@ jobs:
5858
continue-on-error: ${{ matrix.strict }}
5959

6060
steps:
61-
- uses: actions/checkout@v2
61+
- uses: actions/checkout@v3
6262

6363
- name: Cache python dependencies
6464
id: cache-pip
65-
uses: actions/cache@v1
65+
uses: actions/cache@v3.0.2
6666
with:
6767
path: ~/.cache/pip
6868
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }}
6969
restore-keys: |
7070
pip-pre-commit-
7171
7272
- name: Set up Python 3.8
73-
uses: actions/setup-python@v2
73+
uses: actions/setup-python@v3.1.2
7474
with:
7575
python-version: 3.8
7676

@@ -99,26 +99,27 @@ jobs:
9999
continue-on-error: ${{ matrix.experimental }}
100100

101101
steps:
102-
- uses: actions/checkout@v2
102+
- uses: actions/checkout@v3
103103

104104
- name: Cache python dependencies
105105
id: cache-pip
106-
uses: actions/cache@v1
106+
uses: actions/cache@v3.0.2
107107
with:
108108
path: ~/.cache/pip
109109
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/pyproject.toml') }}
110110
restore-keys: |
111111
pip-${{ matrix.python-version }}-tests
112112
113113
- name: Set up Python ${{ matrix.python-version }}
114-
uses: actions/setup-python@v2
114+
uses: actions/setup-python@v3.1.2
115115
with:
116116
python-version: ${{ matrix.python-version }}
117117

118118

119119
- name: Install python dependencies
120120
run: |
121121
pip install -e .[testing,bokeh-plots]
122+
pip install pyhull
122123
123124
- name: Run pytest
124125
run: pytest

.github/workflows/fleur-release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
timeout-minutes: 30
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515

1616
- name: Set up Python 3.8
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v3.1.2
1818
with:
1919
python-version: 3.8
2020

@@ -40,7 +40,7 @@ jobs:
4040
run: exit 1
4141

4242
- name: Create Pull Request
43-
uses: peter-evans/create-pull-request@v3
43+
uses: peter-evans/create-pull-request@v4.0.2
4444
with:
4545
commit-message: "[fleur release] Fleur schema update"
4646
branch: fleur-release/schema

.pre-commit-config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ repos:
8383
masci_tools/io/parsers/fleur_schema/.*py|
8484
masci_tools/io/parsers/hdf5/.*py|
8585
masci_tools/io/io_nmmpmat.py|
86-
masci_tools/io/io_fleurxml.py|
86+
masci_tools/io/fleur_xml.py|
8787
masci_tools/io/fleur_inpgen.py|
8888
masci_tools/io/hdf5_util.py|
8989
masci_tools/io/fleurxmlmodifier.py|
@@ -92,16 +92,15 @@ repos:
9292
masci_tools/util/lockable_containers.py|
9393
masci_tools/util/case_insensitive_dict.py|
9494
masci_tools/util/schema_dict_util.py|
95-
masci_tools/util/parse_task_decorators.py|
9695
masci_tools/util/logging_util.py|
9796
masci_tools/util/python_util.py|
9897
masci_tools/util/math_util.py|
99-
masci_tools/util/parse_tasks.py|
10098
masci_tools/util/parse_utils.py|
10199
masci_tools/util/typing.py|
102100
masci_tools/util/econfig.py|
103101
masci_tools/util/fleur_calculate_expression.py|
104102
masci_tools/tools/fleur_inpxml_converter.py|
105103
masci_tools/tools/greensfunction.py|
106104
masci_tools/cmdline/parameters/slice.py|
105+
masci_tools/vis/parameters.py|
107106
)$

CHANGELOG.md

+37-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Changelog
22

3+
## v.0.10.0
4+
[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.9.1...v0.10.0)
5+
6+
This release provides several new features in the XML modification/evaluation for Fleur XML files and bugfixes. Multiple problems when
7+
working with DFT+U density matrix files are also fixed.
8+
### Added
9+
- New XML setter `align_nmmpmat_to_sqa` to rotate the density matrix file according to SQAs specified either for noco or second variation SOC [[#140]](https://github.com/JuDFTteam/masci-tools/pull/140)
10+
- Added `task_list` property to `FleurXMLModifier` to construct a list which can be used to replicate the same `FleurXMLModifier` with the `fromList()` classmethod [[#149]](https://github.com/JuDFTteam/masci-tools/pull/#149)
11+
- Added `FleurXMLContext`, which acts as a holder of th XML elements, schema dictionary, constants and logger to reduce the amount of information/clutter in functions evaluating things from the XML file [[#152]](https://github.com/JuDFTteam/masci-tools/pull/#152)
12+
13+
Note: The class `ParseTasks` used in the `outxml_parser` was simplified and placed into the `outxml_parser` module and the decorator `register_parsing_function` was removed. This was done without deprecation since they were exclusively used in the `outxml_parser` and were the main cause of cyclic import problems previously
14+
- Added several predefined conversions to/from input version `0.35` to `inpxml_converter` [[#153]](https://github.com/JuDFTteam/masci-tools/pull/#153)
15+
16+
### Improvements
17+
- Added `inverse` argument to nmmpmat XML setters. These will correctly produce the inverse rotation operation for the given angles. Also allow setting `orbital='all'` in `rotate_nmmpmat` to rotate all blocks by the given angles [[#140]](https://github.com/JuDFTteam/masci-tools/pull/140)
18+
- The XML setters `create_tag`, `replace_tag` and their low-level equivalents now also accept XML strings, i.e. `<example attribute="1"/>`, as arguments for the elements to create/replace [[#145]](https://github.com/JuDFTteam/masci-tools/pull/145)
19+
### Bugfixes
20+
- Fix for XML setters operating on the DFT+U density matrix file. Previously these functions would not map the density matrix blocks correctly if multiple atomgroups shared the same species containing `ldaU` tags [[#140]](https://github.com/JuDFTteam/masci-tools/pull/140)
21+
- Added missing prefactor `(-1)^(m-mp)` to `get_wigner_matrix()`
22+
- Added basic tests of `masci_tools.tools.greensfunction` module and fixed several bugs found due to this [[#150]](https://github.com/JuDFTteam/masci-tools/pull/150)
23+
- Fixed bug in XML setters operating on the DFT+U density matrix file not correctly extracting the number of spin blocks when only setting `l_mperp`
24+
- Fixed bug, when using the `FleurXMLModifier` directly (not in `aiida-fleur`), included XML files were not handled
25+
- Fixed bug in `outxml_parser`, when the XML file had to be repaired and more than one iteration was present the wrong iteration was chosen as the last stable iteration [[#152]](https://github.com/JuDFTteam/masci-tools/pull/#152)
26+
27+
### Deprecated
28+
- The module `masci_tools.io.io_fleurxml` is renamed to `masci_tools.io.fleur_xml` [[#152]](https://github.com/JuDFTteam/masci-tools/pull/#152)
29+
- The module `masci_tools.util.parse_task_decorator` is removed. All decorators are now availaibe under `masci_tools.io.parsers.fleur` [[#152]](https://github.com/JuDFTteam/masci-tools/pull/#152)
30+
31+
### For Developers
32+
- Added `py.typed` marker to masci-tools, since a large part of the outside facing code (especially the XML APIs are typed). With this marker other packages can use the typehints in this package
33+
334
## v.0.9.1
435
[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.9.0...v0.9.1)
536

@@ -35,7 +66,7 @@
3566
- Fix for signatures of `set_text`/`set_first_text`. These contained names of attribute setting functions [[#118]](https://github.com/JuDFTteam/masci-tools/pull/118)
3667
- Fix for validating arguments in `FleurXMLModifier` not accepting an argument named `name` when passed by keyword. [[#118]](https://github.com/JuDFTteam/masci-tools/pull/118)
3768
- Fixed problems in `masci_tools.testing.bokeh` when adding files for new bokeh versions [[#122]](https://github.com/JuDFTteam/masci-tools/pull/122)
38-
- Several fixes for `plot_fleur_dos`. Using the `area_plot` or specifying `color` explicitely could mess up the color order [[#132]](https://github.com/JuDFTteam/masci-tools/pull/132)
69+
- Several fixes for `plot_fleur_dos`. Using the `area_plot` or specifying `color` explicitly could mess up the color order [[#132]](https://github.com/JuDFTteam/masci-tools/pull/132)
3970
- Fixed bug in `validate_nmmpmat` and consequently `FleurXMLModifier` not correctly validating denisty matrix files with certain off-diagonal elements being negative [[#135]](https://github.com/JuDFTteam/masci-tools/pull/135)
4071
- Fix for `HDF5Reader` for compatibility for file handles in `aiida-core` 2.0. The file handles coming from the file repository have no directly attached extension so the check if the file is a hdf file cannot be performed
4172

@@ -57,7 +88,7 @@
5788
- Added `IncompatibleSchemaVersions` error when a combination of output and input version for `OutputSchemaDict` is given, for which it is known that no XML schema can be compiled
5889
- `xml_getters` functions can now be used in the task definitions of the `outxml_parser` to keep information consistent. This example definition will insert the structure data, i.e. a tuple of atoms, bravais matrix and periodic boundary conditions into the output dictionary. `{'parse_type':'xmlGetter', 'name': 'get_structure_data'}` [[#107]](https://github.com/JuDFTteam/masci-tools/pull/107)
5990
- The `_conversions` key in the `outxml_parser` now accepts namedtuples `Conversion` to enable passing additional arguments to these functions. [[#109]](https://github.com/JuDFTteam/masci-tools/pull/109)
60-
- Adjusted `get_cell` to understand the `bravaisMatrixFilm` inut introduced with the MaX6 release of fleur [[#110]](https://github.com/JuDFTteam/masci-tools/pull/110)
91+
- Adjusted `get_cell` to understand the `bravaisMatrixFilm` input introduced with the MaX6 release of fleur [[#110]](https://github.com/JuDFTteam/masci-tools/pull/110)
6192
- Improved detection, whether a given xpath contains a tag including stripping predicates. Added function `contains_tag` in `masci_tools.util.xml.common_functions` [[#113]](https://github.com/JuDFTteam/masci-tools/pull/113)
6293
- Refactored bokeh plot routine `periodic_table_plot` to make use of the plot parameters utilities [[#114]](https://github.com/JuDFTteam/masci-tools/pull/114)
6394
- `get_parameter_data` now extracts LOs with higher energy derivatives or `HELO` type, as they are supported by the newest versions of the inpgen. The old behaviour of dropping all non `SCLO` and `eDeriv="0"` LOs is available via the option `allow_special_los=False`
@@ -89,7 +120,7 @@
89120
- Fix for HDF5 transformation ``add_partial_sums`` if not all formatted patterns are present in the dataset, e.g. if a bandstructure/DOS is calculated for only selected atoms
90121
### For developers
91122
- More strict ``mypy`` configuration and moved a lot of the annotations to modern syntax with ``from __future__ import annotations``
92-
- Added ``pyupgrade`` hook to automatically do some easy refactoring, i.e. removing compatibility workarounds move ot modern syntax. Set to apply changes compatible with ``3.7`` and later
123+
- Added ``pyupgrade`` hook to automatically do some easy refactoring, i.e. removing compatibility workarounds move to modern syntax. Set to apply changes compatible with ``3.7`` and later
93124

94125
## v.0.7.0
95126
[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.6.2...v0.7.0)
@@ -128,7 +159,7 @@ Commandline interface, refactoring of SchemaDict/XML functions and major improve
128159
- Made test suite executable from the root-folder (Some file paths were not transferrable when changing the execution directory)
129160
- Added ``test_file`` fixture, which constructs the absolute filepath to files in the ``tests/files`` folder to reduce the difficulty of moving test files around and reorganizing the pytest suite
130161
- Updated pylint (``2.11``), pytest (``6.0``) in ``setup.py``
131-
- Added ``mypy`` pre-commit hook. Checked files are specified explicitely [[#86]](https://github.com/JuDFTteam/masci-tools/pull/86).
162+
- Added ``mypy`` pre-commit hook. Checked files are specified explicitly [[#86]](https://github.com/JuDFTteam/masci-tools/pull/86).
132163
- Added typing to majority of XML functions (with stubs package ``lxml-stubs``) and large parts of the ``io`` and ``util`` subpackages
133164
- Dropped testing for python ``3.6`` in CI
134165

@@ -168,7 +199,7 @@ This release contains major improvements to plotting methods and new tools. Also
168199
- Refactored attribute/text type definitions in `SchemaDict` objects. Now unified under one structure. Both attributes and texts can now be recognized to contain multiple values [[#64]](https://github.com/JuDFTteam/masci-tools/pull/64)
169200
- Added `spin_arrows` option to toggle spin arrows in `plot_spinpol_dos` for matplotlib. Previously this was only possible for bokeh
170201
- Added options to create different types of bar plots to `barchart`: Available are `'stacked'` (default), `'grouped'`, `'independent'` (positions can be defined for each data set)
171-
- Exceptions occuring in `transforms` for `HDF5Reader` are now bundled into `HDF5TransformationError` to allow easier error handling
202+
- Exceptions occurring in `transforms` for `HDF5Reader` are now bundled into `HDF5TransformationError` to allow easier error handling
172203
- Added MT keys to `kkrparams`
173204

174205
### Bugfixes
@@ -284,7 +315,7 @@ This release contains bugifxes for the visualization routines
284315
- XML getters now also accept etree.Element
285316
- Added `etree.indent` calls to keep modified `inp.xml` clean (raises lxml dependency constraint to 4.5)
286317
- `io_fleurxml` functions now pass keyword arguments to XMLParser
287-
- Readd `fleur_modes` to output_dict
318+
- Re-add `fleur_modes` to output_dict
288319
### Bugfixes
289320
- Bugfix for relative xpaths
290321

docs/source/conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@
404404
('py:class', 'FilterType'),
405405
('py:class', 'XMLLike'),
406406
('py:class', 'etree.XPathElementEvaluator'),
407+
('py:class', 'contextlib._GeneratorContextManager'),
408+
('py:data', 'masci_tools.io.parsers.fleur.fleur_outxml_parser.F')
407409
]
408410

409411

docs/source/devel_guide/fleur_parser.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ The following are valid:
7878
For example ```[('jspins', 2), ('soc', True)]``` will only perform the task for a
7979
magnetic SOC calculation
8080
:_conversions: list of str, giving the names of functions to call after this task. Functions
81-
given here have to be decorated with the :py:func:`~masci_tools.util.parse_tasks_decorators.conversion_function()` decorator
81+
given here have to be decorated with the :py:func:`~masci_tools.io.parsers.fleur.conversion_function()` decorator
8282
:_special: bool, if True (default False) this task is NEVER added automatically and has to be added
8383
by hand
8484

8585
Migrating the parsing tasks
8686
----------------------------
8787

88-
These task definitions might have to be adapted for new fleur versions. Some changes might be possible to make in :py:mod:`~masci_tools.io.parsers.fleur.default_parse_tasks` directly without breaking backwards compatibility. If this is not possible there is a decorator :py:func:`~masci_tools.util.parse_tasks_decorators.register_migration()` to define a function that is recognized by the class :py:class:`~masci_tools.util.parse_tasks.ParseTasks` to convert between versions. A usage example is shown below.
88+
These task definitions might have to be adapted for new fleur versions. Some changes might be possible to make in :py:mod:`~masci_tools.io.parsers.fleur.default_parse_tasks` directly without breaking backwards compatibility. If this is not possible there is a decorator :py:func:`~masci_tools.io.parsers.fleur.register_migration()` to define a function that is recognized by the :py:func:`~masci_tools.io.parsers.fleur.outxml_parser()` to convert between versions. A usage example is shown below.
8989

9090
.. code-block:: python
9191
92-
from masci_tools.util.parse_tasks_decorators import register_migration
92+
from masci_tools.io.parsers.fleur import register_migration
9393
import copy
9494
9595
@register_migration(base_version='0.33', target_version='0.34')

docs/source/module_guide/code.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ Functions/Classes for loading/validating fleur XML files
112112
.. automodule:: masci_tools.io.parsers.fleur_schema.schema_dict
113113
:members:
114114

115-
.. automodule:: masci_tools.io.io_fleurxml
115+
.. automodule:: masci_tools.io.fleur_xml
116116
:members:
117+
:private-members: _EvalContext
117118

118119
Helper functions for the ``n_mmp_mat`` file
119120
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

docs/source/module_guide/tools.rst

-6
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ Fleur parser utility
7272
.. automodule:: masci_tools.util.fleur_calculate_expression
7373
:members:
7474

75-
.. automodule:: masci_tools.util.parse_tasks
76-
:members:
77-
78-
.. automodule:: masci_tools.util.parse_tasks_decorators
79-
:members:
80-
8175
.. automodule:: masci_tools.io.parsers.fleur.outxml_conversions
8276
:members:
8377

0 commit comments

Comments
 (0)