From 65cb6dea0dc9d78f82c7a173a2bcdd93f654ded0 Mon Sep 17 00:00:00 2001 From: Yuchen Ethan Xiao Date: Wed, 6 Aug 2025 15:51:44 -0400 Subject: [PATCH] chore: fix examples --- docs/examples/debyemodel.py | 4 ++-- docs/examples/interface.py | 2 +- news/fix-examples.rst | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 news/fix-examples.rst diff --git a/docs/examples/debyemodel.py b/docs/examples/debyemodel.py index e3b6c212..3fb42c70 100644 --- a/docs/examples/debyemodel.py +++ b/docs/examples/debyemodel.py @@ -91,8 +91,8 @@ def makeRecipe(): # Load data and add it to the profile. It is our responsibility to get our # data into the profile. - xydy = numpy.array(map(float, data.split()), dtype=float).reshape(-1, 3) - x, y, dy = numpy.hsplit(xydy, 3) + xydy = numpy.array(data.split(), dtype=float).reshape(-1, 3) + x, y, dy = xydy.T profile.setObservedProfile(x, y, dy) # The FitContribution diff --git a/docs/examples/interface.py b/docs/examples/interface.py index ee70e699..6b0daca7 100644 --- a/docs/examples/interface.py +++ b/docs/examples/interface.py @@ -53,7 +53,7 @@ def main(): # loosely tying parameters to a value. r = FitRecipe() r |= c - r += (c.A, 0.5), (c.x0, 5), "sig" + r += (c.A, 0.5), (c.x0, 5), ("sig", 1) r *= c.sigma, "sig" r %= c.A, 0.5, 0.5 diff --git a/news/fix-examples.rst b/news/fix-examples.rst new file mode 100644 index 00000000..cf9df673 --- /dev/null +++ b/news/fix-examples.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news added: Fix examples. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*