Star Formation 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file starformation-0.0.3.tar.gz.
File metadata
- Download URL: starformation-0.0.3.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.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da44172e7e35978932796acfc62eadf8d944188ddd9b212d37f3f0c26d2815f2
|
|
| MD5 |
498f6b6ccac62c79f1c9f4145cf910b1
|
|
| BLAKE2b-256 |
ce732ad59986edba3bb45b0a470c682e16f8140bba844d714ccdc2d9b1ffc206
|
File details
Details for the file starformation-0.0.3-py3-none-any.whl.
File metadata
- Download URL: starformation-0.0.3-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b81acac499a18db172d52c51b6efccde7435b0ed4fb56cd6ebb6fe9f4a37593f
|
|
| MD5 |
9f2f640290cd90e8d6317f6c3d2d1458
|
|
| BLAKE2b-256 |
8ff216cf285a08b834223ac47766c2f9bf99e2e80fd64da1c700726889bf3daa
|