End-to-end-provenance / DDG-Explorer

Software to support creation, visualization and querying of Data Derivation Graphs.
5 stars 5 forks source link

Multiple definitions of the same function name bug #59

Closed fong22e closed 5 years ago

fong22e commented 8 years ago

DDG Explorer shows an error when there are multiple definitions of the same function name in the R script. For example:

fn1 <- function()
{
    fn <- function()
    {
        a <- 1
    }
}

fn2 <- function()
{
    fn <- function()
    {
        b <- 2
    }
}

fn1()
fn2()

When RDataTracker is used to run the above example and when the resulting ddg is displayed using ddg.display(), DDG Explorer gives the following error:

There is more than one definition of the function fn
tfjmp commented 8 years ago

Hi, can you attach the JSON being generated?

fong22e commented 8 years ago

Hi, I am so sorry for the delay. This is the JSON file generated for the above example. Since GitHub says that it does not support the JSON file type, I have changed it to a .txt instead.

ddg.json.txt

tfjmp commented 8 years ago

Thanks!

However, the JSON is misformed (there is a bug with "sourced script"), I did a dirty and quick fix there (probably still does not work in some corner cases): https://github.com/tfjmp/RDataTracker/commit/42bab405a757b5df3f6be321fc003e0363f05c83

Once that is fixed, the graph generated (as seen bellow) seems completely valid[1]. Outside of bug in the JSON format, you can visualise your graph there: http://camflow.org/demo; valid the JSON there: https://jsonformatter.curiousconcept.com. graph

Well that does not solve your issue, but if you are working on RDataTracker you can continue to do so ^^.

[1] "undefined" are the line number which attribute name changed across RDataTracker versions, it would be great to be notified of changes to the JSON formatting. If you switch to using the dev branch it should be all good!

blernermhc commented 5 years ago

This no longer causes an error.