Recent Posts

Sunday, March 19, 2017

Python SFC Models Update -- Syntax Change

Progress has been good; I now how have the external sector (open economy) working properly. It look a few tries (I hate foreign exchange translations), but it now looks good. Additionally, there will be a major change to the interface code for how sector and Country objects are created. The sector description is not heavily used, and so it will no longer be required to be specified in the object construction.

The old syntax for Country creation was:

Country(model, long_name, code, {optional currency=})

For example:

ca = Country(mod, 'Canada', 'CA')

This is now changing to:

Country(model, code, {long_name=,currency=, })

So it will be possible to do:

ca = Country(mod, 'CA')

This will create a Country with code 'CA', and:
  • Default description (something like 'Country CA')
  • Default currency, which equals the code 'CA. 
This change will break all existing user and example code. I unfortunately wrote that I was not going to break code, but I think this is an important quality of life change, and I need to do this before I write too much of my book describing the package.

Please let me know if there are issues.

(c) Brian Romanchuk 2017

No comments:

Post a Comment

Note: Posts may be moderated, and there may be a considerable delay before they appear.

Although I welcome people who disagree with me, please be civil.

Please note that my spam comment filter appears to dislike long "anonymous" posts. I get no warning about this, and only go through my "spambox" infrequently. The best bet it to keep comments short, and if you think the spam filter struck, let me know with a short comment.