FZ - Parametric Scientific Computing Framework
A powerful Python package for parametric simulations and computational experiments. FZ wraps your simulation codes to automatically run parametric studies, manage input/output files, handle parallel execution, and collect results in structured DataFrames.
What's New in 0.9.1
- SLURM Calculator: Execute on HPC clusters with workload management
- Funz Server: Connect to legacy Java Funz calculator servers
- R Interpreter: Use R for statistical formula evaluation
- Shell Path Config: Custom binary resolution with
FZ_SHELL_PATH - Progress Callbacks: Monitor execution with custom callbacks
- Variable Defaults: Syntax for default values
${var~default}
What is FZ?
FZ is a framework that simplifies running parametric computational studies. Whether you're working with scientific simulations, engineering calculations, or any computational model, FZ helps you:
- 🔄 Run parametric studies - Automatically generate and execute all combinations of parameter values
- ⚡ Parallelize execution - Run multiple cases concurrently across multiple calculators
- 💾 Cache results - Reuse previous calculations based on input file hashes
- 🌐 Execute remotely - Run calculations on remote servers via SSH
- 📊 Structure output - Get results as pandas DataFrames with automatic type conversion
Four Core Functions
FZ provides four fundamental functions that cover the entire workflow:
| Function | Purpose | Description |
|---|---|---|
| fzi | Parse Input | Identify variables in input files |
| fzc | Compile | Substitute variable values in templates |
| fzo | Parse Output | Extract results from output files |
| fzr | Run | Execute complete parametric studies |
Quick Example
Here's a simple parametric study in just a few lines:
import fz
# Define the model
model = {
"varprefix": "$",
"output": {
"pressure": "grep 'pressure = ' output.txt | awk '{print $3}'"
}
}
# Run all combinations (4 × 3 = 12 cases)
results = fz.fzr(
"input.txt",
{
"T_celsius": [10, 20, 30, 40], # 4 temperatures
"V_L": [1, 2, 5], # 3 volumes
"n_mol": 1.0 # fixed amount
},
model,
calculators="sh://bash calculate.sh",
results_dir="results"
)
print(results) # pandas DataFrame with all results
Key Features
Parametric Studies
Generate and run all combinations of parameter values automatically. FZ creates the Cartesian product of your parameter lists and manages execution.
Multiple Calculators
Execute calculations using different methods:
- Local shell - Run scripts and executables locally
- SSH remote - Execute on remote servers with automatic file transfer
- SLURM - Submit jobs to HPC clusters with workload management (New in 0.9.1)
- Funz server - Connect to Java Funz calculator servers (New in 0.9.1)
- Cache - Reuse previous results based on input hashes
Smart Parallel Execution
FZ automatically parallelizes your calculations across available calculators with:
- Load balancing
- Automatic retry on failures
- Progress tracking with ETA
- Graceful interrupt handling (Ctrl+C)
Formula Evaluation
Use Python or R expressions directly in input templates for calculated parameters:
Getting Started
Ready to get started? Check out our guides:
Plugins
FZ includes plugins for various simulation codes:
- FZ-Moret - Moret model plugin
- FZ-MCNP - Monte Carlo N-Particle Transport Code
- FZ-Cathare - Thermal-hydraulic system code
- FZ-Cristal - Cristal simulation plugin
- FZ-Scale - Scale nuclear analysis code
- FZ-Telemac - Hydrodynamics simulation system
Google Colab Integration
Try FZ directly in your browser with our Google Colab notebooks:
Use Cases
FZ is perfect for:
- Sensitivity Analysis - Understand how parameters affect your results
- Design of Experiments - Systematically explore the parameter space
- Optimization Studies - Find optimal parameter combinations
- Uncertainty Quantification - Propagate uncertainties through your model
- Model Validation - Compare model outputs against experimental data
Community and Support
- GitHub: Funz/fz
- Issues: Report bugs or request features
- Documentation: You're reading it!
License
FZ is released under the BSD 3-Clause License.
Citation
If you use FZ in your research, please cite: