Skip to content

Commit

Permalink
Merge pull request #174 from JuDFTteam/release-0.11.0
Browse files Browse the repository at this point in the history
🚀 Release `0.11.0`
  • Loading branch information
janssenhenning authored Jun 27, 2022
2 parents 20c0628 + 96b5593 commit 2f97cd3
Show file tree
Hide file tree
Showing 251 changed files with 18,092 additions and 4,451 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v3.1.2
- name: Set up Python 3.10
uses: actions/setup-python@v4.0.0
with:
python-version: 3.9
python-version: '3.10'

- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ~/.cache/pip
key: pip-docs-${{ hashFiles('**/pyproject.toml') }}
Expand Down Expand Up @@ -68,15 +68,15 @@ jobs:

- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-pre-commit-
- name: Set up Python 3.8
uses: actions/setup-python@v3.1.2
uses: actions/setup-python@v4.0.0
with:
python-version: 3.8

Expand Down Expand Up @@ -104,15 +104,15 @@ jobs:

- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-${{ matrix.python-version }}-tests
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3.1.2
uses: actions/setup-python@v4.0.0
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -130,7 +130,7 @@ jobs:
pip install codecov
codecov
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: failure()
with:
name: matplotlib-comparison-${{ matrix.python-version }}
Expand All @@ -144,7 +144,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v3.1.2
uses: actions/setup-python@v4.0.0
with:
python-version: 3.7
- name: Install flit
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v3.1.2
- name: Set up Python 3.10
uses: actions/setup-python@v4.0.0
with:
python-version: 3.9
python-version: '3.10'

- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ~/.cache/pip
key: pip-docs-${{ hashFiles('**/pyproject.toml') }}
Expand Down Expand Up @@ -62,15 +62,15 @@ jobs:

- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-pre-commit-
- name: Set up Python 3.8
uses: actions/setup-python@v3.1.2
uses: actions/setup-python@v4.0.0
with:
python-version: 3.8

Expand Down Expand Up @@ -103,15 +103,15 @@ jobs:

- name: Cache python dependencies
id: cache-pip
uses: actions/[email protected].2
uses: actions/[email protected].4
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-tests-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-${{ matrix.python-version }}-tests
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3.1.2
uses: actions/setup-python@v4.0.0
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -129,7 +129,7 @@ jobs:
pip install codecov
codecov
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: failure()
with:
name: matplotlib-comparison-${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fleur-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v3.1.2
uses: actions/setup-python@v4.0.0
with:
python-version: 3.8

Expand All @@ -40,7 +40,7 @@ jobs:
run: exit 1

- name: Create Pull Request
uses: peter-evans/[email protected].2
uses: peter-evans/[email protected].4
with:
commit-message: "[fleur release] Fleur schema update"
branch: fleur-release/schema
Expand Down
12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: double-quote-string-fixer
types: [python]
Expand Down Expand Up @@ -42,7 +42,7 @@ repos:
]

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v2.32.0
hooks:
- id: pyupgrade
args: [
Expand All @@ -52,6 +52,13 @@ repos:
- repo: local
hooks:

#Since this runs after the formatter the docstrings should already satisfy all other hooks
- id: make-fleurxmlmodifier-doc
name: Generate Docstrings for Setter methods of FleurXMLModifier
entry: python ./utils/write_fleurxmlmodifier_docstrings.py
language: system
pass_filenames: false

- id: pylint-errors
name: pylint-errors
entry: pylint
Expand Down Expand Up @@ -103,4 +110,5 @@ repos:
masci_tools/tools/greensfunction.py|
masci_tools/cmdline/parameters/slice.py|
masci_tools/vis/parameters.py|
masci_tools/util/ipython.py|
)$
5 changes: 3 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ formats:
- pdf

python:
version: 3.9
install:
- method: pip
path: .
extra_requirements:
- docs

build:
image: testing
os: ubuntu-20.04
tools:
python: "3.10"
60 changes: 54 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Changelog

## v.0.11.0
[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.10.1...v0.11.0)

This release adds some improvements to the XML and HDF5 handling mainly for better AiiDA-Fleur
support. Also major updates to documentation configurations and Green's function calculations.

