Skip to main content

causaliq-core

Python Versions License: MIT Coverage

This is the core package providing common functionality required by several CausalIQ packages. It is part of the CausalIQ ecosystem for intelligent causal discovery and inference.

Installation

Install from PyPI:

pip install causaliq-core

Status

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

  • migrating functionality from the legacy monolithic discovery repo
  • restructuring classes to reduce module size and improve maintainability and improve usability
  • ensure CausalIQ development standards are met
  • adding new core functionality required by several CausalIQ packages

Features

Currently implemented:

  • Release v0.1.0 - Foundation and utilities: CausalIQ compliant development environment and utility functions (timing, random numbers, environment detection, etc.)
  • Release v0.2.0 - Graph classes: Graph types for causal discovery including Summary Dependence Graphs (SDG), Partially Directed Acyclic Graphs (PDAG), Directed Acyclic Graphs (DAG), with conversion utilities and I/O support for Tetrad/Bayesys formats
  • Release v0.3.0 - Bayesian Networks: support for Bayesian Networks and their parameterised distributions and I/O support for DSC and XDSL formats
  • Release v0.4.0 - Caching Infrastructure: Token-based caching and (de)compression of JSON and GraphML
  • Release v0.5.0 - Aggregation Workflows: PDG (Probabilistic Dependency Graph) for uncertainty over graph structures, GraphML I/O for PDG, filter expression evaluation, and metadata-driven weight computation
  • Release v0.6.0 - Optimal DAG: Greedy optimal DAG extraction from PDG, ActionPattern enum for workflow execution patterns, and template method pattern for action providers
  • Release v0.7.0 - Randomised Filters: random() function support in filter expressions for random sampling of cache entries

Upcoming releases:

  • none planned

Quick Start

from causaliq_core.graph import PDAG, read, write

# Create a partially directed graph
pdag = PDAG(['X', 'Y', 'Z'], [('X', '->', 'Y'), ('Y', '--', 'Z')])

# Save and load graphs
write(pdag, "my_graph.csv")  # Bayesys format
loaded_graph = read("my_graph.csv")

# Convert between graph types
from causaliq_core.graph import extend_pdag
dag = extend_pdag(pdag)  # Extend PDAG to DAG

Getting started

Prerequisites

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

Clone the new repo locally and check that it works

Clone the causaliq-core repo locally as normal

git clone https://github.com/causaliq/causaliq-core.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-core 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-core --help
scripts/check_ci
mkdocs serve

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

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

Start work on new features

The real work of implementing the functionality of this new CausalIQ package can now begin!

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

Metadata

Release files for causaliq-core 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for causaliq-core 0.7.0
File Size Uploaded
causaliq_core-0.7.0.tar.gz 94.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for causaliq-core 0.7.0
File Interpreter ABI Platform
causaliq_core-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 202.3 kB

Release files / causaliq_core-0.7.0.tar.gz

Download URL causaliq_core-0.7.0.tar.gz
Size 94.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3b0110aaa65a5b0e97b3ca5b3f6a32ad9dfb96de047ba79461a80cc72592fdd6
BLAKE2b-256 checksum
How to use checksums
e8e2a1f444957e225cd33e40d0c6dccbbe96757f33158f1e12a77f1173afb8e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / causaliq_core-0.7.0-py3-none-any.whl

Download URL causaliq_core-0.7.0-py3-none-any.whl
Size 107.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0da20ac9c051f6a99a5e4b07894a98720b7f2812091dfb494423935a60a086cc
BLAKE2b-256 checksum
How to use checksums
bd5bd47551104929605b1c1cf0421f07d20f98401e70e4447620354c64b33e51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page