Appropriate build system for cpp returns of declared dtypes

10 views
Skip to first unread message

Matthew Gidden

unread,
Apr 4, 2014, 12:47:17 PM4/4/14
to xdress
Hi all,

This is a bit in the weeds for me, and I'd enjoy some clarification.

I have a xdressed struct and a function that returns it:

h/cc:
class ArcFlow 
std::vector<ArcFlow> execute_exchange(Params& params, std::string db_path = "");

xdressrc:
stlcontainers = [
    ('vector', 'int'),
    ('vector', 'float'),
    ('vector', 'ArcFlow'),
    ('vector', ('vector', 'int')),
    ('map', 'int', 'float'),
    ('map', 'int', 'int'),
    ('map', 'int', 'bool'),
    ('map', 'int', ('vector', 'int')),
    ('map', 'int', ('vector', 'float')),
    ('map', 'int', ('vector', ('vector', 'int'))),
    ('map', 'int', ('map', 'int', ('vector', 'float'))),
    ]

However, when I call the function
from cyclopts.execute import Params, execute_exchange
from cyclopts.dtypes import xd_arcflow
obs = execute_exchange(params)
 
I get the following error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/gidden/phd/cyclopts/tests/test_execute.py", line 12, in test_null
    obs = execute_exchange(params)
  File "execute.pyx", line 314, in cyclopts.execute.execute_exchange (/home/gidden/phd/cyclopts/build/cyclopts/execute.cxx:7095)
NameError: name 'dtypes' is not defined

Any suggestions? I'd be happy to provide more data as requested.

Cheers,
--
Matthew Gidden
Ph.D. Candidate, Nuclear Engineering
The University of Wisconsin -- Madison
Ph. 225.892.3192

Anthony Scopatz

unread,
Apr 4, 2014, 1:30:06 PM4/4/14
to Matthew Gidden, xdress
Hi Matt,

This seems like it is a bug with the dtypes not being imported into execute.  The actual bug is probably in TypeSystem.register_classname().  I'll take a look.

Be Well
Anthony


--
You received this message because you are subscribed to the Google Groups "xdress" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/xdress/CAHRdPFyScUco3kf39yfF%2Bqn%3DZn%3Dyp%3DOGaRVV9cd%3DA%3DA58jnhtQ%40mail.gmail.com.

Anthony Scopatz

unread,
Apr 4, 2014, 1:42:39 PM4/4/14
to Matthew Gidden, xdress
HI Matt, 

From a clean build with the current xdress master and current cyclopts matser, and the following script:

from cyclopts.execute import Params, execute_exchange
from cyclopts.dtypes import xd_arcflow
params = Params()
obs = execute_exchange(params)

I see the following output:

scopatz@ares ~/t $ python temp.py
Clp0000I Optimal - objective value 0
Clp0032I Optimal objective 0 - 0 iterations time 0.002

This seems right to me...

Be Well
Anthony

Matthew Gidden

unread,
Apr 4, 2014, 2:05:32 PM4/4/14
to Anthony Scopatz, xdress
Ah yes, because I commented out the offending code to keep working.

Anthony Scopatz

unread,
Apr 4, 2014, 2:09:29 PM4/4/14
to Matthew Gidden, xdress
So how do I reproduce this?

Matthew Gidden

unread,
Apr 4, 2014, 2:11:57 PM4/4/14
to Anthony Scopatz, xdress
Sorry, I was taking a moment to push to a new branch. You'll find it in cyclopts on the dtypes branch. Blowing away the build directory is required, of course.

Anthony Scopatz

unread,
Apr 4, 2014, 3:10:28 PM4/4/14
to Matthew Gidden, xdress
A fix is in #216
Reply all
Reply to author
Forward
0 new messages