Metadata-Version: 2.4
Name: lamkit
Version: 0.1.3
Summary: Toolkit for stress analysis and failure prediction of composite laminates with holes and joints.
Project-URL: Homepage, https://github.com/swayli94/lamkit
Project-URL: Documentation, https://swayli94.github.io/lamkit/
Project-URL: Repository, https://github.com/swayli94/lamkit
Project-URL: Issues, https://github.com/swayli94/lamkit/issues
Author: Runze Li
License: MIT License
        
        Copyright (c) 2026 Runze LI
        
        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.
License-File: LICENSE
Keywords: bjsfm,buckling,composite,engineering,laminate,open-hole,stress analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: matplotlib>=3.7
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: twine>=5.1; extra == 'dev'
Provides-Extra: docs
Requires-Dist: furo>=2024.8.6; extra == 'docs'
Requires-Dist: myst-parser>=4.0; extra == 'docs'
Requires-Dist: scipy>=1.10; extra == 'docs'
Requires-Dist: sphinx>=8.0; extra == 'docs'
Description-Content-Type: text/markdown

# lamkit

`lamkit` is a Python toolkit for composite laminate analysis, focused on:

- Laminate stress/strain response based on Classical Lamination Theory (CLT)
- LaRC05 failure index evaluation
- Lekhnitskii open-hole infinite-plate analytical solution
- Open-hole plate's effective (homogenisation) properties
- Linear buckling analysis of laminates
- Objective/constraint evaluation for laminate optimization tasks
- Layup engineering-requirement checks and feasibility rating against a layup attribute database

## Installation

### Requirements

- Python `>=3.9`
- Core dependencies: `numpy`, `pandas`, `matplotlib`
- Optional: `scipy` (linear buckling and layup feasibility rating)

### Install from PyPI

```bash
pip install lamkit
```

### Install for local development

```bash
pip install -e .[dev,docs]
```

## Quick Start

The following example creates a laminate and evaluates ply-surface fields under membrane loading:

```python
import numpy as np
from lamkit import Laminate, Ply
from lamkit.analysis.material import IM7_8551_7

ply = Ply(IM7_8551_7, thickness=0.125)  # mm
stacking = [45, -45, 0, 90, 90, 0, -45, 45]
laminate = Laminate(stacking=stacking, plies=ply)

# N = [Nxx, Nyy, Nxy, Mxx, Myy, Mxy]
N = np.array([80.0, 0.0, 0.0, 0.0, 0.0, 0.0])
field = laminate.evaluate_laminate(N)

print(field[["index_ply", "index_surface", "z", "sigma_1", "sigma_2", "tau_12", "FI_max"]].head())
```

## Examples

The `example/` directory contains runnable scripts:

1. **Laminate response (CLT + LaRC05)**  
   `example/1-laminate/example_laminate.py`  
   Computes through-thickness stress/strain and LaRC05 index distributions with plots.

2. **Lekhnitskii unloaded-hole solution**  
   `example/2-lekhnitskii-solution/example_unloaded_hole.py`  
   Solves and visualizes open-hole stress fields.

3. **Laminate open-hole field analysis**  
   `example/3-open-hole/example_open_hole.py`  
   Couples laminate equivalent compliance with open-hole fields and generates failure envelopes/boundary maps.

4. **Effective stiffness with hole homogenization**  
   `example/4-effective-stiffness/example_effective_stiffness.py`  
   Compares laminate stiffness `A` (without hole) and homogenized stiffness `A_eff` (with hole).

5. **Laminate linear buckling**  
   `example/5-laminate-buckling/example_buckling.py`  
   Computes buckling eigenvalues and saves buckling mode plots.

6. **Optimization objective/constraint evaluation**  
   `example/6-laminate-optimization-task/example_laminate_opt_function.py`  
   Demonstrates combined displacement, failure, and buckling constraint evaluation for design tasks.

7. **Layup feasibility rating**  
   `example/7-layup-feasibility/example_layup_feasibility.py`  
   Scores a candidate stacking (ply counts, bending lamination parameters) by distance to the nearest layups in a CSV database.

## Common Development Commands

### Run tests

```bash
pytest
```

### Build distribution package

```bash
python -m build
```

### Build documentation

```bash
cd docs
sphinx-build -b html . _build/html
```
