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

Upcoming releases:

  • Release v0.3.0 - Bayesian Networks: support for Bayesian Networks and their parameterised distributions
  • 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.2.0.tar.gz (37.9 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.2.0-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: causaliq_core-0.2.0.tar.gz
  • Upload date:
  • Size: 37.9 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.2.0.tar.gz
Algorithm Hash digest
SHA256 b5b800a8ab2e5b9d6e5f0054b3d21cc43c4912bedb1bc90751eb45ed2e966ceb
MD5 75dcde95683852b188e21a4c2abde479
BLAKE2b-256 a273562835c9f17dbe9f25eaa39e4dcfcf62a7802699e0d278f432179c26474e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causaliq_core-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 40.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 352f0c0b2817506543a4f7095d9c84336e5161379ed5aec45528ee889b446507
MD5 d1e8bd9ccf5d03a810a28a5943fc27e1
BLAKE2b-256 a052101579b70700f0420568a6ba4ee4ffa096b5445650b10b9fdc40df6c8d17

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