Skip to content

Commit

Permalink
Merge pull request #67 from JuDFTteam/Release-0.5.0
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
janssenhenning authored Aug 19, 2021
2 parents 3083e19 + a7a2efd commit e4d9ea2
Show file tree
Hide file tree
Showing 109 changed files with 4,535 additions and 741 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.4.10
current_version = 0.5.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Run pre-commit
run: |
SKIP=${{ matrix.skip-hooks }} pre-commit run --all-files || (git status --short; git diff ; exit 1)
SKIP=${{ matrix.skip-hooks }} pre-commit run --all-files --config=.pre-commit-config-ci.yaml || (git status --short; git diff ; exit 1)
tests:

Expand Down Expand Up @@ -128,6 +128,12 @@ jobs:
pip install codecov
codecov
- uses: actions/upload-artifact@v2
with:
name: Matplotlib comparison
path: tests/mpl-results/fig_comparison.html
if-no-files-found: ignore

publish:
name: Publish to PyPi
needs: [docs, tests, pre-commit] #pylint-warnings could be added at some later point
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Run pre-commit
run: |
SKIP=${{ matrix.skip-hooks }} pre-commit run --all-files || (git status --short; git diff ; exit 1)
SKIP=${{ matrix.skip-hooks }} pre-commit run --all-files --config=.pre-commit-config-ci.yaml || (git status --short; git diff ; exit 1)
tests:
Expand All @@ -91,6 +91,13 @@ jobs:
strategy:
matrix:
python-version: ['3.9', '3.8', '3.7', '3.6']
experimental: [false]
# include:
# - python-version: 3.10.0-rc.1
# experimental: true

name: tests-python-${{ matrix.python-version }}
continue-on-error: ${{ matrix.experimental }}

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -122,3 +129,9 @@ jobs:
run: |
pip install codecov
codecov
- uses: actions/upload-artifact@v2
with:
name: Matplotlib comparison
path: tests/mpl-results/fig_comparison.html
if-no-files-found: ignore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ publish_to_pypi.sh
#editors etc
.pytest_cache
.vscode
*.sublime-project

# vim
*.swp
Expand Down Expand Up @@ -69,6 +70,7 @@ coverage.xml
*,cover
.hypothesis/
masci_tools/tests/{config.cfg,input*}
tests/mpl-results/

# Translations
*.mo
Expand Down
69 changes: 69 additions & 0 deletions .pre-commit-config-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: double-quote-string-fixer
types: [python]
- id: end-of-file-fixer
- id: fix-encoding-pragma
- id: mixed-line-ending
types: [python]
- id: trailing-whitespace
types: [python]
- id: check-yaml
- id: check-added-large-files
- id: forbid-new-submodules

- repo: git://github.com/pre-commit/mirrors-yapf
rev: v0.31.0
hooks:
- id: yapf
name: yapf
types: [python]
exclude: &exclude_files >
(?x)^(
docs/.*|
)$
args: ['-i']

- repo: https://github.com/ikamensh/flynt/
rev: '0.55'
hooks:
- id: flynt
args: [
'--line-length=120',
'--fail-on-change',
]

- repo: local
hooks:

- id: pylint-errors
name: pylint-errors
entry: pylint
args: [-d, W, -d, R, -d, C]
verbose: true
types: [python]
language: system
exclude: '^(docs/)|(examples/)'

- id: pylint-warnings
name: pylint-warnings
entry: pylint
verbose: true
types: [python]
language: system
exclude: '^(docs/)|(examples/)'

- id: version-number
name: Check version numbers
entry: python ./utils/validate_version_consistency.py
language: system
files: >-
(?x)^(
setup.py|
utils/validate_version_consistency.py|
masci_tools/__init__.py|
.bumpversion.cfg
)$
pass_filenames: false
13 changes: 2 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,8 @@ repos:
- repo: local
hooks:

- id: pylint-errors
name: pylint-errors
entry: pylint
args: [-d, W, -d, R, -d, C]
verbose: true
types: [python]
language: system
exclude: '^(docs/)|(examples/)'

- id: pylint-warnings
name: pylint-warnings
- id: pylint
name: pylint
entry: pylint
verbose: true
types: [python]
Expand Down
163 changes: 163 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Changelog
## v.0.5.0

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.10...v0.5.0)

This release contains fleur inpgen IO capabilities and many major improvements

### Added
- IO routines for reading/writing inpgen input files
- `get_structure_data` now returns the relaxed structure if a `relaxation` section is present
- `get_parameter_data` can read in the electron configuration if requested
- `get_symmetry_information` xml getter to get all defined symmetry operations
- `get_structure_data` and `get_parameter_data` now norm the species names to get consistent ids for usage in the inpgen files [[#70]](https://github.com/JuDFTteam/masci-tools/pull/70)
### Improvements
- Added another possible value to environment variable `MASCI_TOOLS_USE_OLD_CONSTANTS` to get the values of constants in between commits c171563 and 66953f8 [[#66]](https://github.com/JuDFTteam/masci-tools/pull/66)
- `spex` attribute is now used in addition to old `gw` attribute to determine whether a fleur input file is from a SPEX calculation
- `evaluate_tag` can now also get the text and recursively parse all subtags
- Changed default of `multiply_by_eqiv_atoms` in `plot_fleur_dos` to `True`
- `barchart` can now make horizontal bar charts
- `get_cell` now also takes the `scale` attribute into account
- Made conversion to angstroem optional (done by default) in the xml getters. Can be turned off with the options `convert_to/from_angstroem`
- Deprecated: Old atom position output in `get_structure_data`. Use option `site_namedtuple=True` to get new output (includes species information)
### Bugfixes
- Fixes to make `plot_convex_hull_2d` work
- Fix in `evaluate_text` make `constants` argument optional
- Fix for `get_structure_data`; Added missing unit conversion for z-coordinate of film positions

## v.0.4.10

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.9...v0.4.10)

This release contains bugifxes for the visualization routines

### Bugfixes
- Fixed issue for histogram plot, which prevented usage for e.g. stacked histograms with multiple datasets
- Fixed usage of dictionary arguments in plot_fleur_dos, that should not be used to specify parameters for multiple datasets (e.g. limits, lines)
- Updated documentation table of plot parameters to put all dictionaries into literal blocks. Otherwise single quotes appear differently on read the docs

## v.0.4.9

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.8...v0.4.9)

### Improvements
- Added saving/loading of plot defaults in json files to Plotter class (No exposed functions yet in plot_methods or bokeh_plots)
- DOS plot parameters in plot_fleur_dos can now be specifified by label, e.g. color={'Total_up': 'blue'}
### Bugfixes
- Various Bugfixes and improvements to ChemicalElements class, greensfunction tools and plotting methods
- Fixed wrong atom label generation in DOS plots (#55)

## v.0.4.8

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.7...v0.4.8)

### Added
- Tool to analyze/work with greensfunctions calculated by Fleur `masci_tools.tools.greensfunction`
### Improvements
- Several improvements of KKR parsers/parameters [[#13]](https://github.com/JuDFTteam/masci-tools/pull/13)
- Introduced patching functions for the schema dictionaries to manually correct ambiguities (#48)
- Improvements of the `HDF5Reader` and recipes for Fleur DOS/bandstructure calculation
- For devs:
- pylint warnings are no longer fatal for the CI jobs
- tests folder moved outside package directory
### Bugfixes
- Bugfixes and improvements in the plotting functions for DOS/bandstructures
- Bugfixes in `xml_setters` and `fleurxmlmodifier` modules

## v.0.4.7

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.6...v0.4.7)

### Added
- Introduced higher level XML modification functions for `xml_delete_tag`, `xml_delete_att`, `xml_replace_tag`
### Improvements
- moving conversion factors for energy and bohr to angstroem conversion to NIST values in KKR parts of the code. This can also be disabled for backwards compatibility by setting the environment flag `MASCI_TOOLS_USE_OLD_CONSTANTS`
- Added missing energy unit alias for Fleur input files
- `xml_delete_tag`, `xml_delete_att`, `xml_replace_tag` now also support the `occurrences` argument
- FleurXMLModifier improvements. Modification registration methods will now test the given arguments against the modifying functions immediately to fail early for errors. `fromList` classmethod allows the instantiation with a known list of tasks to perform. These are passed through the same procedure as the normal registration of changes

## v.0.4.6

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.5...v0.4.6)

### Bugfixes
- Fix for the `clear_xml` function, where comments could end up in the set of included tags. This lead to failures in aiida-fleur

## v.0.4.5

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.4...v0.4.5)

### Added
- Introduced function to split a xmltree back up into the included subtrees and the main tree with `xi:include` tags
- clear_xml now returns a set of the tags, that were included
### Bugfixes
- various bugfixes for xml modifying functions
- A special case for `theta`, `phi` and `ef_shift` attributes of forceTheorem tags, since they are not correctly typed in the Inputschema

## v.0.4.4

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.3...v0.4.4)

### Added
- XML getter methods for number of kpoints and relaxation information
- XML setter methods for manipulating kpoints
### Improvements
- top level `create_tag` now also accepts a etree.Element
- XML getters now also accept etree.Element
- Added `etree.indent` calls to keep modified `inp.xml` clean (raises lxml dependency constraint to 4.5)
- `io_fleurxml` functions now pass keyword arguments to XMLParser
- Readd `fleur_modes` to output_dict
### Bugfixes
- Bugfix for relative xpaths

## v.0.4.3

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.2...v0.4.3)

