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

Updatets #80

Closed
wants to merge 8 commits into from
Closed

Updatets #80

wants to merge 8 commits into from

Conversation

gidden
Copy link
Member

@gidden gidden commented Jun 12, 2015

This is the fourth PR in a set of prs related to dbtypes.js. It does not work with the current dbtypes.js installed by cyclus in cyclus/cyclus#1184, but it does work with dbtypes.js.old that is also installed. It is depedent on cyclus/cyclus#1184.

Note that by "work" I mean: "builds and tests without error".

The (now with a better message) error that is raised on the current dbtypes.js is:

$ rm -r build; ./setup.py install --user && nosetests -w tests
Generating API Bindings...

--------------------

If you are having issues building cymetric, please report your problem to cyclus-dev@googlegroups.com or look for help at http://fuelcycle.org

--------------------
Traceback (most recent call last):
  File "./setup.py", line 269, in <module>
    main()
  File "./setup.py", line 240, in main
    main_body(cmake_args, make_args)
  File "./setup.py", line 214, in main_body
    genapi.main([])
  File "/home/gidden/work/cyclus/cymetric/genapi.py", line 1018, in main
    code_gen(ts, ns)
  File "/home/gidden/work/cyclus/cymetric/genapi.py", line 1001, in code_gen
    s = func(ts, ns)
  File "/home/gidden/work/cyclus/cymetric/genapi.py", line 857, in typesystem_pyx
    rtn = TYPESYSTEM_PYX.render(ctx)
  File "/home/gidden/.local/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/gidden/.local/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "<template>", line 93, in top-level template code
  File "/home/gidden/work/cyclus/cymetric/genapi.py", line 222, in convert_to_py
    raise Exception(errormsg.format(x, t, "declaration", e))
Exception: KeyError with variable x of type (u'std::map', u'std::string') (in declaration): u'valdecl'

This failure goes away if the following types are removed:

    '["std::map< std::string, std::pair<double, std::map<int, double> > >", 3, "SQLite", "v1.3", 1],' +
    '["std::map< int, std::map< std::string, double> >", 3, "SQLite", "v1.3", 1],' +
    '["std::map< std::string, std::vector< std::pair< int, std::pair<std::string, std::string> > > >", 5, "SQLite", "v1.3", 1],' +
    '["std::map< std::string, std::pair<double, std::map<int, double> > >", 3, "HDF5", "v1.3", 0],' +
    '["std::map< int, std::map< std::string, double> >", 3, "HDF5", "v1.3", 0],' +
    '["std::map< std::string, std::vector< std::pair< int, std::pair<std::string, std::string> > > >", 5, "HDF5", "v1.3", 0],' +
    '["std::map< std::pair<int, std::string>, double >", 2, "HDF5", "v1.3", 0],' +

I can not find any simple unique features that explain the bug, so I will leave it to others to contemplate.

@gidden
Copy link
Member Author

gidden commented Jun 12, 2015

note that this is built on top of #79

@opotowsky
Copy link
Member

@gidden, after installing the changes from the relevant PR in cyclus, the following error happens whether genapi.py looks for dbtypes.js or dbtypes.js.old:

(gidden-updatets) $ ./setup.py install --user
Generating API Bindings...

--------------------

If you are having issues building cymetric, please report your problem to cyclus-dev@googlegroups.com or look for help at http://fuelcycle.org

--------------------
Traceback (most recent call last):
  File "./setup.py", line 269, in <module>
    main()
  File "./setup.py", line 240, in main
    main_body(cmake_args, make_args)
  File "./setup.py", line 214, in main_body
    genapi.main([])
  File "/home/opotowsky/cyclus/cymetric/genapi.py", line 1018, in main
    code_gen(ts, ns)
  File "/home/opotowsky/cyclus/cymetric/genapi.py", line 1001, in code_gen
    s = func(ts, ns)
  File "/home/opotowsky/cyclus/cymetric/genapi.py", line 857, in typesystem_pyx
    rtn = TYPESYSTEM_PYX.render(ctx)
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "<template>", line 93, in top-level template code
  File "/home/opotowsky/cyclus/cymetric/genapi.py", line 222, in convert_to_py
    raise Exception(errormsg.format(x, t, "declaration", e))
Exception: KeyError with variable x of type (u'std::map', u'std::string') (in declaration): u'valdecl'

I'm not exactly sure of whats happening in this function (outside of the obvious) so I don't have an explanation for this. Shouldn't this not happen with .old?

@opotowsky
Copy link
Member

Or are the types you listed above still in .old? It's hard to tell without line numbers

@gidden gidden mentioned this pull request Jun 15, 2015
@opotowsky opotowsky mentioned this pull request Jul 6, 2015
@gidden
Copy link
Member Author

gidden commented Aug 6, 2015

FYI @rwcarlsen, @gonuke, this PR has a code snippet for generating enum types given a cpp type

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

Successfully merging this pull request may close these issues.

2 participants