Replies: 7 comments 19 replies
-
My feedback is that it would be good to give more attention to backwards compatibility if you want people outside the small group of developers to use, and continue to use, Mesa. Having succeeded with considerable difficulty in porting my model from version 0.8.8.1 to 2.1.5 (OK, that's a lot of versions to skip over), I saw there was a new version, 2.2.0, and thought I'd try porting to that. But the introduction of AgentSet caused it to crash immediately. As far as I can see, there's no documentation on how a model would need changing to run under 2.2.0 (a long list of changes from 2.1.5 to 2.2.0 doesn't really cut it), and there's a note that the feature is experimental and may be removed in future versions. So I'll stick with 2.1.5, and if other people want to play with my model (I intend to put it in OpenABM) they will need to install Mesa 2.1.5, not whatever the latest version is at the time. |
Beta Was this translation helpful? Give feedback.
-
I think it is virtually impossible to cover these kinds of situations when adding new elements to the public API. Remember, Semver is about denoting change in the public API. In this particular case, we added something to the API that was not there before. This is a new feature but does not change the existing public API. Is it part of Semver not to add stuff to a public API because the name might be used by someone somewhere using the library? Technically, it also would be hard to do this. Metaclasses might be partially used to validate class definitions, but given the dynamic nature of python, it is virtually impossible to cover everything. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your responses. I'll continue with 2.1.5 for the present. I do already have a requirements.txt file set up for the current model version running under 2.1.5. I appreciate that the developers are all volunteers giving their time free - I'm just pointing out that if you want a significant user community beyond the developers, their needs and experiences must be taken into account. |
Beta Was this translation helpful? Give feedback.
-
I think we need to differentiate here a bit. I mean yes if we add for example a new function to our Grid we can't make sure the name isn't taken and that shouldn't stop us from developing. But there the name clash is caused by users modifying our implementation. In this case here we modified a class that is explicitly there for subclassing and adding new attributes and functionalities. In that case I would argue part of the public API are also all the attributes we did not add and are free to use by users. Going the other attribute we could build Model in a way that disallows adding any new attributes to it. With your definition this wouldn't be a breaking change. But it would still break all existing models. So I think apart from the technical definition of semver the expectation is that upgrading a minor version shouldn't break models - unless you are very unlucky with the names you used. In this case we all agreed that a model level agent attribute makes a lot of sense as a place to store agents. But this is also very likely also already used by users. So the right way would have been to add a warning that Model.agents will be reserved in Mesa 3.0 and only then do the change. |
Beta Was this translation helpful? Give feedback.
-
Just to note, porting from 2.1.5 to 2.2.0 did turn out to be simple: a global replace of ".agents" by ".agentlist", followed by another of "agentlist_" by "agents_" (my input files use "agents_crowded" and similar) did it. |
Beta Was this translation helpful? Give feedback.
-
AgentSet raises a FutureWarning if first used. To original motivation for this was that early adopters know that the feature is experimental, subject to change and link to this discussion for us to receive feedback. The issues with this is that now that our Schedulers internally use this feature and the FutureWarning is also triggered if new users just follow along the intro tutorial. I find this problematic, because users don't expect to trigger a warning following an intro tutorial and they also can't have any idea what this feature even is, because they don't use it directly. I think it would be great if we could resolve this for our next bug fix release, also I have to admit I haven't thought about how to do this cleanly. |
Beta Was this translation helpful? Give feedback.
-
"We would love to hear what you think about this new feature. If you have any thoughts, share them with us here" My thoughts On AgentSet:
On the warning message :"/home/oren/work/blog/env/lib/python3.10/site-packages/mesa/time.py:82: FutureWarning: The AgentSet is experimental. It may be changed or removed in any and all future releases, including patch releases.
|
Beta Was this translation helpful? Give feedback.
-
We would love feedback on the new
AgentSet
class!Beta Was this translation helpful? Give feedback.
All reactions