We originally used dictionaries exclusively, but some users complained that putting large numbers of parameter settings using names in quotes was irritating.
That was fair enough, so the args class simply provides an alternative, struct-like syntax for the same thing. So it's entirely up to you which syntax you prefer to use. There's no efficiency loss as far as we're concerned.
The idea is that whenever an args class is used, a dictionary would also work. The args class implements pretty much every method needed to act like a dictionary...
Rob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Slowly but surely I am perusing the code for a greater understanding of PyDSTool.
One question I have is how args is implemented in common.py.
Why are class instances mapped to key values? Is this simply a visual addition, make it look more like structs as opposed to a python dictionary?
Do be more clear, is there any reason to write
PCargs.name = 'Rozen'
vs
PCargs['name'] = 'Rozen'
The latter seems more pythonic . . . though I have no real vested interest in either.
Gabriel
Sorry I ment to write 'To be more clear'
not 'Do be more clear' ! the latter is aggressive, which was certainly not intended . . .
Not sure how to edit my posts.
Gabriel
We originally used dictionaries exclusively, but some users complained that putting large numbers of parameter settings using names in quotes was irritating.
That was fair enough, so the args class simply provides an alternative, struct-like syntax for the same thing. So it's entirely up to you which syntax you prefer to use. There's no efficiency loss as far as we're concerned.
The idea is that whenever an args class is used, a dictionary would also work. The args class implements pretty much every method needed to act like a dictionary...
Rob