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

Easy Enhancement: filepath instead of filename for pyro.render_model() #3184

Closed
LysSanzMoreta opened this issue Feb 22, 2023 · 2 comments
Closed

Comments

@LysSanzMoreta
Copy link
Contributor

Hi!

I am just wondering if it would be possible to have a small fix to the pyro.render_model() function, so that it can take a filepath instead of a filename to save the .pdf to. Right now the function removes the path from the name (not sure why):

    if filename is not None:
        filename = Path(filename)
        suffix = filename.suffix[1:]  # remove leading period from suffix
        graph.render(filename.stem, view=False, cleanup=True, format=suffix)

Thanks!

@fehiepsi
Copy link
Member

Keeping the path sounds more reasonable to me. Do you want to submit the change?

@LysSanzMoreta
Copy link
Contributor Author

LysSanzMoreta commented Feb 27, 2023

@fehiepsi Sure, let me have a look at it

LysSanzMoreta added a commit to LysSanzMoreta/pyro that referenced this issue Feb 28, 2023
fehiepsi pushed a commit that referenced this issue Mar 3, 2023
* Issue #3184

* reverted signature

* os import

* black formatting

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

No branches or pull requests

2 participants