Broken python program

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

Can you send us the code for your animation? Compatibility should not have been broken but hard to say why without seeing your animation

···

On Tue, Nov 20, 2018, 5:31 PM Harold Breeden <hdb4720@gmail.com wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-labs-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/013c8a88-88f2-42d2-b355-aad9e72610b1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Looking at the code some more… short answer, change your code to use self.cur_step instead of self._step
Now I will go yell at Tom for “deprecating” self._step for some reason. It looks like he fixed it in all of our own animations but didn’t exactly check if it would break anyone else.
Honestly self._step is just a convention. You can call it whatever you want as long as you initialize it in __init__() and increment it in def step()

···

On Tue, Nov 20, 2018 at 5:33 PM Adam Haile adammhaile@gmail.com wrote:

Can you send us the code for your animation? Compatibility should not have been broken but hard to say why without seeing your animation

On Tue, Nov 20, 2018, 5:31 PM Harold Breeden <hdb4720@gmail.com wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-labs-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/013c8a88-88f2-42d2-b355-aad9e72610b1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Here is my test program I used for troubleshooting.

The test app does not do much. You can run it with “python -i wip1.py”. It just sets things up.

Than at the python prompt can you do things such as "set_color(“red”) which will turn the strip whatever color you selected.

The problem occurs when I try to run the BaseStripAnim in the led_pattern() class. It used the valid_patterns.py which is just a collection of various color patterns.

If you run “play_pattern(valid_patterns.barney)” the v3.4.15 will begin an animation of purple scrolling. v3.4.35 throws an exception.

I am running this on Windows 10 Pro with an AllPixel.

Example:

python -i .\wip1.py

set_color(“red”)
set_color(“green”)
set_color(“blue”)
set_color(“black”)
play_pattern(valid_patterns.forest)
WARNING - deprecated - BaseAnimation.run
Traceback (most recent call last):
File “”, line 1, in
File “.\wip1.py”, line 71, in play_pattern
anim.run(fps=FPS)
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\animation\animation.py”, line 204, in run
self.start()
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\animation\animation.py”, line 119, in start
self.threading.start()
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\animation\animation_threading.py”, line 80, in start
self.target()
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\animation\animation_threading.py”, line 40, in target
self.run()
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\animation\animation.py”, line 128, in run_all_frames
for i in self.generate_frames():
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\animation\animation.py”, line 136, in generate_frames
self._run_one_frame()
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\animation\animation.py”, line 150, in _run_one_frame
self.step(self.runner.amt)
File “.\wip1.py”, line 51, in step
self._led.set(i, self._colors[(self._step + i) % len(self._colors)])
AttributeError: ‘led_pattern’ object has no attribute ‘_step’

validPatterns.py (8.29 KB)

wip1.py (1.96 KB)

···

On Tuesday, November 20, 2018 at 4:31:43 PM UTC-6, Harold Breeden wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

Tried using self.cur_step. Does not throw the exception, but no animation plays.

···

On Tuesday, November 20, 2018 at 4:31:43 PM UTC-6, Harold Breeden wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

The change to self.cur_step still works fine in v3.4.15.

···

On Tuesday, November 20, 2018 at 4:31:43 PM UTC-6, Harold Breeden wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

He included 2 files a few emails back Tom, that has the animation. I’m looking at it but not sure why it’s not working… apparently doesn’t except anymore but shows nothing. He’s calling run() directly which also seems to be deprecated???

···

On Tue, Nov 20, 2018 at 6:09 PM Tom Swirly tom@swirly.com wrote:

Ah, I believed that self._step would continue to work in third-party animations. :-/ Sorry about that!!!

self.cur_step should be exactly the same, which is why we deprecated self._step use (but I thought I had a proxy fixing it).

Can we see the animation to see why there would be a difference?

On Tue, Nov 20, 2018 at 11:56 PM Harold Breeden hdb4720@gmail.com wrote:

The change to self.cur_step still works fine in v3.4.15.

On Tuesday, November 20, 2018 at 4:31:43 PM UTC-6, Harold Breeden wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-labs-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/86c9e79a-993e-4553-a24a-49c61bcc66c5%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


/t

https://tom.ritchford.com

https://tom.swirly.com

You received this message because you are subscribed to the Google Groups “Maniacal Labs Users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to maniacal-labs-users+unsubscribe@googlegroups.com.

To post to this group, send email to maniacal-labs-users@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/maniacal-labs-users/CAOuQWfUS2tXzFsxPZSysJLw4be9cSt3mWh8i6a8xQH6D%3DcUUHA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Not sure what you mean by “see” the animation? I can shoot a video if you want, but under v3.4.35 the strip just stays dark.

···

On Tuesday, November 20, 2018 at 4:31:43 PM UTC-6, Harold Breeden wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

Great! I will try the new release to see if it allows my original project to function as is.

I am very interested in learning the new approach to BiblioPixel. We are continuing to develop new led-based art projects and BiblioPixel appears to be an extremely valuable tool to have available.I will work through the documentation and tutorial and let you know if I need any additional assistance.

···

On Tuesday, November 20, 2018 at 4:31:43 PM UTC-6, Harold Breeden wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

Not sure I understand what you mean by “won’t light up, as the code only ever sets pixels to black. :-)”.

My little wip1.py is not intended to do anything. It simply creates an environment with which I could test two BiblioPixel functions.

Here is what wip1.py does:

  1. imports the required libraries (lines 1-7)
  2. sets some variables just cause. I could have used values instead of variables, but … (lines 8-14)
  3. defines a class based on BiblioPixel.BaseStripAnim(). This is actually the meat of the whole app. (lines 15-54)
  4. provides three functions - set_color(), set_off(), play_pattern() - available for use in the py code and at the python command line. (lines 55-77)
  5. initializes the AllPixel (lines 78-82)
    How I use it is from the Windows prompt (though this should also work at the Linux prompt on my Pi) I start an interactive python shell using the wip1.py code:
  • python -i wip1.py
    This initializes the AllPixel and for good practice insures that the AllPixel starts of with all leds off. This is why you “only” see it setting all leds to Black.

  • Line 81: set_off()
    Now I am at a Python prompt with a working AllPixel. With everything initialized and at the Python prompt (">>>") I can now just play with the AllPixel.

Some of the things I can do now:

  • Set solid colors:
  • set_color(“red”)
  • This turns all the leds to Red
  • set_color(“blue”)
  • Same thing but now Blue
  • I can continue entering as many set_color(“color_name”) commands as I want.
  • set_off()
  • Turns all the leds off
  • could also just use set_color(“black”) and achieve the same result
  • Both v3.4.15 and 3.4.35 respond as expected by setting the strip to the desired color.
  • Of course the “correct” color is determined by insuring the the RGBORDER is set properly for the strip in use.
  • Play a color animation
  • play_pattern(“barney”)
  • This functions will look up the pattern in the valid_patterns.py to get a series of color codes.
  • Barney is a purple-based color scheme.
  • There is also Forest and several others which were adapted from BiblioPixel code.
  • Each pattern in valid_patterns.py define a desired color sequence to provide a scrolling color stream along the led strip.
  • The BaseStripAnim.step() provides all the work behind this:
  • it displays the color scheme in a repeating pattern along the strip
  • advances the color scheme one pixel and displays the strip
  • repeat ad infintum to provide a pleasing scrolling color display
  • in addition to the BiblioPixel patterns of colors such as Forest, Clouds, Lava
  • added in special functions like Merica for 4th of July - a red, white and blue pattern
  • added in color combinations of color contrasts (Mango, Black Leather, etc, etc)
  • added some just fun like KSU and Colombian flag
  • v3.4.15 works fine as is
  • v3.4.25 does not work
  • threw an exception because of the reference to BaseStripAnim._step
  • when I replaced that with BaseStripAnim.cur_step the exception is not thrown, but the BaseStripAnim animation does not display any leds
    Like I said wip1.py just sets up an environment in which you can than play with the AllPixel and BiblioPixel functionalities. It was not intended as a working Led App to do anything in particular.
···

On Tuesday, November 20, 2018 at 4:31:43 PM UTC-6, Harold Breeden wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

Correction for my previous post:

When running play_patterns():

  • play_patterns(valid_patterns.barney)
    If you pass just a “string” as I noted in the previous post (“barney”) it will error out with:

play_pattern(“barney”)
Traceback (most recent call last):
File “”, line 1, in
File “.\wip1.py”, line 67, in play_pattern
anim._colors[i] = colors.color_scale(anim._colors[i], int(256 * (BRIGHTNESS/100)))
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\util\colors\arithmetic.py”, line 14, in color_scale
return tuple([int(i * level) >> 8 for i in list(color)])
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\util\colors\arithmetic.py”, line 14, in
return tuple([int(i * level) >> 8 for i in list(color)])
ValueError: invalid literal for int() with base 10: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

Sorry!

···

On Tuesday, November 20, 2018 at 4:31:43 PM UTC-6, Harold Breeden wrote:

I have a BiblioPixel project up and running using the BaseStripAnim from BiblioPixel-3.4.15.

I am working a new project so made sure I was using the most current libraries. I use VirtualEnv which saved me in this case. When I updated BiblioPixel if got BiblioPixel-3.4.35. This version broke my animation. If I revert back to v3.4.15 it works just fine.

I found a difference in the self.step() module that is inherited from Animation() base class.

I followed the instructions on https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation which still has the original code I used in my first project. In v3.4.35 it hits an exception on self._step.

I reviewed the differences between animation.py in v3.4.15 and 3.4.35 and found that the module the self.step have been changed to just a pass. I tried doing that to my project but than no animation runs.

Any suggestions on how I get 3.4.35 to function as originally intended?

I don’t mind learning the new methods but I need my original project to continue running without having to worry about which BiblioPixel library I am using.

Trying to create a new project. Didn’t get very far …

It appears it is having a problem being on Windows instead of Linux.

Here is my result:

(env) PS Patterns>bp new patterns
Traceback (most recent call last):
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\Scripts\bp”, line 16, in
main.main()
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\main\main.py”, line 39, in main
args.run(args)
File “C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\commands\new.py”, line 53, in run
tmpl_data = open(tmpl_file).read()
FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\hdb47\hdbcentos6\hbreeden\Documents\Development\Python\PyImageSearch\env\lib\site-packages\bibliopixel\commands\template/project.yml.tmpl’
(env) PS Patterns>