All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lucuma.itc.client.arb.ArbTargetInput.scala Maven / Gradle / Ivy

There is a newer version: 0.22.7
Show newest version
// Copyright (c) 2016-2023 Association of Universities for Research in Astronomy, Inc. (AURA)
// For license information see LICENSE or https://opensource.org/licenses/BSD-3-Clause

package lucuma.itc.client.arb

import lucuma.core.math.RadialVelocity
import lucuma.core.math.arb.ArbRadialVelocity
import lucuma.core.model.SourceProfile
import lucuma.core.model.arb.ArbSourceProfile
import lucuma.itc.client.TargetInput
import org.scalacheck.Arbitrary
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.Cogen

trait ArbTargetInput {
  import ArbRadialVelocity.given
  import ArbSourceProfile.given

  given Arbitrary[TargetInput] = Arbitrary {
    for {
      sp <- arbitrary[SourceProfile]
      rv <- arbitrary[RadialVelocity]
    } yield TargetInput(sp, rv)
  }

  given Cogen[TargetInput] = Cogen[(SourceProfile, RadialVelocity)].contramap { a =>
    (a.sourceProfile, a.radialVelocity)
  }
}

object ArbTargetInput extends ArbTargetInput




© 2015 - 2024 Weber Informatics LLC | Privacy Policy