### Added
- Added utility for creating schema dictionary version specific functions
- Added XML getter functions adapted from aiida-fleur fleurinpdata methods [[#40]](https://github.com/JuDFTteam/masci-tools/pull/40)
### Improvements
- Improved logging and failure handling of XML parser functions [[#39]](https://github.com/JuDFTteam/masci-tools/pull/39)
- Improved handling of `schema_dict_util` functions with nodes away from the XML root of the file [[#41]](https://github.com/JuDFTteam/masci-tools/pull/41)

## v.0.4.2

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.1...v0.4.2)

### Added
- Added key descriptions to Plotter objects and ``get_mpl_help`` and ``get_bokeh_help`` functions in plotting modules for getting descriptions of parameters
- Two new recipes for ``HDF5Reader`` for bandstructures (for reading in no or specific weights besides eigenvalues)
### Improvements
- MatplotlibPlotter and BokehPlotter now have a autogenerated table of descriptions and default values in the docstring (not as nicely formatted) and in the sphinx build (really nicely formatted)
- ``save_format`` in matplotlib plots can now be a list of formats
- Various visual improvements to band/DOS plots:
- Bandstructure size scaling adjusted to not produce massive bands
- Bandstrcuture spin up components are now potted on top by default
- size/color scaling now done with respect to the maximum in the plotting region
- DOS added spin arrows in spin-polarized case
- DOS inverted x-axis in vertical plot (spin down now on the right side)
- DOS added symmetric limits in DOS direction for spin-polarized plots
- DOS default figsize flipped for vertical plots

## v.0.4.1

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.4.0...v0.4.1)

### Bugfixes
- Fix for `plot_lattice_constant` to make it work in aiida-fleur

## v.0.4.0

[full changelog](https://github.com/JuDFTteam/masci-tools/compare/v0.3.12...v0.4.0)

### Added
- Parsers for Fleur `inp.xml`/`out.xml` files. These are robust with respect to changing file versions [[#3]](https://github.com/JuDFTteam/masci-tools/pull/3)
- General parser for `.hdf` files [[#30]](https://github.com/JuDFTteam/masci-tools/pull/30)
- Functionality for modifying `inp.xml` files [[#23]](https://github.com/JuDFTteam/masci-tools/pull/23)
- Fleur visualization routines `plot_fleur_dos` and `plot_fleur_bands`
- IO Module for creating/reading and manipulating `n_mmp_mat` files for LDA+U calculations in fleur [[#31]](https://github.com/JuDFTteam/masci-tools/pull/31)
- Tool for calculating crystal field coefficients [[#22]](https://github.com/JuDFTteam/masci-tools/pull/22)
### Improvements
- Refactored parameter handling in plotting methods. Introduced
`Plotter` class for consistent behaviour and easy extendability of plotting capabilities [[#6]](https://github.com/JuDFTteam/masci-tools/pull/6)
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include masci_tools/io/parsers/fleur/fleur_schema/*/*.xsd
include masci_tools/io/parsers/fleur/fleur_schema/*/*.py
include AUTHORS.txt
include CHANGELOG.md
include LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion docs/source/devel_guide/fleur_parser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Updating or adapting the Fleur Parsers
Each input and output file for Fleur has a correspong XML-Schema, where the structure
of these files are defined.

To be able to parse such files efficiently and without hardcoding their structure we extract all necessary information about the schemas in :py:func:`~masci_tools.io.parsers.fleur.fleur_schema.create_inpschema_dict()` and :py:func:`~masci_tools.io.parsers.fleur.fleur_schema.create_outschema_dict()`. The resulting python dictionaries can be accessed via the classes :py:class:`~masci_tools.io.parsers.fleur.fleur_schema.InputSchemaDict` and :py:class:`~masci_tools.io.parsers.fleur.fleur_schema.OutputSchemaDict`. The easiest way to instantiate one of these objects is to use the :py:meth:`~masci_tools.io.parsers.fleur.fleur_schema.InputSchemaDict.fromVersion()` or :py:meth:`~masci_tools.io.parsers.fleur.fleur_schema.OutputSchemaDict.fromVersion()` methods by providing the desired version string.
To be able to parse such files efficiently and without hardcoding their structure we extract all necessary information about the schemas in the modules under :py:mod:`~masci_tools.io.parsers.fleur.fleur_schema`. The resulting python dictionaries can be accessed via the classes :py:class:`~masci_tools.io.parsers.fleur.fleur_schema.InputSchemaDict` and :py:class:`~masci_tools.io.parsers.fleur.fleur_schema.OutputSchemaDict`. The easiest way to instantiate one of these objects is to use the :py:meth:`~masci_tools.io.parsers.fleur.fleur_schema.InputSchemaDict.fromVersion()` or :py:meth:`~masci_tools.io.parsers.fleur.fleur_schema.OutputSchemaDict.fromVersion()` methods by providing the desired version string.

Adding/modifying a Fleur Schema:
---------------------------------
Expand Down
8 changes: 7 additions & 1 deletion docs/source/module_guide/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ Fleur related IO
------------------

Input/Output Parser
^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^

.. automodule:: masci_tools.io.parsers.fleur
:members:

Inputgenerator related IO
^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: masci_tools.io.fleur_inpgen
:members:

Functions for modifying the input file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 2 additions & 0 deletions docs/source/module_guide/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Fleur parser utility
.. automodule:: masci_tools.io.parsers.fleur.outxml_conversions
:members:

.. automodule:: masci_tools.util.econfig
:members:

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

__version__ = '0.4.10'
__version__ = '0.5.0'

logging.getLogger(__name__).addHandler(logging.NullHandler())
Loading

0 comments on commit e4d9ea2

Please sign in to comment.