Configuration

The config module provides global configuration settings for PAL.

Configuration utilities for the PAL library.

Provides configuration management for random seeding, simulation parameters, and global library settings.

pal.config.set_default_n_sims(n)[source]

Sets the default number of simulations.

Parameters:

n (int) – The number of simulations.

Return type:

None

pal.config.set_random_seed(seed)[source]

Sets the random seed for the simulation.

Parameters:

seed (int) – The random seed.

Return type:

None

Configuration Options

The following configuration options are available:

n_sims

The number of simulations to run. Default is 100,000.

from pal import config
config.n_sims = 1000000

rng

The random number generator instance. Uses numpy’s default_rng.

from pal import config
config.set_random_seed(123456)

GPU Mode

PAL supports GPU acceleration with CuPy. Enable it via environment variable:

export PAL_USE_GPU=1

Or in Python:

import os
os.environ['PAL_USE_GPU'] = '1'