FireWorks
raw JSON → 2.1.3 verified Sat May 09 auth: no python
FireWorks is a workflow software for managing high-throughput calculations, particularly in materials science. Current version: 2.1.3. It uses MongoDB as a backend. Release cadence is irregular with occasional minor updates.
pip install fireworks Common errors
error pymongo.errors.ServerSelectionTimeoutError: No servers found yet ↓
cause MongoDB is not running or not accessible at the configured host/port.
fix
Start MongoDB:
mongod --dbpath /data/db & (or use systemd). Check host/port defaults: LaunchPad uses localhost:27017. error ImportError: cannot import name 'LaunchPad' from 'fireworks' ↓
cause Using old import path. In older versions, LaunchPad was in fireworks.core.
fix
Use
from fireworks import LaunchPad (v2+) or from fireworks.core import LaunchPad (v1.x). Check your version. error fireworks.core.firework.FWData object has no attribute 'to_dict' ↓
cause Using deprecated `FWData` class (removed in v2.1+).
fix
Replace
FWData with FileWriteTask or ScriptTask. See migration guide. error TypeError: __init__() got an unexpected keyword argument 'host' ↓
cause Passing host/port directly to LaunchPad; in older versions, the constructor signature was different.
Warnings
breaking In v2.0+, the import paths changed dramatically. Submodules like fireworks.core, fireworks.firetasks, and fireworks.utilities moved or merged. Check all imports if upgrading from v1.x. ↓
fix Update imports: `from fireworks import LaunchPad, Workflow, Firework, PyTask` instead of old paths.
breaking The default MongoDB connection changed. In v2.0+, the LaunchPad defaults to host='localhost' and port=27017, but the database name is no longer 'fireworks' by default; it uses the name parameter. Previously, it was 'fireworks' implicitly. ↓
fix Explicitly pass `name='fireworks'` to LaunchPad if you relied on the old default.
gotcha FireWorks requires MongoDB running locally (or accessible). Many new users forget to start MongoDB, leading to connection errors. ↓
fix Start MongoDB service before using FireWorks: `mongod --dbpath /data/db &` or via system service.
deprecated The `FWAction` and `FWData` classes are deprecated in v2.1+. Use `FileWriteTask` and `ScriptTask` instead. ↓
fix Replace `FWAction` with `ScriptTask` or appropriate built-in tasks.
gotcha When using `PyTask`, the `func` argument must be a string that can be imported from the module where the function lives. If the function is not importable, tasks will fail at runtime. ↓
fix Ensure the function is defined in a module accessible via Python's import system. Use dotted strings like `'mymodule.myfunc'`.
Imports
- LaunchPad wrong
from fireworks.core import LaunchPadcorrectfrom fireworks import LaunchPad - Workflow wrong
from fireworks.core.firework import Workflowcorrectfrom fireworks import Workflow - Firework wrong
from fireworks.core.firework import Fireworkcorrectfrom fireworks import Firework - PyTask wrong
from fireworks.core.firetasks import PyTaskcorrectfrom fireworks import PyTask
Quickstart
from fireworks import LaunchPad, Workflow, Firework, PyTask
# Initialize launchpad (requires MongoDB running)
launchpad = LaunchPad(name='test')
# Define tasks
task1 = PyTask(func='print', args=["Hello from FireWorks"])
task2 = PyTask(func='print', args=["Task 2"])
# Create fireworks
fw1 = Firework(tasks=[task1], name='hello_task')
fw2 = Firework(tasks=[task2], name='task2')
# Create workflow
wf = Workflow([fw1, fw2], name='my_workflow')
# Add workflow to launchpad
launchpad.add_wf(wf)
print('Workflow added successfully. Run with: lpad run')