Skip to content

Commit

Permalink
Add changelog, update version, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccafair committed Jan 22, 2020
1 parent b8df352 commit 7391fcf
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 23 deletions.
38 changes: 38 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
`Unreleased <https://github.com/pace-neutrons/Euphonic/compare/v0.2.0...HEAD>`_
----------

`v0.2.0 <https://github.com/pace-neutrons/Euphonic/compare/v0.1-dev3...v0.2.0>`_
------

- There are several breaking changes:

- Changes to the object instantiation API. The former interface
``InterpolationData(seedname)`` has been changed to
``InterpolationData.from_castep(seedname)`,` in anticipation of more codes
being added which require more varied arguments.
- Changes to the Debye-Waller calculation API when calculating the structure
factor. The previous ``dw_arg`` kwarg accepted either a seedname or length
3 list describing a grid. The new kwarg is now ``dw_data`` and accepts a
``PhononData`` or ``InterpolationData`` object with the frequencies
calculated on a grid. This is to make it clearer to the user exactly what
arguments are being used when calculating phonons on the grid.
- Changes to parallel functionality. The previous parallel implementation
based on Python's multiprocessing has been removed and replaced by a
C/OpenMP version. This has both better performance and is more robust. As
a result the ``n_procs`` kwarg to ``calculate_fine_phonons`` has been
replaced by ``use_c`` and ``n_threads`` kwargs.

- Improvements:

- The parallel implementation based on Python's multiprocessing has been
removed and now uses C/OpenMP which both has better performance and is more
robust
- Documentation has been moved to readthedocs and is more detailed
- Clearer interface for calculating the Debye-Waller factor
- Better error handling (e.g. empty ``InterpolationData`` objects, Matplotlib
is not installed...)

- Bug fixes:

- Fix gwidth for DOS not being converted to correct units
- Fix qwidth for S(Q,w) broadening being incorrectly calculated
25 changes: 10 additions & 15 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ Installing the C extension (optional)
Euphonic has an optional C extension, which can lead to increased performance
and enable use of multiple cores when interpolating phonons. By default
Euphonic will attempt to install this extension, but will print a warning and
fall back to the pure Python version
if this fails.
fall back to the pure Python version if this fails. To determine if the C
extension is installing properly and investigate any problems, it is best to
increase pip's verbosity:

.. code-block:: bash
pip install -vvv euphonic
**Windows**

Expand All @@ -65,20 +70,10 @@ the same pip commands as above.

**Linux**

The recommended compiler is ``gcc`` (currently tested with ``4.8.5``), first the
environment variable ``CC`` must be set to the gcc compiler:

.. code-block:: bash
You should have a version of ``gcc`` on your path (currently tested with
``4.8.5``). If ``gcc`` can be found the Euphonic extension will be automatically
installed when using the same pip commands as above.

export CC=gcc
Then the Euphonic extension will be automatically installed when using the same
pip commands as above. If installing the C extension is failing, you can
investigate by increasing pip's verbosity with the ``-vvv`` flag:

.. code-block:: bash
pip install -vvv euphonic

.. toctree::
:hidden:
Expand Down
21 changes: 15 additions & 6 deletions euphonic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from pint import UnitRegistry
__version__ = '0.2.0'

try:
# Create ureg here so it is only created once. However, this __init__.py
# needs to be imported by setup.py to find __version__, so allow pint import
# to fail as in this case pint might not be installed yet
from pint import UnitRegistry

ureg = UnitRegistry()
# All values from CODATA 2014
ureg.define('rydberg = 13.605693009*eV = Ry')
ureg.define('bohr = 0.52917721067*angstrom = a_0')
ureg.define('electron_mass = 0.0005485799093*amu = e_mass')
except ImportError:
pass

ureg = UnitRegistry()
# All values from CODATA 2014
ureg.define('rydberg = 13.605693009*eV = Ry')
ureg.define('bohr = 0.52917721067*angstrom = a_0')
ureg.define('electron_mass = 0.0005485799093*amu = e_mass')
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
from euphonic import __version__

try:
from setuptools import setup, find_packages, Extension
Expand All @@ -8,6 +8,7 @@
def run_setup(build_c=True):

if build_c:
import os
import numpy as np
include_dirs = [np.get_include(), 'c']
sources = ['c/_euphonic.c', 'c/dyn_mat.c', 'c/util.c', 'c/py_util.c',
Expand Down Expand Up @@ -48,7 +49,7 @@ def run_setup(build_c=True):

setup(
name='euphonic',
version='0.1dev3',
version=__version__,
author='Rebecca Fair',
author_email='[email protected]',
description=(
Expand Down

0 comments on commit 7391fcf

Please sign in to comment.