Skip to content

Commit

Permalink
Merge pull request #216 from hakonanes/prep-for-0.6.0-release
Browse files Browse the repository at this point in the history
Prepare for 0.6rc1 release
  • Loading branch information
CSSFrancis authored May 13, 2024
2 parents cc8b0a7 + 5bbd6f2 commit 870d632
Show file tree
Hide file tree
Showing 82 changed files with 286 additions and 244 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Test files
file_01.pickle

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"orcid": "0000-0002-1213-2911",
"affiliation": "Norwegian University of Science and Technology"
},
{
"name":"Carter Francis",
"orcid": "0000-0003-2564-1851",
"affiliation": "University of Wisconsin Madison"
},
{
"name":"Eric Prestat"
},
Expand Down
16 changes: 10 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0>`_
this project tries its best to adhere to
`Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.

Unreleased
==========
2024-05-12 - version 0.6.0
==========================

Added
-----
- Explicit support for Python 3.11.
- Added Pre-Commit for code formatting.
- Added deprecation tools for deprecating functions, parameters, methods, and properties.
- Added deprecation tools for deprecating functions, parameters, methods, and
properties.

Changed
-------
Expand All @@ -23,16 +24,19 @@ Changed

Deprecated
----------
- ``get_hkl()``, ``get_highest_hkl()``, and ``get_equivalent_hkl()`` methods in the
crystallography module. Please use the following corresponding methods in the
``ReciprocalLatticeVector`` class instead: ``from_highest_hkl()``,
``from_min_dspacing()``, and ``symmetrise()``.

Removed
-------
- Removed support for Python 3.6 and Python 3.7, leaving 3.8 as the oldest supported
version.
- ``ReciprocalLatticePoint`` class; Use the ``ReciprocalLatticeVector`` class instead,
which is an improved replacement.

Fixed
-----
- ``StructureLibrary.from_crystal_systems()`` class method, which previously raised a
``NotImplementedError``, but now will throw an ``AttributeError`` instead.

2023-05-22 - version 0.5.2
==========================
Expand Down
96 changes: 78 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,29 +1,89 @@
|build_status|_ |Coveralls|_ |docs|_ |pypi_version|_ |black|_ |doi|_
diffsims is an open-source Python library for simulating diffraction.

The package is released under the GPL v3 license.

.. |pypi_version| image:: https://img.shields.io/pypi/v/diffsims.svg?style=flat
:target: https://pypi.python.org/pypi/diffsims

.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/diffsims.svg?logo=conda-forge&logoColor=white
:target: https://anaconda.org/conda-forge/diffsims

.. |build_status| image:: https://github.com/pyxem/diffsims/workflows/build/badge.svg
.. _build_status: https://github.com/pyxem/diffsims/actions
:target: https://github.com/pyxem/diffsims/actions/workflows/build.yml

.. |Coveralls| image:: https://coveralls.io/repos/github/pyxem/diffsims/badge.svg?branch=master
.. _Coveralls: https://coveralls.io/github/pyxem/diffsims?branch=master
.. |python| image:: https://img.shields.io/badge/python-3.8+-blue.svg
:target: https://www.python.org/downloads/

.. |docs| image:: https://readthedocs.org/projects/diffsims/badge/?version=latest
.. _docs: https://diffsims.readthedocs.io/en/latest
.. |Coveralls| image:: https://coveralls.io/repos/github/pyxem/diffsims/badge.svg?branch=main
:target: https://coveralls.io/github/pyxem/diffsims?branch=main

.. |pypi_version| image:: https://img.shields.io/pypi/v/diffsims.svg?style=flat
.. _pypi_version: https://pypi.org/project/diffsims/
.. |pypi_downloads| image:: https://img.shields.io/pypi/dm/diffsims.svg?label=PyPI%20downloads
:target: https://pypi.org/project/diffsims/

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
.. _black: https://github.com/psf/black
.. |conda_downloads| image:: https://img.shields.io/conda/dn/conda-forge/diffsims.svg?label=Conda%20downloads
:target: https://anaconda.org/conda-forge/diffsims

