Metadata-Version: 2.4
Name: cottax
Version: 0.1.0
Summary: Declare, rewrite, prove and draw computation graphs whose leaves are JAX functions
Author: Timo Bogaarts
License-Expression: MIT
Project-URL: Documentation, https://timobogaarts.github.io/cottax/
Project-URL: Source, https://github.com/timobogaarts/cottax
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jax>=0.4
Requires-Dist: networkx>=3
Provides-Extra: solvers
Requires-Dist: optimistix; extra == "solvers"
Requires-Dist: scipy; extra == "solvers"
Provides-Extra: ode
Requires-Dist: diffrax>=0.7; extra == "ode"
Provides-Extra: viz
Requires-Dist: matplotlib; extra == "viz"
Requires-Dist: graphviz; extra == "viz"
Requires-Dist: cairosvg; extra == "viz"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx_autodoc_typehints; extra == "docs"
Requires-Dist: myst_nb; extra == "docs"
Requires-Dist: furo; extra == "docs"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: equinox>=0.11; extra == "dev"
Requires-Dist: cottax[docs,ode,solvers,viz]; extra == "dev"
Dynamic: license-file

# cottax

Python package for computational graph generation using JAX, enabling graph manipulation and multidisciplinary optimization.

**Documentation, theory and examples: https://timobogaarts.github.io/cottax/**

## Installation

cottax needs Python 3.12 or newer.

```bash
pip install cottax                  # the core: jax and networkx
pip install "cottax[solvers]"       # + optimistix and scipy, needed by `cottax.assemblies.jax`
pip install "cottax[solvers,ode,viz]"   # + diffrax for ODEs, and the drawing dependencies
```

From source, with everything needed for the tests and the docs:

```bash
git clone https://github.com/timobogaarts/cottax.git
cd cottax
pip install -e ".[dev]"
JAX_PLATFORMS=cpu pytest
```

To get started, see the [Sellar example](https://timobogaarts.github.io/cottax/examples/implicit_sellar.html).

## Why the Frozen base?

This package is designed to ensure that the graphs it builds are *always* valid, and the operations on them preserve that validity. 
These graphs are therefore immutable: any change to a graph must prove that the new graph is actually valid too.
Furthermore, they are additive checks: every additional level (e.g. executable/runnable) only *adds* checks, never removes them.
This only holds if no subclass accidentally overrides checks or change what a check reads. Python is rather permissive here, so to make that enforced 
rather than convention, no implemented method may be overridden in a subclass. 
You may extend such a class with additional methods (abstract or not), or add additional rules and checks though.

The `Frozen` base class implements this pattern; it is additionally used for the nodes, since they carry the same proof obligation.

