Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ repos:
additional_dependencies:
- "prettier@^3.2.4"
# docformatter - PEP 257 compliant docstring formatter
- repo: https://github.com/s-weigand/docformatter
rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.8
hooks:
- id: docformatter
additional_dependencies: [tomli]
Expand Down
46 changes: 23 additions & 23 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,63 +17,63 @@ Release notes


Version 2024.2.2
----------------
=====

**Fixes:**
**Fixed:**

* Correct powder pattern plotting with a non-empty name

Version 2024.2.1
----------------
=====

**Changes:**
**Changed:**

* PowderPattern:
* Fix re-using a matplotlib figure when plotting
* Add ``figure`` property

Version 2024.2
--------------
=====

**Changes:**
**Changed:**

* **DiffractionDataSingleCrystal**: add ``SetHklIobs``, ``SetIobs``, ``SetSigma``, ``GetSigma``, ``GetChi2``, ``FitScaleFactorForRw`` and ``FitScaleFactorForR`` (`issue #42 <https://github.com/diffpy/pyobjcryst/issues/42>`_)
* Add a single crystal data notebook example
* Online documentation notebooks now include the plots `<https://pyobjcryst.readthedocs.io/en/latest/examples>`_

**Fixes:**
**Fixed:**

* From libobjcryst: update the ScatteringComponentList when a Scatterer is removed from a Crystal (`issue #41 <https://github.com/diffpy/pyobjcryst/issues/41>`_)

Version 2024.1
--------------
=====

**Changes:**
**Changed:**

* Add python access to MolZAtom, for ``Molecule.AsZMatrix()``

Version 2.2.6
--------------
=====

**Changes:**
**Changed:**

* Support for Windows and Python>=3.8
* Added a zoom limit for 3D crystal views

**Fixes:**
**Fixed:**

* Correct error preventing pyobjcryst import for Windows and Python>=3.8 (`issue #33 <https://github.com/diffpy/pyobjcryst/issues/33>`_)
* Fix for matplotlib >=3.7.0 when removing hkl labels

Version 2.2.5
--------------
=====

**Changes:**
**Changed:**

