Posts about py5 (old posts, page 1)

New py5 Release: 0.7.2a0

The previous release had some unexpected and urgent OSX problems. This release fixes them, and in addition, expands the py5 functionality available on OSX. This is the first py5 release that can run py5 Sketches with the generic Python interpreter and not through a Jupyter notebook.

The fix involved applying some things I learned from studying jpype's source code and previously applied to the run_sketch command line utility used by the Thonny plugin.

I've been searching for a way to get py5 to work with the generic Python interpreter for a long time. When I sat down to address this latest bug, everything came together in the right way and it just worked. I'm thrilled.

There are still a few more outstanding OSX related issues for me to solve, and that's before considering the Apple Silicon can of worms. All of these things will be addressed over the next few releases. There is a clear path between this release and cross-platform feature parity.

Bug fixes:

Questions:

Maybe this next release works on Apple Silicon (macOS-aarch64) machines? Please test and provide feedback.

What's Ahead:

  • Unit tests!

  • More OSX improvements!

New py5 Release: 0.7.1a6

Another big release, 2 months after the previous release.

Here are the new features in this release:

  • Update Processing jars to version 4.0b6. This means py5 now supports the new features in that release, including the new commands for controlling the Sketch window such as window_move() and window_title().

  • Improvements to py5 to enable packaging with pyinstaller. In the near future I will add documentation to the py5 website explaining how to do this. If you can't wait that long, have a look at this gist for a working example. That example has room for improvement, and will be improved before the documentation is finalized.

  • The typehints have been updated to conform to PEP 585. Also, the numpy typing package nptyping has been removed in favor of using the numpy typehint features introduced in versions 1.20 and 1.21. This version of py5 now requires numpy>=1.21, but that shouldn't be a problem for anyone because that version has been out for almost a year now and most likely you have version 1.22 installed already.

  • The run_sketch command line tool now accepts command line arguments that will get passed to Processing. Among other things, this will allow the Thonny plugin to set the window position. (#60).

  • As previously stated, this release now requires Java 17.

Bug fixes:

Questions:

I'd like someone with an Apple Silicon (macOS-aarch64) machine to test py5 and tell me if it works. I'm specifically curious about the P2D and P3D renderers. I don't think it will work but I want to know what happens. I don't have access to such a machine to do the test myself.

What's Ahead:

  • Unit tests! Not having them is costing me too much time.

  • OSX improvements! I have new ideas and believe it is time to revisit the OSX limitations.

New py5 Release: 0.7.0a0

A another big release with two new features!

But before getting into that, an important announcement. This is the last version of py5 that will run on Java 11. The next version of py5, probably (hopefully) available in February, will require Java 17. This is changing because Processing 4 now requires Java 17. I am delaying py5's upgrade to Java 17 to give others a chance to adapt their code. This version will work just fine with Java 17, but does not require it.

And back to the release. What's new:

  • Reworked noise functionality. The Python noise library is no longer used to generate noise; the library has been removed as dependency. Instead, py5 uses the OpenSimplex noise algorithm and Processing's noise algorithm. The OpenSimplex algorithm is provided by KdotJPG's OpenSimplex2S implementation. Both support noise generation with numpy arrays as parameters. Read the documentation to learn more.

  • New Py5Vector class. This new feature was a lot of work and incorporates the design ideas of many people in the py5 community. Read the documentation to learn what you can do with this class.

Here's an animated GIF I created with py5 and the new Py5Vector class. The example code is available as a gist.

/images/py5/tesseract.gif

Bug Fixes:

  • #50

  • #52

  • Other small bugs I found and fixed along the way

What's Ahead:

  • Move required Java version from 11 to 17.

  • Many improvements to type hints. The Python nptyping library will be removed and numpy (version >=1.20) will be used instead.

New Py5Vector Class

Over the past few months, one of the most requested py5 features has been a dedicated vector class. Since there is a lot of interest, I wanted to build a draft version of a vector class that I am now making available for discussion with the growing py5 community.

The vector class code associated with this blog post is available on gist, but since this is an evolving process, the most current version will always be in the github repo. I've also created a discussion on github for feedback; please direct your comments and questions there. Feel free to comment or question anything you like. Update: the new Py5Vector class is complete and has been released. Visit the documentation website to learn how to use the Py5Vector class.

Read more…

Happy Holidays!

Happy Holidays!

This year I used my new Axidraw to create my holiday cards. I'm very happy with the result:

holiday card with a wire frame christmas tree and the words "happy holidays" across the top

holiday card with a wire frame christmas tree and the words "merry christmas" across the top

Read more…

New py5 Release: 0.6.0.alpha.2

A big release with new features and important bug fixes!

What's new:

  • Context Managers. This context manager functionality is one of many great ideas found in processing.py that several members of the py5 community have been asking for. Ideas and feedback like this contribute much to py5, so please keep them coming! And many thanks to the processing.py team for coming up with this idea.

  • py5bot now supports the SVG and PDF renderers

  • Update to the latest Processing 4.0 beta 2 jars

  • The save() and save_frame() methods can now save to a io.BytesIO object

  • Version number now conforms to proper semantic versioning standards

Bug Fixes:

  • #40

  • #44

  • Other small bugs I found and fixed along the way

What's Ahead:

  • Rework noise functionality. See #38 for more information. The new version's noise functionality may not be backwards compatible.

  • There are other items on my todo list but I want to make reworking the noise functionality a higher priority. I'll do a new release once this is complete.

Help Test py5 Release 0.6.0-alpha.1

In an effort to improve the py5 release process, I am making the next release available on github for testing before I package and deploy it to PyPI.

Install py5 0.6.0-alpha.1

Here's the command you'll need to install py5 from github:

pip install git+https://github.com/py5coding/py5.git@0.6.0-alpha.1#egg=py5

This needs to be done after the other py5 installation tasks (as explained in the documentation) are completed. The simplest way to go about this is to create a working py5 environment and then run the above command. Don't forget to install the py5 and py5bot kernels, and don't forget to check the version number:

>>> import py5
>>> py5.__version__
'0.6.0-alpha.1'

Since py5's github repositories are split between the py5generator and py5 repositories, there are a bunch of extra steps one must take to install the development version of py5. The only person who uses the development build is me. Moving forward I need to come up with a way to change this so that more people can provide helpful feedback before a release.

Read more…

Jupyter Book Documentation Now Live!

The new py5 documentation website is now live! Go to https://py5.ixora.io to have a look.

The documentation is built with Jupyter Book. One of the reasons why I am so enthusiastic about this is that Jupyter Book is so well designed for creating Python documentation. It's very easy use and the end result is a much higher quality than what I was using before.

Now I need to get to work and document all the great features in py5 that nobody knows about!

Jupyter Book Documentation

I'm enthusiastic about this prototype for py5's documentation website: py5dev.ixora.io. It is built with Jupyter Book.

Once I got up to speed on Jupyter Book I was able to modify the Reference documentation to use the new system. That was probably the most tedious part. One challenge is that I am using restructuredtext for the documentation source content, so the reference documentation build process also outputs restructuredtext. That's fine because Jupyter Book supports that, but it is clear that markdown or Myst is easier to use. I will use Myst for new documentation files, not restructuredtext.

One of the great features of Jupyter Book is the ability to link the documentation to binder. Readers will be able to launch a notebook kernel right from the documentation. In addition, Jupyter Book supports Thebe, an amazing tool that I never imagined was even possible. Readers will also be able to execute py5 code through the documentation website itself, with the execution results provided by binder. This supports custom kernels like py5bot and embedded animations using the Sketch Portal. This connection with binder will be used extensively in the tutorials and howto sections.