Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Divasco committed Oct 8, 2024
1 parent e8cc466 commit 4165fe3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion tests/core/test_div_acc.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_DiversificationAccessor_zheng_entropy(risso_portfolio):

def test_DiversificationAccessor_cross_entropy(risso_portfolio):
pf = risso_portfolio(random_state=42)
expected = 0
expected = 0.
np.testing.assert_allclose(pf.div.cross_entropy(), expected)


Expand Down
34 changes: 17 additions & 17 deletions tests/datasets/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@
# =============================================================================


# from garpar import datasets
from garpar import datasets

# import numpy as np
import numpy as np

# import pytest
import pytest


# =============================================================================
# TESTS
# =============================================================================

# @pytest.mark.parametrize(
# "imputation, mean, std",
# [
# ("ffill", 136.60173850574714, 52.66562555912109),
# ("pad", 136.60173850574714, 52.66562555912109),
# ("bfill", 136.60018530798706, 52.665682290838745),
# ("backfill", 136.60018530798706, 52.665682290838745),
# (42, 136.56374963159448, 52.82468365235412),
# ],
# )
# def test_load_merval2021_2022(imputation, mean, std):
# pf = datasets.load_merval2021_2022(imputation)
# np.testing.assert_almost_equal(pf.prices.mean().mean(), mean, decimal=13)
# np.testing.assert_almost_equal(pf.prices.std().mean(), std, decimal=13)
@pytest.mark.parametrize(
"imputation, mean, std",
[
("ffill", 62.04622807409393, 70.3072133444952),
("pad", 62.04622807409393, 70.3072133444952),
("bfill", 62.045251347568424, 70.30657769357053),
("backfill", 62.045251347568424, 70.30657769357053),
(42, 62.04957287292654, 70.40979087943586),
],
)
def test_load_MERVAL(imputation, mean, std):
pf = datasets.load_MERVAL(imputation)
np.testing.assert_almost_equal(pf.prices.mean().mean(), mean, decimal=13)
np.testing.assert_almost_equal(pf.prices.std().mean(), std, decimal=13)
File renamed without changes.
File renamed without changes.

0 comments on commit 4165fe3

Please sign in to comment.