Skip to content

Commit 2ecb970

Browse files
committed
Change to the derivative function accidentally added a circular import error. For issue #1343
1 parent 9ba6922 commit 2ecb970

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xga/models/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
2-
# Last modified by David J Turner (turne540@msu.edu) 15/08/2025, 13:38. Copyright (c) The Contributors
2+
# Last modified by David J Turner (turne540@msu.edu) 15/08/2025, 13:45. Copyright (c) The Contributors
33

44
import inspect
55
from abc import ABCMeta, abstractmethod
@@ -20,7 +20,6 @@
2020
# from scipy.misc import derivative
2121
from tabulate import tabulate
2222

23-
from . import derivative
2423
from ..exceptions import XGAFitError
2524

2625

@@ -281,6 +280,9 @@ def nth_derivative(self, x: Quantity, dx: Quantity, order: int, use_par_dist: bo
281280
best fit parameters, or a distribution.
282281
:rtype: Quantity
283282
"""
283+
# Local import of the scipy.misc.derivative drop-in replacement - to avoid a circular import error
284+
from . import derivative
285+
284286
# Just checking that the units of x and dx aren't silly
285287
if not x.unit.is_equivalent(self._x_unit):
286288
raise UnitConversionError("You have passed an x value in units of {p}, but this model expects units of "

0 commit comments

Comments
 (0)