Skip to content

Commit

Permalink
Solve Numpy and Python depreciation warnings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
markjonestx committed Jun 11, 2021
1 parent 39274be commit 2cf3a80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PyPWA/libs/fit/likelihoods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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}
"""

Expand Down Expand Up @@ -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)}
"""

Expand Down

0 comments on commit 2cf3a80

Please sign in to comment.