Skip to main content

Workflow engine for causal discovery and inference

Project description

causaliq-workflow

Python Versions License: MIT Coverage

GitHub Actions-inspired workflow orchestration for causal discovery experiments within the CausalIQ ecosystem. Execute causal discovery workflows using familiar CI/CD patterns with conservative execution and comprehensive action framework.

Status

🚧 Active Development - This repository is currently in active development, which involves:

  • migrating functionality from the legacy monolithic discovery repo to support legacy experiments and analysis
  • ensure CausalIQ development standards are met
  • adding new features to provide a comprehensive, open, causal discovery workflow.

Features

Implemented Releases

  • Release v0.1.0 - Workflow Foundations: Plug-in actions, basic workflow and CLI support, 100% test coverage

See Git commit history for detailed implementation progress

🛣️ Upcoming Releases

  • Release v0.2.0 - Knowledge Workflows: Integrate with causaliq-knowledge generate_graph action.
  • Release v0.3.0 - Result Caching: Output action results and metadata store to the results cache
  • Release v0.4.0 - Analysis Workflows: Graph averaging and structural analysis workflows.
  • Release v0.5.0 - Enhanced Workflow: Dry and comparison runs, runtime estimation and processing summary
  • Release v0.6.0 - Discovery Workflows: Structure learning algorithms integrated

Brief Example Usage

Example Workflow Definition, experiment.xml:

description: "Causal Discovery Experiment"
id: "experiment-001"

matrix:
  network: ["asia", "cancer"]
  algorithm: ["pc", "ges"]
  sample_size: ["100", "1K"]

steps:
  - name: "Structure Learning"
    uses: "causaliq-discovery"
    with:
      algorithm: "{{algorithm}}"
      sample_size: "{{sample_size}}"
      dataset: "/data/{{network}}"
      output: "/results/{{id}}/{{algorithm}}/{{network}}/{{sample_size}}"

Execute with modes:

cqflow experiment.yml --mode=dry-run    # Validate and preview (default)
cqflow experiment.yml --mode=run        # Execute (skip if outputs exist)
cqflow experiment.yml --mode=compare    # Re-execute and compare outputs

Note that cqflow is a short synonym for causaliq-workflow which can also be used.

Upcoming Key Innovations

🔄 Workflow Orchestration

  • Continuous Integration (CI) testing: Workflow specification syntax
  • Dask distributed computing: Scalable parallel processing
  • Dependency management: Automatic handling of data and processing dependencies
  • Error recovery: Robust handling of failures and restarts

📊 Experiment Management

  • Configuration management: YAML-based experiment specifications
  • Parameter sweeps: Systematic exploration of algorithm parameters
  • Version control: Git-based tracking of experiments and results
  • Reproducibility: Deterministic execution with seed management

Integration with CausalIQ Ecosystem

  • 🔍 CausalIQ Discovery is called by this package to perform structure learning.
  • 📊 CausalIQ Analysis is called by this package to perform results analysis and generate assets for research papers.
  • 🔮 CausalIQ Predict is called by this package to perform causal prediction.
  • 🔄 Zenodo Synchronisation is used by this package to download datasets and upload results.
  • 🧪 CausalIQ Papers are defined in terms of CausalIQ Workflows allowing the reproduction of experiments, results and published paper assets created by the CausalIQ ecosystem.

LLM Support

The following provides project-specific context for this repo which should be provided after the personal and ecosystem context:

tbc

Prerequisites

  • Python 3.9-3.13
  • Git
  • R with bnlearn (optional, for external integration)

Installation

git clone https://github.com/causaliq/causaliq-workflow.git
cd causaliq-workflow

# Set up development environment
scripts/setup-env.ps1 -Install
scripts/activate.ps1

Example workflows: docs/example_workflows.md

Research Context

Supporting research for May 2026 paper on LLM integration for intelligent model averaging. The CI workflow architecture enables sophisticated experimental designs while maintaining familiar syntax for the research community.

Migration target: Existing workflows from monolithic discovery repo by end 2026.

Quick Start

# to be completed

Getting started

Prerequisites

  • Git
  • Latest stable versions of Python 3.9, 3.10. 3.11 and 3.12

Clone the new repo locally and check that it works

Clone the causaliq-analysis repo locally as normal

git clone https://github.com/causaliq/causaliq-analysis.git

Set up the Python virtual environments and activate the default Python virtual environment. You may see messages from VSCode (if you are using it as your IDE) that new Python environments are being created as the scripts/setup-env runs - these messages can be safely ignored at this stage.

scripts/setup-env -Install
scripts/activate

Check that the causaliq-analysis CLI is working, check that all CI tests pass, and start up the local mkdocs webserver. There should be no errors reported in any of these.

causaliq-analysis --help
scripts/check_ci
mkdocs serve

Enter http://127.0.0.1:8000/ in a browser and check that the causaliq-data documentation is visible.

If all of the above works, this confirms that the code is working successfully on your system.

Documentation

Full API documentation is available at: http://127.0.0.1:8000/ (when running mkdocs serve)

Contributing

This repository is part of the CausalIQ ecosystem. For development setup:

  1. Clone the repository
  2. Run scripts/setup-env -Install to set up environments
  3. Run scripts/check_ci to verify all tests pass
  4. Start documentation server with mkdocs serve

Supported Python Versions: 3.9, 3.10, 3.11, 3.12, 3.13 Default Python Version: 3.11
License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

causaliq_workflow-0.1.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

causaliq_workflow-0.1.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file causaliq_workflow-0.1.0.tar.gz.

File metadata

  • Download URL: causaliq_workflow-0.1.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for causaliq_workflow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1bcda42f78b7d0d61c5fb19edc6ac21a6c65a5350f95ebf85eca8d722b2e7449
MD5 7ebd5f8db03e346da4d34e8bdacf79c2
BLAKE2b-256 f095f34cbf12359e78374cc7ac0af2dab00aa9fed279c1291bd39a2457106f1f

See more details on using hashes here.

File details

Details for the file causaliq_workflow-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for causaliq_workflow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d45f4a3152166a225837337ad2c343ee67219dcdc0198782f58f6d005b99f364
MD5 abfd3550145d024cafd5b409c7e5a4d0
BLAKE2b-256 7ab783bdc2a99a100df38ff75961d848efab33bd1469b6712668c7f97c0e079c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page