.. |doi| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3337900.svg
.. _doi: https://doi.org/10.5281/zenodo.3337900
:target: https://doi.org/10.5281/zenodo.3337900

diffsims is an open-source Python library for simulating diffraction.
.. |GPLv3| image:: https://img.shields.io/github/license/pyxem/diffsims
:target: https://opensource.org/license/GPL-3.0

If simulations performed using diffsims form a part of published work please
cite the DOI at the top of this page. You can find demos in the `diffsims-demos
<https://github.com/pyxem/diffsims-demos>`_ repository. See the `documentation
<https://diffsims.readthedocs.io/en/latest/>`_ for installation instructions, the API
reference, the changelog and more.
.. |GH-issues| image:: https://img.shields.io/badge/GitHub-Issues-green?logo=github
:target: https://github.com/pyxem/diffsims/issues

.. |docs| image:: https://readthedocs.org/projects/diffsims/badge/?version=latest
:target: https://diffsims.readthedocs.io/en/latest

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

+----------------------+------------------------------------------------+
| Deployment | |pypi_version| |conda| |
+----------------------+------------------------------------------------+
| Build status | |build_status| |docs| |python| |
+----------------------+------------------------------------------------+
| Metrics | |Coveralls| |
+----------------------+------------------------------------------------+
| Activity | |pypi_downloads| |conda_downloads| |
+----------------------+------------------------------------------------+
| Citation | |doi| |
+----------------------+------------------------------------------------+
| License | |GPLv3| |
+----------------------+------------------------------------------------+
| Community | |GH-issues| |
+----------------------+------------------------------------------------+
| Formatter | |black| |
+----------------------+------------------------------------------------+

Documentation
-------------

Refer to the `documentation <https://diffsims.readthedocs.io>`__ for detailed
installation instructions, a user guide, a technical (API) reference, and the `changelog
<https://diffsims.readthedocs.io/en/latest/changelog.html>`_.

Installation
------------

diffsims can be installed with ``pip``::

pip install diffsims

diffsims is released under the GPL v3 license.
or ``conda``::

conda install diffsims -c conda-forge

The source code is hosted in `GitHub <https://github.com/pyxem/diffsims>`_, and can also
be downloaded from `PyPI <https://pypi.org/project/diffsims>`_ and
`Anaconda <https://anaconda.org/conda-forge/diffsims>`_.

Further details are available in the
`installation guide
<https://diffsims.readthedocs.io/en/latest/user/installation.html>`_.

Citing diffsims
---------------

If simulations performed using diffsims form a part of published work please
cite the DOI at the top of this page.
2 changes: 1 addition & 1 deletion diffsims/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
16 changes: 14 additions & 2 deletions diffsims/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand All @@ -17,16 +17,21 @@
# along with diffsims. If not, see <http://www.gnu.org/licenses/>.

from diffpy.structure import Atom, Lattice, Structure
import matplotlib.pyplot as plt
from orix.crystal_map import Phase
import pytest

from diffsims.crystallography import ReciprocalLatticeVector
from diffsims.generators.diffraction_generator import DiffractionGenerator


def pytest_sessionstart(session):
plt.rcParams["backend"] = "agg"


@pytest.fixture
def default_structure():
"""An atomic structure represented using diffpy"""
"""An atomic structure represented using diffpy."""
latt = Lattice(3, 3, 5, 90, 90, 120)
atom = Atom(atype="Ni", xyz=[0, 0, 0], lattice=latt)
hexagonal_structure = Structure(atoms=[atom], lattice=latt)
Expand Down Expand Up @@ -109,3 +114,10 @@ def add_reciprocal_lattice_vector_al(doctest_namespace):
)
rlv = ReciprocalLatticeVector(phase, hkl=[[1, 1, 1], [2, 0, 0]])
doctest_namespace["rlv"] = rlv


