Closed amanmdesai closed 1 year ago
To use this:
from pyhepmc.view import save_event
save_event(event,'evt.svg') #or .png to save as png
Thanks for this contribution! I added some comments.
Hi @HDembinski Thanks a lot for your comments. I have implemented all of them except -
Ideally,
name
should also accept a file handle from a file that was already opened. The implementation then becomes more complex. You don't have to implement that, I can do it, but if you feel up to it, give it a try.
Please let me know me if the implementation looks fine.
For the tests, shall I write a test that call the function and see if that works? as we need to test if the function works. (or is something additional required?)
Ideally, name should also accept a file handle from a file that was already opened. The implementation then becomes more complex. You don't have to implement that, I can do it, but if you feel up to it, give it a try.
I do not know how this is implemented.
@amanmdesai I implemented saving to more formats supported by graphviz, and the option to save to an existing file-like object. I also added a test. I made some unrelated changes to, which fix issues with colors.
@amanmdesai I implemented saving to more formats supported by graphviz, and the option to save to an existing file-like object. I also added a test. I made some unrelated changes to, which fix issues with colors.
@HDembinski Thanks very much.
@amanmdesai Fixing and upgrading the tests took me way too long, but I am going to merge now. Thank for you very much for contributing to this patch!
Thanks @HDembinski
Hi @HDembinski, I would be happy to know if this PR resolves #46.
I have not yet included tests (and formatting).