Metadata-Version: 2.4
Name: py_windblade_opa
Version: 0.8.0
Summary: A package for the performance analysis and optimisation of wind turbine blades performance
Project-URL: Documentation, https://npapnet.github.io/py_windblade_opa/
Project-URL: Source, https://github.com/npapnet/py_windblade_opa
Author-email: "N. Papadakis" <npapnet@gmail.com>
License: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: openpyxl
Requires-Dist: pandas
Requires-Dist: plotnine>=0.15.2
Requires-Dist: scipy
Provides-Extra: docs
Requires-Dist: furo; extra == 'docs'
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: sphinx-autobuild; extra == 'docs'
Requires-Dist: sphinx>=7.0; extra == 'docs'
Requires-Dist: sphinxcontrib-mermaid; extra == 'docs'
Description-Content-Type: text/markdown

# py_windblade_opa

A python package for Windblade Optimization and Performance Assessment

Author: [N. Papadakis](https://github.com/npapnet).

## Scope

This package is intended to provide a set of tools for the optimization and performance assessment of wind turbine blades. 

## Installation

## For Users
If you just want to use py_windblade_opa in your own projects, install the latest stable version from PyPI:

> pip install py-windblade-opa

## For Developers and Contributors

We offer two ways to set up the development environment. We strongly recommend using uv (the modern method) as it guarantees you are using the exact same dependencies and Python version as the maintainers.

### Option A: Using uv (Recommended)

This method automatically handles Python version management and dependency locking.

1. **Clone the repository**:

```bash
git clone https://github.com/npapnet/py_windblade_opa.git
cd py_windblade_opa
```

2. **Sync the environment**: This command creates the virtual environment, installs the specific Python version required, and sets up the package in editable mode, installing also all the development dependencies. 

```Bash
uv sync --extra dev
```

3. **Run tests or scripts**: You can run commands inside the environment using `uv run`:


```Bash
# Run the test suite
uv run pytest


# Run a script
uv run python examples/my_script.py
``` 

### Option B: Using Conda (Legacy)
If you prefer managing your own environments with Conda, you can install the package in "editable" mode using standard pip.

1. Clone the repository:

```Bash
git clone https://github.com/npapnet/py_windblade_opa.git
cd py_windblade_opa
```

2. Create and activate your Conda environment:

```Bash
conda create -n windblade python=3.13
conda activate windblade
``` 

Install in editable mode: Note: You must use the [dev] flag to get testing tools like pytest and ruff.

```Bash
pip install -e .[dev]
```

Verify Installation
To confirm everything is working, run the following command (works for both methods):

```cmd
python -c "import py_windblade_opa; print(f'Successfully installed version {py_windblade_opa.__version__}')"
``` 

## Usage

The package is still under development. The following is an example of how to use the package:

```python   
import py_windblade_opa as wbo

power = 1000
Cp = 0.45
n_elec = 0.95
v_nom = 10
reqs = Reqs(power_w=power, n_elec=n_elec, v_nom=v_nom, Cp=Cp)

constants = .wbo.Constants()
config = wbo.Config(lambda0=4.8,  no_blades=3, pitch=0)
r_m = wbo.reqs.estimate_blade_r()
blade = wbo.Blade(r_m=r_m, wt_config=config)
blade_calc = wbo.BladeCalc(blade=blade)

blade.main_calculation()
blade_calc.calculate_i_flow(verbosePlot=False)
blade_calc.step3_eleven_coeffs(verbosePlot=False)
blade_calc.step4_coeffs_collection()
blade_calc.step5_rpm_power(verbosePlot=False)
blade_calc.step6_torque_calcs(verbosePlot=True)

plt.show()
```