mcgibbon / sympl

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

set_constant should ensure units are valid #11

Closed mcgibbon closed 6 years ago

mcgibbon commented 6 years ago

Currently set_constant is only a light wrapper that sets constants in the default_constant dictionary. It would be nice if it also warned users (with an exception) when they give invalid units.

JoyMonteiro commented 6 years ago

Such a feature would be only possible if the constant with the given name already exists in the library. I don't see how it could work for arbitrary constants. Is that what you were hoping it does?

mcgibbon commented 6 years ago

Makes sure our unit handling library doesn't raise an exception when given those units. That they are actually a unit and not a random string or a typo.

JoyMonteiro commented 6 years ago

New PR should address this.

mcgibbon commented 6 years ago

Closed by #13