From 2cf3a806d1279d08c72b6309bda0d470ef2a5bc3 Mon Sep 17 00:00:00 2001 From: Mark Jones Date: Fri, 11 Jun 2021 10:21:14 -0400 Subject: [PATCH] Solve Numpy and Python depreciation warnings For numpy, it was more of the float issue that needed to be resolved. A quick switch from numpy.float to numpy.float64 guarenteed the same behaviour as before. For Python, it seems that how the interpretor interprets strings for docstrings has changed, and was reading the latex switches as escape characters. So I escaped the escape characters and now those depreciation warnings have been resolved as well. --- PyPWA/libs/fit/likelihoods.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PyPWA/libs/fit/likelihoods.py b/PyPWA/libs/fit/likelihoods.py index 55ecd067..5f4a09d5 100644 --- a/PyPWA/libs/fit/likelihoods.py +++ b/PyPWA/libs/fit/likelihoods.py @@ -141,7 +141,7 @@ def run(self, communicator: List[Any], *args: Any) -> Any: for likelihood_process in communicator: likelihood_process.send(args) - result = npy.float(0) + result = npy.float64(0) for likelihood_process in communicator: data = likelihood_process.recv() @@ -214,12 +214,12 @@ class ChiSquared(_GeneralLikelihood): Binned ChiSquare: .. math:: - \chi^{2} = \\frac{(Amp(data) - binned)^{2}}{binned} + \\chi^{2} = \\frac{(Amp(data) - binned)^{2}}{binned} Expected values: .. math:: - \chi^{2} = \\frac{(Amp(data) - expected)^{2}}{errors} + \\chi^{2} = \\frac{(Amp(data) - expected)^{2}}{errors} """ @@ -367,7 +367,7 @@ class LogLikelihood(_GeneralLikelihood): .. math:: L = \\sum{Q_f \\cdot log (Amp(data))} - \\ - \\frac{1}{generated\_length} \\cdot \\sum{Amp(monte\_carlo)} + \\frac{1}{generated\\_length} \\cdot \\sum{Amp(monte\\_carlo)} """