Closed mcgibbon closed 6 years ago
Just to clarify "by default, the generic names (such as vapor_phase) will be aliased to water" -- Does this mean changing heat_capacity_of_vapor_phase_at_constant_pressure will change heat_capacity_of_water_vapor_at_constant_pressure?
Yes, it does.
I'm thinking we should make a custom internal AliasDict class which implements this functionality, so that user code which directly accesses default_constants will also have this behavior.
And/or we should remove default_constants from the public API, and have users use set_constant and get_constant functions to access constants. Actually I lean more towards this option.
I agree that default_constants must be removed. Having two possibly incompatible ways of setting constants is just asking for trouble. OTOH, sympl does not have any way of listing what constants are available, and this will pose a problem if you want to set anything.
Well, with a custom AliasDict class, the two ways of setting and getting constants would be entirely compatible. The list of available constants should be in the documentation. We could also write a function list_constants
which does this, or something like your CliMT function which prints out all of the constants and their values.
If they are compatible, I suggest keep it accessible. There must be some way for packages building on top of sympl to access default_constants (my code would break if it disappeared)
Closed by #20, though we could still use some more constants to be set for different condensibles.
Planetary modeling often requires condensible compounds other than water to be used, but we want to support interoperability between components written by planetary modelers and Earth modelers. We'll do this as follows:
set_condensible_to(compound_name)
which switches what the condensible component aliases point to. For example, if you callset_condensible_to('carbon_dioxide')
, it should make it so that the "heat_capacity_of_vapor_phase_at_constant_pressure" is the same as "heat_capacity_of_carbon_dioxide_vapor_at_constant_pressure".