Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert missing trailing commas #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Engine[TD, EI, PD, Q, P, A](
Map("" -> dataSourceClass),
Map("" -> preparatorClass),
algorithmClassMap,
Map("" -> servingClass)
Map("" -> servingClass),
)

/** Java-friendly constructor
Expand All @@ -122,7 +122,7 @@ class Engine[TD, EI, PD, Q, P, A](
Map("" -> dataSourceClass),
Map("" -> preparatorClass),
JavaConversions.mapAsScalaMap(algorithmClassMap).toMap,
Map("" -> servingClass)
Map("" -> servingClass),
)

/** Returns a new Engine instance, mimicking case class's copy method behavior.
Expand Down Expand Up @@ -280,7 +280,7 @@ class Engine[TD, EI, PD, Q, P, A](
sc: SparkContext,
engineInstanceId: String,
// AlgoName, Algo, Model
algoTuples: Seq[(String, Params, BaseAlgorithm[_, _, _, _], Any)]
algoTuples: Seq[(String, Params, BaseAlgorithm[_, _, _, _], Any)],
): Seq[Any] = {

logger.info(s"engineInstanceId=$engineInstanceId")
Expand Down Expand Up @@ -386,7 +386,7 @@ class Engine[TD, EI, PD, Q, P, A](
WorkflowUtils.extractParams(engineLanguage,
compact(render(eap.params)),
algorithmClassMap(eap.name),
jsonExtractor)
jsonExtractor),
)
}
case _ => Nil
Expand Down Expand Up @@ -593,7 +593,7 @@ object Engine {
dataSourceMap.m,
preparatorMap.m,
algorithmClassMap,
servingMap.m
servingMap.m,
)

/** Provides concrete implementation of training for [[Engine]].
Expand All @@ -614,7 +614,7 @@ object Engine {
dataSource: BaseDataSource[TD, _, Q, _],
preparator: BasePreparator[TD, PD],
algorithmList: Seq[BaseAlgorithm[PD, _, Q, _]],
params: WorkflowParams
params: WorkflowParams,
): Seq[Any] = {
logger.info("EngineWorkflow.train")
logger.info(s"DataSource: $dataSource")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class EngineParams(
(dataSourceName, dataSourceParams),
(preparatorName, preparatorParams),
JavaConversions.mapAsScalaMap(algorithmParamsList).toSeq,
(servingName, servingParams)
(servingName, servingParams),
)
}

Expand Down Expand Up @@ -102,7 +102,7 @@ object EngineParams {
dataSourceParams = (dataSourceName, dataSourceParams),
preparatorParams = (preparatorName, preparatorParams),
algorithmParamsList = algorithmParamsList,
servingParams = (servingName, servingParams)
servingParams = (servingName, servingParams),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private[prediction] trait StatsMetricHelper[EI, Q, P, A] {
evalDataSet.map {
case (_, qpaRDD) =>
qpaRDD.map { case (q, p, a) => calculate(q, p, a) }
}
},
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just weird 😕

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)

doubleRDD.stats()
Expand All @@ -79,7 +79,7 @@ private[prediction] trait StatsOptionMetricHelper[EI, Q, P, A] {
evalDataSet.map {
case (_, qpaRDD) =>
qpaRDD.flatMap { case (q, p, a) => calculate(q, p, a) }
}
},
)

doubleRDD.stats()
Expand Down Expand Up @@ -216,7 +216,7 @@ abstract class SumMetric[EI, Q, P, A, R : ClassTag](implicit num: Numeric[R])
evalDataSet.map {
case (_, qpaRDD) =>
qpaRDD.map { case (q, p, a) => calculate(q, p, a) }
}
},
)

union.aggregate[R](num.zero)(_ + _, _ + _)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object CoreWorkflow {
sc = sc,
engineParams = engineParams,
engineInstanceId = engineInstance.id,
params = params
params = params,
)

val instanceId = Storage.getMetaDataEngineInstances
Expand All @@ -78,7 +78,7 @@ object CoreWorkflow {
engineInstances.update(
engineInstance.copy(
status = "COMPLETED",
endTime = DateTime.now
endTime = DateTime.now,
))

logger.info("Training completed successfully.")
Expand Down Expand Up @@ -137,7 +137,7 @@ object CoreWorkflow {
endTime = DateTime.now,
evaluatorResults = evaluatorResult.toOneLiner,
evaluatorResultsHTML = evaluatorResult.toHTML,
evaluatorResultsJSON = evaluatorResult.toJSON
evaluatorResultsJSON = evaluatorResult.toJSON,
)

logger.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ object CreateServer extends Logging {
engineParams,
engineInstance.id,
modelsFromEngineInstance,
params = WorkflowParams()
params = WorkflowParams(),
)

val algorithms = engineParams.algorithmParamsList.map {
Expand Down Expand Up @@ -502,7 +502,7 @@ class ServerActor[Q, P](val args: ServerConfig,
args.eventServerPort,
requestCount,
avgServingSec,
lastServingSec
lastServingSec,
)
.toString
}
Expand All @@ -523,7 +523,7 @@ class ServerActor[Q, P](val args: ServerConfig,
queryString,
algorithms.head.queryClass,
algorithms.head.querySerializer,
algorithms.head.gsonTypeAdapterFactories
algorithms.head.gsonTypeAdapterFactories,
)
val queryJValue = JsonExtractor.toJValue(
jsonExtractorOption,
Expand Down Expand Up @@ -711,7 +711,7 @@ class ServerActor[Q, P](val args: ServerConfig,
"description" -> p.pluginDescription,
"class" -> p.getClass.getName,
"params" -> pluginContext.pluginParams(p.pluginName))
}
},
))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ object CreateWorkflow extends Logging {
engineParamsGeneratorClass = wfc.engineParamsGeneratorClass.get,
batch = wfc.batch,
env = pioEnvVars,
sparkConf = workflowParams.sparkEnv
sparkConf = workflowParams.sparkEnv,
)
Workflow.runEvaluation(evaluation = evaluation.get,
engineParamsGenerator = engineParamsGenerator.get,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ object Workflow {
evaluationInstance = evaluationInstance,
evaluator = evaluation.evaluator,
env = env,
params = params
params = params,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object WorkflowContext extends Logging {
batch: String = "",
executorEnv: Map[String, String] = Map(),
sparkEnv: Map[String, String] = Map(),
mode: String = ""
mode: String = "",
): SparkContext = {
val conf = new SparkConf()
val prefix = if (mode == "") "PredictionIO" else s"PredictionIO ${mode}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ object WorkflowUtils extends Logging {
try {
(
EngineLanguage.Scala,
engineObject.instance.asInstanceOf[EngineFactory]
engineObject.instance.asInstanceOf[EngineFactory],
)
} catch {
case e @ (_: NoSuchFieldException | _: ClassNotFoundException) =>
try {
(
EngineLanguage.Java,
Class.forName(engine).newInstance.asInstanceOf[EngineFactory]
Class.forName(engine).newInstance.asInstanceOf[EngineFactory],
)
}
}
Expand All @@ -88,7 +88,7 @@ object WorkflowUtils extends Logging {
try {
(
EngineLanguage.Scala,
epgObject.instance.asInstanceOf[EngineParamsGenerator]
epgObject.instance.asInstanceOf[EngineParamsGenerator],
)
} catch {
case e @ (_: NoSuchFieldException | _: ClassNotFoundException) =>
Expand All @@ -98,7 +98,7 @@ object WorkflowUtils extends Logging {
Class
.forName(epg)
.newInstance
.asInstanceOf[EngineParamsGenerator]
.asInstanceOf[EngineParamsGenerator],
)
}
}
Expand All @@ -112,14 +112,14 @@ object WorkflowUtils extends Logging {
try {
(
EngineLanguage.Scala,
evaluationObject.instance.asInstanceOf[Evaluation]
evaluationObject.instance.asInstanceOf[Evaluation],
)
} catch {
case e @ (_: NoSuchFieldException | _: ClassNotFoundException) =>
try {
(
EngineLanguage.Java,
Class.forName(evaluation).newInstance.asInstanceOf[Evaluation]
Class.forName(evaluation).newInstance.asInstanceOf[Evaluation],
)
}
}
Expand Down Expand Up @@ -316,7 +316,7 @@ object WorkflowUtils extends Logging {

NameParams(
name = nameOpt.getOrElse(""),
params = paramsOpt
params = paramsOpt,
)
}

Expand Down
Loading