docstr: Reads given configuration file.
  
  Absolute path is converted to relative for Hydra methods.
  
  Parameters
  ----------
  config_file : Path
      Path to the configuration file.
  
  Returns
  -------
  DictConfig
      Configuration file in a OmegaConf.DictConf format.
docstr_tok: ["Reads","given","configuration","file",".","Absolute","path","is","converted","to","relative","for","Hydra","methods",".","Parameters","--","--","--","--","--","config_file",":","Path","Path","to","the","configuration","file",".","Returns","--","--","--","-","DictConfig","Configuration","file","in","a","OmegaConf.DictConf","format","."]
code: def read_config(config_file: Path) -> DictConfig:
      """Reads given configuration file.
  
      Absolute path is converted to relative for Hydra methods.
  
      Parameters
      ----------
      config_file : Path
          Path to the configuration file.
  
      Returns
      -------
      DictConfig
          Configuration file in a OmegaConf.DictConf format.
      """
      # Create a configuration path which is relative to this file. Hydra works with
      # the directory of the file calling it, not the working directory.
      config_file = Path(
          os.path.relpath(config_file, Path(__file__).parent)
      )
      # Clear any previous global Hydra configurations.
      GlobalHydra.instance().clear()
      # Split config file path into directory and file name.
      config_path = str(config_file.parent)
      config_name = config_file.name.split(".")[0]
      with hydra.initialize(
          config_path=config_path, version_base="1.3"
      ):
          config = hydra.compose(config_name=config_name)
      return config
  
file_path: aequitas/src/aequitas/fairflow/utils/config.py
imports: import os
  from pathlib import Path
  import hydra
  from hydra.core.global_hydra import GlobalHydra
  from omegaconf import DictConfig
label_desc: Use image node_id 2 for calling the ConfigReader obj's underlying member method code with example usage: obj.read_config(config_file) and returns: config