Metadata-Version: 2.1
Name: totypes
Version: 0.6.4
Summary: Custom datatypes useful in a topology optimization context
Author-email: "Martin F. Schubert" <mfschubert@gmail.com>
Maintainer-email: "Martin F. Schubert" <mfschubert@gmail.com>
License: MIT License
        
        Copyright (c) 2023 The INVRS-IO authors.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: topology,optimization,jax,inverse design
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jax
Requires-Dist: jaxlib
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: bump-my-version ; extra == 'dev'
Requires-Dist: darglint ; extra == 'dev'
Requires-Dist: totypes[tests] ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Provides-Extra: tests
Requires-Dist: optax ; extra == 'tests'
Requires-Dist: parameterized ; extra == 'tests'
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: pytest-cov ; extra == 'tests'
Requires-Dist: pytest-subtests ; extra == 'tests'

# totypes - Custom types for topology optimization
`v0.6.4`

## Overview

The `totypes` package defines custom jax-compatible datatypes for use in a topology optimization, inverse design, or AI-guided design context. The custom types are pytree nodes consisting of standard jax arrays along with metadata that describe the desired characteristics of the arrays.
- `BoundedArray`, an array with optional lower and/or upper bounds, used e.g. for representing layer thicknesses.
- `Density2DArray`, an array with lower and upper bounds and characteristics such as fixed pixels, minimum feature size, or symmetry, used for representing layer density as is common in topology optimization.

Custom types do not modify the underlying arrays to ensure that e.g. bounds are obeyed. Instead, it is intended that any scheme for generating arrays be aware of and respect the metadata. For example, a topology optimization scheme could read the minimum width and spacing of layers, and use these quantities to construct an appropriate filtering scheme.

Several related utilities are also provided. The `json_utils` module provides functions for serializing and deserializing pytrees containing the custom types. And, the `symmetry` module provides functions that symmetrize arrays; the allowed symmetries of the `Density2DArray` are restricted to those implemented in the `symmetry` module.

## Install

```
pip install totypes
```
