semvec/pypi-packages huggingface dataset:
ibp2py 1.0.6
SAP Data Retrieval and Processing Library for IBP
Keywords: SAP IBP API ODATA

# Ibp2py - Python library for SAP IBP

This is a Python library designed to make it easier to interact with the SAP Integrated Business Planning (IBP) API.

## Installation

You can install ibpy using pip:

```bash
pip install ibpy2py
```
## Usage

To use ibpy, first create an instance of the `ibpy` class using your SAP IBP username and password:

```python
from ibpy import ibpy  
username = "YOUR_IBP_USERNAME" 
password = "YOUR_IBP_PASSWORD" 
host = 'YOUR_HOST_URL' 
connection = Ibp2py(username, password, host)
```

### Extracting Master Data

Here is an example of how to extract master data:
Method -> MASTER_DATA_API_SRV


```python
PlanningAreaID = 'SAP01' 
VersionID = "BASE" 
MasterDataTypeID = "M3LOCATION" 
PlanningAreaDescr = "Planning" 
VersionName = "Base Line" 
select = '*' 
data = connection.masterdata(MasterDataTypeID, select=select, PlanningAreaID=PlanningAreaID, VersionID=VersionID, PlanningAreaDescr=PlanningAreaDescr, VersionName=VersionName)
```

### Extracting Telemetry Data
Method -> *AddInLogon* (MtrgActyExcelAddInLogon)
Method -> *AddInLogon* (MtrgActyExcelAddInPlanningView)

module -> Method


Here is an example of how to extract telemetry data:

```python
data = connection.telemetry('PlanningView', module)
```
### Extracting Key Figure Data
Method -> 1 (PLANNING_DATA_API_SRV)
Method -> 2 (EXTRACT_ODATA_SRV)

modulo -> Method

Here is an example of how to extract key figure data:

```python
filters="(PERIODID0_TSTAMP ge datetime'2023-04-01T00:00:00' and PERIODID0_TSTAMP lt datetime'2023-07-02T00:00:00')"+ " and CONSENSUSDEMAND gt 0" 
PlanningAreaID = 'SAP01' 
MasterData = 'PRDID,CUSTID' 
KeyFigures = 'CONSENSUSDEMAND' 
data = connection.keyfigure(PlanningAreaID, MasterData, KeyFigures,modulo = modulo,filters=filters)
```
## Contact Information

For any issues or queries related to ibpy2py, feel free to reach out:

- Author: Pedro Rastha
- Email: [pedrorastha@gmail.com](mailto:pedrorastha@gmail.com)
- LinkedIn: [@pedrorastha](https://www.linkedin.com/in/pedrorastha)


## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License

[Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/)

**Note:** This library is open source and is not sponsored or supported by SAP.
fft-conv-pytorch 1.2.0
Implementation of 1D, 2D, and 3D FFT convolutions in PyTorch.
Requires Python: >=3.7

# fft-conv-pytorch

Implementation of 1D, 2D, and 3D FFT convolutions in PyTorch.  
* Faster than direct convolution for large kernels.
* **Much slower** than direct convolution for small kernels.
* In my local tests, FFT convolution is faster when the kernel has >100 or so elements.
    * Dependent on machine and PyTorch version.
    * Also see benchmarks below.


## Install

Using `pip`:
```bash
pip install fft-conv-pytorch
```

From source:
```bash
git clone https://github.com/fkodom/fft-conv-pytorch.git
cd fft-conv-pytorch
pip install .
```

## Example Usage

```python
import torch
from fft_conv_pytorch import fft_conv, FFTConv1d

# Create dummy data.  
#     Data shape: (batch, channels, length)
#     Kernel shape: (out_channels, in_channels, kernel_size)
#     Bias shape: (out channels, )
# For ordinary 1D convolution, simply set batch=1.
signal = torch.randn(3, 3, 1024 * 1024)
kernel = torch.randn(2, 3, 128)
bias = torch.randn(2)

# Functional execution.  (Easiest for generic use cases.)
out = fft_conv(signal, kernel, bias=bias)

# Object-oriented execution.  (Requires some extra work, since the 
# defined classes were designed for use in neural networks.)
fft_conv = FFTConv1d(3, 2, 128, bias=True)
fft_conv.weight = torch.nn.Parameter(kernel)
fft_conv.bias = torch.nn.Parameter(bias)
out = fft_conv(signal)
```

## Benchmarks

Benchmarking FFT convolution against the direct convolution from PyTorch in 1D, 2D, 
and 3D. The exact times are heavily dependent on your local machine, but relative 
scaling with kernel size is always the same. 

Dimensions | Input Size   | Input Channels | Output Channels | Bias | Padding | Stride | Dilation
-----------|--------------|----------------|-----------------|------|---------|--------|---------
1          | (4096)       | 4              | 4               | True | 0       | 1      | 1
2          | (512, 512)   | 4              | 4               | True | 0       | 1      | 1
3          | (64, 64, 64) | 4              | 4               | True | 0       | 1      | 1

![Benchmark Plot](doc/benchmark.png)