tolgaatam / ColabTurtle

An HTML based Turtle implementation, in order to work in Google Colab
MIT License
55 stars 30 forks source link

Extending ColabTurtle #11

Closed mathriddle closed 2 years ago

mathriddle commented 3 years ago

I wanted to thank you again for your work on developing ColabTurtle. I began using it last March to help prepare some figures for a website I have about the fractals of iterated function systems. I started making a few changes to your python package to fit how I needed my figures to be drawn and displayed. For example, I needed a few of the missing turtle functions, and I wanted to be able to save the images drawn with the help of ColabTurtle as svg files that I could then import into my web pages. But as I got involved in adapting ColabTurtle to my needs, my interest in learning more about python and more about svg led me to add more and more of the classic turtle functions to the package, even ones not particularly relevant to my fractal project, as well as the different turtles shapes available in turtle.py. By the time I was done in May, the package had been extended quite a bit to include almost all of the turtle functions in the classic turtle.py. I called my version ColabTurtlePlus for lack of a better name. You can see it at https://github.com/mathriddle/ColabTurtlePlus.

The Readme file explains many of the differences with ColabTurtle, as well as the main differences with turtle.py.

The package can be imported into Colab or JupyterLab using !pip3 install git+https://github.com/mathriddle/ColabTurtlePlus.git@main

I tried to make it so that anyone who had been using your ColabTurtle package from PyPi could use ColabTurtlePlus without the need to rewrite their code. So, for example, all that is needed to run the example from your Readme file in Colab with ColabTurtlePlus is to insert the command oldDefaults() before the call to initializeTurtle. But I also hoped that users of turtle.py could easily move their code to Colab without having to make too many changes. For example, bdklahn's daughter's turtle example that was included in one of the issues comments runs as written after replacing "import turtle" with "import ColabTurtlePlus.Turtle as turtle" and then adding turtle.initializeTurtle((600,400))

So I'm not sure what to do with my package now. I've been using it quite a bit the last few weeks to create svg images to replace some of the gif versions on my website (the gif images were created with a Visual Basic program I wrote many years ago to draw the fractals associated with iterated function systems). Should I make it available on PyPi? I've never submitted anything to PyPi, so I would need to learn how to do that. I thought perhaps your original ColabTurtle package should remain as is since you indicated that it was developed for your university's introductory CS course. Would it be better to use a different name for my package?

tolgaatam commented 3 years ago

@mathriddle , first of all, I sincerely thank you for the way you handle this extension idea. I am really grateful of the references that you gave to me in your repository. Also the fact that you open this issue here to explain your points and reasons is really beautiful.

Around March (i guess), by bdklahn's requests, I added many default turtle functions into this library. Even after these additions, there were several missing functionalities from python's original library. On top of this, I did not change some behaviour due to the fact that my university's introductory course and probably many other instructors around the world are utilizing this library currently. I need to stay compatible with the API I unintentionally created with some conflict with the original turtle package.

For the reasons I explained, I support that another package comes into play and extends/changes behaviour of my package. What you have done with ColabTurtlePlus is beneficial for everybody who wants to port their native turtle code to colab 1-1 exactly. I feel proud that what I started is now extended into a another version and can be beneficial for even more people with the help of your nice execution. Adding the option to call useOldDefaults() to keep using the behaviour of this package with all the same svg shapes and coordinates and so on is also a nice and well-intended idea - I appreciate that.

In terms of name, I believe that ColabTurtlePlus is fine. I am also not sure whether it is the best option available, but it seems to explains what it tries to achieve, so I guess is fine. For deployments, I recommend you to upload your project to PyPi, as it makes adding the package pretty straightforward for everybody. I also had not used PyPi before this project and was kind of lazy to learn how to do that; but it literally took me 30 minutes to follow a tutorial online and get my package to PyPi successfully. I think you should do so. However, uploading your package to PyPi with the name ColabTurtle (so overriding mine) would break compatibility for the people already using it, so you can just move on with ColabTurtlePlus on PyPi, too.

If you can think of any point that I can contribute to, please feel free to ping me. You can also send me an e-mail anytime to discuss.

Best.