Skip to content

Releases: py5coding/py5generator

Live Coding

10 Nov 19:34
730bc12
Compare
Choose a tag to compare

New Feature: Live Coding

py5 has a new feature: Live Coding. The basic idea is to have a live coding environment where you can write and modify your py5 code and see the results in real time. It is designed to support rapid prototyping of ideas and experimentation. You'll be able to write code in an editor or Jupyter Notebook and see the results in a running Sketch immediately, without having to exit a running Sketch and then start a new one.

You can read more about Live Coding on the documentation website:

https://py5coding.org/content/live_coding.html

Closed Issues:

Small release with a few new features

29 Jul 11:32
07626b1
Compare
Choose a tag to compare

Small release with a few new features

30 Mar 18:53
e457d61
Compare
Choose a tag to compare

This is a small release with two new features and a handful of bug fixes.

Numpy Version

The main reason why this py5 release is happening now and not later is because numpy will soon have a major release that is not completely backwards compatible. Version 2.0 of numpy will be released soon and library maintainers have been advised to pin dependencies to numpy<2.0 and then test with numpy 2.0 when it is available. This is to ensure that py5 and every library py5 depends on is ready for the new version and does not cause users any problems.

Once the new numpy version is released and I verify py5 works well with it, I will do another release of py5 that removes the numpy<2.0 pin.

New Contributors

Recently py5 had two first-time contributors. Many thanks to keko24 (Andrej) for PR #406 - Implemented corresponding changes to convert_image and convert_shape, addressing Issue #405. Also, thanks to JulienBacquart for PR #416 correct constrain documentation, addressing some documentation errors.

New Features

Neither of these new features are that significant and most likely they won't be useful for most users. However, they have been useful for me as I've done the prototyping experiments for a gallery show, opening next Friday in Detroit.

  • The new predraw_update() user function is called before each call to draw(). The purpose of this function is to provide a small performance boost by moving non-drawing update code to a function that executes during a time when the Python interpreter would otherwise be idle. If you want to read more about this feature, visit the new Update Function section of the new User Functions page.
  • Processing Mode users can now use the jclass_params keyword parameter to pass arguments to the constructors of their Java Classes. Read the Processing Mode documentation to learn more about this use of py5.

Closed Issues

py5's Python Ecosystem Integration

30 Dec 22:30
b45327f
Compare
Choose a tag to compare
Pre-release

This is a major release with many new features.

New Features

The major theme of this release is expanding and improving py5's Python ecosystem integrations. This release includes new features for working with matplotlib, Shapely, and Trimesh through the new convert_shape() method and the upgraded convert_image() method. It also includes a new color mode called CMAP that is built around matplotlib colormaps.

The documentation for these new features is extensive. There is now a new section in the documentation called Python Ecosystem Integrations that explains how py5 integrates with other Python libraries. This covers the new features in this release as well as existing features that perhaps some people didn't know about.

Removed Features

Unfortunately, the py5_tools.sketch_portal() function has been removed from py5. The functionality was broken because of recent upgrades in Jupyter. I tried to fix it but couldn't figure out how to make it work again. I know it has something to do with changes to Jupyter and Jupyter Widgets. Programming Jupyter Widgets is very difficult and involves a lot of confusing Python and TypeScript code.

The SketchPortal feature wasn't that great of a tool to begin with and it doesn't seem that very many people were using it anyway.

My plan for the future is to re-implement this feature using the Python library anywidget. This seems to be a much more robust and reliable approach that will cause less headaches for me.

Other Changes

Closed Issues

There are many more bugs fixes in this release than the ones listed here. When I find small bugs with easy solutions I often fix them right away without opening an issue recording it.

Processing Code Changes

In addition to the above, this release includes a few Processing code bug fixes.

The new convert_shape() method needed a fix for issue #643 so I found a fix for it. It took two PRs because my first PR wasn't quite right.

The second issue, #781, was discovered while reviewing py5's example code. It was an easy fix.

None of these code changes have been part of a Processing release yet and one of the PRs still hasn't been merged into the main branch. I can't wait for that to happen so this py5 release is using the fix791 branch of my fork of the Processing repo. Once the last PR is merged and the code is released, py5 will go back to using the latest Processing core jars.

Imported Mode Code Importing & Improvements to Py5Shape

24 Jul 02:26
af24c17
Compare
Choose a tag to compare

...and bug fixes.

We are moving back to py5's previous release frequency of a release every 2-3 months. This is minor release with one important feature to support Thonny users, as well as a handful of bug fixes and other improvements.

Imported Mode Code Importing feature

Python projects with moderate to large amounts of code will be typically split into multiple files that will be imported from from one file to another. However, due to the way py5's Imported Mode works, this couldn't be done with py5 Imported Mode code. This new feature changes that, supporting the ability to import Imported Mode code from one file to another. How to do this is described in more detail in the documentation page Importing Imported Mode Code.

Other Changes

  • Using g to access the primary Py5Graphics object is now deprecated. Users will receive a warning message instructing them to use get_graphics() intead. Allowing the single character g to be a reserved variable name is problematic for users coding in Imported Mode. Consider that the g variable is often used in a rgb variable triplet. The g variable will be removed in the next release.
  • Update dependency versions for numpy from 1.23 to 1.24 and for pillow from 9.2 to 9.5
  • New Py5Shape.color_mode() method, similar to Py5Graphics.color_mode() and py5.color_mode()
  • New Py5Shape methods vertices(), bezier_vertices(), quadratic_vertices(), and curve_vertices(), analogous to the other methods of the same name.

Closed Issues

Processing Mode and Hybrid Coding

04 May 11:55
08749e4
Compare
Choose a tag to compare
Pre-release

This is a major release with big improvements to py5's functionality. This release was a lot of work!

What Changed?

You can read about all of the changes and the reasons behind them on the maintainers blog. The main highlights are:

  • Processing Mode - gives Processing users a new callPython() method to make arbitrary calls to Python. Here, py5 functions as a bridge from Java to the Python world
  • Hybrid Programming - augment your py5 Sketches with Java code
  • Attribute Errors now provide coding suggestions. For example:
    py5 encountered an error in your code:

    File "<ipython-input-6-b7441cc777da>", line 2, in setup
        1    def setup():
    --> 2        c = py5.colorr(255)
        3        py5.background(c)
        ..................................................
        py5.colorr = # AttributeError
            py5 = <module 'py5' from '/Users/jim/INSTALL/anaconda3/envs/
            py5/lib/python3.8/site-packages/py5/__init__.py'>
        ..................................................

    AttributeError: py5 has no function or field named "colorr". Did you mean "color"?
  • Small changes to Py5Vector to make it more consistent with Processing's PVector class
  • The create_image_from_numpy() method now supports BGR and BGRA color channel ordering

API changes

  • The get() method has been renamed get_pixels() and a new method set_pixels() has been added
  • The random_choice() method has been renamed random_sample() and a new implementation of random_choice() has been created

New Contributors

Bug Fixes

Full Changelog: py5-1286-0018-0.8.3a1...py5-1292-0019-0.9.0a0

More bug fixes and small features

21 Nov 23:19
a48401a
Compare
Choose a tag to compare
Pre-release

This is a minor release with a handful of bug fixes and small enhancements. Most of the bug fixes are small improvements to the documentation or error messages. Thanks again to Alexandre Villares for raising the majority of the now fixed bugs.

Enhancements

  • New methods for saving and loading data. The new methods are load_strings(), save_strings(), load_bytes(), save_bytes(), load_pickle(), and save_pickle()
  • New join_thread() method

Pull Requests

There was one pull request from zztkm to fix the bug they reported. Thank you!

Bug fixes

Lots of bug fixes

29 Aug 10:51
fb4a965
Compare
Choose a tag to compare
Lots of bug fixes Pre-release
Pre-release

Small release with lots of bug fixes. Some of these bugs were important to Thonny users, and I didn't want them to wait for fixes.

Color features and lots of bug fixes

09 Aug 02:04
Compare
Choose a tag to compare
Pre-release

New features:

  • Any valid matplotlib color string is now a valid color to use in py5 (if matplotlib is installed)
  • New hex_color() method
  • New select_folder(), select_input(), and select_output() methods
  • Upgraded random_choice() method
  • New np_random property
  • New g property
  • New next_page() method for the PDF renderer
  • Proper object equality

See the blog post for more information about this release.

Bug fixes:

py5 events and improved sketch portal

26 May 16:50
Compare
Choose a tag to compare
Pre-release

New Features:

  • Py5KeyboardEvent and Py5MouseEvent classes
  • User-defined event functions such as mouse_moved() and key_pressed() can take an parameter, and an instance of Py5KeyboardEvent and Py5MouseEvent will be passed when it is called
  • New py5jupyter library to contain all of py5's Jupyter functionality
  • The Sketch Portal is now interactive

Use of py5 + Jupyter without py5jupyter installed is now deprecated. See the blog post for more information about this release.

Bug Fixes: