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

1 comment:

  1. This comment has been removed by a blog administrator.


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.

Note: if you want to post comments from Apple devices (iPhone, iPad), you apparently need to turn off "prevent cross-site tracking" in Safari privacy settings. (The reason presumably is that another URL handles comments, and so the user session needs to be preserved when redirected to that site. I don't like this, but this is not enough to make me switch my hosting service.)