Installation

This page explains how to install twowaypanel and its main dependencies.

Prerequisites

  • Python 3.8+ is recommended.

  • twowaypanel relies on standard scientific Python libraries, including NumPy, SciPy, pandas, and PyTorch.

Note

PyTorch is required, because twowaypanel uses automatic differentiation (autograd) functionality to support numerical optimization routines. You can install PyTorch by following the official instructions at: https://pytorch.org/. GPU/CUDA is not required. For most users, the CPU-only version of PyTorch is sufficient. twowaypanel includes an internal copy of the optimization routines based on pytorch-minimize by Reuben Feinman.

Installation options

2. Install the development version from GitHub

To install the latest development version from GitHub:

git clone https://github.com/zizhongyan/twowaypanel.git
cd twowaypanel
pip install -e .

The -e option performs an editable install, meaning local code changes take effect immediately without reinstalling.

3. Install from a local copy

If you downloaded the source code (e.g., as a ZIP file) and unzipped it locally, install from the repository root:

cd /path/to/twowaypanel
pip install -e .

This option is convenient for offline use or replication bundles shared as archived source code.

4. Jupyter / notebook users

In Jupyter, it is important to ensure the package is installed into the same Python environment used by the current notebook kernel. The recommended approach is to use %pip inside the notebook.

From the repository root directory, run:

%cd /path/to/twowaypanel
%pip install -e .

Then verify:

import twowaypanel

Reference for pytorch-minimize