MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / get_parameter_information

Function get_parameter_information

src/DataStructures.cpp:180–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180std::string get_parameter_information(int key, std::string_view info) {
181 const std::map<int, std::string>* M = nullptr;
182 auto& parameter_information = get_parameter_information();
183 // Hook up the right map (since they are all of the same type)
184 if (info == "IO") {
185 M = &(parameter_information.IO_map);
186 } else if (info == "short") {
187 M = &(parameter_information.short_desc_map);
188 } else if (info == "long") {
189 M = &(parameter_information.description_map);
190 } else if (info == "units") {
191 M = &(parameter_information.units_map);
192 } else {
193 throw ValueError(format("Bad info string [%s] to get_parameter_information", std::string(info).c_str()));
194 }
195
196 auto it = M->find(key);
197 if (it != M->end()) {
198 return it->second;
199 }
200 throw ValueError(format("Unable to match the key [%d] in get_parameter_information for info [%s]", key, std::string(info).c_str()));
201}
202
203/// Return a list of parameters
204std::string get_csv_parameter_list() {

Callers 15

is_trivial_parameterFunction · 0.85
get_csv_parameter_listFunction · 0.85
is_valid_parameterFunction · 0.85
DataStructures.cppFile · 0.85
trivial_keyed_outputMethod · 0.85
keyed_outputMethod · 0.85
get_dT_drhoFunction · 0.85
CoolProp-Tests.cppFile · 0.85
fast_evaluateMethod · 0.85
updateMethod · 0.85

Calls 2

formatFunction · 0.70
stringClass · 0.50

Tested by

no test coverage detected