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
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exclude =
build,
dist,
doc/source/conf.py
max-line-length = 115
max-line-length = 79
# Ignore some style 'errors' produced while formatting by 'black'
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings
extend-ignore = E203
2 changes: 1 addition & 1 deletion .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run:
shell: bash -l {0}

runs-on: ubuntu-latest
runs-on: macos-14
steps:
- name: Check out diffpy.srreal
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[settings]
# Keep import statement below line_length character limit
line_length = 115
line_length = 79
multi_line_output = 3
include_trailing_comma = True
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ repos:
rev: v4.6.0
hooks:
- id: check-yaml
exclude: ^conda-recipe/meta\.yaml$
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
Expand Down
23 changes: 23 additions & 0 deletions news/pre-commit-auto.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Update linelength to sk-package standard of 79 characters.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
5 changes: 4 additions & 1 deletion src/diffpy/srreal/bondcalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
__all__ = ["BondCalculator"]

from diffpy.srreal.srreal_ext import BondCalculator
from diffpy.srreal.wraputils import propertyFromExtDoubleAttr, setattrFromKeywordArguments
from diffpy.srreal.wraputils import (
propertyFromExtDoubleAttr,
setattrFromKeywordArguments,
)

# property wrappers to C++ double attributes

Expand Down
5 changes: 4 additions & 1 deletion src/diffpy/srreal/bvscalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
__all__ = ["BVSCalculator"]

from diffpy.srreal.srreal_ext import BVSCalculator
from diffpy.srreal.wraputils import propertyFromExtDoubleAttr, setattrFromKeywordArguments
from diffpy.srreal.wraputils import (
propertyFromExtDoubleAttr,
setattrFromKeywordArguments,
)

# Property wrappers to C++ double attributes

Expand Down
5 changes: 4 additions & 1 deletion src/diffpy/srreal/overlapcalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
__all__ = ["OverlapCalculator"]

from diffpy.srreal.srreal_ext import OverlapCalculator
from diffpy.srreal.wraputils import propertyFromExtDoubleAttr, setattrFromKeywordArguments
from diffpy.srreal.wraputils import (
propertyFromExtDoubleAttr,
setattrFromKeywordArguments,
)

# property wrappers to C++ double attributes

