Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/python/src/modulewrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using phlex::product_query;

// TODO: the layer is currently hard-wired and should come from the product
// specification instead, but that doesn't exist in Python yet.
static std::string const LAYER = "job";
static std::string const LAYER = "event";

// Simple phlex module wrapper
// clang-format off
Expand Down
30 changes: 15 additions & 15 deletions test/python/source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,58 @@ using namespace phlex;
PHLEX_REGISTER_PROVIDERS(s)
{
s.provide("provide_i", [](data_cell_index const& id) -> int { return id.number() % 2; })
.output_product("i"_in("job"));
.output_product("i"_in("event"));
s.provide("provide_j",
[](data_cell_index const& id) -> int { return 1 - (int)(id.number() % 2); })
.output_product("j"_in("job"));
.output_product("j"_in("event"));
s.provide("provide_k", [](data_cell_index const&) -> int { return 0; })
.output_product("k"_in("job"));
.output_product("k"_in("event"));

s.provide("provide_f1",
[](data_cell_index const& id) -> float { return (float)((id.number() % 100) / 100.0); })
.output_product("f1"_in("job"));
.output_product("f1"_in("event"));
s.provide(
"provide_f2",
[](data_cell_index const& id) -> float { return 1.0f - (float)((id.number() % 100) / 100.0); })
.output_product("f2"_in("job"));
.output_product("f2"_in("event"));

s.provide(
"provide_d1",
[](data_cell_index const& id) -> double { return (double)((id.number() % 100) / 100.0); })
.output_product("d1"_in("job"));
.output_product("d1"_in("event"));
s.provide("provide_d2",
[](data_cell_index const& id) -> double {
return 1.0 - (double)((id.number() % 100) / 100.0);
})
.output_product("d2"_in("job"));
.output_product("d2"_in("event"));

s.provide(
"provide_u1",
[](data_cell_index const& id) -> unsigned int { return (unsigned int)(id.number() % 2); })
.output_product("u1"_in("job"));
.output_product("u1"_in("event"));
s.provide(
"provide_u2",
[](data_cell_index const& id) -> unsigned int { return 1 - (unsigned int)(id.number() % 2); })
.output_product("u2"_in("job"));
.output_product("u2"_in("event"));

s.provide("provide_l1", [](data_cell_index const& id) -> long { return (long)(id.number() % 2); })
.output_product("l1"_in("job"));
.output_product("l1"_in("event"));
s.provide("provide_l2",
[](data_cell_index const& id) -> long { return 1 - (long)(id.number() % 2); })
.output_product("l2"_in("job"));
.output_product("l2"_in("event"));

s.provide(
"provide_ul1",
[](data_cell_index const& id) -> unsigned long { return (unsigned long)(id.number() % 101); })
.output_product("ul1"_in("job"));
.output_product("ul1"_in("event"));
s.provide("provide_ul2",
[](data_cell_index const& id) -> unsigned long {
return 100 - (unsigned long)(id.number() % 101);
})
.output_product("ul2"_in("job"));
.output_product("ul2"_in("event"));

s.provide("provide_b1", [](data_cell_index const& id) -> bool { return (id.number() % 2) == 0; })
.output_product("b1"_in("job"));
.output_product("b1"_in("event"));
s.provide("provide_b2", [](data_cell_index const& id) -> bool { return (id.number() % 2) != 0; })
.output_product("b2"_in("job"));
.output_product("b2"_in("event"));
}
Loading