semvec/pypi-packages huggingface dataset:
pymbend 0.1.0
Bending non-positive-definite matrices to positive-definite
Requires Python: >=3.8

# pymbend

## Description

[`mbend`](https://github.com/nilforooshan/mbend) is an "R package for bending non-positive-definite matrices to positive-definite".
This is a simple port of `mbend` to Python, with the goal of improving computation time.

Some naive timings are below:

| Matrix size | `mbend` time [s] | `pymbend` time [s] |
| --- | ---: | ---: |
| 100 | 0.89 | 0.85|
| 200 | 13.8 | 4.4 |
| 500 | 1370.6 | 36.7 |

These were made on a 2021 Intel MacBook Pro.


In addition, it adds the ability to bend a matrix ($A$) to satisfy a generalized Rayleigh quotient inequality:
$$0 \leq \frac{\beta^\intercal A \beta}{\beta^\intercal B \beta} \leq 1$$


## Installation

```console
pip install git+https://github.com/zietzm/pymbend
```

## License

`pymbend` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
multipal 0.1.1
A distributed computing framework for multi-machines over the network
Requires Python: >=3.8

# Master-Worker Connection Manager Tutorial

This tutorial will guide you through setting up and using the Master-Worker Connection Manager system.

## Prerequisites

- Python 3.x installed on all machines (master and workers)
- Network connectivity between the master and worker machines

## Setup

1. Ensure all necessary files are in place:
   - `connection_manager.py` (contains the MasterManager class)
   - Any additional dependencies

2. Install required Python packages:
   ```
   pip install socket threading sqlite3
   ```

## Usage

### Starting the Master Server

1. Create a Python script (e.g., `run_master.py`) with the following content:

   ```python
   from connection_manager import MasterManager

   master = MasterManager()
   master.start_master_server(ip_address='0.0.0.0', port=5000, authorized_workers=['192.168.1.100', '192.168.1.101'])
   ```

2. Run the master server:
   ```
   python run_master.py
   ```

   This will start the master server on all available network interfaces (0.0.0.0) on port 5000.

### Connecting Workers

1. Ensure workers have the necessary client-side code to connect to the master.

2. Workers should send their local IP addresses to the master upon connection.

3. Only authorized workers (as specified in `authorized_workers` list) will be allowed to connect.

## Features

- **Authorization**: The master server authorizes workers based on their IP addresses.
- **Multi-threading**: The server can handle multiple worker connections simultaneously.
- **SQLite Database**: Client IDs and specifications are stored in an SQLite database.

## Troubleshooting

- If connections fail, check firewall settings and ensure the correct IP addresses and ports are being used.
- Verify that all workers' IP addresses are correctly listed in the `authorized_workers` list.

## Extending the System

To add more functionality:
1. Modify the `MasterManager` class in `connection_manager.py`.
2. Implement additional methods for task distribution, result collection, etc.
3. Update the client-side code on workers to handle new features.

For more detailed information, refer to the comments in the `connection_manager.py` file.
iammeterWpc 0.1
IamMeterWpc api

## IamMeterWpc

Python Client for IamMeterWpc device.

See https://www.iammeter.com

##### Create a new connection by supplying IamMeterWpc host and port(default:80)

```
import asyncio
from api import IammeterWpcAPI

async def main():
    device = IammeterWpcAPI('IP')
    monitor_data = await device.get_monitor_data()
    print(monitor_data)

    result = await device.set_wpc_adv(
        #run_mode=1,
        max_power=2000,
        #meter_address="100.10.30.135",
        meter_config="1,1,1",
        threshold=0,
        hysteresis=0,
        tz_offset=0,
        start_hour=0,
        stop_hour=0,
        meter_type=0,
        restore_power=0,
        ntp_server="ntp1.aliyun.com"
    )
    print(result)

    power_result = await device.set_power(5000)  # set power to 5000
    print(power_result)

if __name__ == "__main__":
    asyncio.run(main())
```



##### ChangeLog

0.1 first commit.