Skip to content

Releases: py5coding/py5generator

Imported Mode Code Importing & Improvements to Py5Shape

24 Jul 02:26
af24c17

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

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

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

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

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

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:

py5 with generic python interpreter

05 Apr 17:52

Choose a tag to compare

Pre-release

New Features:

  • py5 now works on OSX with the generic python interpreter. Jupyter notebooks are no longer required. There are still a few OSX-specific problems but there is a clear path between this release and cross-platform feature parity.

Bug fixes:

py5 => Java 17

24 Mar 15:21

Choose a tag to compare

py5 => Java 17 Pre-release
Pre-release

New Features:

  • py5 now requires Java 17 to be installed on your computer. If JAVA_HOME is set, it must point to your Java 17 installation.
  • 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. (see #60)

Bug fixes:

Reworked noise functionality and new Py5Vector class

21 Jan 19:17

Choose a tag to compare

New Features:

  • 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.
  • New Py5Vector class

Fixes:

New Context Manager feature + Important Bug Fixes

30 Oct 10:15

Choose a tag to compare

New Features:

  • Context Managers: methods like begin_shape() or push_matrix() can be used as context managers
  • 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 conforms to proper semantic versioning standards

Fixes: