<commit_before>package com.krux.hyperion

import com.krux.hyperion.activity.PipelineActivity
import scala.language.implicitConversions

/**
 * See com.krux.hyperion.examples.ExampleWorkflow for usage
 */
class WorkflowDSL(activities: Seq[PipelineActivity]) {

  // assert that we are not mix the dependsOn approach with WorkFlowDSL, it will have unexpected
  // behavior
  private def assertNoDependencies(acts: PipelineActivity*) = {
    for (act <- acts) assert(act.dependsOn.isEmpty)
  }

  // assertNoDependencies(activities:_*)

  def andThen(act: PipelineActivity): Seq[PipelineActivity] = {
    assertNoDependencies(act)
    Seq(act.dependsOn(activities:_*))
  }

  def :~>(act: PipelineActivity): Seq[PipelineActivity] = this.andThen(act)

  def priorTo_:(act: PipelineActivity): Seq[PipelineActivity] = this.andThen(act)

  def <~:(act: PipelineActivity): Seq[PipelineActivity] = this.priorTo_:(act)

  def andThen(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = {
    assertNoDependencies(acts:_*)
    for (act <- acts) yield act.dependsOn(activities:_*)
  }

  def :~>(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = this.andThen(acts)

  def priorTo_:(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = this.andThen(acts)

  def <~:(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = this.priorTo_:(acts)

  def and(act: PipelineActivity): Seq[PipelineActivity] = activities :+ act

  def +(act: PipelineActivity): Seq[PipelineActivity] = this.and(act)

  def and(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = activities ++ acts

  def +(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = this.and(acts)


}

object WorkflowDSL {<commit_msg>(Closes #85) (Fixes #83) Remove dependency assertion in WorkflowDSL<commit_after>package com.krux.hyperion

import com.krux.hyperion.activity.PipelineActivity
import scala.language.implicitConversions

/**
 * See com.krux.hyperion.examples.ExampleWorkflow for usage
 */
class WorkflowDSL(activities: Seq[PipelineActivity]) {

  def andThen(act: PipelineActivity): Seq[PipelineActivity] = Seq(act.dependsOn(activities:_*))

  def :~>(act: PipelineActivity): Seq[PipelineActivity] = this.andThen(act)

  def priorTo_:(act: PipelineActivity): Seq[PipelineActivity] = this.andThen(act)

  def <~:(act: PipelineActivity): Seq[PipelineActivity] = this.priorTo_:(act)

  def andThen(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = acts.map(_.dependsOn(activities:_*))

  def :~>(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = this.andThen(acts)

  def priorTo_:(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = this.andThen(acts)

  def <~:(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = this.priorTo_:(acts)

  def and(act: PipelineActivity): Seq[PipelineActivity] = activities :+ act

  def +(act: PipelineActivity): Seq[PipelineActivity] = this.and(act)

  def and(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = activities ++ acts

  def +(acts: Seq[PipelineActivity]): Seq[PipelineActivity] = this.and(acts)

}

object WorkflowDSL {
{'fraction_non_alphanumeric': 0.13637857377587906, 'fraction_numerical': 0.0013144922773578706, 'mean_word_length': 6.179245283018868, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2268823', 'n_tokens_mistral': 1042, 'n_tokens_neox': 974, 'n_words': 193}