STEllAR-GROUP / phylanx

An Asynchronous Distributed C++ Array Processing Toolkit
Boost Software License 1.0
75 stars 76 forks source link

Bad physl output for d_random() #1243

Closed stevenrbrandt closed 4 years ago

stevenrbrandt commented 4 years ago

Given a file named err.physl containing this code

random_d(list(3,3), find_here(), num_localities())

and execution of the file like this

physl --print err.physl

The output is

[[0.466236, 1.07511, 0.459589], [-1.14393, 0.170149, 0.0301673], [-0.422635, -0.294086, -0.298268]], annotation("localities", list("meta_0", list("tile", list("rows", 0, 3), list("columns", 0, 3))), list("locality", 0, 1), list("name", "random_array_1/0"))

This is not a proper PhySL value. Possibly, the output should be

{
  "data":[[0.466236, 1.07511, 0.459589], [-1.14393, 0.170149, 0.0301673], [-0.422635, -0.294086, -0.298268]],
  "localities": list("meta_0", list("tile", list("rows", 0, 3), list("columns", 0, 3))), list("locality", 0, 1), list("name", "random_array_1/0")
}
hkaiser commented 4 years ago

This pretends that the data is actually represented as a dictionary, which is not the case. But I agree that this would improve the readability (and possibly utility) of the generated output.

stevenrbrandt commented 4 years ago

@hkaiser the problem is, the output of --print should be something that PhySL can interpret. Otherwise, I have no way of getting a result back to the user in the notebook.

stevenrbrandt commented 4 years ago

@hkaiser I mean, I can hack together some regex parser to figure out something... but I think that's a bad strategy in the long term.

hkaiser commented 4 years ago

I'll take care of this, shouldn't be a problem.