Configurations#

Overview#

The centralized configuration system for HiFAST manages global settings, supporting multiple sources with a clear priority order.

Priority Order (Highest to Lowest)#

  1. Environment Variables: HIFAST_<SECTION>_<OPTION>

  2. Config File: ~/.config/hifast/config.ini

  3. Defaults: System hardcoded defaults.

Key Features#

Offline Mode#

To disable all network requests (e.g., for working in isolated environments):

# CLI
python -m hifast.utils.config set general offline true

# Environment Variable
export HIFAST_GENERAL_OFFLINE=1

Tcal Configuration#

Configure the source for Noise Calibration data:

  • Source (tcal source): ‘r2’ (default) or ‘github’.

  • Data Directory (tcal tcal_dir): Local storage path (Default: ~/Tcal/).

Examples#

# List all current settings & Env Var names
python -m hifast.utils.config list

# Set Tcal source to Github
python -m hifast.utils.config set tcal source github

# Check a specific value
python -m hifast.utils.config get tcal tcal_dir

Full Parameter Reference#

Set and retrieve configuration values for HiFAST modules (e.g., Tcal).

Priority Order:
  1. Environment Variables: - Standard: HIFAST_SECTION_OPTION (e.g., HIFAST_TCAL_SOURCE)

  2. Config File (~/.config/hifast/config.ini)

  3. Global Defaults

usage: python -m hifast.utils.config [-h] {set,get,list} ...

Positional Arguments#

command

Possible choices: set, get, list

Sub-commands#

set#

Set a configuration value

python -m hifast.utils.config set [-h] section option value
Positional Arguments#
section

Config section (e.g., tcal)

option

Config option (e.g., source)

value

Value to set

get#

Get a configuration value

python -m hifast.utils.config get [-h] section option
Positional Arguments#
section

Config section

option

Config option

list#

List all available options and current values

python -m hifast.utils.config list [-h]

Examples:

# List all options python -m hifast.utils.config list

# Set Tcal source to R2 (default) python -m hifast.utils.config set tcal source r2

# Get current data directory python -m hifast.utils.config get tcal data_dir