@pytest.fixture(params=[("file_01")])
def pickle_temp_file(tmpdir, request):
name = request.param
fname = tmpdir.join(name + ".pickle")
yield fname
2 changes: 1 addition & 1 deletion diffsims/crystallography/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/crystallography/get_hkl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/crystallography/reciprocal_lattice_vector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/generators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/generators/diffraction_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/generators/library_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
5 changes: 2 additions & 3 deletions diffsims/generators/rotation_list_generators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand All @@ -22,7 +22,6 @@

from orix.sampling.sample_generators import get_sample_fundamental, get_sample_local
from orix.quaternion.rotation import Rotation
from orix.vector.neo_euler import AxAngle

from diffsims.utils.sim_utils import uvtw_to_uvw
from diffsims.generators.sphere_mesh_generators import (
Expand Down Expand Up @@ -168,7 +167,7 @@ def get_grid_around_beam_direction(beam_rotation, resolution, angular_range=(0,
np.arange(start=angular_range[0], stop=angular_range[1], step=resolution)
)
axes = np.repeat([[0, 0, 1]], angles.shape[0], axis=0)
in_plane_rotation = Rotation.from_neo_euler(AxAngle.from_axes_angles(axes, angles))
in_plane_rotation = Rotation.from_axes_angles(axes, angles)

orix_grid = beam_rotation * in_plane_rotation
rotation_list = get_list_from_orix(orix_grid, rounding=2)
Expand Down
2 changes: 1 addition & 1 deletion diffsims/generators/sphere_mesh_generators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/generators/zap_map_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/libraries/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/libraries/diffraction_library.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
32 changes: 1 addition & 31 deletions diffsims/libraries/structure_library.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down Expand Up @@ -81,36 +81,6 @@ def from_orientation_lists(cls, identifiers, structures, orientations):
"""
return cls(identifiers, structures, orientations)

@classmethod
def from_crystal_systems(
cls, identifiers, structures, systems, resolution, equal="angle"
):
"""
Creates a structure library from crystal system derived orientation lists
Parameters
----------
identifiers : list of strings/ints
A list of phase identifiers referring to different atomic structures.
structures : list of diffpy.structure.Structure objects.
A list of diffpy.structure.Structure objects describing the atomic
structure associated with each phase in the library.
systems : list
A list over indentifiers of crystal systems
resolution : float
resolution in degrees
equal : str
Default is 'angle'
Raises
------
NotImplementedError:
"This function has been removed in version 0.3.0, in favour of creation from orientation lists"
"""
raise NotImplementedError(
"This function has been removed in version 0.3.0, in favour of creation from orientation lists"
)

def get_library_size(self, to_print=False):
"""
Returns the the total number of orientations in the
Expand Down
2 changes: 1 addition & 1 deletion diffsims/libraries/vector_library.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/pattern/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
2 changes: 1 addition & 1 deletion diffsims/pattern/detector_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017-2023 The diffsims developers
# Copyright 2017-2024 The diffsims developers
#
# This file is part of diffsims.
#
Expand Down
7 changes: 4 additions & 3 deletions diffsims/release_info.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name = "diffsims"
version = "0.6.dev0"
version = "0.6rc1"
author = "Duncan Johnstone, Phillip Crout"
copyright = "Copyright 2017-2023, The diffsims developers"
copyright = "Copyright 2017-2024, The diffsims developers"
# Initial committer first, then listed by line additions
credits = [
"Duncan Johnstone",
"Phillip Crout",
"Håkon Wiik Ånes",
"Carter Francis",
"Eric Prestat",
"Rob Tovey",
"Simon Høgås",
Expand All @@ -25,6 +26,6 @@
"Eirik Opheim",
]
license = "GPLv3+"
maintainer = "Duncan Johnstone, Phillip Crout, Håkon Wiik Ånes"
maintainer = "Duncan Johnstone, Phillip Crout, Håkon Wiik Ånes, Carter Francis"
email = "[email protected]"
status = "Development"
Loading

0 comments on commit 870d632

Please sign in to comment.