use dry::macro_for;
use log::debug;
use paste::paste;
use crate::{
io::JsonIO,
models::{CatCTBN, GaussBN},
types::Result,
};
macro_for!(
$bn in [
arth150, ecoli70, magic_irri, magic_niab
] {
paste! {
#[doc = "Load the `" $bn:upper "` Gaussian BN from the assets."]
pub fn [<load_ $bn>]() -> Result<GaussBN> {
debug!("Loading the '{}' BN from assets.", stringify!($bn));
GaussBN::from_json_string(include_str!(concat!(stringify!($bn), ".json")))
}
}
});
macro_for!(
$ctbn in [
eating
] {
paste! {
#[doc = "Load the `" $ctbn:upper "` categorical CTBN from the assets."]
pub fn [<load_ $ctbn>]() -> Result<CatCTBN> {
debug!("Loading the '{}' CTBN from assets.", stringify!($ctbn));
CatCTBN::from_json_string(include_str!(concat!(stringify!($ctbn), ".json")))
}
}
});