semvec/pypi-packages huggingface dataset:
semantic-cache 0.1.1
Semantic Caching on python functions
Requires Python: >=3.8

<div align="center">

# `semantic-cache`: Semantic Caching for Python Functions

</div>

This project provides a decorator for Python functions that implements semantic caching. This means that function calls with semantically similar inputs will return the cached result, even if the exact input values are different. This can be useful for optimizing expensive function calls, especially when dealing with natural language processing or other tasks where inputs can vary slightly but still have the same meaning.

## How it works

The semantic_cache decorator uses the Qdrant vector similarity search engine to store and retrieve function call information. When a function is decorated, the following happens:

1. **Input encoding:** The function arguments and keyword arguments are converted into a string representation.
2. **Similarity search:** This string representation is used to query Qdrant for similar previously cached function calls.
3. **Cache hit:** If a similar call is found with a similarity score above a threshold (default 0.95), the cached result is returned.
4. **Cache miss:** If no similar call is found, the function is executed, its output is stored in the cache along with the input representation, and the output is returned.

## Installation

```sh
pip install semantic-cache
```

## Usage

```py
from semantic_cache import semantic_cache

@semantic_cache()
def say(message: str) -> str:
    return f"Hi {message}"

# First call, function is executed
result1 = say("John")

# Second call with semantically similar input, cached result is used
result2 = say("john")

assert result1 == result2
```

## Features

- **Similarity threshold:** You can adjust the similarity threshold for determining cache hits.
- **In-memory caching:** By default, an in-memory Qdrant instance is used for caching. You can configure a persistent Qdrant server for production use.
- **Automatic input encoding:** The decorator automatically handles the conversion of function arguments into a searchable representation.

## Potential Applications

- **Natural language processing:** Cache results for functions that process text inputs, even if the wording is slightly different.
- **Machine learning model inference:** Optimize inference calls by caching results for similar input data points.
- **Expensive calculations:** Cache the results of computationally intensive functions based on input parameters.

## Contributing

Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for details.

## License

This project is licensed under the [MIT License](LICENSE).
BetterMaths 0.0.4
Python mathematics made easier
Requires Python: >=3.4
Keywords: better, easier, easy, math, mathematics, simple

![BeterMaths Banner](https://github.com/Dhaiven/BetterMaths/blob/main/images/banner.png)

[![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
> [!WARNING]
> This module is in beta phase


## Little documentation
This module add ```Equation``` class that allow resolve equation in string
```python
# Create an equation
equation = Equation("2+7*8cos(3)")
# Resolve this equation
equation.result() # 57.92325394625613
```

### Why use ```Equation``` and not ```eval``` ?
- ```Equation``` is faster than ```eval``` (See [tests/main.py](https://github.com/Dhaiven/BetterMaths/blob/main/tests/main.py))
- ```Equation``` support parenthese, mathematical formulas like ```cos``` and magics numbers like ```π```


### See the [Wiki](https://github.com/Dhaiven/BetterMaths/wiki) for more documentations

## Instalation
Open your terminal and put ```pip install BetterMaths```
<br> For upgrade the version, put ```pip install --upgrade BetterMaths```

## Contribution
BetterMaths accepts community contributions! <br>
This contributions must case no error tests folder.
Launch __init__ file, put ```y``` for take your changes and checks if there are error.

## Authors
  - <img src="https://www.github.com/Dhaiven.png" width="3%" height="3%"/> [@Dhaiven](https://www.github.com/Dhaiven) for code, optimisation and tests
  - <img src="https://www.github.com/algorythmTTV.png" width="3%" height="3%"/> [@algorythmTTV](https://www.github.com/algorythmTTV) for images, site ans code
druidaHFSS 0.0.3
Ansys interface for Data Generation
Requires Python: >=3.7

# druidaHFSS 
# Ansys HFSS Interface
## _Simulate, data generation, optimization_

This development is intended to provide an interface to access HFSS, in order to automate simulation, Data generation and optimization processes.

## Features

- Automate the re-creation of models in aedt files.
- Create intermediate files to run simulations.
- Run simulations and gather specific metrics from the simulator.

## Usage
```
from dbuilder import Manager as MG
```


```
Builder=MG.Builder(ansysPath=ansysPath,modelName=_,projectName=_, designName=_,modelPath=_, exportPath=_)
```

```
Builder.create()
```

```
Builder.sim_file('', batch, iteration, simfile_path, **kwargs)
```


```    
Builder.simulate(simfile_path+simfileName)
```

```
dbManager=MG.DBManager(ansysPath=ansysPath,
                       modelName=modelName,
                       projectName=project_name,
                       designName=designName,
                       modelPath=modelPath, 
                       dbPath=dBPath,
                      dbName=dbName)
```

```
dbManager.load_df(columns=columnNames)


"""This object can be treated as a pandas dataframe"""
dbManager.df 

```

```
dbManager.insert_row(data_to_store)
```

```
image_rgb=tools.cropImage( file,image_path=path,
                              image_name=fileName_absolute,
                              output_path=imagesPath, 
                             resize_dim=(512,512))
```