Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

LayerCake

“Welcome to the layer cake son.”

-- Michael Gambon - Layer Cake (2004)

PyPI version PyPI pyversions DOI Documentation Status License

General Information

LayerCake is a framework to design models based on systems of partial differential equations (PDEs), and convert them to ordinary differential equations (ODEs) via Galerkin-type expansions.

LayerCake allows you to construct systems of PDEs, and to specify coordinate systems and basis functions to build the corresponding ODE systems. To build these systems, LayerCake relies heavily on the Sympy symbolic computation framework. The output of this procedure is either a Numbaified Python callable, or a list of symbolic ODE tendencies that can be integrated in any of the supported languages (Fortran, Julia and Python for the moment). These two kinds of output allow for the study of the computed models with the modern tools available in all these languages.

LayerCake has been designed with geophysics in mind, although it may be useful for other applications.

About

(c) 2025-2026 Jonathan Demaeyer and Oisín Hamilton

See LICENSE.txt for license information.

Installation

With pip

The easiest way to install and run LayerCake is to use pip. Type in a terminal

pip install layercake-model

and you are set!

Additionally, you can clone the repository

git clone https://github.com/Climdyn/LayerCake.git

and perform a test by running the script

python LayerCake/examples/atmospheric/barotropic_one_layer.py

to see if everything runs smoothly (this should take less than 5 minutes).

With Anaconda

The second-easiest way to install and run LayerCake is to use an appropriate environment created through Anaconda.

First install Anaconda and clone the repository:

git clone https://github.com/jodemaey/LayerCake.git

Then install and activate the Python3 Anaconda environment:

conda env create -f environment.yml
conda activate layercake

You can then perform a test by running the script

python examples/atmospheric/barotropic_one_layer.py

to see if everything runs smoothly (this should take less than 5 minutes to run).

Documentation

To build the documentation, please run (with the conda environment activated):

cd documentation
make html

You may need to install make if it is not already present on your system. Once built, the documentation is available here.

The documentation is also available online at https://climdyn.github.io/LayerCake/. In particular, please consider reading the User guide.

Examples

A few examples are available in the examples folder. More examples will be provided as the code is further developed.

Dependencies

LayerCake needs mainly:

  • Numpy for numeric support
  • sparse for sparse multidimensional arrays support
  • Numba for code acceleration
  • Sympy for symbolic computations

Check the YAML file environment.yml for the dependencies.

Contributing

LayerCake is in beta development phase, bug reports and tests of the features are welcome. Please simply raise an issue on Github.

If you want to contribute actively to the development, please contact the main authors. In addition, if you have made changes that you think will be useful to others, please feel free to suggest these as a pull request on the LayerCake Github repository.

Release files for layercake-model 1.0.7b0

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

Source distribution (sdist)

Source distribution for layercake-model 1.0.7b0
File Size Uploaded
layercake_model-1.0.7b0.tar.gz 66.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for layercake-model 1.0.7b0
File Interpreter ABI Platform
layercake_model-1.0.7b0-py3-none-any.whl Python 3 none any Details

Total release size: 147.7 kB

Release files / layercake_model-1.0.7b0.tar.gz

Download URL layercake_model-1.0.7b0.tar.gz
Size 66.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f92e578717feb76ba755dd2adc0ede7a05fe97022276ad11589473751d3912bc
BLAKE2b-256 checksum
How to use checksums
3360932537279391e8180821b0d2aa36134b87821316edb999469aaf05cf263e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / layercake_model-1.0.7b0-py3-none-any.whl

Download URL layercake_model-1.0.7b0-py3-none-any.whl
Size 81.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32ed64fe83ab6accaf211a47a9419c5e3073efee9863b340d7cfc4d8c70f2681
BLAKE2b-256 checksum
How to use checksums
f668383082abf00781a7c6dd83e6aa2f65f3acebfe0ed433da29cfbb101daeeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18
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