@classmethod
def from_specification(cls, specification, model, classical_gap, ground_energy
    ):
    """Construct a PenaltyModel from a Specification.

        Args:
            specification (:class:`.Specification`): A specification that was used
                to generate the model.
            model (:class:`dimod.BinaryQuadraticModel`): A binary quadratic model
                that has ground states that match the feasible_configurations.
            classical_gap (numeric): The difference in classical energy between the ground
                state and the first excited state. Must be positive.
            ground_energy (numeric): The minimum energy of all possible configurations.

        Returns:
            :class:`.PenaltyModel`

        """
    return cls(specification.graph, specification.decision_variables,
        specification.feasible_configurations, specification.vartype, model,
        classical_gap, ground_energy, ising_linear_ranges=specification.
        ising_linear_ranges, ising_quadratic_ranges=specification.
        ising_quadratic_ranges)
