ARTS 2.5.4 (git: 4c0d3b4d)
make_autoarts_h.cc
Go to the documentation of this file.
1#include <auto_md.h>
2#include <global_data.h>
3
4#include <algorithm>
5#include <iostream>
6#include <map>
7#include <string>
8#include <vector>
9
10struct Group {
11 std::string varname_group;
12 std::string varname_desc;
13 std::size_t artspos;
14};
15
16struct Method {
17 struct Gin {
18 std::vector<std::string> desc;
19 std::vector<std::string> group;
20 std::vector<std::string> name;
21 std::vector<std::string> defs;
22 std::vector<bool> hasdefs;
23 };
24
25 struct Gout {
26 std::vector<std::string> desc;
27 std::vector<std::string> group;
28 std::vector<std::string> name;
29 };
30
31 struct In {
32 std::vector<std::string> varname;
33 std::vector<std::size_t> varpos;
34 };
35
36 struct Out {
37 std::vector<std::string> varname;
38 std::vector<std::size_t> varpos;
39 };
40
41 std::string name;
42 std::size_t pos;
43 std::string desc;
44 std::vector<std::string> authors;
55 std::vector<std::size_t> inoutvarpos;
56};
57
58struct AgendaData {
59 std::size_t pos;
60 std::string desc;
61 std::vector<std::string> ins;
62 std::vector<std::string> outs;
63};
64
65std::map<std::string, Group> groups() {
66 std::map<std::string, std::size_t> group;
67 for (auto& x : global_data::WsvGroupMap) group[x.first] = x.second;
68 std::map<std::string, std::size_t> name;
69 for (auto& x : Workspace::wsv_data) name[x.Name()] = x.Group();
70 std::map<std::string, std::string> desc;
71 for (auto& x : Workspace::wsv_data) desc[x.Name()] = x.Description();
72 std::map<std::string, std::size_t> pos;
73 for (auto& x : Workspace::WsvMap) pos[x.first] = x.second;
74
75 std::map<std::string, Group> out;
76 for (auto& x : name) {
77 for (auto& y : group) {
78 if (y.second == x.second) {
79 out[x.first] = {y.first, desc[x.first], pos[x.first]};
80 break;
81 }
82 }
83 }
84 return out;
85}
86
87std::pair<std::vector<std::string>, std::vector<bool>> fixed_defaults(
88 const std::vector<std::string>& vargroups,
89 const std::vector<std::string>& vardefaults) {
90 std::vector<std::string> defaults(vargroups.size());
91 std::vector<bool> hasdefaults(vargroups.size());
92 for (size_t i = 0; i < vargroups.size(); i++) {
93 if (vardefaults[i] == NODEF)
94 hasdefaults[i] = false;
95 else
96 hasdefaults[i] = true;
97
98 if (vargroups[i] == "String") {
99 defaults[i] = std::string("\"") + vardefaults[i] + std::string("\"");
100 } else if (vargroups[i] == "Numeric") {
101 if ("NaN" == vardefaults[i] or "nan" == vardefaults[i]) {
102 defaults[i] = "std::numeric_limits<Numeric>::quiet_NaN()";
103 } else if ("Inf" == vardefaults[i] or "inf" == vardefaults[i]) {
104 defaults[i] = "std::numeric_limits<Numeric>::infinity()";
105 } else if ("-Inf" == vardefaults[i] or "-inf" == vardefaults[i]) {
106 defaults[i] = "-std::numeric_limits<Numeric>::infinity()";
107 } else {
108 defaults[i] = vardefaults[i];
109 }
110 } else if (vardefaults[i] == "[]") {
111 defaults[i] = "{}";
112 } else {
113 defaults[i] = vardefaults[i];
114 }
115
116 if (defaults[i] == "") defaults[i] = "{}";
117
118 for (auto& x : defaults[i]) {
119 if (x == '[')
120 x = '{';
121 else if (x == ']')
122 x = '}';
123 }
124 }
125
126 return {defaults, hasdefaults};
127}
128
129std::vector<Method> methods() {
130 std::map<std::string, std::size_t> vargroup;
131 for (auto& x : global_data::WsvGroupMap) vargroup[x.first] = x.second;
132 std::map<std::string, std::size_t> varpos;
133 for (auto& x : Workspace::WsvMap) varpos[x.first] = x.second;
134 std::map<std::string, std::size_t> methodpos;
135 for (auto& x : global_data::MdMap) methodpos[x.first] = x.second;
136
137 std::vector<std::string> metname;
138 for (auto& x : global_data::md_data) metname.push_back(x.Name());
139 std::vector<std::string> actual_groups;
140 for (auto& x : global_data::md_data)
141 actual_groups.push_back(x.ActualGroups());
142 std::vector<std::vector<std::size_t>> gin_group;
143 for (auto& x : global_data::md_data)
144 gin_group.emplace_back(x.GInType().cbegin(), x.GInType().cend());
145 std::vector<std::vector<std::string>> gin_names;
146 for (auto& x : global_data::md_data)
147 gin_names.emplace_back(x.GIn().cbegin(), x.GIn().cend());
148 std::vector<std::vector<std::string>> gin_defaults;
149 for (auto& x : global_data::md_data)
150 gin_defaults.emplace_back(x.GInDefault().cbegin(), x.GInDefault().cend());
151 std::vector<std::vector<std::string>> gin_desc;
152 for (auto& x : global_data::md_data)
153 gin_desc.emplace_back(x.GInDescription().cbegin(), x.GInDescription().cend());
154 std::vector<std::vector<std::size_t>> gout_group;
155 for (auto& x : global_data::md_data)
156 gout_group.emplace_back(x.GOutType().cbegin(), x.GOutType().cend());
157 std::vector<std::vector<std::string>> gout_names;
158 for (auto& x : global_data::md_data)
159 gout_names.emplace_back(x.GOut().cbegin(), x.GOut().cend());
160 std::vector<std::vector<std::string>> gout_desc;
161 for (auto& x : global_data::md_data)
162 gout_desc.emplace_back(x.GOutDescription().cbegin(), x.GOutDescription().cend());
163 std::vector<std::vector<std::size_t>> in_wspace;
164 for (auto& x : global_data::md_data)
165 in_wspace.emplace_back(x.In().cbegin(), x.In().cend());
166 std::vector<std::vector<std::size_t>> out_wspace;
167 for (auto& x : global_data::md_data)
168 out_wspace.emplace_back(x.Out().cbegin(), x.Out().cend());
169 std::vector<std::string> desc;
170 for (auto& x : global_data::md_data) desc.push_back(x.Description());
171 std::vector<std::vector<std::string>> authors;
172 for (auto& x : global_data::md_data)
173 authors.emplace_back(x.Authors().cbegin(), x.Authors().cend());
174
175 std::vector<bool> set_method;
176 for (auto& x : global_data::md_data) set_method.push_back(x.SetMethod());
177 std::vector<bool> agenda_method;
178 for (auto& x : global_data::md_data)
179 agenda_method.push_back(x.AgendaMethod());
180 std::vector<bool> supergeneric;
181 for (auto& x : global_data::md_data) supergeneric.push_back(x.Supergeneric());
182 std::vector<bool> uses_templates;
183 for (auto& x : global_data::md_data)
184 uses_templates.push_back(x.UsesTemplates());
185 std::vector<bool> pass_workspace;
186 for (auto& x : global_data::md_data)
187 pass_workspace.push_back(x.PassWorkspace());
188 std::vector<bool> pass_wsv_names;
189 for (auto& x : global_data::md_data)
190 pass_wsv_names.push_back(x.PassWsvNames());
191
192 std::vector<std::vector<std::size_t>> inoutvarpos;
193 for (auto& x : global_data::md_data)
194 inoutvarpos.emplace_back(x.InOut().cbegin(), x.InOut().cend());
195 std::vector<std::vector<std::size_t>> invarpos;
196 for (auto& x : global_data::md_data)
197 invarpos.emplace_back(x.InOnly().cbegin(), x.InOnly().cend());
198 std::vector<std::vector<std::size_t>> outvarpos;
199 for (auto& x : global_data::md_data)
200 outvarpos.emplace_back(x.Out().cbegin(), x.Out().cend());
201
202 std::vector<Method> retval;
203 for (std::size_t i = 0; i < desc.size(); i++) {
204 Method m;
205 m.name = metname[i];
206 if (supergeneric[i])
207 m.pos = methodpos[metname[i] + String("_sg_") + actual_groups[i]];
208 else
209 m.pos = methodpos[metname[i]];
210 m.desc = desc[i];
211 m.authors = authors[i];
212
213 Method::Gin gin;
214 gin.desc = gin_desc[i];
215 for (auto g : gin_group[i]) {
216 bool found = false;
217 for (auto& y : vargroup) {
218 if (y.second == g) {
219 gin.group.push_back(y.first);
220 found = true;
221 break;
222 }
223 }
224 if (not found) {
225 std::cerr << "Cannot find group\n";
226 std::terminate();
227 }
228 }
229 gin.name = gin_names[i];
230 auto fixgin = fixed_defaults(gin.group, gin_defaults[i]);
231 gin.defs = fixgin.first;
232 gin.hasdefs = fixgin.second;
233 m.gin = gin;
234
235 Method::Gout gout;
236 gout.desc = gout_desc[i];
237 for (auto g : gout_group[i]) {
238 bool found = false;
239 for (auto& y : vargroup) {
240 if (y.second == g) {
241 gout.group.push_back(y.first);
242 found = true;
243 break;
244 }
245 }
246 if (not found) {
247 std::cerr << "Cannot find group\n";
248 std::terminate();
249 }
250 }
251 gout.name = gout_names[i];
252 m.gout = gout;
253
254 Method::In in;
255 for (auto v : in_wspace[i]) {
256 bool found = false;
257 for (auto& y : varpos) {
258 if (v == y.second) {
259 in.varname.push_back(y.first);
260 found = true;
261 break;
262 }
263 }
264 if (not found) {
265 std::cerr << "Cannot find variable\n";
266 std::terminate();
267 }
268 }
269 in.varpos = invarpos[i];
270 m.in = in;
271
272 Method::Out out;
273 for (auto v : out_wspace[i]) {
274 bool found = false;
275 for (auto& y : varpos) {
276 if (v == y.second) {
277 out.varname.push_back(y.first);
278 found = true;
279 break;
280 }
281 }
282 if (not found) {
283 std::cerr << "Cannot find variable\n";
284 std::terminate();
285 }
286 }
287 out.varpos = outvarpos[i];
288 m.out = out;
289
290 m.set_method = set_method[i];
291 m.agenda_method = agenda_method[i];
292 m.supergeneric = supergeneric[i];
293 m.uses_templates = uses_templates[i];
294 m.pass_workspace = pass_workspace[i];
295 m.pass_wsv_names = pass_wsv_names[i];
296 m.inoutvarpos = inoutvarpos[i];
297 retval.push_back(m);
298 }
299
300 return retval;
301}
302
303std::map<std::string, AgendaData> agendas() {
304 auto g = groups();
305
306 std::map<std::string, AgendaData> out;
307 for (auto& x : global_data::agenda_data) {
308 out[x.Name()].pos = global_data::AgendaMap.at(x.Name());
309 out[x.Name()].desc = x.Description();
310
311 for (std::size_t i : x.In()) {
312 bool found = false;
313 for (auto& y : g) {
314 if (y.second.artspos == i) {
315 out[x.Name()].ins.push_back(y.first);
316 found = true;
317 break;
318 }
319 }
320 if (not found) {
321 std::cerr << "Cannot find the variable\n";
322 std::terminate();
323 }
324 }
325
326 for (std::size_t i : x.Out()) {
327 bool found = false;
328 for (auto& y : g) {
329 if (y.second.artspos == i) {
330 out[x.Name()].outs.push_back(y.first);
331 found = true;
332 break;
333 }
334 }
335 if (not found) {
336 std::cerr << "Cannot find the variable\n";
337 std::terminate();
338 }
339 }
340 }
341 return out;
342}
343
344struct NameMaps {
345 std::map<std::string, AgendaData> agendaname_agenda;
346 std::vector<Method> methodname_method;
347 std::map<std::string, Group> varname_group;
348 std::map<std::string, std::size_t> group;
349
351 for (auto& x : global_data::WsvGroupMap) group[x.first] = x.second;
355 }
356};
357
359 std::cout << "#include <auto_md.h>" << '\n'
360 << "#include <arts.h>" << '\n'
361 << "#include <global_data.h>" << '\n'
362 << "#include <m_basic_types.h>" << '\n'
363 << "#include <m_general.h>" << '\n'
364 << "#include <m_append.h>" << '\n'
365 << "#include <m_conversion.h>" << '\n'
366 << "#include <m_copy.h>" << '\n'
367 << "#include <m_gridded_fields.h>" << '\n'
368 << "#include <m_xml.h>" << '\n'
369 << "#include <m_select.h>" << '\n'
370 << "#include <m_reduce.h>" << '\n'
371 << "#include <m_nc.h>" << '\n'
372 << "#include <m_delete.h>" << '\n'
373 << "#include <m_extract.h>" << '\n'
374 << "#include <m_ignore.h>" << '\n'
375 << "#include <isotopologues.h>" << '\n'
376 << '\n'
377 << '\n';
378
379 std::cout << "extern String out_basename;\n\n";
380}
381
383 std::cout << "/*! An ARTS Workspace, the main class of ARTS */\n";
384 std::cout << "using Workspace=Workspace; \n\n";
385 std::cout << "/*! The ARTS constants namespace */\n";
386 std::cout << "namespace Constant { using namespace ::Constant; }\n\n";
387 std::cout << "/*! The ARTS conversions namespace */\n";
388 std::cout << "namespace Conversion { using namespace ::Conversion; }\n\n";
389 std::cout << "/*! The ARTS Group namespace */\n";
390 std::cout << "namespace Group {\n";
391 for (auto& x : artsname.group) {
392 if (x.first == "Any") continue;
393 std::cout << "/*! ARTS " << x.first << " type */\n";
394 std::cout << "using " << x.first << '=' << x.first << ';' << '\n' << '\n';
395 }
396
397 std::cout << "/*! The ARTS Internal Groups namespace */\n";
398 std::cout << "namespace Internal {\n";
399 std::cout << "/*! A Tokenized Value. Used purely in internal code */\n";
400 std::cout << "using TokVal=TokVal;\n" << '\n';
401 std::cout << "/*! A Method Record. Used to pass methods to agendas */\n";
402 std::cout << "using MRecord=MRecord;\n" << '\n';
403 std::cout << "} // namespace Internal\n";
404 std::cout << "} // namespace Group \n\n";
405}
406
407void print_variables(const NameMaps& artsname) {
408 std::cout << "namespace Var {\n";
409 for (auto& x : artsname.group) {
410 if (x.first == "Any") continue;
411 std::cout << "/*! Workspace Variable class. Used as default\n"
412 " input to many Method and AgendaMethod.\n"
413 " Note that it is not recommended to manually\n"
414 " create this class as many methods makes distinct\n"
415 " assumptions about the states that this class are\n"
416 " allowed to be in */\n";
417 std::cout << "class " << x.first << ' ' << '{' << '\n';
418 std::cout << " std::size_t p;\n";
419 std::cout << " Group::" << x.first << "* v;\n";
420 std::cout << "public:\n";
421 std::cout << " /*! Default construct. DO NOT USE MANUALLY. Leaves "
422 "islast() true and isnull() true */\n";
423 std::cout << " " << x.first
424 << "() noexcept : p(std::numeric_limits<std::size_t>::max()), "
425 "v(nullptr) {}\n\n";
426 std::cout << " /*! Construct from existing Workspace. DO NOT USE "
427 "MANUALLY. Leaves islast() false and isnull() false */\n";
428 std::cout << " " << x.first
429 << "(std::size_t i, void * x) noexcept : p(i), "
430 "v(static_cast<Group::" << x.first << " *>(x)) {}\n\n";
431 std::cout << " /*! Construct from Group::" << x.first << ". Leaves islast() true and "
432 "isnull() false */\n";
433 std::cout << " " << x.first
434 << "(const Group::" << x.first << "& val) noexcept : "
435 "p(std::numeric_limits<std::size_t>::max()), v(new Group::" << x.first << "(val)) "
436 "{}\n\n";
437 std::cout << " /*! Delete data only when islast() is true and isnull() is "
438 "false */\n";
439 std::cout << " ~" << x.first
440 << "() noexcept {if (islast() and not isnull()) delete v;}\n\n";
441 std::cout
442 << " /*! Get value ref as Group::" << x.first << ". Works when isnull() is false */\n";
443 std::cout << " Group::" << x.first << "& value() noexcept {return *v;}\n\n";
444 std::cout
445 << " /*! Get value const-ref as Group::" << x.first << ". Works when isnull() is false */\n";
446 std::cout << " const Group::" << x.first << "& value() const noexcept {return *v;}\n\n";
447 std::cout << " /*! Set value from Group::" << x.first << ". Works when isnull() is "
448 "false */\n";
449 std::cout << " " << x.first
450 << "& operator=(const Group::" << x.first << "& t) noexcept {value() = t; return "
451 "*this;}\n\n";
452 std::cout
453 << " /*! Return the position of the variable in the Workspace */\n";
454 std::cout << " std::size_t pos() const noexcept {return p;}\n\n";
455 std::cout << " /*! Return true if there is no data */\n";
456 std::cout << " bool isnull() const noexcept {return v == nullptr;}\n\n";
457 std::cout << " /*! Return true if data is not in the Workspace */\n";
458 std::cout << " bool islast() const noexcept {return p == "
459 "std::numeric_limits<std::size_t>::max();}\n\n";
460 std::cout << " /*! Name of variable. Must be in the workspace */\n";
461 std::cout << " const Group::String& name() const noexcept {return "
462 "Workspace::wsv_data[p].Name();}\n\n";
463
464 // NOTE: Don't add more groups here. The ones that are here are ugly
465 // enough as it is. Just define an output operator...
466 if (x.first not_eq "Ppath" and x.first not_eq "TessemNN" and
467 x.first not_eq "Timer" and x.first not_eq "ArrayOfPpath") {
468 std::cout << " /*! Output to stream of internal variable */\n";
469 std::cout << " friend std::ostream& operator<<(std::ostream& os, const "
470 << x.first
471 << "& var) {if (var.isnull()) return os << \"NULLDATA\"; else "
472 "return os << var.value();}\n";
473 }
474
475 std::cout << '}' << ';' << '\n' << '\n';
476 }
477 for (auto& x : artsname.varname_group) {
478 std::cout << "/*! " << x.second.varname_desc << '\n';
479 std::cout << "@param[in,out] Workspace ws - An ARTS workspace\n";
480 std::cout << "@return A class with a pointer to this variable and its "
481 "position in the workspace\n*/\n";
482 std::cout << "[[nodiscard]] inline ";
483 std::cout << x.second.varname_group << ' ' << x.first
484 << "(Workspace& ws) "
485 "noexcept { "
486 "return {"
487 << x.second.artspos << ", ws[" << x.second.artspos
488 << "]}; "
489 "}\n\n";
490 }
491 for (auto& x : artsname.group) {
492 if (x.first == "Any") continue;
493
494 std::cout << "/*! Creates in, and returns from, Workspace a/an " << x.first
495 << '\n'
496 << '\n';
497 std::cout << "@param[in,out] Workspace ws - An ARTS workspace\n";
498 std::cout << "@param[in] " << x.first
499 << " inval - The default value the variable will have in "
500 "the workspace\n";
501 std::cout << "@param[in] String name - The name the variable will have in "
502 "the workspace\n";
503 std::cout << "@param[in] String desc - The description the variable will "
504 "have in the workspace (default: \"nodescription\")\n";
505 std::cout << "@return A class with a pointer to this variable and its new "
506 "position in the workspace\n";
507 std::cout << "*/\n";
508 std::cout << "[[nodiscard]] inline\n";
509 std::cout
510 << x.first << ' ' << x.first
511 << "Create(\n Workspace& ws,\n const Group::"
512 << x.first
513 << "& inval,\n const Group::String& name,\n "
514 "const Group::"
515 "String& "
516 "desc=\"nodescription\") {\n";
517 std::cout << " const std::size_t ind = "
518 "std::size_t(ws.add_wsv_inplace({name.c_str(), desc.c_str(), "
519 << x.second << "}));\n";
520 std::cout << " " << x.first << ' ' << "val{ind, ws[ind]};\n";
521 std::cout << " return val = inval;\n"
522 << "}\n\n";
523 }
524 std::cout << "} // namespace Var \n\n";
525}
526
527std::string spaces(std::size_t n) {
528 std::string s = "";
529 for (std::size_t i=0; i<n; i++)
530 s += " ";
531 return s;
532}
533
534void print_gin_methods(const NameMaps& artsname) {
535 for (auto& x : artsname.methodname_method) {
536 // Skip methods using verbosity and Agenda methods (for now)
537 if (x.agenda_method) continue;
538
539 // Also skip create methods since these must be called via Var
540 if (std::any_of(artsname.group.cbegin(), artsname.group.cend(),
541 [metname = x.name](auto& y) {
542 return (y.first + String("Create")) == metname;
543 }))
544 continue;
545
546 // Describe the method
547 std::cout << "/*! " << x.desc << '\n';
548 for (const auto& a : x.authors) std::cout << "@author " << a << '\n';
549 std::cout << "\n"
550 "@param[in,out] Workspace ws - An ARTS workspace\n";
551 for (std::size_t i = 0; i < x.gout.name.size(); i++)
552 std::cout << "@param[out] " << x.gout.name[i] << " - " << x.gout.desc[i]
553 << "\n";
554 for (std::size_t i = 0; i < x.gin.name.size(); i++) {
555 std::cout << "@param[in] " << x.gin.name[i] << " - " << x.gin.desc[i];
556 if (x.gin.hasdefs[i]) std::cout << " (default: " << x.gin.defs[i] << ")";
557 std::cout << '\n';
558 }
559 std::cout << "\nUse the ARTS documentation to read more on how the "
560 "workspace is manipulated\n";
561 std::cout << "This interface function has been automatically generated\n";
562 std::cout << "*/" << '\n';
563
564 // Make the function
565 std::cout << "inline void " << x.name << "(Workspace& ws";
566
567 // First put all GOUT variables
568 for (std::size_t i = 0; i < x.gout.group.size(); i++) {
569 std::cout << ',' << '\n' << spaces(x.name.size() + 13) << "Var::" << x.gout.group[i] << ' '
570 << x.gout.name[i];
571 }
572
573 // Second put all GIN variables that have no default argument
574 for (std::size_t i = 0; i < x.gin.group.size(); i++) {
575 if (not x.gin.hasdefs[i]) {
576 std::cout << ',' << '\n' << spaces(x.name.size() + 13 - 6)
577 << "const Var::" << x.gin.group[i] << ' ' << x.gin.name[i];
578 }
579 }
580
581 // Lastly put all GIN variables that have a default argument
582 for (std::size_t i = 0; i < x.gin.group.size(); i++) {
583 if (x.gin.hasdefs[i]) {
584 if (x.gin.defs[i] == "{}") {
585 std::cout << ',' << '\n' << spaces(x.name.size() + 13 - 6)
586 << "const Var::" << x.gin.group[i] << ' ' << x.gin.name[i]
587 << '=' << "Group::" << x.gin.group[i] << x.gin.defs[i];
588 } else {
589 std::cout << ',' << '\n' << spaces(x.name.size() + 13 - 6)
590 << "const Var::" << x.gin.group[i] << ' ' << x.gin.name[i]
591 << '=' << "Group::" << x.gin.group[i] << '{'
592 << x.gin.defs[i] << '}';
593 }
594 }
595 }
596
597 // End of function definition and open function block
598 std::cout << ')' << ' ' << '{' << '\n';
599
600 // Output variables have to be on the Workspace
601 if (x.gout.group.size()) std::cout << ' ';
602 for (std::size_t i = 0; i < x.gout.group.size(); i++) {
603 std::cout << " if (" << x.gout.name[i]
604 << ".islast()) {\n throw std::runtime_error(\""
605 << x.gout.name[i] << " needs to be a defined "
606 << x.gout.group[i] << " since it is output of " << x.name
607 << "\");\n }";
608 }
609 if (x.gout.group.size()) std::cout << '\n' << '\n';
610
611 // Call the ARTS auto_md.h function
612 std::cout << ' ' << ' ' << x.name << '(';
613
614 // We need the workspace if we input an Agenda or simply pass the workspace
615 bool has_any = false;
616 if (x.pass_workspace or x.agenda_method or
617 std::any_of(
618 x.gin.group.cbegin(), x.gin.group.cend(),
619 [](auto& g) { return g == "Agenda" or g == "ArrayOfAgenda"; }) or
620 std::any_of(x.in.varname.cbegin(), x.in.varname.cend(), [&](auto& g) {
621 return artsname.varname_group.at(g).varname_group == "Agenda" or
622 artsname.varname_group.at(g).varname_group == "ArrayOfAgenda";
623 })) {
624 std::cout << "ws";
625 has_any = true;
626 }
627
628 // First are all the outputs
629 for (std::size_t i = 0; i < x.out.varname.size(); i++) {
630 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
631 has_any = true;
632 std::cout << "Var::" << x.out.varname[i] << "(ws).value()";
633 }
634
635 // Second comes all the generic outputs
636 for (std::size_t i = 0; i < x.gout.name.size(); i++) {
637 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
638 has_any = true;
639 std::cout << x.gout.name[i];
640 std::cout << ".value()";
641 }
642
643 // And their filenames if relevant
644 if (x.pass_wsv_names) {
645 for (std::size_t i = 0; i < x.gout.name.size(); i++) {
646 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
647 has_any = true;
648 std::cout << x.gout.name[i] << ".name()";
649 }
650 }
651
652 // Then come all the inputs that are not also outputs
653 for (std::size_t i = 0; i < x.in.varname.size(); i++) {
654 if (std::any_of(
655 x.out.varname.cbegin(), x.out.varname.cend(),
656 [in = x.in.varname[i]](const auto& out) { return in == out; }))
657 continue;
658 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
659 has_any = true;
660 std::cout << "Var::" << x.in.varname[i] << "(ws).value()";
661 }
662
663 // Lastly are all the generic inputs, which cannot also be outputs
664 for (std::size_t i = 0; i < x.gin.name.size(); i++) {
665 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
666 has_any = true;
667 std::cout << x.gin.name[i];
668 std::cout << ".value()";
669 }
670
671 // And their filenames if relevant
672 if (x.pass_wsv_names) {
673 for (std::size_t i = 0; i < x.gin.name.size(); i++) {
674 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
675 has_any = true;
676 std::cout << x.gin.name[i] << ".islast() ? Group::String{\""
677 << x.gin.name[i] << "\"} : " << x.gin.name[i] << ".name()";
678 }
679 }
680
681 // Check verbosity
682 const bool has_verbosity =
683 std::any_of(x.in.varname.cbegin(), x.in.varname.cend(),
684 [](auto& name) { return name == "verbosity"; });
685
686 // Add verbosity of it does not exist
687 if (not has_verbosity) {
688 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
689 has_any = true;
690 std::cout << "Var::verbosity(ws).value()";
691 }
692
693 // Close the function call and the function itself
694 std::cout << ')' << ';' << '\n' << '}' << '\n' << '\n' << '\n';
695 }
696}
697
698void print_full_methods(const NameMaps& artsname) {
699 for (auto& x : artsname.methodname_method) {
700 // Skip methods using verbosity and Agenda methods (for now)
701 if (x.agenda_method) continue;
702
703 // Also skip create methods since these must be called via Var
704 if (std::any_of(artsname.group.cbegin(), artsname.group.cend(),
705 [metname = x.name](auto& y) {
706 return (y.first + String("Create")) == metname;
707 }))
708 continue;
709
710 // Skip the 'silly' methods
711 if (not x.out.varname.size() and not x.gout.name.size() and
712 not x.in.varname.size() and not x.gin.name.size())
713 continue;
714
715 // Describe the method
716 std::cout << "/*! " << x.desc << '\n';
717 for (const auto& a : x.authors) std::cout << "@author " << a << '\n';
718 std::cout << "\n"
719 "@param[in,out] Workspace ws - An ARTS workspace\n";
720 for (std::size_t i = 0; i < x.out.varname.size(); i++) {
721 if (std::any_of(
722 x.in.varname.cbegin(), x.in.varname.cend(),
723 [out = x.out.varname[i]](const auto& in) { return in == out; }))
724 std::cout << "@param[in,out] ";
725 else
726 std::cout << "@param[out] ";
727 std::cout << x.out.varname[i] << " - as *Var::" << x.out.varname[i]
728 << "(ws)*\n";
729 }
730 for (std::size_t i = 0; i < x.gout.name.size(); i++)
731 std::cout << "@param[out] " << x.gout.name[i] << " - " << x.gout.desc[i]
732 << "\n";
733 for (std::size_t i = 0; i < x.in.varname.size(); i++) {
734 if (std::any_of(
735 x.out.varname.cbegin(), x.out.varname.cend(),
736 [in = x.in.varname[i]](const auto& out) { return in == out; }))
737 continue;
738 std::cout << "@param[in] " << x.in.varname[i]
739 << " - as *Var::" << x.in.varname[i] << "(ws)*\n";
740 }
741 for (std::size_t i = 0; i < x.gin.name.size(); i++) {
742 std::cout << "@param[in] " << x.gin.name[i] << " - " << x.gin.desc[i];
743 if (x.gin.hasdefs[i]) std::cout << " (default: " << x.gin.defs[i] << ")";
744 std::cout << '\n';
745 }
746 std::cout << "\nUse the ARTS documentation to read more on how the "
747 "workspace is manipulated\n";
748 std::cout << "This interface function has been automatically generated\n";
749 std::cout << "*/" << '\n';
750
751 // Make the function
752 std::cout << "inline void " << x.name
753 << "(Workspace& ws [[maybe_unused]]";
754
755 // First put all OUT variables
756 for (std::size_t i = 0; i < x.out.varname.size(); i++)
757 std::cout << ',' << '\n' << spaces(x.name.size() + 13) << "Group::"
758 << artsname.varname_group.at(x.out.varname[i]).varname_group
759 << '&' << ' ' << x.out.varname[i];
760
761 // Second put all GOUT variables
762 for (std::size_t i = 0; i < x.gout.group.size(); i++)
763 std::cout << ',' << '\n' << spaces(x.name.size() + 13) << "Group::" << x.gout.group[i]
764 << '&' << ' ' << x.gout.name[i];
765
766 // Third put all the inputs that are not also outputs
767 for (std::size_t i = 0; i < x.in.varname.size(); i++) {
768 if (std::any_of(
769 x.out.varname.cbegin(), x.out.varname.cend(),
770 [in = x.in.varname[i]](const auto& out) { return in == out; }))
771 continue;
772 std::cout << ',' << '\n' << spaces(x.name.size() + 13 - 6) << "const Group::"
773 << artsname.varname_group.at(x.in.varname[i]).varname_group
774 << '&' << ' ' << x.in.varname[i];
775 }
776
777 // Last put all GIN variables that have no default argument
778 for (std::size_t i = 0; i < x.gin.group.size(); i++)
779 std::cout << ',' << '\n' << spaces(x.name.size() + 13 - 6) << "const Group::" << x.gin.group[i] << '&'
780 << ' ' << x.gin.name[i];
781
782 // End of function definition and open function block
783 std::cout << ')' << ' ' << '{' << '\n';
784
785 // Call the ARTS auto_md.h function
786 std::cout << ' ' << ' ' << x.name << '(';
787
788 // We need the workspace if we input an Agenda or simply pass the workspace
789 bool has_any = false;
790 if (x.pass_workspace or x.agenda_method or
791 std::any_of(
792 x.gin.group.cbegin(), x.gin.group.cend(),
793 [](auto& g) { return g == "Agenda" or g == "ArrayOfAgenda"; }) or
794 std::any_of(x.in.varname.cbegin(), x.in.varname.cend(), [&](auto& g) {
795 return artsname.varname_group.at(g).varname_group == "Agenda" or
796 artsname.varname_group.at(g).varname_group == "ArrayOfAgenda";
797 })) {
798 std::cout << "ws";
799 has_any = true;
800 }
801
802 // First are all the outputs
803 for (std::size_t i = 0; i < x.out.varname.size(); i++) {
804 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
805 has_any = true;
806 std::cout << x.out.varname[i];
807 }
808
809 // Second comes all the generic outputs
810 for (std::size_t i = 0; i < x.gout.name.size(); i++) {
811 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
812 has_any = true;
813 std::cout << x.gout.name[i];
814 }
815
816 // And their filenames if relevant
817 if (x.pass_wsv_names) {
818 for (std::size_t i = 0; i < x.gout.name.size(); i++) {
819 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
820 has_any = true;
821 std::cout << "Group::String{\"" << x.gout.name[i] << "\"}";
822 }
823 }
824
825 // Then come all the inputs that are not also outputs
826 for (std::size_t i = 0; i < x.in.varname.size(); i++) {
827 if (std::any_of(
828 x.out.varname.cbegin(), x.out.varname.cend(),
829 [in = x.in.varname[i]](const auto& out) { return in == out; }))
830 continue;
831 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
832 has_any = true;
833 std::cout << x.in.varname[i];
834 }
835
836 // Lastly are all the generic inputs, which cannot also be outputs
837 for (std::size_t i = 0; i < x.gin.name.size(); i++) {
838 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
839 has_any = true;
840 std::cout << x.gin.name[i];
841 }
842
843 // And their filenames if relevant
844 if (x.pass_wsv_names) {
845 for (std::size_t i = 0; i < x.gin.name.size(); i++) {
846 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
847 has_any = true;
848 std::cout << "Group::String{\"" << x.gin.name[i] << "\"}";
849 }
850 }
851
852 // Check verbosity
853 const bool has_verbosity =
854 std::any_of(x.in.varname.cbegin(), x.in.varname.cend(),
855 [](auto& name) { return name == "verbosity"; });
856
857 // Add verbosity of it does not exist
858 if (not has_verbosity) {
859 if (has_any) std::cout << ',' << '\n' << spaces(x.name.size() + 2 + 1);
860 has_any = true;
861 std::cout << "Var::verbosity(ws).value()";
862 }
863
864 // Close the function call and the function itself
865 std::cout << ')' << ';' << '\n' << '}' << '\n' << '\n' << '\n';
866 }
867}
868
869void print_methods(const NameMaps& artsname) {
870 std::cout << "#pragma clang diagnostic push\n";
871 std::cout << "#pragma clang diagnostic ignored \"-Wbraced-scalar-init\"\n";
872 std::cout << "namespace Method {\n";
873 print_gin_methods(artsname);
874 print_full_methods(artsname);
875 std::cout << "} // namespace Method \n\n";
876 std::cout << "#pragma clang diagnostic pop\n";
877}
878
879void print_agenda_methods(const NameMaps& artsname) {
880 std::cout << "namespace Method {\n";
881
882 for (auto& x : artsname.methodname_method) {
883 // Skip methods using verbosity and Agenda methods (for now)
884 if (x.agenda_method) continue;
885
886 // Also skip create methods since these must be called via Var
887 if (std::any_of(artsname.group.cbegin(), artsname.group.cend(),
888 [metname = x.name](auto& y) {
889 return (y.first + String("Create")) == metname;
890 }))
891 continue;
892
893 // Describe the method
894 std::cout << "/*! " << x.desc << '\n';
895 for (const auto& a : x.authors) std::cout << "@author " << a << '\n';
896 std::cout << "\n"
897 "@param[in,out] Workspace ws - An ARTS workspace\n";
898 for (std::size_t i = 0; i < x.gout.name.size(); i++)
899 std::cout << "@param[out] " << x.gout.name[i] << " - " << x.gout.desc[i]
900 << "\n";
901 for (std::size_t i = 0; i < x.gin.name.size(); i++) {
902 std::cout << "@param[in] " << x.gin.name[i] << " - " << x.gin.desc[i];
903 if (x.gin.hasdefs[i]) std::cout << " (default: " << x.gin.defs[i] << ")";
904 std::cout << '\n';
905 }
906 std::cout << "\nUse the ARTS documentation to read more on how the "
907 "workspace is manipulated\n";
908 std::cout << "This interface function has been automatically generated\n";
909 std::cout << "\n"
910 << "@return MRecord to call this method\n";
911 std::cout << "*/" << '\n';
912
913 // Make the function
914 std::cout << "[[nodiscard]] inline\nGroup::Internal::MRecord " << x.name
915 << "(Workspace& ws [[maybe_unused]]";
916
917 // Check if we have the first input
918 for (std::size_t i = 0; i < x.gout.group.size(); i++) {
919 std::cout << ',' << '\n' << spaces(x.name.size() + 26);
920 std::cout << "Var::" << x.gout.group[i] << ' '
921 << x.gout.name[i];
922 }
923
924 // Second put all GIN variables that have no default argument
925 for (std::size_t i = 0; i < x.gin.group.size(); i++) {
926 if (not x.gin.hasdefs[i]) {
927 std::cout << ',' << '\n' << spaces(x.name.size() + 26 - 6);
928 std::cout << "const Var::" << x.gin.group[i] << ' '
929 << x.gin.name[i];
930 }
931 }
932
933 // Lastly put all GIN variables that have a default argument
934 for (std::size_t i = 0; i < x.gin.group.size(); i++) {
935 if (x.gin.hasdefs[i]) {
936 std::cout << ',' << '\n' << spaces(x.name.size() + 26 - 6);
937 std::cout << "const Var::" << x.gin.group[i] << '&'
938 << ' ' << x.gin.name[i] << '=' << "{}";
939 }
940 }
941
942 // End of function definition and open function block
943 std::cout << ')' << ' ' << '{' << '\n';
944
945 // Output variables have to be on the Workspace
946 if (x.gout.group.size() or x.gin.group.size()) std::cout << ' ';
947 for (std::size_t i = 0; i < x.gout.group.size(); i++) {
948 std::cout << " if (" << x.gout.name[i]
949 << ".islast()) {\n throw std::runtime_error(\""
950 << x.gout.name[i] << " needs to be a defined Workspace"
951 << x.gout.group[i] << " since it is output of " << x.name
952 << "\");\n }";
953 }
954 for (std::size_t i = 0; i < x.gin.group.size(); i++) {
955 if (x.gin.hasdefs[i])
956 std::cout << " if (not " << x.gin.name[i] << ".isnull() and "
957 << x.gin.name[i]
958 << ".islast()) {\n throw std::runtime_error(\""
959 << x.gin.name[i] << " needs to be a defined Workspace"
960 << x.gin.group[i]
961 << " (or left default) since it is agenda input to " << x.name
962 << "\");\n }";
963 else
964 std::cout << " if (" << x.gin.name[i]
965 << ".islast()) {\n throw std::runtime_error(\""
966 << x.gin.name[i] << " needs to be a defined Workspace"
967 << x.gin.group[i] << " since it is agenda input to " << x.name
968 << "\");\n }";
969 }
970 if (x.gout.group.size() or x.gin.group.size()) std::cout << '\n' << '\n';
971
972 for (std::size_t i = 0; i < x.gin.group.size(); i++) {
973 if (x.gin.hasdefs[i]) {
974 std::cout
975 << " static const auto " << x.gin.name[i]
976 << "_default = Var::" << x.gin.group[i] << "Create(ws, "
977 << x.gin.defs[i] << ",\n \"" << x.name << '_' << x.gin.name[i]
978 << "_autodefault"
979 << "\",\n \"auto generated variable with default from method "
980 "definition\");\n";
981 }
982 }
983
984 // Call the ARTS auto_md.h function
985 std::cout << " return Group::Internal::MRecord(" << x.pos << ',' << '\n'
986 << spaces(34) << "Group::ArrayOfIndex(" << '{';
987
988 // First are all the outputs
989 for (unsigned long varpo : x.out.varpos) {
990 std::cout << varpo << ',' << '\n' << spaces(34 + 21);
991 }
992
993 // Second comes all the generic outputs
994 for (const auto & i : x.gout.name) {
995 std::cout << "Group::Index(" << i << ".pos())" << ',' << '\n' << spaces(34 + 21);
996 }
997 std::cout << '}' << ')' << ',' << '\n' << spaces(34) << "Group::ArrayOfIndex("
998 << '{';
999
1000 // Then come all the inputs that are not also outputs
1001 for (unsigned long varpo : x.in.varpos) {
1002 std::cout << varpo << ',' << '\n' << spaces(34 + 21);
1003 }
1004
1005 // Lastly are all the generic inputs, which cannot also be outputs
1006 for (std::size_t i = 0; i < x.gin.name.size(); i++) {
1007 if (x.gin.hasdefs[i])
1008 std::cout << x.gin.name[i] << ".isnull() ? Group::Index(" << x.gin.name[i]
1009 << "_default.pos()) :" << '\n' << spaces(34 + 21 + 12 + x.gin.name[i].size());
1010 std::cout << "Group::Index(" << x.gin.name[i] << ".pos())" << ',' << '\n' << spaces(34 + 21);
1011 }
1012
1013 std::cout << '}' << ')' << ',' << ' ';
1014
1015 if (x.set_method)
1016 std::cout << '\n' << spaces(34) << "Group::Internal::TokVal{" << x.gin.name[0]
1017 << ".value()}";
1018 else
1019 std::cout << '\n' << spaces(34) << "Group::Internal::TokVal{}";
1020
1021 std::cout << ',' << '\n' << spaces(34) << "Group::Agenda{}";
1022
1023 // Close the function call and the function itself
1024 std::cout << ')' << ';' << '\n' << '}' << '\n' << '\n' << '\n';
1025 }
1026 std::cout << "} // namespace Method \n\n";
1027}
1028
1029void print_agenda_execute(const NameMaps& artsname) {
1030 std::cout << "namespace Execute { \n\n";
1031 for (auto& x : artsname.agendaname_agenda) {
1032 std::cout << "/*! " << x.second.desc << '\n'
1033 << "@param[in,out] Workspace ws - An ARTS workspace\n"
1034 << "*/\n"
1035 << "inline void " << x.first << "(Workspace& ws) {\n " << x.first
1036 << "Execute(ws";
1037 for (auto& name : x.second.outs) {
1038 std::cout << ',' << '\n' << spaces(x.first.size() + 2 + 1 + 7) << "Var::" << name
1039 << "(ws).value()";
1040 }
1041 for (auto& name : x.second.ins) {
1042 if (not std::any_of(x.second.outs.cbegin(), x.second.outs.cend(),
1043 [name](auto& outname) { return name == outname; }))
1044 std::cout << ',' << '\n' << spaces(x.first.size() + 2 + 1 + 7) << "Var::" << name
1045 << "(ws).value()";
1046 }
1047 std::cout << ',' << '\n' << spaces(x.first.size() + 2 + 1 + 7) << "Var::" << x.first << "(ws).value());\n}\n\n";
1048 }
1049 std::cout << "} // namespace Execute \n\n";
1050}
1051
1052void print_agenda_define(const NameMaps& artsname) {
1053 std::cout << "namespace Define { \n";
1054 std::cout << "/*! Append Records to an agenda */\n";
1055 std::cout
1056 << "template <typename ... Records>\nvoid Append(Group::Agenda& ag, "
1057 "Records ... records) {\n"
1058 << " for (auto& x: { Group::Internal::MRecord(records)... })\n "
1059 "ag.push_back(x);\n}\n\n";
1060 for (auto& x : artsname.agendaname_agenda) {
1061 if (artsname.varname_group.at(x.first).varname_group == "ArrayOfAgenda")
1062 continue;
1063 std::cout << "/*! " << x.second.desc << '\n'
1064 << "@param[in,out] Workspace ws - An ARTS workspace\n"
1065 << "@param[in] MRecords records - Any number of ARTS methods "
1066 "from AgendaMethod\n"
1067 << "*/\n"
1068 << "template <typename ... Records> "
1069 << "\nvoid " << x.first
1070 << "(Workspace& ws, Records ... records) {\n"
1071 << " Var::" << x.first << "(ws).value().resize(0);\n"
1072 << " Var::" << x.first << "(ws).value().set_name(\"" << x.first
1073 << "\");\n"
1074 << " Append(Var::" << x.first << "(ws).value(), records...);"
1075 << "\n"
1076 << " Var::" << x.first
1077 << "(ws).value().check(ws, Var::verbosity(ws).value());\n}\n\n";
1078 }
1079 std::cout << "} // namespace Define \n\n";
1080}
1081
1082void print_agendas(const NameMaps& artsname) {
1083 std::cout << "/*! ARTS Agenda interaction namespace\n\n Will only be "
1084 "populated by namespaces.\n Users of the API can define their "
1085 "Agendas\n in the Agenda namespace\n*/\n";
1086 std::cout << "namespace Agenda {\n";
1087 print_agenda_methods(artsname);
1088 print_agenda_execute(artsname);
1089 print_agenda_define(artsname);
1090 std::cout << "} // namespace Agenda\n";
1091}
1092
1094 std::cout << "namespace Species {\n";
1095 std::cout << " using namespace ::Species;\n";
1096 std::cout << "} // namespace Species \n\n";
1097}
1098
1100 std::cout << "/*! Create a Workspace and set its main verbosity\n\n"
1101 << " @param[in] screen Screen verbosity\n"
1102 << " @param[in] file File verbosity\n"
1103 << " @param[in] agenda Agenda verbosity\n"
1104 << " @param[in] basename Default basename for output variables\n"
1105 << " @param[in] numthreads OpenMP thread count (defaults to max "
1106 "if invalid count)\n"
1107 << " @return Workspace a full ARTS Workspace\n"
1108 << "*/\n";
1109 std::cout
1110 << "inline Workspace init(std::size_t screen=0, std::size_t file=0, "
1111 "std::size_t agenda=0, const Group::String& basename=\"arts\", "
1112 "[[maybe_unused]] int numthreads=0) {\n"
1113#ifdef _OPENMP
1114 " omp_set_num_threads(numthreads < 1 ? arts_omp_get_max_threads() : "
1115 "numthreads > arts_omp_get_max_threads() ? arts_omp_get_max_threads() "
1116 ": numthreads);\n"
1117 "\n"
1118#endif
1119 " define_wsv_group_names();\n"
1120 " Workspace::define_wsv_data();\n"
1121 " Workspace::define_wsv_map();\n"
1122 " define_md_data_raw();\n"
1123 " expand_md_data_raw_to_md_data();\n"
1124 " define_md_map();\n"
1125 " define_agenda_data();\n"
1126 " define_agenda_map();\n"
1127 " global_data::workspace_memory_handler.initialize();\n"
1128 "\n"
1129 " Workspace ws;\n"
1130 " ws.initialize();\n"
1131 " Var::verbosity(ws).value().set_screen_verbosity(screen);\n"
1132 " Var::verbosity(ws).value().set_agenda_verbosity(agenda);\n"
1133 " Var::verbosity(ws).value().set_file_verbosity(file);\n"
1134 " Var::verbosity(ws).value().set_main_agenda(1);\n"
1135 "\n"
1136 " out_basename = basename;\n"
1137 "\n"
1138 "#ifndef NDEBUG\n"
1139 " ws.context = \"\";\n"
1140 "#endif\n"
1141 "\n"
1142 " return ws;\n"
1143 "}\n";
1144}
1145
1146int main() {
1152 define_md_map();
1155
1156 const auto artsname = NameMaps();
1157
1158 std::cout << "#ifndef autoarts_h\n"
1159 << "#define autoarts_h\n"
1160 << '\n';
1161
1163
1164 std::cout << "namespace ARTS {\n";
1165
1167
1168 print_variables(artsname);
1169
1170 print_methods(artsname);
1171
1172 print_agendas(artsname);
1173
1175
1176 print_startup();
1177
1178 std::cout << "} // namespace::ARTS\n\n";
1179
1180 std::cout << "#endif // autoarts_h\n";
1181}
void define_agenda_map()
void define_agenda_data()
Definition: agendas.cc:44
void define_wsv_group_names()
Define the array of workspace variable group names.
Definition: groups.cc:77
static void define_wsv_data()
Define workspace variables.
Definition: workspace.cc:39
static void define_wsv_map()
Map WSV names to indices.
Definition: workspace_ng.cc:48
static Array< WsvRecord > wsv_data
Global WSV data.
Definition: workspace_ng.h:58
static map< String, Index > WsvMap
Global map associated with wsv_data.
Definition: workspace_ng.h:61
void print_include_and_external()
void print_agenda_methods(const NameMaps &artsname)
std::vector< Method > methods()
std::pair< std::vector< std::string >, std::vector< bool > > fixed_defaults(const std::vector< std::string > &vargroups, const std::vector< std::string > &vardefaults)
void print_gin_methods(const NameMaps &artsname)
void print_methods(const NameMaps &artsname)
void print_full_methods(const NameMaps &artsname)
void print_agenda_define(const NameMaps &artsname)
void print_agenda_execute(const NameMaps &artsname)
std::map< std::string, AgendaData > agendas()
void print_startup()
std::string spaces(std::size_t n)
void print_variables(const NameMaps &artsname)
std::map< std::string, Group > groups()
void print_agendas(const NameMaps &artsname)
int main()
void print_groups_and_namespaces(const NameMaps &artsname)
void print_species_identification()
void define_md_data_raw()
Definition: methods.cc:191
void define_md_map()
Define MdMap.
Definition: methods_aux.cc:473
void expand_md_data_raw_to_md_data()
Expand supergeneric methods.
Definition: methods_aux.cc:410
#define NODEF
Definition: methods.h:35
my_basic_string< char > String
The String type for ARTS.
Definition: mystring.h:287
const Array< MdRecord > md_data
Lookup information for workspace methods.
Definition: methods_aux.cc:48
const map< String, Index > MdMap
The map associated with md_data.
Definition: methods_aux.cc:39
const Array< AgRecord > agenda_data
The lookup information for the agendas.
Definition: agendas.cc:41
const map< String, Index > WsvGroupMap
The map associated with wsv_group_names.
Definition: groups.cc:41
map< String, Index > AgendaMap
The map associated with agenda_data.
#define v
#define a
std::size_t pos
std::vector< std::string > outs
std::vector< std::string > ins
std::string desc
std::string varname_desc
std::size_t artspos
std::string varname_group
std::vector< std::string > group
std::vector< bool > hasdefs
std::vector< std::string > defs
std::vector< std::string > name
std::vector< std::string > desc
std::vector< std::string > group
std::vector< std::string > desc
std::vector< std::string > name
std::vector< std::size_t > varpos
std::vector< std::string > varname
std::vector< std::size_t > varpos
std::vector< std::string > varname
std::string desc
bool pass_workspace
bool agenda_method
bool uses_templates
std::string name
std::vector< std::string > authors
std::vector< std::size_t > inoutvarpos
bool pass_wsv_names
bool set_method
std::size_t pos
bool supergeneric
std::vector< Method > methodname_method
std::map< std::string, AgendaData > agendaname_agenda
std::map< std::string, std::size_t > group
std::map< std::string, Group > varname_group