Skip to content

Commit e398935

Browse files
committed
[FIXUP] Accommodate schema changes
1 parent 7749d6a commit e398935

6 files changed

Lines changed: 16 additions & 37 deletions

File tree

phlex/app/load_module.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,7 @@ namespace phlex::experimental {
7979
auto& creator =
8080
create_module.emplace_back(plugin_loader<detail::module_creator_t>(spec, "create_module"));
8181

82-
// Automatically specify the 'pymodule' Phlex plugin if the 'py' parameter is specified
83-
if (auto const* py = raw_config.if_contains("py")) {
84-
if (auto const* cpp = raw_config.if_contains("cpp")) {
85-
std::string msg = fmt::format("Both 'cpp' and 'py' parameters specified in for {}", label);
86-
if (auto const* cpp_value = cpp->if_string()) {
87-
msg += fmt::format("\n - cpp: {}", *cpp_value);
88-
}
89-
if (auto const* py_value = py->if_string()) {
90-
msg += fmt::format("\n - py: {}", *py_value);
91-
}
92-
throw std::runtime_error(msg);
93-
}
94-
raw_config["cpp"] = "pymodule";
95-
}
96-
97-
configuration const config{raw_config};
82+
configuration const config{adjusted_config};
9883
creator(g.module_proxy(config), config);
9984
}
10085

plugins/python/src/pymodule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PHLEX_EXPERIMENTAL_REGISTER_ALGORITHMS(m, config)
2222

2323
PyGILRAII g;
2424

25-
std::string modname = config.get<std::string>("pyplugin");
25+
std::string modname = config.get<std::string>("py");
2626
PyObject* mod = PyImport_ImportModule(modname.c_str());
2727
if (mod) {
2828
PyObject* reg = PyObject_GetAttrString(mod, "PHLEX_EXPERIMENTAL_REGISTER_ALGORITHMS");

test/python/pyconfig.jsonnet

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{
22
driver: {
3-
plugin: 'generate_layers',
3+
cpp: 'generate_layers',
44
layers: {
55
event: { parent: 'job', total: 10, starting_number: 1 }
66
}
77
},
88
sources: {
99
provider: {
10-
plugin: 'cppsource4py',
10+
cpp: 'cppsource4py',
1111
}
1212
},
1313
modules: {
1414
pyconfig: {
15-
plugin: 'pymodule',
16-
pyplugin: 'all_config',
15+
py: 'all_config',
1716
input: ['i', 'j'],
1817
a_bool: false,
1918
an_int: -37,

test/python/pyfailure.jsonnet

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{
22
driver: {
3-
plugin: 'generate_layers',
3+
cpp: 'generate_layers',
44
layers: {
55
event: { parent: 'job', total: 10, starting_number: 1 }
66
}
77
},
88
sources: {
99
provider: {
10-
plugin: 'cppsource4py',
10+
cpp: 'cppsource4py',
1111
}
1212
},
1313
modules: {
1414
pyadd: {
15-
plugin: 'pymodule',
16-
pyplugin: 'adder',
15+
py: 'adder',
1716
#input: ['i', 'j'], # commented out to cause a failure
1817
output: ['sum'],
1918
},

test/python/pyreduce.jsonnet

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
{
22
driver: {
3-
plugin: 'generate_layers',
3+
cpp: 'generate_layers',
44
layers: {
55
event: { parent: 'job', total: 10, starting_number: 1 }
66
}
77
},
88
sources: {
99
provider: {
10-
plugin: 'cppsource4py',
10+
cpp: 'cppsource4py',
1111
}
1212
},
1313
modules: {
1414
pyreduce: {
15-
plugin: 'pymodule',
16-
pyplugin: 'reducer',
15+
py: 'reducer',
1716
input: ['i', 'j'],
1817
},
1918
pyverify: {
20-
plugin: 'pymodule',
21-
pyplugin: 'verify',
19+
py: 'verify',
2220
input: ['sum'],
2321
sum_total: 4,
2422
},

test/python/pyvec.jsonnet

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
{
22
driver: {
3-
plugin: 'generate_layers',
3+
cpp: 'generate_layers',
44
layers: {
55
event: { parent: 'job', total: 10, starting_number: 1 }
66
}
77
},
88
sources: {
99
provider: {
10-
plugin: 'cppsource4py',
10+
cpp: 'cppsource4py',
1111
}
1212
},
1313
modules: {
1414
pysum: {
15-
plugin: 'pymodule',
16-
pyplugin: 'sumit',
15+
py: 'sumit',
1716
input: ['i', 'j'],
1817
output: ['sum'],
1918
},
2019
pyverify: {
21-
plugin: 'pymodule',
22-
pyplugin: 'verify',
20+
py: 'verify',
2321
input: ['sum'],
2422
sum_total: 1,
2523
},

0 commit comments

Comments
 (0)