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

2 comments:

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

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete

Note: Posts are manually moderated, with a varying delay. Some disappear.

The comment section here is largely dead. My Substack or Twitter are better places to have a conversation.

Given that this is largely a backup way to reach me, I am going to reject posts that annoy me. Please post lengthy essays elsewhere.