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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file starform-0.0.1.tar.gz.

File metadata

  • Download URL: starform-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for starform-0.0.1.tar.gz
Algorithm Hash digest
SHA256 908bb5d634dc209670c32c1c2014baf44f63c08cea9bfd9af01bc356f21610c2
MD5 7d6e819b1e622ee7973f5df0e89174c8
BLAKE2b-256 c3714f87fc0afce56e1a1e1b69d708af859ed924284198bcd1e5a37bb84018dc

See more details on using hashes here.

File details

Details for the file starform-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: starform-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for starform-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b23ee9b5f68bbf43be561f508c74525a732c53d73a411bd6f4984f36284ad75b
MD5 d3137ae1804efc53bb4cfadac0d52e8e
BLAKE2b-256 185ed86514782bd70ecc8f33457bd0a5c4dcd7ec506aa53fe260737e645c20be

See more details on using hashes here.

Supported by

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