* Raise an exception if ``alpha``, ``beta`` or ``gamma`` are not within ``]0;pi[`` when changing lattice angles
* Add ``UnitCell.ChangeSpaceGroup()``

**Fixes:**
**Fixed:**

* Avoid duplication of plots when using ipympl (aka ``%matplotlib widget``)
* Correct powder pattern tests to avoid warnings
Expand All @@ -83,9 +83,9 @@ Version 2.2.5
* ``loadCrystal`` – use ``create_crystal_from_cif()`` instead

Version 2.2.4
--------------
=====

**Changes:**
**Changed:**

* The list of HKL reflections will now be automatically re-generated for a ``PowderPatternDiffraction`` when the Crystal's spacegroup changes, or the lattice parameters are modified by more than 0.5%

Expand All @@ -94,7 +94,7 @@ Version 2.2.4
* Fixed the powder pattern indexing test

Version 2.2.3
--------------
=====

**Added:**

Expand All @@ -104,9 +104,9 @@ Version 2.2.3
* Add ``gDiffractionDataSingleCrystalRegistry`` to globals

Version 2.2.2
--------------
=====

**Changes:**
**Changed:**

* Add correct wrapping for C++-instantiated objects available through global registries, e.g. when loading an XML file. The objects are decorated with the python functions when accessed through the global registries ``GetObj()``
* Moved global object registries to ``pyobjcryst.globals``
Expand All @@ -118,7 +118,7 @@ Version 2.2.2
* Fix powder pattern plot issues (NaN and update of hkl text with recent matplotlib versions)

Version 2.2.1 -- 2021-11-28
----------------------------
=====

* Add quantitative phase analysis with ``PowderPattern.qpa()``, including an example notebook using the QPA Round-Robin data
* Correct import of ``urllib.request.urllopen()`` when loading CIF or z-matrix files from HTTP URLs
Expand All @@ -128,14 +128,14 @@ Version 2.2.1 -- 2021-11-28
* Fix issue when using ``Crystal.XMLInput()`` for a non-empty structure. Existing scattering power will be re-used when possible, and otherwise not deleted anymore (which could lead to crashes)

Version 2.2.0 -- 2021-06-08
----------------------------
=====

* Add access to ``Radiation`` class & functions to change RadiationType, wavelength in ``PowderPattern`` and ``ScatteringData`` (and hence ``DiffractionDataSingleCrystal``) classes
* Fix the custodian_ward when creating a ``PowderPatternDiffraction``: ``PowderPatternDiffraction`` must persist while ``PowderPattern`` exists, and Crystal must persist while ``PowderPatternDiffraction`` exists
* Add 3D Crystal viewer ``pyobjcryst.crystal.Crystal.widget_3d``

Version 2.1.0 -- 2019-03-11
----------------------------
=====

**Added:**

Expand Down
23 changes: 23 additions & 0 deletions news/fix-spelling-and-changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Exposed the correctly spelled `ORTHORHOMBIC` while preserving `ORTHOROMBIC` as temporary backend compatible alias

**Security:**

* <news item>
2 changes: 1 addition & 1 deletion requirements/conda.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy
libobjcryst>=2026.1
libobjcryst>=2026.2.0
libboost-devel
libboost-python
packaging # for matplotlib version parsing in powderpattern.py
Expand Down
3 changes: 2 additions & 1 deletion src/extensions/indexing_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ std::string __str__RecUnitCell(RecUnitCell& ruc)
{
case TRICLINIC:sys="TRICLINIC"; break;
case MONOCLINIC:sys="MONOCLINIC"; break;
case ORTHOROMBIC:sys="ORTHOROMBIC"; break;
case ORTHORHOMBIC:sys="ORTHORHOMBIC"; break;
case HEXAGONAL:sys="HEXAGONAL"; break;
case RHOMBOEDRAL:sys="RHOMBOEDRAL"; break;
case TETRAGONAL:sys="TETRAGONAL"; break;
Expand Down Expand Up @@ -299,6 +299,7 @@ void wrap_indexing()
.value("TRICLINIC", TRICLINIC)
.value("MONOCLINIC", MONOCLINIC)
.value("ORTHOROMBIC", ORTHOROMBIC)
.value("ORTHORHOMBIC", ORTHORHOMBIC)
.value("HEXAGONAL", HEXAGONAL)
.value("RHOMBOEDRAL", RHOMBOEDRAL)
.value("TETRAGONAL", TETRAGONAL)
Expand Down
1 change: 0 additions & 1 deletion src/pyobjcryst/crystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ def _display_list(
independent atoms, no symmetry or translation is applied
:return : the list of atoms and bonds to be displayed for 3dmol
"""

spg = self.GetSpaceGroup()
vv = []
idx = 0
Expand Down
6 changes: 3 additions & 3 deletions src/pyobjcryst/diffractiondatasinglecrystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@


def create_singlecrystaldata_from_cif(file, crystal):
"""
Create a DiffractionDataSingleCrystal object from a CIF file. Note that
this will use the last created Crystal as a reference structure.
"""Create a DiffractionDataSingleCrystal object from a CIF file.

Note that this will use the last created Crystal as a reference structure.
Example using the COD to load both crystal and data:
c=create_crystal_from_cif('http://www.crystallography.net/cod/2201530.cif')
d=create_singlecrystaldata_from_cif('http://www.crystallography.net/cod/2201530.hkl', c)
Expand Down
1 change: 1 addition & 0 deletions src/pyobjcryst/globaloptim.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Changes from ObjCryst::MonteCarloObj::
In development !
"""

__all__ = ["MonteCarlo", "AnnealingSchedule", "GlobalOptimType"]

import warnings
Expand Down
4 changes: 2 additions & 2 deletions src/pyobjcryst/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def quick_index(
CrystalSystem.TETRAGONAL,
CrystalSystem.RHOMBOEDRAL,
CrystalSystem.HEXAGONAL,
CrystalSystem.ORTHOROMBIC,
CrystalSystem.ORTHORHOMBIC,
CrystalSystem.MONOCLINIC,
]:
if csys == CrystalSystem.CUBIC:
Expand All @@ -99,7 +99,7 @@ def quick_index(
vcen = [CrystalCentering.LATTICE_P]
elif csys == CrystalSystem.HEXAGONAL:
vcen = [CrystalCentering.LATTICE_P]
elif csys == CrystalSystem.ORTHOROMBIC:
elif csys == CrystalSystem.ORTHORHOMBIC:
vcen = [
CrystalCentering.LATTICE_P,
CrystalCentering.LATTICE_A,
Expand Down
5 changes: 3 additions & 2 deletions src/pyobjcryst/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@


def ImportFenskeHallZMatrix(cryst, src, named=False):
"""Create a Molecule from a Fenske-Hall z-matrix. This is cleaner
than importing the Z-matrix into a ZScatterer object and then using
"""Create a Molecule from a Fenske-Hall z-matrix.

This is cleaner than importing the Z-matrix into a ZScatterer object and then using
ZScatterer2Molecule, as it takes care of keeping only the created
Molecule inside the Crystal.

Expand Down
10 changes: 5 additions & 5 deletions src/pyobjcryst/powderpattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,11 @@ def _do_plot_hkl(self, nb_max=100, fontsize_hkl=None):

@property
def figure(self):
"""
return: the figure used for plotting, or None. Note that
if you want to display it in a notebook using ipympl (aka
'matplotlib widget'), you should 'figure.canvas' to display
also the toolbar (zoom, etc...).
"""Return: the figure used for plotting, or None.

Note that if you want to display it in a notebook using ipympl
(aka 'matplotlib widget'), you should 'figure.canvas' to display
also the toolbar (zoom, etc...).
"""
return self._plot_fig

Expand Down
2 changes: 0 additions & 2 deletions src/pyobjcryst/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
##############################################################################
"""Utilities for crystals."""


# FIXME: check if this function does any meaningful job.


Expand Down Expand Up @@ -95,7 +94,6 @@ def f(v):
def _xyztostring(crystal):
"""Helper function to write xyz coordinates of a crystal to a
string."""

nsc = 0
out = ""
scl = crystal.GetScatteringComponentList()
Expand Down
5 changes: 3 additions & 2 deletions tests/pyobjcryst_test_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
# See LICENSE_DANSE.txt for license information.
#
##############################################################################
"""Small tests for pyobjcryst. Not run by pytest, for memory leak
checks.
"""Small tests for pyobjcryst.

Not run by pytest, for memory leak checks.

To check for memory leaks, run valgrind --tool=memcheck --leak-
check=full python ./pyobjcrysttest.py
Expand Down
1 change: 0 additions & 1 deletion tests/test_crystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def testDummyAtom(self):

def testEmbedding(self):
"""Test integrity of mutually-embedded objects."""

c = makeCrystal(*makeScatterer())

class Level1(object):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_estimate_cell_volume(self):
1 / 1.537,
1 / 47.326,
20,
CrystalSystem.ORTHOROMBIC,
CrystalSystem.ORTHORHOMBIC,
CrystalCentering.LATTICE_F,
1.2,
)
Expand All @@ -65,7 +65,7 @@ def test_estimate_cell_volume(self):
1 / 1.537,
1 / 47.326,
20,
CrystalSystem.ORTHOROMBIC,
CrystalSystem.ORTHORHOMBIC,
CrystalCentering.LATTICE_I,
0.3,
)
Expand Down
4 changes: 0 additions & 4 deletions tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def testFindAtom(self):

def testBonds(self):
"""Test the Bond methods."""

a1 = self.m.GetAtom(0)
a2 = self.m.GetAtom(1)
a3 = self.m.GetAtom(2)
Expand Down Expand Up @@ -746,7 +745,6 @@ def tearDown(self):

def testStretchModeBondLength(self):
"""Test the StretchModeBondLength class."""

# Measure the distance
ac = self.m[0]
# The 0, 0, z atom
Expand Down Expand Up @@ -795,7 +793,6 @@ def tearDown(self):

def testStretchModeBondAngle(self):
"""Test the StretchModeBondLength class."""

a1 = self.m[1]
ac = self.m[0]
a2 = self.m[2]
Expand Down Expand Up @@ -839,7 +836,6 @@ def tearDown(self):

def testStretchModeTorsion(self):
"""Test the StretchModeBondLength class."""

a1 = self.m[1]
ac0 = self.m[3]
ac1 = self.m[0]
Expand Down
1 change: 0 additions & 1 deletion tests/test_spacegroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
##############################################################################
"""Unit tests for pyobjcryst.spacegroup."""


import unittest

from pyobjcryst.spacegroup import SpaceGroup
Expand Down
Loading