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

CDMGraphVisualizer.py KeyError: 'type' #2

Open
UnnameBao opened this issue Jun 8, 2020 · 1 comment
Open

CDMGraphVisualizer.py KeyError: 'type' #2

UnnameBao opened this issue Jun 8, 2020 · 1 comment

Comments

@UnnameBao
Copy link

When I try use CDMGraphVisualizer.py to visualize testdata, I found this error:

Traceback (most recent call last):
File "CDMGraphVisualizer.py", line 232, in
main()
File "CDMGraphVisualizer.py", line 180, in main
rtype = cdmparser.get_record_type(edge)
File "/home/b0ring/anaconda3/envs/py27/lib/python2.7/site-packages/tc/schema/records/parsing.py", line 79, in get_record_type
if record["type"] == self.type_checks[type]:
KeyError: 'type'

I tried to fix this problem to modifiy parsing.py in line 79 to:

if record["datum"]["type"] == self.type_checks[type]:

but then I got a new error:

Traceback (most recent call last):
File "CDMGraphVisualizer.py", line 232, in
main()
File "CDMGraphVisualizer.py", line 180, in main
rtype = cdmparser.get_record_type(edge)
File "/home/b0ring/anaconda3/envs/py27/lib/python2.7/site-packages/tc/schema/records/parsing.py", line 86, in get_record_type
raise ValueError("Provided record type not supported by CDM Parser.")
ValueError: Provided record type not supported by CDM Parser.

Since I use testdata rather than use my own data, I thought there has problem at this script.

@Endcat
Copy link

Endcat commented Sep 18, 2023

When I try use CDMGraphVisualizer.py to visualize testdata, I found this error:

Traceback (most recent call last):
File "CDMGraphVisualizer.py", line 232, in
main()
File "CDMGraphVisualizer.py", line 180, in main
rtype = cdmparser.get_record_type(edge)
File "/home/b0ring/anaconda3/envs/py27/lib/python2.7/site-packages/tc/schema/records/parsing.py", line 79, in get_record_type
if record["type"] == self.type_checks[type]:
KeyError: 'type'

I tried to fix this problem to modifiy parsing.py in line 79 to:

if record["datum"]["type"] == self.type_checks[type]:

but then I got a new error:

Traceback (most recent call last):
File "CDMGraphVisualizer.py", line 232, in
main()
File "CDMGraphVisualizer.py", line 180, in main
rtype = cdmparser.get_record_type(edge)
File "/home/b0ring/anaconda3/envs/py27/lib/python2.7/site-packages/tc/schema/records/parsing.py", line 86, in get_record_type
raise ValueError("Provided record type not supported by CDM Parser.")
ValueError: Provided record type not supported by CDM Parser.

Since I use testdata rather than use my own data, I thought there has problem at this script.

I think the script works well for me, but not the given testdata.
The script works fine with darpa tc datasets, since you can replace the testdata. There are still missing key-values in
https://github.com/raytheonbbn/tc-ta3-api-bindings-python/blob/8cd25dc46b5c6f7fd86cd4bbf6d512a7bfbef8e9/tools/CDMGraphVisualizer.py#L51C24-L51C24
NodeEdgeShapesColors dict which need to fix it according to errors.
btw, graphviz is too week to generate a large CDM graph, it crashed my pc every time :<

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