Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.1.0 regression] Image files from examples don't load (on Windows) #1461

Closed
EwoutH opened this issue Oct 20, 2022 · 10 comments · Fixed by #1463
Closed

[1.1.0 regression] Image files from examples don't load (on Windows) #1461

EwoutH opened this issue Oct 20, 2022 · 10 comments · Fixed by #1463

Comments

@EwoutH
Copy link
Contributor

EwoutH commented Oct 20, 2022

Describe the bug
On Windows using Mesa 1.1.0, agent portrayal images don't load when running an example.

Expected behavior
Agent images load without errors in the example model.

To Reproduce

  1. Checkout Mesa 1.1.0 (or the current main branch)
  2. Run the run.py file of one of the examples (sugarscape_cg or wolf_sheep) (on Windows?)

Additional context

1.0.0

Screenshot_797Screenshot_798

1.1.0

Screenshot_799Screenshot_796

@rht
Copy link
Contributor

rht commented Oct 20, 2022

After bisecting the commits, I found this commit to be the cause: 3def79d. cc @wang-boyu

@rht
Copy link
Contributor

rht commented Oct 20, 2022

I made a fix in https://github.com/projectmesa/mesa/tree/v1.1.1-hotfix, but this needs to be tested on Mesa-Geo. Once tested, let's release 1.1.1 ASAP (cc @jackiekazil ). I added back the local handler last so that hopefully the catch-all /local/(.*) doesn't collide with the element-specific handlers.

@wang-boyu
Copy link
Member

wang-boyu commented Oct 20, 2022

How about putting these files into a dedicated folder, e.g. local/assets/?

This line could be updated from:

img.src = "local/".concat(shape);

to

img.src = "local/assets/".concat(shape);

And similarly your local handler could be

local_handler = (
            r"/local/assets/(.*)",
            tornado.web.StaticFileHandler,
            {"path": ""},
        )

@rht
Copy link
Contributor

rht commented Oct 20, 2022

That should do. I renamed "assets" to "custom" instead. Already pushed to that branch.

@wang-boyu
Copy link
Member

Tested and didn't see any issues with your branch and Mesa-Geo v0.4.0.

@wang-boyu
Copy link
Member

I guess it's working also because there's only the MapModule gets loaded in Mesa-Geo, nothing in /local/custom/ folder. But I don't have any example that needs both of these folders to test this scenario. It probably will work too.

@rht
Copy link
Contributor

rht commented Oct 20, 2022

I have already tested on the wolf-sheep example. I created the v1.1.1 branch from the wrong HEAD. Was from current main, but now on top of the 1.1.0.

@rht rht mentioned this issue Oct 21, 2022
@rht
Copy link
Contributor

rht commented Oct 21, 2022

@jackiekazil I have added the v1.1.1 tag. You can release to PyPI at any time.

@EwoutH
Copy link
Contributor Author

EwoutH commented Oct 21, 2022

Thanks for looking into and fixing this so quickly!

Is releasing to PyPI not automated? We should get that in the CI

@rht
Copy link
Contributor

rht commented Oct 21, 2022

The PyPI automation is blocked by this question: #1252 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants