Skip to main content

Core utilities and classes for the CausalIQ ecosystem

Project description

causaliq-core

Python Support License: MIT

This is the core package providing common functionality required by several CausalIQ packages.

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

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

Upcoming releases:

  • Release v0.4.0 - Graph ML: support for GraphML formats

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 and 3.12

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
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_core-0.3.0.tar.gz (63.2 kB view details)

Uploaded Source

Built Distribution

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

causaliq_core-0.3.0-py3-none-any.whl (71.9 kB view details)

Uploaded Python 3

File details

Details for the file causaliq_core-0.3.0.tar.gz.

File metadata

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

File hashes

Hashes for causaliq_core-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a7286b08ce0c03c58a91b29abb02a245e73981940b29a97843fac9b9fb6e0110
MD5 6e0de7eb0e4d8525b6a977231bbf14d8
BLAKE2b-256 e0ac76e4fa06b18f3aa503542469ae913f7386a68c330d09ead538c62236fa95

See more details on using hashes here.

File details

Details for the file causaliq_core-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: causaliq_core-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 71.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for causaliq_core-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3697c1806720f716fb72e85114b7aee3e6c40ca180e881c545144526a96dac3a
MD5 91c956670f5e7c74078f67648cc1ad6a
BLAKE2b-256 c32ff7c841dc34fba5bedae7047a448e87d734f7799f08536cf8b12d492fd306

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