-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Raphael Constantinis edited this page Jul 23, 2025
·
1 revision
This page provides comprehensive instructions for customizing the entropic_measurement library, including settings, parameter options, and configuration files.
The entropic_measurement library offers flexible configuration options to adapt to different measurement scenarios and computational requirements. Configuration can be set through:
- Configuration files
- Environment variables
- Direct parameter passing
- Runtime configuration updates
The library looks for configuration files in the following order:
-
./entropic_config.yaml(current directory) -
~/.entropic_measurement/config.yaml(user home directory) -
/etc/entropic_measurement/config.yaml(system-wide)
# entropic_config.yaml
measurement:
precision: "high" # Options: low, medium, high, ultra
sample_rate: 1000 # Samples per second
window_size: 1024 # Analysis window size
overlap: 0.5 # Window overlap ratio (0.0-1.0)
processing:
threads: "auto" # Number of processing threads or 'auto'
memory_limit: "1GB" # Maximum memory usage
cache_size: 100 # Number of cached results
output:
format: "json" # Options: json, csv, hdf5, pickle
precision: 6 # Decimal precision for numeric output
compression: true # Enable output compression
logging:
level: "INFO" # Options: DEBUG, INFO, WARNING, ERROR
file: "entropic.log" # Log file path (optional)
console: true # Enable console loggingConfiguration can also be set using environment variables with the ENTROPIC_ prefix:
-
ENTROPIC_PRECISION: Set measurement precision (low/medium/high/ultra) -
ENTROPIC_SAMPLE_RATE: Sampling rate in Hz -
ENTROPIC_THREADS: Number of processing threads -
ENTROPIC_MEMORY_LIMIT: Maximum memory usage (e.g., "512MB", "2GB")
-
ENTROPIC_OUTPUT_FORMAT: Output format (json/csv/hdf5/pickle) -
ENTROPIC_OUTPUT_PRECISION: Numeric precision for output -
ENTROPIC_COMPRESSION: Enable compression (true/false)
-
ENTROPIC_LOG_LEVEL: Logging level (DEBUG/INFO/WARNING/ERROR) -
ENTROPIC_LOG_FILE: Path to log file -
ENTROPIC_LOG_CONSOLE: Enable console logging (true/false)
# Linux/macOS
export ENTROPIC_PRECISION="high"
export ENTROPIC_SAMPLE_RATE=2000
export ENTROPIC_OUTPUT_FORMAT="hdf5"
export ENTROPIC_LOG_LEVEL="DEBUG"
# Windows
set ENTROPIC_PRECISION=high
set ENTROPIC_SAMPLE_RATE=2000
set ENTROPIC_OUTPUT_FORMAT=hdf5
set ENTROPIC_LOG_LEVEL=DEBUGYou can create and modify configuration at runtime:
from entropic_measurement import Config, EntropicMeasurement
# Create custom configuration
config = Config(
precision='high',
sample_rate=1500,
window_size=2048,
output_format='json'
)
# Initialize with configuration
measurement = EntropicMeasurement(config=config)
# Update configuration during runtime
config.update(precision='ultra', threads=8)# Pass parameters directly to measurement functions
result = measurement.analyze(
data,
precision='high',
window_size=1024,
overlap=0.75
)| Parameter | Type | Default | Description |
|---|---|---|---|
precision |
str | "medium" | Measurement precision level |
sample_rate |
int | 1000 | Sampling rate in Hz |
window_size |
int | 1024 | Analysis window size (power of 2) |
overlap |
float | 0.5 | Window overlap ratio (0.0-1.0) |
method |
str | "fft" | Analysis method (fft/welch/multitaper) |
| Parameter | Type | Default | Description |
|---|---|---|---|
threads |
int/str | "auto" | Number of processing threads |
memory_limit |
str | "512MB" | Maximum memory usage |
cache_size |
int | 50 | Number of cached results |
parallel |
bool | true | Enable parallel processing |
| Parameter | Type | Default | Description |
|---|---|---|---|
format |
str | "json" | Output format |
precision |
int | 4 | Decimal precision |
compression |
bool | false | Enable compression |
metadata |
bool | true | Include metadata in output |
# Register custom analysis method
config.register_method('custom_fft', CustomFFTAnalyzer)
# Use custom method
result = measurement.analyze(data, method='custom_fft')# High-performance configuration
performance:
vectorization: true # Enable SIMD operations
gpu_acceleration: false # Use GPU if available
memory_mapping: true # Use memory mapping for large files
batch_processing: true # Enable batch processingvalidation:
strict_types: true # Enforce strict type checking
range_checks: true # Validate parameter ranges
warn_deprecated: true # Warn about deprecated featuresThe library validates configuration parameters at startup:
# Validate configuration
try:
config.validate()
except ConfigurationError as e:
print(f"Configuration error: {e}")- Use configuration files for consistent settings across runs
- Set environment variables for deployment-specific settings
- Profile your configuration to optimize performance
- Document custom configurations for reproducibility
- Use version control for configuration files
- Invalid precision level: Ensure precision is one of: low, medium, high, ultra
-
Memory errors: Reduce
window_sizeorcache_sizefor large datasets -
Threading issues: Set
threads=1to disable parallel processing - Output format errors: Verify the output format is supported
Enable debug logging to troubleshoot configuration issues:
import logging
logging.basicConfig(level=logging.DEBUG)
# Or via environment variable
# ENTROPIC_LOG_LEVEL=DEBUG