class_docstr: Base class for testing Profet tasks.
class_docstr_tok: ["Base","class","for","testing","Profet","tasks","."]
docstr: Test that tasks have a proper configuration and that they can be created from it.
docstr_tok: ["Test","that","tasks","have","a","proper","configuration","and","that","they","can","be","created","from","it","."]
code: def test_configuration(
      self,
      profet_train_config: MetaModelConfig,
      profet_input_dir: Path,
      checkpoint_dir: Path,
      with_grad: bool,
      device_str: str,
  ):
      """Test that tasks have a proper configuration and that they can be created from it."""
      max_trials = 10
      kwargs = dict(
          max_trials=max_trials,
          model_config=profet_train_config,
          input_dir=profet_input_dir,
          checkpoint_dir=checkpoint_dir,
          device=device_str,
          with_grad=with_grad,
      )
      first_task = self.Task(**kwargs)
  
      assert first_task.configuration == {
          self.Task.__qualname__: dict(
              max_trials=max_trials,
              model_config=asdict(profet_train_config),
              input_dir=str(profet_input_dir),
              checkpoint_dir=str(checkpoint_dir),
              device=device_str,
              with_grad=with_grad,
          )
      }
      from orion.benchmark.benchmark_client import _get_task
  
      # NOTE: This 'name' is the qualname of the class, which is used by the Factory metaclass'
      # `__call__` method.
      name, config_dict = first_task.configuration.popitem()
      second_task = _get_task(name=name, **config_dict)
      assert second_task.configuration == first_task.configuration
  
imports: from dataclasses import asdict, replace
  from logging import getLogger
  from pathlib import Path
  from typing import ClassVar, Type
  import numpy
  import pytest
  from _pytest.tmpdir import TempPathFactory
  from orion.algo.space import Space
  from typing import List, Union, overload
  from pytest_mock import MockerFixture
  from orion.benchmark.task.profet.profet_task import MetaModelConfig, ProfetTask
  from orion.core.worker.trial import Trial
  from .conftest import REAL_PROFET_DATA_DIR, is_nonempty_dir
label_desc: Use image node_id 6 for calling the ProfetTaskTests obj's underlying member method code with example usage: obj.test_configuration(profet_train_config, profet_input_dir, checkpoint_dir, with_grad, device_str) without return types