mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Functions Annotations in the time module create problems with automatic code completion tools such as Pycharm.

Open ambitious-octopus opened this issue 5 years ago • 3 comments

Describe the bug

Functions Annotations in the time module create problems with automatic code completion tools such as Pycharm. https://github.com/projectmesa/mesa/blob/2e66e9f70f9b4c58d90654ba590fc011263c483c/mesa/time.py#L85 To Reproduce

Using Pycharm with Kite and reproducing the sample code MoneyModel: When iterating between agents within the scheduler if an attribute or method of an agent is requested, Pycharm will display the "unresolved attribute reference '"method"' for class Agent" error. This is because Pycharm expects an object of the Agent class when it finds an object that inherits from the Agent class but is not an agent object (MoneyAgent). Important: The code works perfectly when running, but autocompletion does not work during editing and Pycharm display errors.

ambitious-octopus avatar Oct 07 '20 16:10 ambitious-octopus

I am not sure if any of the developers on this project have PyCharm/work with PyCharm. Any chance you can submit a fix for this?

jackiekazil avatar Oct 16 '20 03:10 jackiekazil

I will work on it!

ambitious-octopus avatar Oct 18 '20 18:10 ambitious-octopus

Great! Looking forward to the fix! Let us know if you have any questions!

jackiekazil avatar Oct 18 '20 19:10 jackiekazil