Skip to content

Conversation

@quaquel
Copy link
Member

@quaquel quaquel commented Nov 1, 2024

The How-To guide was outdated with virtually nothing being relevant for MESA 3. I have gone ahead and completely removed it for now. I have updated to tutorial to remove the references to it (which themselves already seemed a bit out of place).

@quaquel quaquel linked an issue Nov 1, 2024 that may be closed by this pull request
@EwoutH
Copy link
Member

EwoutH commented Nov 1, 2024

Let's see: Replacing schedulers is covered in the migration guide, Random you're the expert on, the only thing I'm unsure about it batch_run. Is that outdated? I do remember the issue, was it ever fixed?

Git history shows it was added here:

And solved this issue:

With some discussion here:

@quaquel
Copy link
Member Author

quaquel commented Nov 2, 2024

the only thing I'm unsure about it batch_run. Is that outdated? I do remember the issue, was it ever fixed?

It's the only thing that is not clearly outdated. The underlying thing is, however, not a mesa-specific thing but is all about the proper use of Python's multiprocessing.

However, (1) the provided code is not correct nor up to date. freeze_support should not be needed. (2) The use of if __name__ == '__main__': is recommended on all operating systems. In fact, without it, the code will fail on MacOS and Windows because both don't use os.fork but os.spawn to instantiate new worker processes. (3) you can easily do multiprocessing in jupyter lab, even on Windows as long as the model is imported into the notebook rather than defined in the notebook. Again this has to do with understanding how multiprocessing creates the worker processes.

In my view, this information, if we want to keep it, should be shifted to the module-level docstring of batch-run.

Copy link
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, let’s write up the gist of it there.

@quaquel
Copy link
Member Author

quaquel commented Nov 2, 2024

Sounds good, let’s write up the gist of it there.

Ok,I'll just at the update to that docstring to this PR later today.

@quaquel quaquel merged commit 69571b4 into projectmesa:main Nov 2, 2024
12 checks passed
@quaquel quaquel deleted the howto branch November 2, 2024 10:45
@EwoutH EwoutH added the docs Release notes label label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The How-To guide is outdated

2 participants