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

eng_python() seems to ignore a single line of code that does not generate output #126

Closed
yihui opened this issue Nov 17, 2017 · 3 comments
Closed

Comments

@yihui
Copy link
Member

yihui commented Nov 17, 2017

Minimal reprex:

```{r}
knitr::knit_engines$set(python = reticulate::eng_python)
```

```{python}
x = "hi there"
print(x)
```

```{python}
y = x.split(" ")  # no output
```

```{python}
print(y)
```

Output (note that the second python code chunk is missing):

image

@jjallaire
Copy link
Member

@kevinushey Let's see if we can get a fix in for this one (realize you aren't focused on the python engine right now but I think this might be a deal-breaker for knitr making reticulate the default)

@jjallaire
Copy link
Member

I had to do a patch release of reticulate for another reason and as a result this fix is now on CRAN in v1.3.1: https://cran.r-project.org/web/packages/reticulate/index.html

@yihui
Copy link
Member Author

yihui commented Nov 24, 2017

Excellent! I'll prepare a CRAN release of knitr soon.

yihui added a commit to yihui/knitr that referenced this issue Dec 21, 2017
clrpackages pushed a commit to clearlinux-pkgs/R-knitr that referenced this issue Dec 29, 2017
Carsten Behring (1):
      Call lein exec with '-ep' instead of "-e" (#1439)

Christophe Dervieux (1):
      New imgur_upload with xml2 and httr (#1433)

Jim Hester (1):
      Allow use of _ in engine names (#1468)

Michael Chirico (1):
      Closes #1448. Adds support for fig.dim chunk option (#1449)

Yihui Xie (46):
      add a note on `R CMD build` based on the feedback from @pyltime
      a news item for #1417 and bump version
      fix #1431: try to write the csv file if possible
      bump version
      factor out png_available()
      assume the API always returns XML
      remove XML and RCurl in Suggests, and roxygenize after #1433
      roxygenize and bump version
      fix #1441: call evaluate::evaluate() at runtime instead of package build time
      bump version
      a second usage of engine_output(), so that I don't need to export wrap(); close #1442
      roxygenize and bump version
      add my ORCID
      close #1443: add an evaluate.inline hook
      bump version
      rename to showtext::showtext_begin()
      include_graphics() should use plot_counter() too, just in case it is used along with other plotting functions
      bump version
      fix #1446: when trailing spaces on certain lines of a code chunk in a blockquote are trimmed, knitr fails to remove the indent string (e.g. >)
      export is_latex_output() and is_html_output(); close rstudio/rmarkdown#649
      add a news item, roxygenize, and bump version
      html4 is also HTML output
      bump version
      fix rstudio/flexdashboard#155: html4 should be treated as an HTML output format (i.e. should not take screenshots for HTML widgets when the output format is html4)
      the dev option could be of length > 1, as revealed by rstudio/flexdashboard#155
      bump version
      close #1440: finally knitr can say hello to Python loudly and confidently!! 🎉
      unlist() the engine output if it is a list
      bump version
      typo
      fix #1460: `kable()` should generate the table caption when the data only has one column and the output format is pandoc
      add a new engine `julia` based on `JuliaCall::eng_juliacall()` (#1458)
      cosmetic
      fix #1462: retrieve column names *after* coercing x to a data frame, because dplyr's colum names may not be stable
      remove the last dependency on RCurl
      fix #1456: change the default of auto_pdf to FALSE in include_graphics()
      close #1455: support Haskell comments in read_chunk()
      add a news item for #1449
      a news item for #1444, and add @eliocamp to the list of contributors
      bump version
      a news item for #1462
      bump version
      bump the version of reticulate due to rstudio/reticulate#126
      reorder news items
      update the invalid URL
      knitr 1.18 was submitted to CRAN about a month ago, but I don't know what made it stuck there; I'm going to move on anyway

dmurdoch (1):
      Sweave2knitr left a connection open, the next gc() triggered a warning (#1432)

eliocamp (2):
      adds fig.ncol for latex output (#1444)
      trigger `hook_plot_latex()` with fig.subcap (#1466)

yonicd (1):
      add knitr::opts_chunk$append() (#1417)
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

No branches or pull requests

2 participants