projectmesa / mesa

Mesa is an open-source Python library for agent-based modeling, ideal for simulating complex systems and exploring emergent behaviors.
https://mesa.readthedocs.io
Apache License 2.0
2.54k stars 892 forks source link

All functions with @solara.component annotation missing on read the docs #2451

Open quaquel opened 3 weeks ago

quaquel commented 3 weeks ago

Something weird is going on: all functions annotated with @solara.component are not included in the read-the-docs API overview. I have checked the error log on RTD (we need to some cleaning...., but that's a seperate issue). I can't find anything related to this. No idea what is going on.

EwoutH commented 3 weeks ago

Strange. @maartenbreddels, if I may ask, have you encountered this earlier by any chance?

maartenbreddels commented 3 weeks ago

No, that's strange indeed. Looking at this example it seems that the docstring is passed 'up' to the decorator.

quaquel commented 3 weeks ago

My hunch is that the wrapper in solara.component should itself be annoted with functools.wraps to solve this problem. According to the docs "Without the use of this decorator factory, the name of the example function would have been 'wrapper', and the docstring of the original example() would have been lost."