mcgibbon / sympl

A toolkit for building planetary/Earth system models in Python
http://sympl.readthedocs.io
Other
50 stars 14 forks source link

Constant name map? #10

Closed JoyMonteiro closed 6 years ago

JoyMonteiro commented 6 years ago

To cater for different models' requirements in terms of naming constants, would if make sense to add a constant name map in sympl which can be modified at runtime?

something like a sympl.set_alias_for_constant?

mcgibbon commented 6 years ago

Right now I'm fairly strongly opposed to using aliases for constants, the way you've done for some of the CliMT objects. So we should discuss your motivations for doing it and get on the same page over Skype sometime. Maybe right now?

mcgibbon commented 6 years ago

One of the main benefits of using Sympl for constants is that it is immediately clear when you read a component's code what constants they are using. Having aliases obscures this, makes it easier for users to introduce bugs into their code, and increases cognitive overhead when reading code from multiple component sources.

JoyMonteiro commented 6 years ago

Think the chat helped, closing this!