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
18 changes: 9 additions & 9 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,31 +21,31 @@ 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"]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.9.1
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
additional_dependencies:
Expand All @@ -58,8 +58,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
23 changes: 23 additions & 0 deletions news/precommit-deps-update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news needed: updating pre-commit hooks, black, flake8, isort, nbstripout, codespell and docformatter. Not user facing.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
1 change: 0 additions & 1 deletion src/diffpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
##############################################################################
"""Blank namespace package for module diffpy."""


from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)
Expand Down
1 change: 0 additions & 1 deletion src/diffpy/srreal/_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class prototypes is implemented in libdiffpy. Any Python-extended classes
a call of _registerThisType.
"""


import atexit
import weakref

Expand Down
13 changes: 6 additions & 7 deletions src/diffpy/srreal/_final_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
"""Finalize tweak of classes from the extension module srreal_ext.

This private module handles loading of Python-level tweaks of the
extension-defined classes. Any client that imports this module
must call the `import_now` function. If this module is not loaded
by the time of srreal_ext initialization, `import_now` is executed
from srreal_ext.
extension-defined classes. Any client that imports this module must
call the `import_now` function. If this module is not loaded by the
time of srreal_ext initialization, `import_now` is executed from
srreal_ext.

This avoids unresolvable import dependencies for any order of imports.
"""

_import_now_called = False


def import_now():
"""Import all Python modules that tweak extension-defined
Expand All @@ -46,6 +48,3 @@ def import_now():
import_module("diffpy.srreal.pdfcalculator")
import_module("diffpy.srreal.structureconverters")
return


_import_now_called = False
6 changes: 3 additions & 3 deletions src/diffpy/srreal/atomradiitable.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
##############################################################################
"""Class AtomRadiiTable -- storage of empirical atom radii."""


# exported items, these also makes them show in pydoc.
__all__ = ["AtomRadiiTable", "ConstantRadiiTable", "CovalentRadiiTable"]

Expand Down Expand Up @@ -66,8 +65,9 @@ def clone(self):
return copy.copy(self)

def type(self):
"""Unique string identifier of the CovalentRadiiTable type. This
is used for class registration and as an argument for the
"""Unique string identifier of the CovalentRadiiTable type.

This is used for class registration and as an argument for the
createByType function.

Return string.
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/srreal/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#
##############################################################################
"""class Attributes -- wrapper to C++ class diffpy::Attributes
A base to PairQuantity and quite a few other classes.
A base to PairQuantity and quite a few other classes.
"""

__all__ = ["Attributes"]
Expand Down
7 changes: 2 additions & 5 deletions src/diffpy/srreal/bondcalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
##############################################################################
"""Class BondCalculator -- distances between atoms in the structure."""


# exported items, these also makes them show in pydoc.
__all__ = ["BondCalculator"]

Expand All @@ -28,14 +27,12 @@

BondCalculator.rmin = propertyFromExtDoubleAttr(
"rmin",
"""Lower bound for the bond distances.
[0 A]""",
"Lower bound for the bond distances. [0 A]",
)

BondCalculator.rmax = propertyFromExtDoubleAttr(
"rmax",
"""Upper bound for the bond distances.
[5 A]""",
"Upper bound for the bond distances. [5 A]",
)


Expand Down
1 change: 0 additions & 1 deletion src/diffpy/srreal/bvparameterstable.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""Class BVParametersTable -- storage of bond valence parameters class BVParam
-- bond valence data associated with specific cation-anion pair."""


# exported items, these also makes them show in pydoc.
__all__ = ["BVParam", "BVParametersTable"]

Expand Down
27 changes: 14 additions & 13 deletions src/diffpy/srreal/bvscalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
##############################################################################
"""Class BVSCalculator -- bond valence sums calculator."""


# exported items
__all__ = ["BVSCalculator"]

Expand All @@ -28,30 +27,32 @@

BVSCalculator.valenceprecision = propertyFromExtDoubleAttr(
"valenceprecision",
"""Cutoff value for valence contributions at long distances.
[1e-5]""",
"Cutoff value for valence contributions at long distances. [1e-5]",
)

BVSCalculator.rmaxused = propertyFromExtDoubleAttr(
"rmaxused",
"""Effective bound for bond lengths, where valence contributions
become smaller than valenceprecission, read-only. Always smaller or
equal to rmax. The value depends on ions present in the structure.
""",
(
"Effective bound for bond lengths, where valence contributions"
" become smaller than valenceprecission, read-only."
" Always smaller or equal to rmax."
" The value depends on ions present in the structure."
),
)

BVSCalculator.rmin = propertyFromExtDoubleAttr(
"rmin",
"""Lower bound for the summed bond lengths.
[0 A]""",
"Lower bound for the summed bond lengths. [0 A]",
)

BVSCalculator.rmax = propertyFromExtDoubleAttr(
"rmax",
"""Upper bound for the summed bond lengths. The calculation is
actually cut off much earlier when valence contributions get below
valenceprecission. See also rmaxused and valenceprecission.
[1e6 A]""",
(
"Upper bound for the summed bond lengths."
" The calculation is actually cut off much earlier when"
" valence contributions get below valenceprecission."
" See also rmaxused and valenceprecission. [1e6 A]"
),
)


Expand Down
1 change: 0 additions & 1 deletion src/diffpy/srreal/eventticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""Class EventTicker -- storage of modification times of dependent
objects."""


