Skip to main content

StarForm is a Python library to quickly develop clean modular models/pipelines.

Project description

Star Formation

Star Formation is a Python library to quickly develop clean modular models/pipelines. Geared towards usage with sklearn and keras.

Installation

Use the package manager pip to install foobar.

pip install starformation

Usage

import starformation as sf
#Create pipeline
bf = sf.Formation()
#star() return the input
s = sf.star()
#Add star
bf.add(s)
#returns [4]
bf.run(4)

add(s:star)

Add first star in formation or chain stars to the last added star.

Example: (x+1) * 3

import starformation as sf
from starformation.classic import CStar

bf = sf.Formation()
s = sf.star()
bf.add(CStar(lambda x: x+1))
bf.add(CStar(lambda x: x*3))
#returns [15]
bf.run(4)

link(s:star)

Add first star in formation or chain stars to the last added star.

Example: (x+1) * 3

import starformation as sf
from starformation.classic import CStar

bf = sf.Formation()
s = sf.star()
bf.add(CStar(lambda x: x+1))
bf.add(CStar(lambda x: x*3))
#returns [15]
bf.run(4)

Run(input, cores = none)

Input is fed into the first star. Cores specify how many processes.

Chain stars. Execution star.action() -> star2.action()

import starformation as sf

bf = sf.Formation()
s = sf.star()
bf.add(s)
bf.link(sf.star())
bf.link(sf.star())
bf.link(sf.star())
bf.link(sf.star())
#return [4,4,4,4]
bf.run("example",2)
#also return [4,4,4,4] but not multicore
bf.run("example")

CStar

Makes a custom function.

import starformation as sf
from starformation.classic import CStar

def add(x):
    return x+1

bf = sf.Formation()
bf.add(CStar(add))

#returns [5]
bf.run(4)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GPL

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

starform-0.0.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

starform-0.0.1-py3-none-any.whl (15.9 kB view hashes)

Uploaded 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