{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Installation\n", "\n", "Katsu may be installed via PyPI\n", "\n", "```bash\n", "pip install katsu --upgrade\n", "```\n", "\n", "Or by cloning [the Katsu repository on Github](https://github.com/Jashcraf/katsu)\n", "\n", "```bash\n", "git clone https://github.com/Jashcraf/katsu\n", "```\n", "\n", "# Running Automated Testing\n", "To run Katsu's automated tests, please install the `pytest` package\n", "```bash\n", "pip install --upgrade pytest\n", "```\n", "\n", "then navigate to your clone of the Katsu repository and run \n", "\n", "```bash\n", "pytest tests/\n", "```\n", "\n", "See [Optional Dependecies](##%20Optional%20Dependecies) for how to run pytest with Jax installed.\n", "\n", "## Requirements\n", "The base implementation of Katsu just requires the following, which will install when running the katsu installation\n", "- Python 3.8+\n", "- Numpy\n", "- Scipy\n", "- pyserial\n", "\n", "## Optional Dependecies\n", "If you wish to extend Katsu's functionality, please install the following into your Python environemnt\n", "- Jax: enables differentiable Mueller matrix models\n", "- Cupy: enables computation on GPUs, suitable for handling large datasets\n", "\n", "To enable these options the appropriate backend method must be called, as shown in the code snippet below\n", "```python\n", "from katsu.katsu_math import set_backend_to_jax, set_backend_to_cupy, set_backend_to_numpy\n", "\n", "# sets numpy backend to cupy\n", "set_backend_to_cupy()\n", "\n", "# sets numpy backend to jax\n", "set_backend_to_jax()\n", "\n", "# resets to numppy\n", "set_backend_to_numpy()\n", "```\n", "\n", "In this snippet, the katsu backend will be set from the default (Numpy) to Cupy, then Jax, then Numpy. \n", "\n", "To ensure that Katsu works with Jax, please install Jax before running `pytest tests/`, otherwise the Jax tests will be skipped.\n" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 2 }