# exported items
__all__ = ["EventTicker"]

Expand Down
16 changes: 7 additions & 9 deletions src/diffpy/srreal/overlapcalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""Class OverlapCalculator -- calculator of atom overlaps in a
structure."""


# exported items, these also makes them show in pydoc.
__all__ = ["OverlapCalculator"]

Expand All @@ -29,22 +28,21 @@

OverlapCalculator.rmin = propertyFromExtDoubleAttr(
"rmin",
"""Lower bound for the bond distances.
[0 A]""",
"Lower bound for the bond distances. [0 A]",
)

OverlapCalculator.rmax = propertyFromExtDoubleAttr(
"rmax",
"""Upper bound for the bond distances.
[5 A]""",
"Upper bound for the bond distances. [5 A]",
)

OverlapCalculator.rmaxused = propertyFromExtDoubleAttr(
"rmaxused",
"""Effective upper bound for the bond distances.
rmaxused equals either a double of the maximum atom radius
in the structure or rmax.
""",
(
"Effective upper bound for the bond distances."
" rmaxused equals either a double of the maximum"
" atom radius in the structure or rmax."
),
)

# method overrides that support keyword arguments
Expand Down
1 change: 0 additions & 1 deletion src/diffpy/srreal/pairquantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""Class PairQuantity -- base class for Python defined
calculators."""


# exported items
__all__ = ["PairQuantity"]

Expand Down
15 changes: 7 additions & 8 deletions src/diffpy/srreal/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
into parallel calculators.
"""


# exported items
__all__ = ["createParallelCalculator"]

Expand Down Expand Up @@ -48,8 +47,10 @@ def createParallelCalculator(pqobj, ncpu, pmap):
"""

class ParallelPairQuantity(Attributes):
"""Class for running parallel calculations. This is a proxy
class to the wrapper PairQuantity type with the same interface.
"""Class for running parallel calculations.

This is a proxy class to the wrapper PairQuantity type
with the same interface.

Instance data:

Expand Down Expand Up @@ -144,7 +145,7 @@ def parallel_eval(stru):

@property
def evaluatortype(self):
"""str : Type of evaluation procedure.
"""Str : Type of evaluation procedure.

Parallel calculations allow only the 'BASIC' type.
"""
Expand All @@ -166,11 +167,9 @@ def evaluatortype(self, value):

# create proxy methods to all public methods and some protected methods

proxy_forced = set(
"""_getDoubleAttr _setDoubleAttr _hasDoubleAttr
proxy_forced = set("""_getDoubleAttr _setDoubleAttr _hasDoubleAttr
_namesOfDoubleAttributes _namesOfWritableDoubleAttributes
""".split()
)
""".split())

def _make_proxymethod(name, f):
def proxymethod(self, *args, **kwargs):
Expand Down
7 changes: 4 additions & 3 deletions src/diffpy/srreal/pdfbaseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
PDFBaseline, ZeroBaseline, LinearBaseline
"""


# exported items
__all__ = """
PDFBaseline makePDFBaseline
Expand All @@ -40,8 +39,10 @@

LinearBaseline.slope = propertyFromExtDoubleAttr(
"slope",
"""Slope of an unscaled linear baseline. For crystal structures it
is preset to (-4 * pi * rho0).""",
(
"Slope of an unscaled linear baseline. For crystal structures it"
" is preset to (-4 * pi * rho0)."
),
)

# Python functions wrapper
Expand Down
Loading
Loading