# Revise cannot transform my dataset

**URL:** <https://discourse.julialang.org/t/revise-cannot-transform-my-dataset/39177>\
**Category:** Performance\
**Tags:** performance, dataframes, revise\
**Created:** [May 9, 2020, 11:55am UTC](https://discourse.julialang.org/t/revise-cannot-transform-my-dataset/39177 "2020-05-09T11:55:17Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![orialb](https://avatars.discourse-cdn.com/v4/letter/o/65b543/32.png) [@orialb](https://discourse.julialang.org/u/orialb)\
**Post date:** [May 9, 2020, 9:03pm UTC](https://discourse.julialang.org/t/revise-cannot-transform-my-dataset/39177/21 "2020-05-09T21:03:09Z")

</div>

Maybe I was wrong with what I wrote above. I thought Revise tracks only changes in functions, but this is obviously not correct (in retrospect I know that it also works with new `struct` definitions and so on).  
Still I’m not sure exactly when and which parts of the code will be re-run when you make changes in the script above.  
I guess what I am confused about your workflow is- what parts of the code do you wish that Revise will automatically re-evaluate as you are making changes?

---

<div class="post-metadata">

**Author:** ![chedieck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chedieck/32/14716_2.png) [@chedieck](https://discourse.julialang.org/u/chedieck)\
**Post date:** [May 9, 2020, 9:03pm UTC](https://discourse.julialang.org/t/revise-cannot-transform-my-dataset/39177/22 "2020-05-09T21:03:47Z")

</div>

Yep, tried that, `logs` returns a `0-element Array{Revise.LogRecord,1}`.

I thought about X-posting this to the Issues section on github, but I know @tim.holy replies to the posts here very often, so I thought that it would be unnecessary flooding.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [May 9, 2020, 9:08pm UTC](https://discourse.julialang.org/t/revise-cannot-transform-my-dataset/39177/23 "2020-05-09T21:08:43Z")

</div>

I don’t have time to dig into this in detail right now, but the short answer is that whenever you have problems with `includet` you should consider separating your “code” (function definitions) and “script” (tasks you want to run) into separate files. You should `includet` the functions and `include` the script. (Or better, make the functions a package, so you get the benefits of precompilation.)

This comes down to the fact that `includet` needs to be able to figure out what’s code-definition and what’s “work,” and run the code-definition in the interpreter and the work in the compiler (for reasons of performance, because the interpreter is really slow). Moreover, it needs to be extremely careful not to run certain kinds of things twice. Revise is already quite good at figuring these things out, but surely there are still some bugs and it’s fundamentally a hard (perhaps undecidable) [problem](https://github.com/timholy/Revise.jl/issues/249). You can make its job easier by separating your code from your script-work and make sure it only tracks the former.

---

<div class="post-metadata">

**Author:** ![chedieck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chedieck/32/14716_2.png) [@chedieck](https://discourse.julialang.org/u/chedieck)\
**Post date:** [May 9, 2020, 9:17pm UTC](https://discourse.julialang.org/t/revise-cannot-transform-my-dataset/39177/24 "2020-05-09T21:17:58Z")

</div>

Alright, It makes sense. I will practice this separation (as @orialb and @ericphanson have suggested) of “global variables file” and “functions file”, looks like it’s the Julian way to go.

[Previous page](https://discourse.julialang.org/t/revise-cannot-transform-my-dataset/39177.md?page=1)
