Old engine for Continuous Time Bayesian Networks. Superseded by reCTBN. 🐍
https://github.com/madlabunimib/PyCTBN
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.0 KiB
53 lines
1.0 KiB
4 years ago
|
import numpy as np
|
||
|
import pytest
|
||
|
|
||
|
from pandas.core.arrays import integer_array
|
||
|
from pandas.core.arrays.integer import (
|
||
|
Int8Dtype,
|
||
|
Int16Dtype,
|
||
|
Int32Dtype,
|
||
|
Int64Dtype,
|
||
|
UInt8Dtype,
|
||
|
UInt16Dtype,
|
||
|
UInt32Dtype,
|
||
|
UInt64Dtype,
|
||
|
)
|
||
|
|
||
|
|
||
|
@pytest.fixture(
|
||
|
params=[
|
||
|
Int8Dtype,
|
||
|
Int16Dtype,
|
||
|
Int32Dtype,
|
||
|
Int64Dtype,
|
||
|
UInt8Dtype,
|
||
|
UInt16Dtype,
|
||
|
UInt32Dtype,
|
||
|
UInt64Dtype,
|
||
|
]
|
||
|
)
|
||
|
def dtype(request):
|
||
|
return request.param()
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def data(dtype):
|
||
|
return integer_array(
|
||
|
list(range(8)) + [np.nan] + list(range(10, 98)) + [np.nan] + [99, 100],
|
||
|
dtype=dtype,
|
||
|
)
|
||
|
|
||
|
|
||
|
@pytest.fixture
|
||
|
def data_missing(dtype):
|
||
|
return integer_array([np.nan, 1], dtype=dtype)
|
||
|
|
||
|
|
||
|
@pytest.fixture(params=["data", "data_missing"])
|
||
|
def all_data(request, data, data_missing):
|
||
|
"""Parametrized fixture giving 'data' and 'data_missing'"""
|
||
|
if request.param == "data":
|
||
|
return data
|
||
|
elif request.param == "data_missing":
|
||
|
return data_missing
|