29
A Year of Pyxley My First Open Source Adventure

A Year of Pyxley: My First Open Source Adventure

Embed Size (px)

Citation preview

Page 1: A Year of Pyxley: My First Open Source Adventure

A Year of PyxleyMy First Open Source Adventure

Page 2: A Year of Pyxley: My First Open Source Adventure

What’s Pixley?A Stitch Fix Exclusive

Brand

Designed By Data Scientists!

http://multithreaded.stitchfix.com/blog/2016/07/14/data-driven-fashion-design/

Page 3: A Year of Pyxley: My First Open Source Adventure

What’s pyxley?

https://github.com/stitchfix/pyxley

Helpers and Widgets for Building Flask and React Powered Dashboards

Page 4: A Year of Pyxley: My First Open Source Adventure

Who Am I?

Data Scientist@ STITCH FIX

(Not a Front-End Engineer)

I Used to Kaggle…

Algorithm Development & Feature Engineering

Page 5: A Year of Pyxley: My First Open Source Adventure

In This TalkWhat Led to pyxley…

Lessons LearnedWhat I Thought Was Going To

Happen…What Actually Happened…

What’s next?

Page 6: A Year of Pyxley: My First Open Source Adventure

Stylists Pick 5 Items

Items Are Shipped to Clients

Clients Keep What They Want

and Return the Rest

How Stitch Fix Works

Stylist

Page 7: A Year of Pyxley: My First Open Source Adventure

Merch Algorithms @ Stitch Fixhttp://multithreaded.stitchfix.com/algorithms/

What Should We Buy?

When Should We Order More?

Do We Have the Right

Mix?

What Do We Throw Away?

Page 8: A Year of Pyxley: My First Open Source Adventure

So Many Web AppsWe Provide Insights to our Business Partners Through Web Applications

Page 9: A Year of Pyxley: My First Open Source Adventure

An Overview of Pyxley

Please Don’t Make Me Write

R

Page 10: A Year of Pyxley: My First Open Source Adventure

My First Flask AppReact UIFlask Application

React-BootstrapButtons

NVD3

@app.route(‘/get_data/’)

jsonify(data_as_dict)

PandasDataFrame

Page 11: A Year of Pyxley: My First Open Source Adventure

My First Flask App After Feature RequestsReact UIFlask Application

@app.route(‘/get_data/’)

jsonify(data_as_dict)

@app.route(‘/get_data/’)@app.route(‘/get_data/’)@app.route(‘/get_data/’)@app.route(‘/get_data/’)@app.route(‘/get_data/’)@app.route(‘/get_data/’)

jsonify(data_as_dict)jsonify(data_as_dict)jsonify(data_as_dict)jsonify(data_as_dict)jsonify(data_as_dict)jsonify(data_as_dict)

NVD3

React-BootstrapButtons

My Code Quickly Became a Mess

Page 12: A Year of Pyxley: My First Open Source Adventure

Inspired By Shiny ui.R defines

UI

Specify Filters

Specify Tables

…but I didn’t want to use Shiny

Page 13: A Year of Pyxley: My First Open Source Adventure

React UI

Filters

Flask Application

UIComponent

A Simple Abstraction

jsonify(data_as_dict)

PandasDataFrame

@app.route(‘/get_data/’) Charts

Components Handle Flask StuffSpecify JSON Output Format For Charts

Page 14: A Year of Pyxley: My First Open Source Adventure

Just a Bunch of WrappersOver the Course of a Week…

Decided on a JS

Pattern

Wrote Python

Wrappers

…but I Didn’t Write Any Documentation or Tests

Page 15: A Year of Pyxley: My First Open Source Adventure

Lesson #1: Don’t Plan For Zero Interest

No Docs, No Tests,

No Problems!

Page 16: A Year of Pyxley: My First Open Source Adventure

Releasing pyxleyWhat I Thought Would

Happen…

What Actually Happened…

Page 17: A Year of Pyxley: My First Open Source Adventure

So Many IssuesLots of Dependencies = Lots of Installation

Troubles

Page 18: A Year of Pyxley: My First Open Source Adventure

Lesson #2: Read Some Guides First

Python Open Source Basics

Did You Know PyPi Has a Test

Server?

Page 19: A Year of Pyxley: My First Open Source Adventure

What’s PyPi?

Conda Environments http://conda.pydata.org/docs/using/envs.html

or use virtualenvhttp://docs.python-guide.org/en/latest/dev/virtualenvs/

PyPI Quick and Dirtyhttps://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/

Open Sourcing a Python Package The Right Way (https://jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/)

Manage Package Dependencies

PyPI Tutorials

Page 20: A Year of Pyxley: My First Open Source Adventure

Lesson #3: Make Straightforward Examples (and Documentation!)

The code is the documentation,

right?

Page 21: A Year of Pyxley: My First Open Source Adventure

Datatables + Single UI Component +

Custom SVG

Multiple Charts

Custom React + NVD3

Datamaps + Slider

Page 22: A Year of Pyxley: My First Open Source Adventure

My Thought Process:

Show As Much Functionality In As Few Examples As Possible

User: How Do I Make a Table?

Why Are These Different?

Page 23: A Year of Pyxley: My First Open Source Adventure

Lesson #4: Make Sure It’s Something You Love

What’s “Free Time”?

Page 24: A Year of Pyxley: My First Open Source Adventure

Open Source = Collaboration, Right?What I was Hoping For…

Design Feedback

Widget Contributors

New Use Cases

Page 25: A Year of Pyxley: My First Open Source Adventure

Maintain pyxley

Hobbies

Exercise

Free Time?

pyxley often loses

Page 26: A Year of Pyxley: My First Open Source Adventure

The Bigger PictureAn Example Stitch Fix Web App

Flask Application

React UI

pyxley

S3

Spark ETL

Most of My Time is Spent Preparing Data(and Dashboards are a Small Part of My

Job)

Python (sklearn)

Recommendations

Raw Data

Features

Page 27: A Year of Pyxley: My First Open Source Adventure

JavaScript Skills After a Year of pyxley

Integrating With JavaScript Requires Constant Attention

In the last year…React has gone from version v0.13.x to

v15.3.0PyReact was deprecatedOther libraries have had big API changes

Page 28: A Year of Pyxley: My First Open Source Adventure

Summary and Next Steps

It’s Both Awesome and OverwhelmingThere will always be bugsThere will never be enough docs /

tests / examples

The Future of pyxleyTry to keep up with React (and JS in

general)Simplify the flask side of things

Maintaining an Open Source Project is an Adventure!

Page 29: A Year of Pyxley: My First Open Source Adventure

Nick KridlerTwitter: @nmkridlerGithub: nmkridler

github.com/stitchfix/pyxleypyxley.readthedocs.org

Images Taken From Final Fantasy VI & XIVSquare Enix & Yoshitaka Amano

Contact