santinic / pampy

Pampy: The Pattern Matching for Python you always dreamed of.
MIT License
3.52k stars 125 forks source link

Interactive demo for `pampy` code examples #9

Closed martinzugnoni closed 5 years ago

martinzugnoni commented 5 years ago

Hello @santinic,

I'm following pampy since a few weeks and I really like what you guys have built. The concept is really cool, and it's incredible how simple your solution was. We've even started using it to teach our students at https://rmotr.com/ (co-founder and teacher here).

While looking at the code examples in the README file I thought it would be great to provide some interactive demo that people can use to play with the library before committing to download and install it locally.

A demo is worth a thousand words 😉

I spent some time compiling all pampy examples into a Jupyter Notebook file, and adapted it in a way that we can open it with a small service we have at RMOTR to launch Jupyter environments online. No account or subscription required to use it, so it's pretty convenient for people that wants to get hands on the library with a low entrance barrier.

The result is what you can see in my fork of the repo (see the new "Demo" section): https://github.com/martinzugnoni/pampy

Do you agree that having such interactive demo would help people to know and use pampy? Let's use this issue as a kick off to start a discussion. Nothing here is written in stone and we can change everything as you wish.

I hope you guys like it, and I truly appreciate any feedback.

thanks.

saulshanabrook commented 5 years ago

I think that's a great idea! Another idea is to use binder to host an interactive server.

martinzugnoni commented 5 years ago

that's true, @saulshanabrook. binder could also be an option, but as far as I know it doesn't allow to automatically install third party libraries (like pampy) when you launch a Jupyter environment. The user would need to install it manually him/herself.

saulshanabrook commented 5 years ago

@martinzugnoni The repository you launch from can specify custom build options for binder to use to build a custom image, see https://mybinder.readthedocs.io/en/latest/using.html#launching-your-binder

For example, I believe you could add a binder/requirements.txt file in this repo that contained pampy and then that would be installed.

martinzugnoni commented 5 years ago

Oh, that's new to me. Looks good as well. In that case both systems would work. The main difference I see now is old Jupyter Notebooks UI vs. JupyterLab. There could also be links to both options and let the user decide which one to use.

martinzugnoni commented 5 years ago

@saulshanabrook, if you confirm me I can move forward and open a PR with the Notebooks integration right away at least to have a first interactive demo up and running. Then we can work together and see how we can also integrate it with Binder so we have some diversity. What do you think?

saulshanabrook commented 5 years ago

@martinzugnoni that sounds like a good approach! I haven't actually worked on this project at all, just chiming in here to share my opinion :D I work on JupyterLab mostly, that's why I have used this binder workflow before.

I am gappy to give you feedback if want any if you try adding a binder setup for this repo.

martinzugnoni commented 5 years ago

@saulshanabrook I've just created a PR (https://github.com/santinic/pampy/pull/25). Let's keep the discussion there.