Skip to main content

A library for computing samplings in arbitrary dimensions

Project description

PyPi

Function Library for Analysis and Testing in Python - A collection of scalar functions (many of which generalize to arbitrary dimensions) typically used in global optimization problems, but also suitable for various other test cases.

Working on several different applications with scalar field topology, active learning, and optimization, I have found myself programming and reprogramming a core set of often cited test functions. In addition, I have found the need to modify or tweak some of these functions while also generating completely novel functions that exhibit some specified behavior. This work is an attempt to consolidate those functions and offer them in a reusable fashion in a simple python library with some nice recipes/utilities such as generating a test 2D grid of data, adding noise to the functions, etc.

Installation

A preliminary version is available on PyPI:

pip install flatpy

Otherwise, you can download the repository for the most cutting edge additions:

git clone https://github.com/maljovec/flatpy.git
cd flatpy
python setup.py [build|develop|install]

Usage

import flatpy
import matplotlib.pyplot as plt

X = flatpy.utils.generate_test_grid_2d(40)
x, y = flatpy.utils.unpack2D(X)
z = flatpy.nD.schwefel(X)
plt.figure()
img = plt.tricontourf(x, y, z, cmap="cividis")
plt.colorbar(img)
plt.show()
flatpy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flatpy-0.0.4.tar.gz (1.4 MB view hashes)

Uploaded Source

Built Distribution

flatpy-0.0.4-py2.py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page