# Path: ndlib/models/compartments/enums/NumericalType.py
# class NumericalType(Enum):
#     STATUS = 0
#     ATTRIBUTE = 1


import unittest
import networkx as nx
import numpy as np
import ndlib.models.ModelConfig as mc
import ndlib.models.CompositeModel as gc
import ndlib.models.compartments as cpm
from ndlib.models.compartments.enums.NumericalType import NumericalType
        model.add_rule("Susceptible", "Infected", c)

        config = mc.Configuration()
        config.add_model_parameter('fraction_infected', 0.1)

        model.set_initial_status(config)
        iterations = model.iteration_bunch(10)
        self.assertEqual(len(iterations), 10)

        model = gc.CompositeModel(g)
        model.add_status("Susceptible")
        model.add_status("Infected")

        c = cpm.NodeNumericalVariable('even', var_type=NumericalType.ATTRIBUTE, value=[3, 5], op='IN')
        model.add_rule("Susceptible", "Infected", c)

        config = mc.Configuration()
        config.add_model_parameter('fraction_infected', 0.1)

        model.set_initial_status(config)
        iterations = model.iteration_bunch(10)
        self.assertEqual(len(iterations), 10)

        with self.assertRaises(ValueError):
            cpm.NodeNumericalVariable(5, var_type=NumericalType.ATTRIBUTE, value=0, op='==')
        with self.assertRaises(ValueError):
            cpm.NodeNumericalVariable('even', value=0, op='==')
        with self.assertRaises(ValueError):
            cpm.NodeNumericalVariable('even', var_type=3, value=0, value_type=3, op='==')
        with self.assertRaises(ValueError):

# Path: ndlib/models/compartments/enums/NumericalType.py
# class NumericalType(Enum):
#     STATUS = 0
#     ATTRIBUTE = 1


# Path: ndlib/test/test_compartment.py
import unittest
import networkx as nx
import numpy as np
import ndlib.models.ModelConfig as mc
import ndlib.models.CompositeModel as gc
import ndlib.models.compartments as cpm
from ndlib.models.compartments.enums.NumericalType import NumericalType

        model.add_rule("Susceptible", "Infected", c)

        config = mc.Configuration()
        config.add_model_parameter('fraction_infected', 0.1)

        model.set_initial_status(config)
        iterations = model.iteration_bunch(10)
        self.assertEqual(len(iterations), 10)

        model = gc.CompositeModel(g)
        model.add_status("Susceptible")
        model.add_status("Infected")

        c = cpm.NodeNumericalVariable('even', var_type=NumericalType.ATTRIBUTE, value=[3, 5], op='IN')
        model.add_rule("Susceptible", "Infected", c)

        config = mc.Configuration()
        config.add_model_parameter('fraction_infected', 0.1)

        model.set_initial_status(config)
        iterations = model.iteration_bunch(10)
        self.assertEqual(len(iterations), 10)

        with self.assertRaises(ValueError):
            cpm.NodeNumericalVariable(5, var_type=NumericalType.ATTRIBUTE, value=0, op='==')
        with self.assertRaises(ValueError):
            cpm.NodeNumericalVariable('even', value=0, op='==')
        with self.assertRaises(ValueError):
            cpm.NodeNumericalVariable('even', var_type=3, value=0, value_type=3, op='==')
        with self.assertRaises(ValueError):

            cpm.NodeNumericalVariable(None, var_type=NumericalType.ATTRIBUTE, value=0, op='==')