[GSoC-PortA] detect v1 'constraints' object and uipgrade to v2 'portfolio object

Ross Bennett rossbennett34 at gmail.com
Wed Jul 31 22:39:39 CEST 2013


Brian,

I modified the code where v1 vs. v2 has an effect in an effort to maintain
backwards compatibility. With the revisions, we are actually supporting
backwards compatibility in two ways.

1. The user can specify the v1 constraint object using the old way and add
objectives with add.objective_v1. Then all that is needed is to run the
optimization with the old interface is use optimize.portfolio_v1.

2. The user can specify the v1 constraint object using the old way and add
objectives with add.objective_v1. Then the user can use optimize.portfolio
and pass the v1_constraint object as the constraints argument. The one
minor drawback is that the user still needs to specify a portfolio object
so that I can update it with the constraints and objectives from the
v1_constraint object. The portfolio object does not need to have any
constraints or objectives, so the user only has to add one line of code (in
most cases). The major upside is that this will work with the new utility
functions (print, summary, plot) that work with the v2 specification.

I also added a testing script with examples of backwards compatibility.

Let me know if you have any other suggestions regarding backwards
compatibility or if the portfolio manager that reached out to you has any
questions or feedback with the latest revisions.

Thanks,
Ross

On Wed, Jul 31, 2013 at 8:25 AM, Brian G. Peterson <brian at braverock.com>wrote:

> Yes, a warning to the effect of:
>
> "v1 constraints object detected, converting to v2 portfolio specification"
>
> seems to be in order.  At least that should tell the user that they might
> want to update some code.
>
> Regards,
>
> Brian
>
>
>
> On 07/31/2013 08:24 AM, Ross Bennett wrote:
>
>> Brian,
>>
>> I think that makes a lot of sense and can be done. It should be pretty
>> straightforward to do. Should I also include a message warning the user
>> about using the v1 constraint object?
>>
>> Thanks,
>> Ross
>>
>> On Jul 30, 2013 8:05 PM, "Brian G. Peterson" <brian at braverock.com
>> <mailto:brian at braverock.com>> wrote:
>>
>>     I got an IM from a portfolio manager in Canada today.
>>
>>     He said:
>>
>>     "I had a fun time exploring new portfolio object on the weekend as I
>>     had to svn it to my newly formatted laptop. the concept of the
>>     portfolio object is really powerful, but a lot of code had to be
>>     modified for backwards compatibility"
>>
>>     Which raises the topic of the subject line.
>>
>>     It seems that we should detect when the user has passed a v1
>>     'constraints' object into optimize.portfolio, and upgrade it to the
>>     v2 specification.
>>
>>     Thoughts?
>>
>>     Brian
>>
>>     --
>>     Brian G. Peterson
>>     http://braverock.com/brian/
>>     Ph: 773-459-4973 <tel:773-459-4973>
>>     IM: bgpbraverock
>>     ______________________________**___________________
>>     GSoC-PortA mailing list
>>     GSoC-PortA at lists.r-forge.r-__**project.org<GSoC-PortA at lists.r-forge.r-__project.org>
>>     <mailto:GSoC-PortA at lists.r-**forge.r-project.org<GSoC-PortA at lists.r-forge.r-project.org>
>> >
>>     http://lists.r-forge.r-__**project.org/cgi-bin/mailman/__**
>> listinfo/gsoc-porta<http://lists.r-forge.r-__project.org/cgi-bin/mailman/__listinfo/gsoc-porta>
>>     <http://lists.r-forge.r-**project.org/cgi-bin/mailman/**
>> listinfo/gsoc-porta<http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta>
>> >
>>
>>
>>
>>
>> ______________________________**_________________
>> GSoC-PortA mailing list
>> GSoC-PortA at lists.r-forge.r-**project.org<GSoC-PortA at lists.r-forge.r-project.org>
>> http://lists.r-forge.r-**project.org/cgi-bin/mailman/**
>> listinfo/gsoc-porta<http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta>
>>
>>
>
> --
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
> ______________________________**_________________
> GSoC-PortA mailing list
> GSoC-PortA at lists.r-forge.r-**project.org<GSoC-PortA at lists.r-forge.r-project.org>
> http://lists.r-forge.r-**project.org/cgi-bin/mailman/**listinfo/gsoc-porta<http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/gsoc-porta/attachments/20130731/c5ef5c9e/attachment.html>


More information about the GSoC-PortA mailing list