semvec/pypi-packages huggingface dataset:
replx 1.2
replx is a fast, modern MicroPython CLI: turbo REPL, robust file sync (put/get), project install, mpy-cross integration, and smart port discovery.
Requires Python: >=3.10
Keywords: micropython, repl, serial, pyserial, typer, mpy-cross, deploy

# replx

[![PyPI version](https://badge.fury.io/py/replx.svg)](https://badge.fury.io/py/replx)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

`replx` is a CLI tool for MicroPython development. It uses an agent-based architecture to manage multiple CLI sessions and multiple boards in a consistent workflow.

## What replx provides

- Shared connection management across terminal sessions
- Foreground and background board handling per session
- Workspace-level default device configuration
- File operations on device storage
- Script execution, REPL access, and utility commands

## Installation

```sh
pip install replx
```

## Command summary

### Connection and session

- `setup`: Initialize workspace settings and register a default device.
- `scan`: List available serial devices.
- `status`: Show session and connection state.
- `fg`: Change the foreground device for the current session.
- `whoami`: Show the current foreground device.
- `disconnect`: Close a device connection.
- `shutdown`: Stop the agent and clear active sessions.

### Execution and interaction

- `exec` (`-c`): Execute inline Python code on the device.
- `run`: Run a local or device-side script.
- `repl`: Open an interactive REPL session.
- `shell`: Open a device file-system shell.

### File operations

- `ls`: List files and directories.
- `cat`: Print file content.
- `get`: Download files from device to local.
- `put`: Upload files from local to device.
- `cp`: Copy files or directories on device.
- `mv`: Move or rename files or directories on device.
- `rm`: Remove files or directories on device.
- `mkdir`: Create directories on device.
- `touch`: Create an empty file or update timestamps.

### Device management

- `usage`: Show device storage usage.
- `reset`: Perform a soft reset.
- `format`: Format the device file system.
- `init`: Run initialization scripts on device.
- `wifi`: Manage Wi-Fi configuration and status.
- `firmware`: Check, download, or update firmware.

### Package and build

- `pkg`: Search, download, and update packages.
- `mpy`: Compile `.py` files to `.mpy`.

## Notes

- `scan`, `status`, `whoami`, and `shutdown` are special commands and do not accept `--port`.
- Most device commands can omit the port when a foreground or workspace default device is available.

## License

MIT
lpspline 0.0.3
lpspline
Requires Python: >=3.10

# LPSpline

LPSpline is a Python package for building and optimizing linear spline models using an intuitive additive API. It provides a flexible way to model non-linear relationships using various spline types like Piecewise Linear, B-Splines, Cyclic Splines, and Categorical Factors.

## Installation

Install `lpspline` via pip directly from the repository, or if published:

```bash
pip install lpspline
```


## Quick Start

LPSpline allows you to easily compose additive models. Here's a quick example:

```python
import numpy as np
import polars as pl
from lpspline import l, pwl, bs



# ---------------------------------------- Data Generation

n = 1000

# Regressors
x_linear = np.linspace(0, 10, n)
x_pwl = np.linspace(0, 10, n)
x_bs = np.linspace(0, 10, n)
x_cyc = np.linspace(0, 2*np.pi, n)
x_factor = np.random.randint(0, 3, n)

# Target
y_linear = 0.5 * x_linear
y_pwl = np.where(x_pwl < 5, 0, x_pwl - 5)
y_bs = np.sin(x_bs) 
y_cyc = np.cos(x_cyc)
y_factor = np.array([0, 2, -1])[x_factor]

y = y_linear + y_pwl + y_bs + y_cyc + y_factor + np.random.normal(0, 0.2, n)

df = pl.DataFrame({
    "linear_col": x_linear,
    "pwl_col": x_pwl,
    "bs_col": x_bs,
    "cyc_col": x_cyc,
    "factor_col": x_factor,
    "target": y
})

# ---------------------------------------- Model Definition
model = (
    l(term='linear_col', bias=True)
    + pwl(term='pwl_col', knots=[5.])
    + bs(term="bs_col", knots=np.linspace(0, 10, 5), degree=3)
    + cs(term="cyc_col", period=2*np.pi, order=2)
    + f(term="factor_col", n_classes=3)
)

# ---------------------------------------- Model Fitting
model.fit(df, df["target"])

# ---------------------------------------- Model Prediction
predictions = model.predict(df)

# ---------------------------------------- Model Visualization
plot_components(model=model, df=df, ncols=3)
```

## Expected output

Once the model is fitted, you will see a detailed summary to the console:

```
==================================================
✨ Model Summary ✨
==================================================
Problem Status: ✅ optimal
--------------------------------------------------
Spline Type          | Term            | Params    
--------------------------------------------------
🟢 Linear            | linear_col      | 2         
🟢 PiecewiseLinear   | pwl_col         | 3         
🟢 BSpline           | bs_col          | 1         
🟢 CyclicSpline      | cyc_col         | 5         
🟢 Factor            | factor_col      | 3         
--------------------------------------------------
📊 Total Parameters                    | 14        
==================================================

Model fitted successfully.
```


![LPSpline Visualization](assets/demo_plot.png)