<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * Copyright (C) 2014 <NAME>
 */

package org.openmole.ide.plugin.environment.slurm

import org.openmole.plugin.environment.slurm.SLURMEnvironment
import org.openmole.core.batch.environment.BatchEnvironment
import org.openmole.ide.core.implementation.data.EnvironmentDataUI
import org.openmole.misc.workspace.Workspace
import fr.iscpif.gridscale.slurm.Gres

class SLURMEnvironmentDataUI(val name: String = "",
                             val login: String = "",
                             val host: String = "",
                             val port: Int = 22,
                             val queue: Option[String] = None,
                             val openMOLEMemory: Option[Int] = Some(BatchEnvironment.defaultRuntimeMemory),
                             val wallTime: Option[String] = None,
                             val memory: Option[Int] = None,
                             val path: Option[String] = None,
                             val gres: String = "",
                             val constraints: String = "")
    // not supported yet in GridScale
    //                           val threads: Option[Int] = None,
    //                           val nodes: Option[Int] = None,
    //                           val coreByNode: Option[Int] = None)
    extends EnvironmentDataUI {
  ui ⇒

  def coreObject = util.Try {

    val gresList = gres.split('&') map (g ⇒
      g.split(':') match { case Array(s: String, i: String) ⇒ new Gres(s, i toInt) }) toList
    val constraintsList = constraints.split('&') toList

    SLURMEnvironment(login,
      host,
      port,
      queue,
      openMOLEMemory,
      wallTime,
      memory,
      path,
      gresList,
      constraintsList)(Workspace.authenticationProvider)
  }

  def coreClass = classOf[SLURMEnvironment]

  // TODO: create image
  override def imagePath = "img/slurm.png"

  // TODO: create image
  def fatImagePath = "img/slurm_fat.png"

  def buildPanelUI = new SLURMEnvironmentPanelUI(this)
}
<commit_msg>Fix type erasure problem in match for GresList<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * Copyright (C) 2014 <NAME>
 */

package org.openmole.ide.plugin.environment.slurm

import org.openmole.plugin.environment.slurm.SLURMEnvironment
import org.openmole.core.batch.environment.BatchEnvironment
import org.openmole.ide.core.implementation.data.EnvironmentDataUI
import org.openmole.misc.workspace.Workspace
import fr.iscpif.gridscale.slurm.Gres

class SLURMEnvironmentDataUI(val name: String = "",
                             val login: String = "",
                             val host: String = "",
                             val port: Int = 22,
                             val queue: Option[String] = None,
                             val openMOLEMemory: Option[Int] = Some(BatchEnvironment.defaultRuntimeMemory),
                             val wallTime: Option[String] = None,
                             val memory: Option[Int] = None,
                             val path: Option[String] = None,
                             val gres: String = "",
                             val constraints: String = "")
    // not supported yet in GridScale
    //                           val threads: Option[Int] = None,
    //                           val nodes: Option[Int] = None,
    //                           val coreByNode: Option[Int] = None)
    extends EnvironmentDataUI {
  ui ⇒

  def coreObject = util.Try {

    val gresList = gres.split('&') map (
      g ⇒ g.split(':') match {
        case Array(s: String, i: String) ⇒ Some(new Gres(s, i toInt))
        case _                           ⇒ None
      }) toList

    val constraintsList = constraints.split('&') toList

    SLURMEnvironment(login,
      host,
      port,
      queue,
      openMOLEMemory,
      wallTime,
      memory,
      path,
      gresList.flatten,
      constraintsList)(Workspace.authenticationProvider)
  }

  def coreClass = classOf[SLURMEnvironment]

  // TODO: create image
  override def imagePath = "img/slurm.png"

  // TODO: create image
  def fatImagePath = "img/slurm_fat.png"

  def buildPanelUI = new SLURMEnvironmentPanelUI(this)
}

{'fraction_non_alphanumeric': 0.09497336113041464, 'fraction_numerical': 0.002779708130646282, 'mean_word_length': 1.8093689004554327, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 21, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '426335', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1195, 'n_words': 306}