oryxflow 26.6.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oryxflow-26.6.6/LICENSE +21 -0
- oryxflow-26.6.6/MANIFEST.in +2 -0
- oryxflow-26.6.6/PKG-INFO +256 -0
- oryxflow-26.6.6/README.md +206 -0
- oryxflow-26.6.6/oryxflow/__init__.py +1015 -0
- oryxflow-26.6.6/oryxflow/cache.py +1 -0
- oryxflow-26.6.6/oryxflow/core.py +633 -0
- oryxflow-26.6.6/oryxflow/functional.py +327 -0
- oryxflow-26.6.6/oryxflow/log.py +97 -0
- oryxflow-26.6.6/oryxflow/parameter.py +253 -0
- oryxflow-26.6.6/oryxflow/settings.py +26 -0
- oryxflow-26.6.6/oryxflow/targets/__init__.py +449 -0
- oryxflow-26.6.6/oryxflow/targets/dt.py +15 -0
- oryxflow-26.6.6/oryxflow/targets/h5.py +13 -0
- oryxflow-26.6.6/oryxflow/targets/tf.py +12 -0
- oryxflow-26.6.6/oryxflow/targets/torch.py +37 -0
- oryxflow-26.6.6/oryxflow/tasks/__init__.py +560 -0
- oryxflow-26.6.6/oryxflow/tasks/dt.py +10 -0
- oryxflow-26.6.6/oryxflow/tasks/h5.py +9 -0
- oryxflow-26.6.6/oryxflow/tasks/tf.py +9 -0
- oryxflow-26.6.6/oryxflow/tasks/torch.py +10 -0
- oryxflow-26.6.6/oryxflow/utils.py +194 -0
- oryxflow-26.6.6/oryxflow.egg-info/PKG-INFO +256 -0
- oryxflow-26.6.6/oryxflow.egg-info/SOURCES.txt +32 -0
- oryxflow-26.6.6/oryxflow.egg-info/dependency_links.txt +1 -0
- oryxflow-26.6.6/oryxflow.egg-info/requires.txt +23 -0
- oryxflow-26.6.6/oryxflow.egg-info/top_level.txt +1 -0
- oryxflow-26.6.6/setup.cfg +4 -0
- oryxflow-26.6.6/setup.py +50 -0
- oryxflow-26.6.6/tests/test_main.py +841 -0
- oryxflow-26.6.6/tests/test_runresult.py +136 -0
- oryxflow-26.6.6/tests/test_workflow.py +963 -0
- oryxflow-26.6.6/tests/test_workflowMulti.py +359 -0
- oryxflow-26.6.6/tests/test_workflowMulti2.py +152 -0
oryxflow-26.6.6/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oryx Intelligence LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
oryxflow-26.6.6/PKG-INFO
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: oryxflow
|
|
3
|
+
Version: 26.6.6
|
|
4
|
+
Summary: For data scientists and data engineers, oryxflow is a python library which makes building complex data science workflows easy, fast and intuitive.
|
|
5
|
+
Home-page: https://github.com/oryxintel/oryxflow
|
|
6
|
+
Author: Oryx Intelligence LLC
|
|
7
|
+
Author-email: dev@oryxintel.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: oryxflow,data workflow,data pipelines
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
|
+
Requires-Python: >=3.5
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: pandas
|
|
20
|
+
Requires-Dist: pyarrow
|
|
21
|
+
Requires-Dist: markdown
|
|
22
|
+
Requires-Dist: openpyxl
|
|
23
|
+
Requires-Dist: loguru
|
|
24
|
+
Provides-Extra: dask
|
|
25
|
+
Requires-Dist: toolz; extra == "dask"
|
|
26
|
+
Requires-Dist: dask[dataframe]; extra == "dask"
|
|
27
|
+
Provides-Extra: cloud-base
|
|
28
|
+
Requires-Dist: universal_pathlib; extra == "cloud-base"
|
|
29
|
+
Provides-Extra: gcs
|
|
30
|
+
Requires-Dist: gcsfs; extra == "gcs"
|
|
31
|
+
Requires-Dist: universal_pathlib; extra == "gcs"
|
|
32
|
+
Provides-Extra: s3
|
|
33
|
+
Requires-Dist: s3fs; extra == "s3"
|
|
34
|
+
Requires-Dist: universal_pathlib; extra == "s3"
|
|
35
|
+
Provides-Extra: export
|
|
36
|
+
Requires-Dist: jinja2; extra == "export"
|
|
37
|
+
Dynamic: author
|
|
38
|
+
Dynamic: author-email
|
|
39
|
+
Dynamic: classifier
|
|
40
|
+
Dynamic: description
|
|
41
|
+
Dynamic: description-content-type
|
|
42
|
+
Dynamic: home-page
|
|
43
|
+
Dynamic: keywords
|
|
44
|
+
Dynamic: license
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
Dynamic: provides-extra
|
|
47
|
+
Dynamic: requires-dist
|
|
48
|
+
Dynamic: requires-python
|
|
49
|
+
Dynamic: summary
|
|
50
|
+
|
|
51
|
+
# oryxflow
|
|
52
|
+
|
|
53
|
+
For data scientists and data engineers, `oryxflow` is a python library which makes building complex data science workflows easy, fast and intuitive. It is **primarily designed for data scientists to build better models faster**. For data engineers, it can also be a lightweight alternative and help productionize data science models faster. Unlike other data pipeline/workflow solutions, `oryxflow` focuses on managing data science research workflows instead of managing production data pipelines.
|
|
54
|
+
|
|
55
|
+
## Why use oryxflow?
|
|
56
|
+
|
|
57
|
+
Data science workflows typically look like this.
|
|
58
|
+
|
|
59
|
+

