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
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ci:
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -21,15 +21,15 @@ repos:
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 26.3.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.3.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 9.0.0a3
hooks:
- id: isort
args: ["--profile", "black"]
Expand All @@ -39,14 +39,14 @@ repos:
# hooks:
# - id: nbstripout
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch
name: Prevent Commit to Main Branch
args: ["--branch", "main"]
stages: [pre-commit]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.2
hooks:
- id: codespell
exclude: '.*\.ipynb$'
Expand Down 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
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Version 2024.2.1
**Changes:**

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

Version 2024.2
Expand Down Expand Up @@ -125,7 +125,7 @@ Version 2.2.1 -- 2021-11-28
* Fix blank line javascript output when updating the Crystal 3D view
* Add ``RefinableObj.xml()`` to directly get the XMLOutput as a string
* Add example notebooks to the sphinx-generated html documentation
* 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)
* Fix issue when using ``Crystal.XMLInput()`` for a non-empty structure. Existing scattering power will be reused when possible, and otherwise not deleted anymore (which could lead to crashes)

Version 2.2.0 -- 2021-06-08
----------------------------
Expand Down
23 changes: 23 additions & 0 deletions news/pre-commit-update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No News Added: Updated pre-commit hook to latest version

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
5 changes: 3 additions & 2 deletions src/pyobjcryst/crystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@

import numpy as np

from pyobjcryst._pyobjcryst import BumpMergePar
from pyobjcryst._pyobjcryst import (
BumpMergePar,
)
from pyobjcryst._pyobjcryst import (
CreateCrystalFromCIF as CreateCrystalFromCIF_orig,
)
Expand Down Expand Up @@ -277,7 +279,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
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
14 changes: 8 additions & 6 deletions src/pyobjcryst/powderpattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"SpaceGroupExplorer",
]

from pyobjcryst._pyobjcryst import LSQ
from pyobjcryst._pyobjcryst import (
LSQ,
)
from pyobjcryst._pyobjcryst import (
CreatePowderPatternFromCIF as CreatePowderPatternFromCIF_orig,
)
Expand Down Expand Up @@ -338,11 +340,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: 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