-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add interface to JS renderer #465
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
Conversation
|
I haven't looked at the "Run module doctests" step in the CI before, but it's more likely a problem with some sort of configuration than the actual implementation. |
The relative import warning can be fixed by adding empyt |
f1c7e93 to
32aab00
Compare
|
It seems like CodeFactor doesn't know how if statements work in python? It considers it to be a problem if an if-block containing a return is followed by an elif or else block. |
|
It's probably considering it to be unreachable code or something. |
32aab00 to
aa67826
Compare
|
CodeFactor doesn't like exec, TODOs, if statements, and an admittedly weird import that happens to be necessary here. Not only do I not think it's worth it to satisfy it, but in the case of exec I don't even think it's possible. |
|
Codefactor is just running PyLint. You can run one in you computer also and fix it. Usually default in many ide's. |
|
Running all PRs through pylint is a pretty big change to make with no notice. We should get a .pylintrc, add the dependency to poetry, and update the docs with this. |
|
@eulertour this is my fault - like I said on discord, I meant to try out CodeFactor on my own but didn't realize it was installed on the whole repo. I left it on because I didn't think it was too obtrusive, as we have been merging PRs with the CodeFactor check still in red in some cases. I agree that enforcing it with no notice is a big change, though we haven't really been enforcing it. So the paths forward are to ignore it and leave it here (because I do think it's somewhat useful) but ignore it, or just uninstall it. |
|
I'd prefer to ignore it for until we make the changes from my previous comment and start using it then. |
1eb72b5 to
040e888
Compare
|
I suggest we can merge this only after first release. |
|
We can tag a current or recent commit for the release. We can still do the review now. |
|
Full disclosure, if nobody is willing/able to review this I'll probably merge it soon. Not that that's necessarily a bad thing, but it'll cost us a lot of progress in the long run to leave complex developments for >1 week. |
|
I'll review it. In fact, I have already reviewed half the files. It's just
that my time is not my own this week. Sorry for the wait!
…On Thu, Oct 1, 2020 at 11:59 AM Devin Neal ***@***.***> wrote:
Full disclosure, if nobody is willing/able to review this I'll probably
merge it soon. Not that that's necessarily a bad thing, but it'll cost us a
lot of progress in the long run to leave complex developments for >1 week.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#465 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAILYAHTRXLVXMKVYEJXOILSISRNZANCNFSM4RUGKKHA>
.
--
www.leotrs.com | [email protected]
PhD candidate at the Network Science Institute, Northeastern University
|
leotrs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed everything except for the frame server class. A couple quick things:
- please don't forget to edit the changelog too
- there's a major discussion to be had about how to test this
- what's your opinion on merging this before or after the v0.1 release?
behackl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one thing I am curious about: you say that
- The files in manim/grpc/gen/ were generated by grpc, so there's no need to review them.
If they are automatically generated, do we really need to keep them under version control? If possible, I'd like to have them generated during the installation of manim, for example. (But I don't know anything about grpc, sorry if the question does not make sense. :-))
|
@behackl the question makes sense but it should happen separately from this, as poetry.lock should also be handled this way. |
de03971 to
5d1b9ee
Compare
|
Yes we should totally have a (separate) PR removing certain files from version control (though it would be great to not add them in the first place 👀 ) |
|
Sure, I am fine with delegating this to a later PR. However, the situation for the lock file is different from these autogenerated code files: they ensure a more deterministic setup (especially when it comes to the pipelines / testing) and should be kept (see https://stackoverflow.com/questions/39990017/should-i-commit-the-yarn-lock-file-and-what-is-it-for or similar questions -- the answer there is for We can come back to this question whenever we deal with other autogenerated stuff. :-) |
|
It'd certainly be better to generate the files at install time, but learning the proper way to do it with poetry and finding a way to test it would add a lot of unnecessary overhead to this PR, especially since it's rather large already. I'd be happy to open an issue when this is merged. To answer you questions @leotrs
Done
Not only this, but all of the renderers. IIUC our current tests only validate the pixel data before it's sent to be rendered, so even the de facto cairo renderer isn't being tested right now.
I'd prefer just to do it as soon as possible, not so that it's included in the release but so I can continue to simplify scene.py and factor out the rendering logic. For future releases we should decide on using stable/dev branches or tagging a commit early on so releases don't hinder development progress. |
I did a little bit of searching: poetry does not support post install scripts at all, which is very frustrating. (https://stackoverflow.com/questions/59802468/post-install-script-with-python-poetry -- grpc is also mentioned in the issue linked in the answer.) Anyhow, let us revisit this at a later time, as you suggest. I agree with including the files for the time being. |
abd617d to
ad27768
Compare
|
The tests pass, and this does't seem to change the current workflow of users in any way. Is this at a stage where it is ready to be use-tested by end users? If so, I'd suggest adding documentation. If not, then we can just merge this silently and not ask anyone to use it yet. |
|
It's not quite there yet, so I'd be fine merging it silently. |
|
SGTM. |
behackl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have primarily reviewed your changes to existing files and rather superficially read the new additions; everything looks good to me (and the option of having an alternative render backend is really exciting; pretty cool stuff!).
I only have a minor change request before I also approve: the fact that rendering simply by creating a Scene object has changed to rendering on calling Scene.render() should be documented explicitly in the changelog, I feel. Could you add another explicit entry for that?
ad27768 to
88d67bf
Compare
behackl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Feel free to merge after resolving the merge conflict.
|
This commit breaks the set_test_scene function to produce control data. |

Adds the ability to communicate with the electron frontend at https://github.com/ManimCommunity/manim-renderer, doing some refactoring in
scene.pyand__main__.pyin the process.This PR adds the
JsSceneandJsCameraclasses, which are used in place ofSceneandCamerarespectively when using javascript for rendering. It also adds aFrameServerclass which communicates with the renderer over gRPC. TheFrameServerruns in python on port 50051 and theRenderServerruns in javascript on port 50052.A few things to note:
manim/grpc/gen/were generated by grpc, so there's no need to review them.UpdateFrontendRendererclass inmanim/grpc/impl/frame_server_impl.pywill eventually allow for automatic updates upon code changes but currently doesn't do anything, so there's no need to review it.manim/scene/js_scene.pytheres a line which overwritesScenewithJsScenewhen javascript rendering is requested. This allows for both javascript and ffmpeg rendering without the user changing their code, but if some code were to useSceneprior to this line when javascript rendering is requested, this could potentially cause problems.get_module(),get_scene_classes_from_module(), andget_scenes_to_render()were moved from__main__.pytoutils/module_ops.py, in order to share them with theFrameServer.handle_play_like_call()was moved out ofScenein order to share it withJsScene.Scene.progress_through_animations()was refactored to be a little simpler. It's still not simple enough, asplay()should ideally look something likeself.display_funcsinCamerawas moved into the function where it's used. The reason is that initializing it early causes problems when theCamerais copied (FrameServershares the sameCamerainstance between manySceneinstances, but the initialization forms a closure aroundself(a singleCamerainstance)).It'd also be helpful if you try to build and run the renderer at https://github.com/ManimCommunity/manim-renderer. I've only used it on Linux and one person has run it on Windows a while ago, but I don't have a good idea of how hard it is to set up from scratch.