mirror of
https://github.com/vale981/master-thesis
synced 2025-03-10 05:06:38 -04:00
14 lines
507 B
Python
14 lines
507 B
Python
import stg_helper
|
|
from types import ModuleType
|
|
from typing import Callable
|
|
|
|
def get_n_samples(stg: ModuleType) -> int:
|
|
"""Get the number of samples from ``stg``."""
|
|
with stg_helper.get_hierarchy_data(stg, read_only=True) as hd:
|
|
return hd.get_samples()
|
|
|
|
def has_all_samples(stg: ModuleType) -> bool:
|
|
return stg.__HI_number_of_samples == get_n_samples(stg)
|
|
|
|
def has_all_samples_checker(stg: ModuleType) -> Callable[..., bool]:
|
|
return "Has all samples?", lambda _: has_all_samples(stg)
|