You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, checking if features exist on an attribute involves a begin... rescue block. This can get pretty repetitive for checking single features and/or setting default values in mapper scripts:
Example of current pattern:
system_type="Residential - furnace and central air conditioner"beginsystem_type=feature.system_typerescueend
I think adding a get_property method to Feature objects which can take an optional default value would help make the code cleaner and be more object oriented.
Example proposed usage:
# Returns the second argument if `system_type` doesn't exist in the feature.system_type=feature.get_property("system_type","Residential - furnace and central air conditioner")
The text was updated successfully, but these errors were encountered:
Currently, checking if features exist on an attribute involves a
begin... rescue
block. This can get pretty repetitive for checking single features and/or setting default values in mapper scripts:Example of current pattern:
I think adding a
get_property
method toFeature
objects which can take an optional default value would help make the code cleaner and be more object oriented.Example proposed usage:
The text was updated successfully, but these errors were encountered: