Metadata-Version: 2.4
Name: sketulate
Version: 0.1.0
Summary: Sketchable function and density simulations for data science
Project-URL: Homepage, https://github.com/aaron1rcl/sketulate
Project-URL: Issues, https://github.com/aaron1rcl/sketulate/issues
Author-email: Aaron <aaron_rcl@hotmail.com>
License: This is free and unencumbered software released into the public domain.
        
        Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
        
        In jurisdictions that recognize copyright laws, the author has dedicated any and all copyright and related rights to the public domain worldwide by waiving all of those rights to the extent possible.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
        
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: ipycanvas
Requires-Dist: ipywidgets
Requires-Dist: matplotlib
Requires-Dist: numpy==2.0.0
Requires-Dist: plotly
Requires-Dist: scikit-learn
Requires-Dist: scipy
Description-Content-Type: text/markdown

# Sketulate

**Sketulate** is a Python package for interactive function, surface, and density simulation directly in Jupyter notebooks. Draw functions, surfaces, or densities with your mouse, convert them into callable functions or density distributions, and simulate data for experiments, modeling, or teaching.

## Features

- Sketch univariate functions interactively (`Sketulate`)  
- Sketch 2D surfaces / interactions effects (`SketulateInteraction`)  
- Sketch density distributions
- Generates easy to use functions and sampleable density distributions
- Works seamlessly in Jupyter Notebook
- Easy integration for synthetic data generation  

## Installation

```bash
pip install sketulate

## Quick Example
from sketulate import Sketulate, SketulateInteraction

# Draw a univariate function
f1 = Sketulate(x_min=0, x_max=10, y_min=-5, y_max=5)
f1.sketch()
```


![Sketch a Function](examples/images/draw_a_function.png)

``` bash
f1.accept(callback)  # After drawing, click Accept
# F1 is a now a ready to use function via
f1.f
# Or a custom density distribution (selected in the canvas dropdown) via
f1.g
```
![Sketch a Density](examples/images/draw_a_density.png)

``` bash
# Draw an interaction surface
f3 = SketulateInteraction(x_range=(0,10), y_range=(0,10), z_range=(-5,5), grid_size=5)
f3.sketch()  # Interactive surface with sliders
```

![Sketch Interaction Surface via Sliders](examples/images/interaction_surfaces.png)

#### Put it all together and easily simulate some data
![Sketch a Function](examples/images/simulate_data.png)


## Technical Note
For this version the sketches are modelled via piecewise linear basis functions using sklearn.
Interaction surfaces are modelled using the LinearND interpolator from scipy.
In addition, linear extrapolation is, by default, provided outside of the given ranges. Careful!


