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

Inconsistent translator naming convention for Categories.SCATTER drops #71

Open
myxie opened this issue Oct 4, 2021 · 1 comment
Open

Comments

@myxie
Copy link
Collaborator

myxie commented Oct 4, 2021

Context

When running the translation from an LGT designed in EAGLE, there are inconsistencies in the named output in the translated PGT.

In a *.graph file, a normal application node (e.g. PythonApp) will have the name stored in the text field:

"nodeDataArray": [
            ....
            "category": "PythonApp",
            "categoryType": "Application",
            ...
            "text": "UpdateGSM",

After translation, this produces the following (abridged) output:

...
"dt": "PythonApp", 
"nm": "UpdateGSM",
...

This is a nice form of 'output sugar', as it makes keeping track of the applications in other contexts easier than following the OIDs, which have no contextual meaning.

When the node is a Scatter or Gather drop, the following occurs instead, in the dlg.dropmake.dm_utils.convert_construct function:

if has_app[0] == "i":
    app_node["text"] = node["inputApplicationName"]
else:
    app_node["text"] = node["outputApplicationName"]

This leads to an ambiguous naming convention for the Scatter drops in the PGT file:

# Scatter drop naming in LGT JSON output
"dt": "PythonApp", 
"nm": "Python App"

Request

There is no clear context for why the app_node["text"], and subsequent name change in the drop 'nm' field, requires this change; it is possible there is some historical reason for the change, but updating to the following makes no difference to the translation:

if has_app[0] == "i":
    app_node["text"] = node["text"]
else:
    app_node["text"] = node["text"]

Any discussion or pointers on this would be greatly appreciated.

@myxie myxie changed the title Inconsistent translation naming convention for Categories.SCATTER drops Inconsistent translator naming convention for Categories.SCATTER drops Oct 4, 2021
@james-strauss-uwa
Copy link
Collaborator

I don't have much insight here, I'm not very familiar with the code.

It seems like the purpose of convert_construct is to create a new node (app_node) to contain the input/output application of a scatter/gather/service node.

The name of the input/output application will not necessarily be the same as the containing construct. So it seems like you would want to use the:

app_node["text"] = node["inputApplicationName"]

instead of the

app_node["text"] = node["text"]

so that the new application node carries the name of the application, rather than the name of the containing construct.

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