### Added
- Added `FleurElementMaker` class. This can be used to create XML elements compatible with a given version from scratch.
Has case-insensitivity and converts values to strings for XML [[#159]](https://github.com/JuDFTteam/masci-tools/pull/159)
Example
```python
from masci_tools.util.xml.builder import FleurElementMaker
E = FleurElementMaker.fromVersion('0.35')
new_kpointset = E.kpointlist(
*(
E.kpoint(kpoint, weight=weight, label=special_labels[indx]) if indx in special_labels else
E.kpoint(kpoint, weight=weight) for indx, (kpoint, weight) in enumerate(zip(kpoints, weights))
),
name=name,
count=nkpts,
type=kpoint_type)
```
- Function `serialize_xml_arguments` to `masci_tools.util.xml.common_functions` to remove XML elements/trees from positional/keyword arguments and replace them with string representations of the XML. Can be used in AiiDA-Fleur
- Module `masci_tools.util.ipython` and ipython extension (`%load_ext masci_tools`). Adds syntax highlighted XML tree output and creating HTML syntax highlighted diffs of XML trees [[#158]](https://github.com/JuDFTteam/masci-tools/pull/158)
- Added calculation of Jij Tensor from intersite Green's functions [[#170]](https://github.com/JuDFTteam/masci-tools/pull/170)

### Improvements
- Added `name` entry to `SchemaDict.tag_info` which contains the tag name in the original case [[#159]](https://github.com/JuDFTteam/masci-tools/pull/159)
- `convert_to_xml` is made more strict. Conversion `int` to `str` uses the `{:d}` format specifier and string conversion is no longer always attempted [[#159]](https://github.com/JuDFTteam/masci-tools/pull/159)
- Improvements to Colorbar creation in matplotlib plotting methods. Limits are now set consistently with `limits={'color': (low, high)}` in the plot and colorbar. Spinpolarized bandplots now show two colorbars for the two colormaps if requested
- `get_parameter_data` now also extracts the `gamma` switch for kpoint generation for more consistent roundtrips. This is only set if the first kpoint in the mesh is the gamma point and there are multiple
- `load_inpxml` and `load_outxml` now consistently accept the XML file given as a
string of the content. The content no longer has to be manually encoded as bytes
- The method `FleurXMLModifier.modify_xmlfile` now always returns two things. The modified XML tree and a dictionary with all additional file contents, e.g. `n_mmp_mat`.
- Support for aligning spin/real-space frames of Green's functions. Several further imporvements/bugfixes for Green's function modules [[#170]](https://github.com/JuDFTteam/masci-tools/pull/170)

### Bugfixes
- Bugfix for `outxml_parser` returning a nested list for Hubbard 1 distances, where a flat list was expected. Removed `force_list` argument from the parsing task definition
- Fixes in `plot_fleur_bands`, when providing custom weights without spin suffixes, i.e. `_up`/`_down`
- Fix in `HDF5Reader`. IO like objects without an attached filename would lead to an early error. This is the case for example for some readers in the file repository implementation used in AiiDA v2.0
- Fix in `HDF5Reader`. The file handles for compressed files in the AiiDA v2 repository have to be copied into a temporary file first before they can be used

### For Developers
- Docs: Updated `sphinx` and `sphinx-autodoc-typehints` versions and build docs on python 3.10 [[#156]](https://github.com/JuDFTteam/masci-tools/pull/156)
- Docs: Converted to `MyST` markdown and where appropriate introduced `myst-nb` for executing code cells in the documentation, e.g. generate plotting examples [[#157]](https://github.com/JuDFTteam/masci-tools/pull/157)
- Bokeh regression tests now strip out the bokeh version from the test files
- Added pre-commit hook, which generates the docstrings for the `FleurXMLModifier` registration methods from their XML setter function counterparts [[#166]](https://github.com/JuDFTteam/masci-tools/pull/166)

## v0.10.1
[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.10.0...v0.10.1)

Expand All @@ -13,11 +61,11 @@ This release provides several new features in the XML modification/evaluation fo
working with DFT+U density matrix files are also fixed.
### Added
- 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)
- 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)
- 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)
- 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)
- 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)

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
- Added several predefined conversions to/from input version `0.35` to `inpxml_converter` [[#153]](https://github.com/JuDFTteam/masci-tools/pull/#153)
- Added several predefined conversions to/from input version `0.35` to `inpxml_converter` [[#153]](https://github.com/JuDFTteam/masci-tools/pull/153)

### Improvements
- 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)
Expand All @@ -28,11 +76,11 @@ working with DFT+U density matrix files are also fixed.
- 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)
- 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`
- Fixed bug, when using the `FleurXMLModifier` directly (not in `aiida-fleur`), included XML files were not handled
- 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)
- 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)

### Deprecated
- The module `masci_tools.io.io_fleurxml` is renamed to `masci_tools.io.fleur_xml` [[#152]](https://github.com/JuDFTteam/masci-tools/pull/#152)
- 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)
- The module `masci_tools.io.io_fleurxml` is renamed to `masci_tools.io.fleur_xml` [[#152]](https://github.com/JuDFTteam/masci-tools/pull/152)
- 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)

### For Developers
- 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
Expand Down
24 changes: 11 additions & 13 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['myst_parser',
extensions = ['myst_nb',
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
Expand All @@ -36,17 +36,20 @@
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx',
'sphinx_toolbox.more_autodoc.typehints',
'sphinx_toolbox.more_autodoc.overloads',
'sphinx_autodoc_typehints',
'sphinx_copybutton',
'sphinx_click']

intersphinx_mapping = {'numpy': ('https://numpy.org/doc/stable/', None),
'python': ('https://docs.python.org/3', None),
'lxml': ('https://lxml.de/apidoc/',None),
'h5py': ('https://docs.h5py.org/en/latest/', None)}
'h5py': ('https://docs.h5py.org/en/latest/', None),
'pandas': ('http://pandas.pydata.org/pandas-docs/dev', None)}

myst_enable_extensions = []
myst_enable_extensions = ['colon_fence',
'fieldlist',
'dollarmath',
'deflist']

todo_include_todos = True

Expand Down Expand Up @@ -255,7 +258,7 @@
# No sphinx_rtd_theme installed
pass

autodoc_mock_imports = ['bokeh']
autodoc_mock_imports = ['bokeh', '_typeshed']


# -- Options for manual page output ---------------------------------------
Expand Down Expand Up @@ -397,15 +400,10 @@
('py:obj', 'plum'),
('py:class', 'etree._XPathObject'),
('py:class', 'h5py._hl.group.Group'),
('py:class', 'etree._Element'),
('py:class', 'etree.XPath'),
('py:class', 'TypeAlias'),
('py:class', 'Logger'),
('py:class', 'FilterType'),
('py:class', 'XMLLike'),
('py:class', 'etree.XPathElementEvaluator'),
('py:class', 'contextlib._GeneratorContextManager'),
('py:data', 'masci_tools.io.parsers.fleur.fleur_outxml_parser.F')
('py:data', 'masci_tools.io.parsers.fleur.fleur_outxml_parser.F'),
('py:class', 'np.ndarray')
]


Expand Down
Loading

0 comments on commit 2f97cd3

Please sign in to comment.