|
|
60
|
+
|
|
61
|
+
The workflow involves chaining together parameterized tasks which pass multiple inputs and outputs between each other. The output data gets stored in multiple dataframes, files and databases but you have to manually keep track of where everything is. And often you want to rerun tasks with different parameters without inadvertently rerunning long-running tasks. The workflows get complex and your code gets messy, difficult to audit and doesn't scale well.
|
|
62
|
+
|
|
63
|
+
`oryxflow` to the rescue! **With oryxflow you can easily chain together complex data flows and execute them. You can quickly load input and output data for each task.** It makes your workflow very clear and intuitive.
|
|
64
|
+
|
|
65
|
+
#### Read more at:
|
|
66
|
+
[4 Reasons Why Your Machine Learning Code is Probably Bad](https://github.com/d6t/d6t-python/blob/master/blogs/reasons-why-bad-ml-code.rst)
|
|
67
|
+
[How oryxflow is different from airflow/luigi](https://github.com/d6t/d6t-python/blob/master/blogs/datasci-dags-airflow-meetup.md)
|
|
68
|
+
|
|
69
|
+

|
|
70
|
+

|
|
71
|
+
|
|
72
|
+
## When to use oryxflow?
|
|
73
|
+
|
|
74
|
+
* Data science: you want to build better models faster. Your workflow is EDA, feature engineering, model training and evaluation. oryxflow works with ANY ML library including sklearn, pytorch, keras
|
|
75
|
+
* Data engineering: you want to build robust data pipelines using a lightweight yet powerful library. You workflow is load, filter, transform, join data in pandas, dask, pyspark, sql, athena
|
|
76
|
+
|
|
77
|
+
## What can oryxflow do for you?
|
|
78
|
+
|
|
79
|
+
* Data science
|
|
80
|
+
* Experiment management: easily manage workflows that compare different models to find the best one
|
|
81
|
+
* Scalable workflows: build an efficient data workflow that support rapid prototyping and iterations
|
|
82
|
+
* Cache data: easily save/load intermediary calculations to reduce model training time
|
|
83
|
+
* Model deployment: oryxflow workflows are easier to deploy to production
|
|
84
|
+
* Data engineering
|
|
85
|
+
* Build a data workflow made up of tasks with dependencies and parameters
|
|
86
|
+
* Visualize task dependencies and their execution status
|
|
87
|
+
* Execute tasks including dependencies
|
|
88
|
+
* Intelligently continue workflows after failed tasks
|
|
89
|
+
* Intelligently rerun workflow after changing parameters, code or data
|
|
90
|
+
* Quickly share and hand off output data to others
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## Installation
|
|
94
|
+
|
|
95
|
+
Install with `pip install oryxflow`. To update, run `pip install oryxflow -U`.
|
|
96
|
+
|
|
97
|
+
If you are behind an enterprise firewall, you can also clone/download the repo and run `pip install .`
|
|
98
|
+
|
|
99
|
+
**Python3 only** You might need to call `pip3 install oryxflow` if you have not set python 3 as default.
|
|
100
|
+
|
|
101
|
+
To install latest DEV `pip install git+git://github.com/oryxintel/oryxflow.git` or upgrade `pip install git+git://github.com/oryxintel/oryxflow.git -U --no-deps`
|
|
102
|
+
|
|
103
|
+
## Claude Code plugin
|
|
104
|
+
|
|
105
|
+
Build oryxflow workflows faster with AI assistance. The [oryxflow Claude Code plugin](https://github.com/oryxintel/oryxflow-claude-plugin) adds a skill that auto-activates when you edit pipeline files (`tasks.py`, `flow.py`, `run.py`) plus slash commands to scaffold and manage projects:
|
|
106
|
+
|
|
107
|
+
* `/oryxflow:init-project` – scaffold a new oryxflow project from templates
|
|
108
|
+
* `/oryxflow:init-gitlfs` – set up Git LFS to version data outputs (see [Sharing data](#sharing-data))
|
|
109
|
+
* `/oryxflow:oryxflow` – manually invoke the skill (optional; it auto-activates on pipeline files)
|
|
110
|
+
|
|
111
|
+
Install in [Claude Code](https://claude.com/claude-code):
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
/plugin marketplace add oryxintel/oryxflow-claude-plugin
|
|
115
|
+
/plugin install oryxflow@oryxflow
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
See the [plugin repo](https://github.com/oryxintel/oryxflow-claude-plugin) for more details.
|
|
119
|
+
|
|
120
|
+
## Example: Model Comparison
|
|
121
|
+
|
|
122
|
+
Below is an introductory example that gets training data, trains two models and compares their performance.
|
|
123
|
+
|
|
124
|
+
**[See the full ML workflow example here](http://tiny.cc/d6tflow-start-example)**
|
|
125
|
+
**[Interactive mybinder jupyter notebook](http://tiny.cc/d6tflow-start-interactive)**
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
|
|
129
|
+
import oryxflow
|
|
130
|
+
import sklearn.datasets, sklearn.ensemble, sklearn.linear_model
|
|
131
|
+
import pandas as pd
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# get training data and save it
|
|
135
|
+
class GetData(oryxflow.tasks.TaskPqPandas):
|
|
136
|
+
persists = ['x','y']
|
|
137
|
+
|
|
138
|
+
def run(self):
|
|
139
|
+
ds = sklearn.datasets.load_boston()
|
|
140
|
+
df_trainX = pd.DataFrame(ds.data, columns=ds.feature_names)
|
|
141
|
+
df_trainY = pd.DataFrame(ds.target, columns=['target'])
|
|
142
|
+
self.save({'x': df_trainX, 'y': df_trainY}) # persist/cache training data
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
# train different models to compare
|
|
146
|
+
@oryxflow.requires(GetData) # define dependency
|
|
147
|
+
class ModelTrain(oryxflow.tasks.TaskPickle):
|
|
148
|
+
model = oryxflow.Parameter() # parameter for model selection
|
|
149
|
+
|
|
150
|
+
def run(self):
|
|
151
|
+
df_trainX, df_trainY = self.inputLoad() # quickly load input data
|
|
152
|
+
|
|
153
|
+
if self.model=='ols': # select model based on parameter
|
|
154
|
+
model = sklearn.linear_model.LinearRegression()
|
|
155
|
+
elif self.model=='gbm':
|
|
156
|
+
model = sklearn.ensemble.GradientBoostingRegressor()
|
|
157
|
+
|
|
158
|
+
# fit and save model with training score
|
|
159
|
+
model.fit(df_trainX, df_trainY)
|
|
160
|
+
self.save(model) # persist/cache model
|
|
161
|
+
self.saveMeta({'score': model.score(df_trainX, df_trainY)}) # save model score
|
|
162
|
+
|
|
163
|
+
# goal: compare performance of two models
|
|
164
|
+
# define workflow manager
|
|
165
|
+
flow = oryxflow.WorkflowMulti(ModelTrain, {'model1':{'model':'ols'}, 'model2':{'model':'gbm'}})
|
|
166
|
+
flow.reset_upstream(confirm=False) # DEMO ONLY: force re-run
|
|
167
|
+
flow.run() # execute model training including all dependencies
|
|
168
|
+
|
|
169
|
+
'''
|
|
170
|
+
Scheduled 2 tasks
|
|
171
|
+
* 2 ran successfully
|
|
172
|
+
* 0 complete
|
|
173
|
+
* 0 failed
|
|
174
|
+
'''
|
|
175
|
+
|
|
176
|
+
scores = flow.outputLoadMeta() # load model scores
|
|
177
|
+
print(scores)
|
|
178
|
+
# {'model1': {'score': 0.7406426641094095}, 'gbm': {'model2': 0.9761405838418584}}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
## Example Library
|
|
185
|
+
|
|
186
|
+
* [Minimal example](https://github.com/oryxintel/oryxflow/blob/master/docs/example-minimal.py)
|
|
187
|
+
* [Rapid Prototyping for Quantitative Investing with oryxflow](https://github.com/d6tdev/d6tflow-binder-interactive/blob/master/example-trading.ipynb)
|
|
188
|
+
* oryxflow with functions only: get the power of oryxflow with little change in code. **[Jupyter notebook example](https://github.com/oryxintel/oryxflow/blob/master/docs/example-functional.ipynb)**
|
|
189
|
+
|
|
190
|
+
## Documentation
|
|
191
|
+
|
|
192
|
+
Library usage and reference https://oryxflow.readthedocs.io
|
|
193
|
+
|
|
194
|
+
## Getting started resources
|
|
195
|
+
|
|
196
|
+
[Transition to oryxflow from typical scripts](https://oryxflow.readthedocs.io/en/latest/transition.html)
|
|
197
|
+
|
|
198
|
+
[5 Step Guide to Scalable Deep Learning Pipelines with oryxflow](https://htmlpreview.github.io/?https://github.com/d6t/d6t-python/blob/master/blogs/blog-20190813-d6tflow-pytorch.html)
|
|
199
|
+
|
|
200
|
+
[Data science project starter templates](https://github.com/d6t/d6tflow-template)
|
|
201
|
+
|
|
202
|
+
# Sharing data
|
|
203
|
+
|
|
204
|
+
By default data gets written to `data/` which is gitignored to avoid writing large files to source control.
|
|
205
|
+
|
|
206
|
+
To source control you can use git lfs to dvc.
|
|
207
|
+
|
|
208
|
+
## Git lfs
|
|
209
|
+
|
|
210
|
+
1. Install the LFS extension (once per machine)
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
winget install GitHub.GitLFS # or: choco install git-lfs
|
|
214
|
+
git lfs install # hooks LFS into your git config
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
2. adjust .gitignore to track `data/` and `reports/render`
|
|
218
|
+
|
|
219
|
+
3. Tell LFS which files to track
|
|
220
|
+
```shell
|
|
221
|
+
git lfs track "data/**"
|
|
222
|
+
git lfs track "reports/render/**"
|
|
223
|
+
git lfs track "*.ipynb"
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
4. commit `.gitattributes` and `.gitignore`
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
## Pro version
|
|
230
|
+
|
|
231
|
+
Additional features:
|
|
232
|
+
* Team sharing of workflows and data
|
|
233
|
+
* Integrations for datbase and cloud storage (SQL, S3)
|
|
234
|
+
* Integrations for distributed compute (dask, pyspark)
|
|
235
|
+
* Integrations for cloud execution (athena)
|
|
236
|
+
* Workflow deployment and scheduling
|
|
237
|
+
|
|
238
|
+
[Schedule demo](https://calendar.app.google/FkNWJE9u7QuowfH89)
|
|
239
|
+
|
|
240
|
+
## Accelerate Data Science
|
|
241
|
+
|
|
242
|
+
Check out other d6t libraries, including
|
|
243
|
+
* import data: quickly ingest messy raw CSV and XLS files to pandas, SQL and more
|
|
244
|
+
* join data: quickly combine multiple datasets using fuzzy joins
|
|
245
|
+
|
|
246
|
+
https://github.com/d6t/d6t-python
|
|
247
|
+
|
|
248
|
+
## How To Contribute
|
|
249
|
+
|
|
250
|
+
Thank you for considering to contribute to the project. First, fork the code repository and then pick an issue that is open. Afterwards follow these steps
|
|
251
|
+
* Create a branch called \[issue_no\]\_yyyymmdd\_\[feature\]
|
|
252
|
+
* Implement the feature
|
|
253
|
+
* Write unit tests for the desired behaviour
|
|
254
|
+
* Create a pull request to merge branch with master
|
|
255
|
+
|
|
256
|
+
A similar workflow applies to bug-fixes as well. In the case of a fix, just change the feature name with the bug-fix name. And make sure the code passes already written unit tests.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# oryxflow
|
|
2
|
+
|
|
3
|
+
For data scientists and data engineers, `oryxflow` is a python library which makes building complex data science workflows easy, fast and intuitive. It is **primarily designed for data scientists to build better models faster**. For data engineers, it can also be a lightweight alternative and help productionize data science models faster. Unlike other data pipeline/workflow solutions, `oryxflow` focuses on managing data science research workflows instead of managing production data pipelines.
|
|
4
|
+
|
|
5
|
+
## Why use oryxflow?
|
|
6
|
+
|
|
7
|
+
Data science workflows typically look like this.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
The workflow involves chaining together parameterized tasks which pass multiple inputs and outputs between each other. The output data gets stored in multiple dataframes, files and databases but you have to manually keep track of where everything is. And often you want to rerun tasks with different parameters without inadvertently rerunning long-running tasks. The workflows get complex and your code gets messy, difficult to audit and doesn't scale well.
|
|
12
|
+
|
|
13
|
+
`oryxflow` to the rescue! **With oryxflow you can easily chain together complex data flows and execute them. You can quickly load input and output data for each task.** It makes your workflow very clear and intuitive.
|
|
14
|
+
|
|
15
|
+
#### Read more at:
|
|
16
|
+
[4 Reasons Why Your Machine Learning Code is Probably Bad](https://github.com/d6t/d6t-python/blob/master/blogs/reasons-why-bad-ml-code.rst)
|
|
17
|
+
[How oryxflow is different from airflow/luigi](https://github.com/d6t/d6t-python/blob/master/blogs/datasci-dags-airflow-meetup.md)
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
## When to use oryxflow?
|
|
23
|
+
|
|
24
|
+
* Data science: you want to build better models faster. Your workflow is EDA, feature engineering, model training and evaluation. oryxflow works with ANY ML library including sklearn, pytorch, keras
|
|
25
|
+
* Data engineering: you want to build robust data pipelines using a lightweight yet powerful library. You workflow is load, filter, transform, join data in pandas, dask, pyspark, sql, athena
|
|
26
|
+
|
|
27
|
+
## What can oryxflow do for you?
|
|
28
|
+
|
|
29
|
+
* Data science
|
|
30
|
+
* Experiment management: easily manage workflows that compare different models to find the best one
|
|
31
|
+
* Scalable workflows: build an efficient data workflow that support rapid prototyping and iterations
|
|
32
|
+
* Cache data: easily save/load intermediary calculations to reduce model training time
|
|
33
|
+
* Model deployment: oryxflow workflows are easier to deploy to production
|
|
34
|
+
* Data engineering
|
|
35
|
+
* Build a data workflow made up of tasks with dependencies and parameters
|
|
36
|
+
* Visualize task dependencies and their execution status
|
|
37
|
+
* Execute tasks including dependencies
|
|
38
|
+
* Intelligently continue workflows after failed tasks
|
|
39
|
+
* Intelligently rerun workflow after changing parameters, code or data
|
|
40
|
+
* Quickly share and hand off output data to others
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
Install with `pip install oryxflow`. To update, run `pip install oryxflow -U`.
|
|
46
|
+
|
|
47
|
+
If you are behind an enterprise firewall, you can also clone/download the repo and run `pip install .`
|
|
48
|
+
|
|
49
|
+
**Python3 only** You might need to call `pip3 install oryxflow` if you have not set python 3 as default.
|
|
50
|
+
|
|
51
|
+
To install latest DEV `pip install git+git://github.com/oryxintel/oryxflow.git` or upgrade `pip install git+git://github.com/oryxintel/oryxflow.git -U --no-deps`
|
|
52
|
+
|
|
53
|
+
## Claude Code plugin
|
|
54
|
+
|
|
55
|
+
Build oryxflow workflows faster with AI assistance. The [oryxflow Claude Code plugin](https://github.com/oryxintel/oryxflow-claude-plugin) adds a skill that auto-activates when you edit pipeline files (`tasks.py`, `flow.py`, `run.py`) plus slash commands to scaffold and manage projects:
|
|
56
|
+
|
|
57
|
+
* `/oryxflow:init-project` – scaffold a new oryxflow project from templates
|
|
58
|
+
* `/oryxflow:init-gitlfs` – set up Git LFS to version data outputs (see [Sharing data](#sharing-data))
|
|
59
|
+
* `/oryxflow:oryxflow` – manually invoke the skill (optional; it auto-activates on pipeline files)
|
|
60
|
+
|
|
61
|
+
Install in [Claude Code](https://claude.com/claude-code):
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
/plugin marketplace add oryxintel/oryxflow-claude-plugin
|
|
65
|
+
/plugin install oryxflow@oryxflow
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
See the [plugin repo](https://github.com/oryxintel/oryxflow-claude-plugin) for more details.
|
|
69
|
+
|
|
70
|
+
## Example: Model Comparison
|
|
71
|
+
|
|
72
|
+
Below is an introductory example that gets training data, trains two models and compares their performance.
|
|
73
|
+
|
|
74
|
+
**[See the full ML workflow example here](http://tiny.cc/d6tflow-start-example)**
|
|
75
|
+
**[Interactive mybinder jupyter notebook](http://tiny.cc/d6tflow-start-interactive)**
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
|
|
79
|
+
import oryxflow
|
|
80
|
+
import sklearn.datasets, sklearn.ensemble, sklearn.linear_model
|
|
81
|
+
import pandas as pd
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# get training data and save it
|
|
85
|
+
class GetData(oryxflow.tasks.TaskPqPandas):
|
|
86
|
+
persists = ['x','y']
|
|
87
|
+
|
|
88
|
+
def run(self):
|
|
89
|
+
ds = sklearn.datasets.load_boston()
|
|
90
|
+
df_trainX = pd.DataFrame(ds.data, columns=ds.feature_names)
|
|
91
|
+
df_trainY = pd.DataFrame(ds.target, columns=['target'])
|
|
92
|
+
self.save({'x': df_trainX, 'y': df_trainY}) # persist/cache training data
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# train different models to compare
|
|
96
|
+
@oryxflow.requires(GetData) # define dependency
|
|
97
|
+
class ModelTrain(oryxflow.tasks.TaskPickle):
|
|
98
|
+
model = oryxflow.Parameter() # parameter for model selection
|
|
99
|
+
|
|
100
|
+
def run(self):
|
|
101
|
+
df_trainX, df_trainY = self.inputLoad() # quickly load input data
|
|
102
|
+
|
|
103
|
+
if self.model=='ols': # select model based on parameter
|
|
104
|
+
model = sklearn.linear_model.LinearRegression()
|
|
105
|
+
elif self.model=='gbm':
|
|
106
|
+
model = sklearn.ensemble.GradientBoostingRegressor()
|
|
107
|
+
|
|
108
|
+
# fit and save model with training score
|
|
109
|
+
model.fit(df_trainX, df_trainY)
|
|
110
|
+
self.save(model) # persist/cache model
|
|
111
|
+
self.saveMeta({'score': model.score(df_trainX, df_trainY)}) # save model score
|
|
112
|
+
|
|
113
|
+
# goal: compare performance of two models
|
|
114
|
+
# define workflow manager
|
|
115
|
+
flow = oryxflow.WorkflowMulti(ModelTrain, {'model1':{'model':'ols'}, 'model2':{'model':'gbm'}})
|
|
116
|
+
flow.reset_upstream(confirm=False) # DEMO ONLY: force re-run
|
|
117
|
+
flow.run() # execute model training including all dependencies
|
|
118
|
+
|
|
119
|
+
'''
|
|
120
|
+
Scheduled 2 tasks
|
|
121
|
+
* 2 ran successfully
|
|
122
|
+
* 0 complete
|
|
123
|
+
* 0 failed
|
|
124
|
+
'''
|
|
125
|
+
|
|
126
|
+
scores = flow.outputLoadMeta() # load model scores
|
|
127
|
+
print(scores)
|
|
128
|
+
# {'model1': {'score': 0.7406426641094095}, 'gbm': {'model2': 0.9761405838418584}}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## Example Library
|
|
135
|
+
|
|
136
|
+
* [Minimal example](https://github.com/oryxintel/oryxflow/blob/master/docs/example-minimal.py)
|
|
137
|
+
* [Rapid Prototyping for Quantitative Investing with oryxflow](https://github.com/d6tdev/d6tflow-binder-interactive/blob/master/example-trading.ipynb)
|
|
138
|
+
* oryxflow with functions only: get the power of oryxflow with little change in code. **[Jupyter notebook example](https://github.com/oryxintel/oryxflow/blob/master/docs/example-functional.ipynb)**
|
|
139
|
+
|
|
140
|
+
## Documentation
|
|
141
|
+
|
|
142
|
+
Library usage and reference https://oryxflow.readthedocs.io
|
|
143
|
+
|
|
144
|
+
## Getting started resources
|
|
145
|
+
|
|
146
|
+
[Transition to oryxflow from typical scripts](https://oryxflow.readthedocs.io/en/latest/transition.html)
|
|
147
|
+
|
|
148
|
+
[5 Step Guide to Scalable Deep Learning Pipelines with oryxflow](https://htmlpreview.github.io/?https://github.com/d6t/d6t-python/blob/master/blogs/blog-20190813-d6tflow-pytorch.html)
|
|
149
|
+
|
|
150
|
+
[Data science project starter templates](https://github.com/d6t/d6tflow-template)
|
|
151
|
+
|
|
152
|
+
# Sharing data
|
|
153
|
+
|
|
154
|
+
By default data gets written to `data/` which is gitignored to avoid writing large files to source control.
|
|
155
|
+
|
|
156
|
+
To source control you can use git lfs to dvc.
|
|
157
|
+
|
|
158
|
+
## Git lfs
|
|
159
|
+
|
|
160
|
+
1. Install the LFS extension (once per machine)
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
winget install GitHub.GitLFS # or: choco install git-lfs
|
|
164
|
+
git lfs install # hooks LFS into your git config
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
2. adjust .gitignore to track `data/` and `reports/render`
|
|
168
|
+
|
|
169
|
+
3. Tell LFS which files to track
|
|
170
|
+
```shell
|
|
171
|
+
git lfs track "data/**"
|
|
172
|
+
git lfs track "reports/render/**"
|
|
173
|
+
git lfs track "*.ipynb"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
4. commit `.gitattributes` and `.gitignore`
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
## Pro version
|
|
180
|
+
|
|
181
|
+
Additional features:
|
|
182
|
+
* Team sharing of workflows and data
|
|
183
|
+
* Integrations for datbase and cloud storage (SQL, S3)
|
|
184
|
+
* Integrations for distributed compute (dask, pyspark)
|
|
185
|
+
* Integrations for cloud execution (athena)
|
|
186
|
+
* Workflow deployment and scheduling
|
|
187
|
+
|
|
188
|
+
[Schedule demo](https://calendar.app.google/FkNWJE9u7QuowfH89)
|
|
189
|
+
|
|
190
|
+
## Accelerate Data Science
|
|
191
|
+
|
|
192
|
+
Check out other d6t libraries, including
|
|
193
|
+
* import data: quickly ingest messy raw CSV and XLS files to pandas, SQL and more
|
|
194
|
+
* join data: quickly combine multiple datasets using fuzzy joins
|
|
195
|
+
|
|
196
|
+
https://github.com/d6t/d6t-python
|
|
197
|
+
|
|
198
|
+
## How To Contribute
|
|
199
|
+
|
|
200
|
+
Thank you for considering to contribute to the project. First, fork the code repository and then pick an issue that is open. Afterwards follow these steps
|
|
201
|
+
* Create a branch called \[issue_no\]\_yyyymmdd\_\[feature\]
|
|
202
|
+
* Implement the feature
|
|
203
|
+
* Write unit tests for the desired behaviour
|
|
204
|
+
* Create a pull request to merge branch with master
|
|
205
|
+
|
|
206
|
+
A similar workflow applies to bug-fixes as well. In the case of a fix, just change the feature name with the bug-fix name. And make sure the code passes already written unit tests.
|