Metadata-Version: 2.3
Name: uncharted
Version: 0.1.0
Summary: Black box explorer
Author-email: Alan Sanders <asanders@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2024 Alan Sanders
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        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. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: loguru>=0.7.2
Requires-Dist: numpy>=2.1.1
Requires-Dist: scipy>=1.14.0
Provides-Extra: examples
Requires-Dist: ipykernel>=6.29.5; extra == 'examples'
Requires-Dist: matplotlib>=3.9.2; extra == 'examples'
Requires-Dist: tqdm>=4.66.5; extra == 'examples'
Description-Content-Type: text/markdown

# Uncharted: A package for exploring parameter spaces of functions

Uncharted provides a framework for exploring a function's parameter space using a variety of sampling algorithms, such as grid sampling, random sampling, or attempting to optimally sample the space by varying the local sampling density and minimizing the number of samples.

For many applications there exist computationally expensive functions or calculations, where one cannot expect the necessarily know the underlying structure of their parameter spaces. In these instances simple sampling methods such as grid sampling may either oversample the function (resulting in slower data acquisition times and increased storage requirements) or undersample it (resulting in inaccuracies such as aliasing or missing critical features). The aim of `uncharted` is to provide a means of efficiently exploring such parameter spaces in ways that minimize the total number of samples.

## Installation

To install the latest release:
```shell
pip install uncharted
```

## Quick-start guide

Assuming you have some function `f(x)` that you wish to explore where `x: NDArray[(n,)]` is an nD parameter space, this can be explored using
```python
from uncharted import Explorer, Parameter
from uncharted.samplers import RandomSampler

params = (Parameter(0, 2), ..., Parameter(-1, 1))  # define the parameter space as a sequence of Parameters
explorer = Explorer(params=params, sampler=RandomSampler())  # instantiate an Explorer on the space
results = explorer.explore(f, n=100)  # explore the space using the requested sampler up to 100 points
```

For more control over sampling using the ask-and-tell interface:
```python
from uncharted import EarlyTermination

for _ in range(n):
    x = explorer.ask(m)  # ask the assigned sampler for m samples to explore
    # x is an array of shape (m, n) - assume f is vectorized to handle this in this example
    y = f(x)  # compute the values at these points
    # assuming f is vectorized and has scalar output y will have shape (m,)
    try:
        explorer.tell(x, y)  # tell the explorer the values
    except EarlyTermination:  # if sufficient confidence has been achieved in
        break
results = explorer.results
```

## Reference documentation

For details about the uncharted API, see []().

## Citing Uncharted

To cite this repository:

```bibtex
@software{uncharted2024github,
  author = {Alan Sanders},
  title = {{Uncharted}: A package for exploring parameter spaces of functions},
  url = {http://github.com/asanders/uncharted},
  version = {0.1.0},
  year = {2024},
}
```
