Re: Old matplotlib animation now fails
Den 2024-10-15 skrev MRAB : > On 2024-10-15 21:16, Martin Schöön via Python-list wrote: >> Some years ago I created a Python program that reads GPS data and >> It is the second to last line that throws an error: >> >> l.set_data(x0, y0) >> >> The error messages drills down to something called >> "/home/.../matplotlib/lines.py", line 1289, in set_xdata >> >> and tells me 'x must be a sequence' >> > """ > Help on function set_data in module matplotlib.lines: > > set_data(self, *args) > Set the x and y data. > > Parameters > -- > *args : (2, N) array or two 1D arrays > > See Also > > set_xdata > set_ydata > """ > > So, the arguments should be arrays: > > For example: > > x0, y0 = np.array([0.0]), np.array([0.0]) > > Has the API changed at some point? > So it seems. Thanks for the quick reply. /Martin -- https://mail.python.org/mailman/listinfo/python-list
[RELEASE] Python 3.14.0 alpha 1 is now available
It's now time for a new alpha of a new version of Python! https://www.python.org/downloads/release/python-3140a1/ **This is an early developer preview of Python 3.14** # Major new features of the 3.14 series, compared to 3.13 Python 3.14 is still in development. This release, 3.14.0a1 is the first of seven planned alpha releases. Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process. During the alpha phase, features may be added up until the start of the beta phase (2025-05-06) and, if necessary, may be modified or deleted up until the release candidate phase (2025-07-22). Please keep in mind that this is a preview release and its use is **not** recommended for production environments. Many new features for Python 3.14 are still being planned and written. Among the new major new features and changes so far: * PEP 649 (https://peps.python.org/pep-0649/): deferred evaluation of annotations ( https://docs.python.org/3.14/whatsnew/3.14.html#pep-649-deferred-evaluation-of-annotations ) * Improved error messages ( https://docs.python.org/3.14/whatsnew/3.14.html#improved-error-messages) * (Hey, **fellow core developer,** if a feature you find important is missing from this list, [let Hugo know (h...@python.org).) The next pre-release of Python 3.14 will be 3.14.0a2, currently scheduled for 2024-11-19. # More resources * Online documentation: https://docs.python.org/3.14/ * PEP 745, 3.14 Release Schedule: https://peps.python.org/pep-0719/ * Report bugs at https://github.com/python/cpython/issues * Help fund Python and its community: https://www.python.org/psf/donations/ # And now for something completely different π (or pi) is a mathematical constant, approximately 3.14, for the ratio of a circle's circumference to its diameter. It is an irrational number, which means it cannot be written as a simple fraction of two integers. When written as a decimal, its digits go on forever without ever repeating a pattern. Here's 76 digits of π: 3.141592653589793238462643383279502884197169399375105820974944592307816406286 Piphilology is the creation of mnemonics to help remember digits of π. In a pi-poem, or "piem", the number of letters in a word equal the corresponding digit. This covers 9 digits, 3.14159265: > *How I wish I could recollect pi easily today!* One of the most well-known covers 15 digits, 3.14159265358979: > *How I want a drink, alcoholic of course, after the heavy chapters involving quantum mechanics!* Here's a 35-word piem in the shape of a circle, 3.1415926535897932384626433832795728: It's a fact A ratio immutable Of circle round and width, Produces geometry's deepest conundrum. For as the numerals stay random, No repeat lets out its presence, Yet it forever stretches forth. Nothing to eternity. The Guiness World Record for memorising the most digits is held by Rajveer Meena, who recited 70,000 digits blindfold in 2015. The unofficial record is held by Akira Haraguchi who recited 100,000 digits in 2006. # Enjoy the new release Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation. Regards from a bright and colourful Helsinki, Your release team, Hugo van Kemenade Ned Deily Steve Dower Łukasz Langa -- https://mail.python.org/mailman/listinfo/python-list
Re: Old matplotlib animation now fails
Den 2024-10-15 skrev Stefan Ram : > Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or quoted: >>l.set_data(x0, y0) > > Well, I got to say, it's pretty rad that you're rocking Python! > That language is the bee's knees, for real. > > As for your question, here's my two cents off the cuff: > Could it be that the newer Matplotlib versions are jonesing > for something like "l.set_data( [ x0 ],[ y0 ])" in that spot? > Thanks, that was quick and adding square brackets fixed my code. Me rocking Python? /Martin -- https://mail.python.org/mailman/listinfo/python-list
Re: Common objects for CLI commands with Typer
On 9/23/24 22:51, Dan Sommers via Python-list wrote: On 2024-09-23 at 19:00:10 +0100, Barry Scott wrote: On 21 Sep 2024, at 11:40, Dan Sommers via Python-list wrote: But once your code gets big the disciple of using classes helps maintenance. Code with lots of globals is problematic. Even before your code gets big, discipline helps maintenance. :-) Every level of your program has globals. An application with too many classes is no better (or worse) than a class with too many methods, or a module with too many functions. Insert your own definitions of (and tolerances for) "too many," which will vary in flexibility. I think the need of classes comes when you need objects thus a set of variables with an identity and that may be created N times. Classes are object factories. A second aspect is inheritance: classes may inherit from other classes and reuse existing functionality and data structures for their objects. In cases where you only need to encapsulate a single set of data and functions modules are the best choice. -- https://mail.python.org/mailman/listinfo/python-list
Re: Old matplotlib animation now fails
On 16 Oct 2024 08:20:10 GMT, Martin Schöön wrote: > Den 2024-10-15 skrev Stefan Ram : >> Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or >> quoted: >>>l.set_data(x0, y0) >> >> Well, I got to say, it's pretty rad that you're rocking Python! >> That language is the bee's knees, for real. >> >> As for your question, here's my two cents off the cuff: >> Could it be that the newer Matplotlib versions are jonesing for >> something like "l.set_data( [ x0 ],[ y0 ])" in that spot? >> > Thanks, that was quick and adding square brackets fixed my code. > > Me rocking Python? > > /Martin You have to understand Stefan tries to use American slang, not always entirely accurately. I think 'bee's knees' died out around 1931. -- https://mail.python.org/mailman/listinfo/python-list
Re: Old matplotlib animation now fails
Den 2024-10-16 skrev Stefan Ram : > Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or quoted: >>Me rocking Python? > >|to rock >|1. To use. To make do with, usually to great effect. >|"You don't need to make up the guest bed; we can rock the couch." > Urban Dictionary (2005) - Aaron Peckham (editor) (1979-04-03/), > Andrews McMeel Publishing, Kansas City > That is a use and meaning of rock I was not aware of. An example of what I use this Python code for (track top right): https://shorturl.at/m3ZKp (Youtube's compression algorithm clearly did not like this video.) /Martin -- https://mail.python.org/mailman/listinfo/python-list
Re: Old matplotlib animation now fails
On 16/10/2024 22:47, rbowman wrote: On 16 Oct 2024 08:20:10 GMT, Martin Schöön wrote: Den 2024-10-15 skrev Stefan Ram : Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or quoted: l.set_data(x0, y0) Well, I got to say, it's pretty rad that you're rocking Python! That language is the bee's knees, for real. As for your question, here's my two cents off the cuff: Could it be that the newer Matplotlib versions are jonesing for something like "l.set_data( [ x0 ],[ y0 ])" in that spot? Thanks, that was quick and adding square brackets fixed my code. Me rocking Python? /Martin You have to understand Stefan tries to use American slang, not always entirely accurately. I think 'bee's knees' died out around 1931. Not sure about America, but the bee's knees is still in common use in the UK -- Chris -- https://mail.python.org/mailman/listinfo/python-list