-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Currently we register parameter names using SG_ADD(&class_member, "name", "parameter description"). The problem is that changing the registered name (in this case "name") results in issues everytime we refactor the parameter names. To address this issue the class should register a static constexpr std::string_view kParam = "name" that should be used to register the class name.
If we ever need to use get/put we should use these constexpr string_views, to avoid any typos.
Example:
Parameter name is define here:
shogun/src/shogun/machine/RandomForest.h
Lines 171 to 172 in e29377d
| public: | |
| static constexpr std::string_view kWeights = "weights"; |
And is used in parameter registration here:
shogun/src/shogun/machine/RandomForest.cpp
Line 207 in e29377d
| SG_ADD(&m_weights, kWeights, "weights"); |