Scamp_extensions.process package


I’m trying to work with the l_systems and MarkovChain classes in scamp. Does someone have examples using these classes?

Thank you!


I’ve been meaning to put together some examples for how to use these.
I’ll try to come up with some and get back to you!

Hi Marc,

thank you! Looking forward to look at these examples,


Hi, trying to use these extensions (Markov) with this code:

from scamp import*
from scamp_extensions.process import markov, l_systems

modello = markov.MarkovModel([61, 62, 63, 64, 65])
analisi = modello.generate(5, 1)


error messages are the following: any idea?

Traceback (most recent call last):
File “/Users/ericmaestri/Dropbox/ConservatorioGenova/Anno04/ComposizioneInformatica/Corso20-21/compinf09/”, line 2, in
from scamp_extensions.process import markov, l_systems
File “/Users/ericmaestri/Library/Python/3.7/lib/python/site-packages/scamp_extensions/process/”, line 22, in
from .l_systems import LSystem
File “/Users/ericmaestri/Library/Python/3.7/lib/python/site-packages/scamp_extensions/process/”, line 26, in
class LSystem:
File “/Users/ericmaestri/Library/Python/3.7/lib/python/site-packages/scamp_extensions/process/”, line 50, in LSystem
def get_generation(self, n: int) → str:
File “/Applications/”, line 490, in lru_cache
raise TypeError(‘Expected maxsize to be an integer or None’)
TypeError: Expected maxsize to be an integer or None

thank you!


Hi Eric! Sorry I’ve been slow in responding to this. What you’ve run into is a very slight typo-style bug in the LSystems module, which caused a crash for python version 3.7 and lower. I’ve fixed it, and put up a post-release. If you pip3 install --upgrade scamp_extensions, it should be fixed.

After that, the rest of your markov code should work fine. I still owe you an example or two though, sorry for the delay!

Dear Marc,

thank you!
Looking forward for the examples!



sorry. Same problem…

Are you sure you’re using the post-release? Try running pip install scamp-extensions==0.3.2.post1. It could be it doesn’t upgrade without explicitly doing this.

Yes it is.

Hmm… can you click through to the file and copy and paste its contents to here? The bug was with the decorator @lru_cache, which should say @lru_cache()