Skip to content

Expose CFunction#9

Open
dpinte wants to merge 32 commits intomasterfrom
enh/add-cfunction
Open

Expose CFunction#9
dpinte wants to merge 32 commits intomasterfrom
enh/add-cfunction

Conversation

@dpinte
Copy link
Contributor

@dpinte dpinte commented Jul 10, 2019

@flongford here is the first steps towards being able to use a CFunction. It's very close, I just need to get a full test running and add error management. Can you do a first review? The naming of the classes and modules definitely needs a second pass.

Copy link

@flongford flongford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had an overview and tested some functionality of the PyFunction class, but will take a closer look next week.



cdef class ExpressionType(Expression):
# Is it ok to let users rely on the Expression.__cinit__.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose instantiating objects as Expression base classes makes more sense than abstracting the base class from an existing class...

@dpinte dpinte changed the title WIP: Expose CFunction Expose CFunction Jul 12, 2019
@dpinte
Copy link
Contributor Author

dpinte commented Jul 12, 2019

@flongford this should be functional now.

@dpinte
Copy link
Contributor Author

dpinte commented Jul 13, 2019

Tests segfault on Travis. I'll investigate

Current thread 0x00007efde0e60740 (most recent call first):
  File "/src/acadopy/tests/test_function.py", line 121 in test_full_example

@dpinte
Copy link
Contributor Author

dpinte commented Jul 15, 2019

Tests segfault on Travis. I'll investigate

The bug seems related to copying the DVector in the setX call. Will need further investigations.

dpinte added 5 commits July 18, 2019 20:43
- __cinit__ arguments match with C++ constructor
- expose a dim property
- remove print statements
- and execute a full set/get item cycle
- updated arguments in initializer
- add some dimension checks
@dpinte
Copy link
Contributor Author

dpinte commented Oct 9, 2019

One idea about the segfault. The Travis testing environment uses acado 1.2.2beta while I am using the latest master on Mac.

@dpinte
Copy link
Contributor Author

dpinte commented Nov 13, 2019

Issue identified. It's related to the way EvaluationPoint extracts information from the underlying Function. It seems the nx of the Function is always 0, which leads to unassigned arrays and thus the segfault when copying the data (calling set_x). I'm investigating.

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