mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 11:33:42 +02:00
[Feat] Provide derivatives for pow (#246)
* [Feat] Provide manual derivatives for __pow__ * [Feat] Also applied changes to rpow * [Test] Another pow test added.
This commit is contained in:
parent
0ce765a99d
commit
30bfb55981
2 changed files with 15 additions and 6 deletions
|
@ -461,6 +461,18 @@ def test_cobs_overloading():
|
|||
obs / cobs
|
||||
|
||||
|
||||
def test_pow():
|
||||
data = [1, 2.341, pe.pseudo_Obs(4.8, 0.48, "test_obs"), pe.cov_Obs(1.1, 0.3 ** 2, "test_cov_obs")]
|
||||
|
||||
for d in data:
|
||||
assert d * d == d ** 2
|
||||
assert d * d * d == d ** 3
|
||||
|
||||
for d2 in data:
|
||||
assert np.log(d ** d2) == d2 * np.log(d)
|
||||
assert (d ** d2) ** (1 / d2) == d
|
||||
|
||||
|
||||
def test_reweighting():
|
||||
my_obs = pe.Obs([np.random.rand(1000)], ['t'])
|
||||
assert not my_obs.reweighted
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue