AB-CE / abce

Agent-based computational Economics, the Python library that makes AB modelling easier

Home Page:http://abce.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NotEnoughGoods called without needed arguments in Firm produce()

glysbaysb opened this issue · comments

If a firm does not have enough goods for its production function it throws the NotEnoughGoods exception. However it does not pass the required parameters in the constructor making it impossible to handle this error.

  File "/home/a/code/econ/abce/examples/economy/bakery.py", line 41, in production
    self.produce(self.pf, self.inputs)
  File "/home/a/.local/lib/python3.8/site-packages/abcEconomics/agents/firm.py", line 130, in produce
    raise NotEnoughGoods
TypeError: __init__() missing 3 required positional arguments: '_agent_name', 'good', and 'amount_missing'

See https://github.com/AB-CE/abce/blob/master/abcEconomics/agents/firm.py#L130

commented

@glysbaysb thanks for the report. Made a fix in 296216d. Let me know if it fixes the bug.

Yes that works perfectly, sorry it took me a while to reply.