Expand Down
26 changes: 22 additions & 4 deletions src/diffpy/srreal/pdfcalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@
PDFCalculator -- calculate PDF by peak summation in real space
"""

from diffpy.srreal.srreal_ext import DebyePDFCalculator, PDFCalculator, fftftog, fftgtof
from diffpy.srreal.wraputils import propertyFromExtDoubleAttr, setattrFromKeywordArguments
from diffpy.srreal.srreal_ext import (
DebyePDFCalculator,
PDFCalculator,
fftftog,
fftgtof,
)
from diffpy.srreal.wraputils import (
propertyFromExtDoubleAttr,
setattrFromKeywordArguments,
)

# exported items
__all__ = """
Expand All @@ -28,7 +36,12 @@
""".split()

# imports for backward compatibility
from diffpy.srreal.pdfbaseline import LinearBaseline, PDFBaseline, ZeroBaseline, makePDFBaseline
from diffpy.srreal.pdfbaseline import (
LinearBaseline,
PDFBaseline,
ZeroBaseline,
makePDFBaseline,
)
from diffpy.srreal.pdfenvelope import (
PDFEnvelope,
QResolutionEnvelope,
Expand All @@ -38,7 +51,12 @@
makePDFEnvelope,
)
from diffpy.srreal.peakprofile import PeakProfile
from diffpy.srreal.peakwidthmodel import ConstantPeakWidth, DebyeWallerPeakWidth, JeongPeakWidth, PeakWidthModel
from diffpy.srreal.peakwidthmodel import (
ConstantPeakWidth,
DebyeWallerPeakWidth,
JeongPeakWidth,
PeakWidthModel,
)

# silence the pyflakes syntax checker
assert all((fftftog, fftgtof))
Expand Down
6 changes: 5 additions & 1 deletion src/diffpy/srreal/peakprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
__all__ = ["PeakProfile", "GaussianProfile", "CroppedGaussianProfile"]

from diffpy.srreal import _final_imports
from diffpy.srreal.srreal_ext import CroppedGaussianProfile, GaussianProfile, PeakProfile
from diffpy.srreal.srreal_ext import (
CroppedGaussianProfile,
GaussianProfile,
PeakProfile,
)
from diffpy.srreal.wraputils import propertyFromExtDoubleAttr

# class PeakProfile ----------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion src/diffpy/srreal/peakwidthmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
__all__ = ["PeakWidthModel", "ConstantPeakWidth", "DebyeWallerPeakWidth", "JeongPeakWidth"]

from diffpy.srreal import _final_imports
from diffpy.srreal.srreal_ext import ConstantPeakWidth, DebyeWallerPeakWidth, JeongPeakWidth, PeakWidthModel
from diffpy.srreal.srreal_ext import (
ConstantPeakWidth,
DebyeWallerPeakWidth,
JeongPeakWidth,
PeakWidthModel,
)
from diffpy.srreal.wraputils import propertyFromExtDoubleAttr

# class PeakWidthModel -------------------------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion src/diffpy/srreal/scatteringfactortable.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
__all__ = ["ScatteringFactorTable", "SFTXray", "SFTElectron", "SFTNeutron", "SFTElectronNumber", "SFAverage"]

from diffpy.srreal.sfaverage import SFAverage
from diffpy.srreal.srreal_ext import ScatteringFactorTable, SFTElectron, SFTElectronNumber, SFTNeutron, SFTXray
from diffpy.srreal.srreal_ext import (
ScatteringFactorTable,
SFTElectron,
SFTElectronNumber,
SFTNeutron,
SFTXray,
)

# Pickling Support -----------------------------------------------------------

Expand Down
6 changes: 5 additions & 1 deletion tests/test_atomradiitable.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

import pytest

from diffpy.srreal.atomradiitable import AtomRadiiTable, ConstantRadiiTable, CovalentRadiiTable
from diffpy.srreal.atomradiitable import (
AtomRadiiTable,
ConstantRadiiTable,
CovalentRadiiTable,
)

# ----------------------------------------------------------------------------

Expand Down
6 changes: 5 additions & 1 deletion tests/test_bondcalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

import numpy
import pytest
from testutils import loadDiffPyStructure, loadObjCrystCrystal, pickle_with_attr
from testutils import (
loadDiffPyStructure,
loadObjCrystCrystal,
pickle_with_attr,
)

from diffpy.srreal.bondcalculator import BondCalculator

Expand Down
6 changes: 5 additions & 1 deletion tests/test_overlapcalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

import numpy
import pytest
from testutils import loadDiffPyStructure, loadObjCrystCrystal, pickle_with_attr
from testutils import (
loadDiffPyStructure,
loadObjCrystCrystal,
pickle_with_attr,
)

from diffpy.srreal.atomradiitable import CovalentRadiiTable
from diffpy.srreal.overlapcalculator import OverlapCalculator
Expand Down
7 changes: 6 additions & 1 deletion tests/test_pdfbaseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
import numpy
from testutils import pickle_with_attr

from diffpy.srreal.pdfbaseline import LinearBaseline, PDFBaseline, ZeroBaseline, makePDFBaseline
from diffpy.srreal.pdfbaseline import (
LinearBaseline,
PDFBaseline,
ZeroBaseline,
makePDFBaseline,
)
from diffpy.srreal.pdfcalculator import PDFCalculator

# ----------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion tests/test_pdfcalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
import unittest

import numpy
from testutils import _maxNormDiff, datafile, loadDiffPyStructure, pickle_with_attr
from testutils import (
_maxNormDiff,
datafile,
loadDiffPyStructure,
pickle_with_attr,
)

from diffpy.srreal.pdfcalculator import PDFCalculator, fftftog, fftgtof

Expand Down
6 changes: 5 additions & 1 deletion tests/test_peakwidthmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
from testutils import loadDiffPyStructure

from diffpy.srreal.pdfcalculator import DebyePDFCalculator, PDFCalculator
from diffpy.srreal.peakwidthmodel import DebyeWallerPeakWidth, JeongPeakWidth, PeakWidthModel
from diffpy.srreal.peakwidthmodel import (
DebyeWallerPeakWidth,
JeongPeakWidth,
PeakWidthModel,
)
from diffpy.srreal.structureadapter import createStructureAdapter

# ----------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion tests/test_structureadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ def test_createStructureAdapter(self):

def test_createStructureAdapterTypes(self):
"""Check types returned by conversion from diffpy.structure."""
from diffpy.srreal.structureconverters import DiffPyStructureAtomicAdapter, DiffPyStructurePeriodicAdapter
from diffpy.srreal.structureconverters import (
DiffPyStructureAtomicAdapter,
DiffPyStructurePeriodicAdapter,
)

adpt = createStructureAdapter(self.nickel)
self.assertTrue(type(adpt) is DiffPyStructurePeriodicAdapter)
Expand Down
Loading