Skip to content

Commit 9f87d92

Browse files
committed
Fix CI
1 parent 6f3992b commit 9f87d92

File tree

2 files changed

+124
-37
lines changed

2 files changed

+124
-37
lines changed

include/queryosity/lazy.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ template <typename Action>
2222
class lazy : public dataflow::node,
2323
public ensemble::slotted<Action>,
2424
public systematic::resolver<lazy<Action>>,
25-
public query::result_if_qryregation<Action> {
25+
public query::result_if_aggregation<Action> {
2626

2727
public:
2828
class varied;
@@ -169,15 +169,15 @@ class lazy : public dataflow::node,
169169
*/
170170
template <
171171
typename V = Action,
172-
std::enable_if_t<queryosity::query::is_qryregation_v<V>, bool> = false>
172+
std::enable_if_t<queryosity::query::is_aggregation_v<V>, bool> = false>
173173
auto result() -> decltype(std::declval<V>().result());
174174

175175
/**
176176
* @brief Shortcut for `result()`.
177177
*/
178178
template <
179179
typename V = Action,
180-
std::enable_if_t<queryosity::query::is_qryregation_v<V>, bool> = false>
180+
std::enable_if_t<queryosity::query::is_aggregation_v<V>, bool> = false>
181181
auto operator->() -> decltype(std::declval<V>().result()) {
182182
return this->result();
183183
}
@@ -201,7 +201,7 @@ class lazy : public dataflow::node,
201201
protected:
202202
template <
203203
typename V = Action,
204-
std::enable_if_t<queryosity::query::is_qryregation_v<V>, bool> = false>
204+
std::enable_if_t<queryosity::query::is_aggregation_v<V>, bool> = false>
205205
void merge_results();
206206

207207
protected:
@@ -411,7 +411,7 @@ auto queryosity::lazy<Action>::get(queryosity::column::series<Col> const &col)
411411

412412
template <typename Action>
413413
template <typename V,
414-
std::enable_if_t<queryosity::query::is_qryregation_v<V>, bool>>
414+
std::enable_if_t<queryosity::query::is_aggregation_v<V>, bool>>
415415
auto queryosity::lazy<Action>::result()
416416
-> decltype(std::declval<V>().result()) {
417417
this->m_df->analyze();
@@ -421,7 +421,7 @@ auto queryosity::lazy<Action>::result()
421421

422422
template <typename Action>
423423
template <typename V,
424-
std::enable_if_t<queryosity::query::is_qryregation_v<V>, bool> e>
424+
std::enable_if_t<queryosity::query::is_aggregation_v<V>, bool> e>
425425
void queryosity::lazy<Action>::merge_results() {
426426
if (this->m_merged)
427427
return;

queryosity.h

Lines changed: 118 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ class dataflow {
21782178
/**
21792179
* @brief Initiate a cutflow.
21802180
* @tparam Col Column type.
2181-
* @param[in] column Input column value used as cut decision.
2181+
* @param[in] column Input column used as cut decision.
21822182
* @return Lazy selection.
21832183
*/
21842184
template <typename Col>
@@ -2187,7 +2187,7 @@ class dataflow {
21872187
/**
21882188
* @brief Initiate a cutflow.
21892189
* @tparam Col Column type.
2190-
* @param[in] column Input column value used as weight decision.
2190+
* @param[in] column Input column used as weight decision.
21912191
* @return Lazy selection.
21922192
*/
21932193
template <typename Col>
@@ -2196,15 +2196,15 @@ class dataflow {
21962196
/**
21972197
* @brief Initiate a cutflow.
21982198
* @tparam Col Lazy varied column.
2199-
* @param[in] column Input column value used as cut decision.
2199+
* @param[in] column Input column used as cut decision.
22002200
* @return Lazy varied selection.
22012201
*/
22022202
template <typename Col> auto filter(Col const &col);
22032203

22042204
/**
22052205
* @brief Initiate a cutflow.
22062206
* @tparam Col Lazy varied column.
2207-
* @param[in] column Input column value used as weight decision.
2207+
* @param[in] column Input column used as weight decision.
22082208
* @return Lazy varied selection.
22092209
*/
22102210
template <typename Col> auto weight(Col const &col);
@@ -2845,39 +2845,113 @@ class lazy : public dataflow::node,
28452845
std::enable_if_t<queryosity::is_column_v<V>, bool> = false>
28462846
auto to() const -> lazy<column::valued<To>>;
28472847

2848-
template <typename Col> auto filter(lazy<Col> const &col) const;
2849-
template <typename Col> auto weight(lazy<Col> const &col) const;
2848+
/**
2849+
* @brief Compound a weight to from this selection.
2850+
* @tparam Col Column type.
2851+
* @param[in] column Input lazy column used as weight decision.
2852+
* @details The current selection becomes its prerequisite in the cutflow: all
2853+
* prerequisites must pass in order for a downstream selection to pass.
2854+
* @return Compounded lazy weight.
2855+
*/
2856+
template <typename Col> auto filter(lazy<Col> const &column) const;
2857+
2858+
/**
2859+
* @brief Compound a weight to from this selection.
2860+
* @tparam Col Column type.
2861+
* @param[in] column Input lazy column used as weight decision.
2862+
* @return Compounded lazy weight.
2863+
*/
2864+
template <typename Col> auto weight(lazy<Col> const &column) const;
2865+
2866+
/**
2867+
* @brief Compound a varied cut to this selection.
2868+
* @tparam Col Varied lazy column type.
2869+
* @param[in] column Input varied column used as cut decision.
2870+
* @return Varied lazy cut.
2871+
*/
2872+
template <typename Col> auto filter(Col const &column) const;
28502873

2851-
template <typename Col> auto filter(Col const &col) const;
2852-
template <typename Col> auto weight(Col const &col) const;
2874+
/**
2875+
* @brief Compound a varied weight to this selection.
2876+
* @tparam Col Varied lazy column type.
2877+
* @param[in] column Input varied column used as weight decision.
2878+
* @return Varied lazy weight.
2879+
*/
2880+
template <typename Col> auto weight(Col const &column) const;
28532881

2882+
/**
2883+
* @brief Compound a cut to this selection.
2884+
* @tparam Expr Callable type (C++ function, functor, lambda, etc.).
2885+
* @param[in] column Input lazy column used as cut decision.
2886+
* @return Selection evaluator.
2887+
*/
28542888
template <typename Expr>
28552889
auto filter(queryosity::column::expression<Expr> const &expr) const;
28562890

2891+
/**
2892+
* @brief Compound a weight to from this selection.
2893+
* @tparam Expr Callable type (C++ function, functor, lambda, etc.).
2894+
* @param[in] expr Expression used to evaluate the weight decision.
2895+
* @return Selection evaluator.
2896+
*/
28572897
template <typename Expr>
28582898
auto weight(queryosity::column::expression<Expr> const &expr) const;
28592899

2860-
template <typename Agg> auto book(Agg &&agg) const;
2861-
template <typename... Aggs> auto book(Aggs &&...aggs) const;
2900+
/**
2901+
* @brief Book a query at this selection.
2902+
* @tparam Qry (Varied) query booker type.
2903+
* @param[in] qry Query booker.
2904+
* @details The query booker should have already been filled with input columns (if applicable).
2905+
* @return (Varied) lazy query.
2906+
*/
2907+
template <typename Qry> auto book(Qry &&qry) const;
28622908

28632909
/**
2864-
* @brief Get a column series for the entries passing the selection
2910+
* @brief Book multiple queries at this selection.
2911+
* @tparam Qrys (Varied) query booker types.
2912+
* @param[in] qrys Query bookers.
2913+
* @details The query bookers should have already been filled with input columns (if applicable).
2914+
* @return (Varied) lazy queries.
2915+
*/
2916+
template <typename... Qrys> auto book(Qrys &&...qrys) const;
2917+
2918+
/**
2919+
* @brief Get a column series for the entries passing the selection.
2920+
* @tparam Col Lazy column type.
2921+
* @return Lazy query.
28652922
* @attention The weight value does not apply in the population of the
28662923
* series.
28672924
*/
2868-
template <typename Col, std::enable_if_t<queryosity::is_nominal_v<Col>,bool> = false>
2925+
template <typename Col,
2926+
std::enable_if_t<queryosity::is_nominal_v<Col>, bool> = false>
28692927
auto get(column::series<Col> const &col)
28702928
-> lazy<query::series<typename column::series<Col>::value_type>>;
28712929

2872-
template <typename Col, std::enable_if_t<queryosity::is_varied_v<Col>,bool> = false>
2873-
auto get(column::series<Col> const &col)
2874-
-> typename lazy<query::series<typename column::series<Col>::value_type>>::varied;
2930+
/**
2931+
* @brief Get a column series for the entries passing the selection.
2932+
* @tparam Col Varied column type.
2933+
* @return Varied lazy query.
2934+
* @attention The weight value does not apply in the population of the
2935+
* series.
2936+
*/
2937+
template <typename Col,
2938+
std::enable_if_t<queryosity::is_varied_v<Col>, bool> = false>
2939+
auto get(column::series<Col> const &col) -> typename lazy<
2940+
query::series<typename column::series<Col>::value_type>>::varied;
28752941

2942+
/**
2943+
* @brief (Process and) retrieve the result of a query.
2944+
* @return Query result.
2945+
* @attention Invoking this turns *all* lazy actions in the dataflow *eager*.
2946+
*/
28762947
template <
28772948
typename V = Action,
28782949
std::enable_if_t<queryosity::query::is_aggregation_v<V>, bool> = false>
28792950
auto result() -> decltype(std::declval<V>().result());
28802951

2952+
/**
2953+
* @brief Shortcut for `result()`.
2954+
*/
28812955
template <
28822956
typename V = Action,
28832957
std::enable_if_t<queryosity::query::is_aggregation_v<V>, bool> = false>
@@ -2923,9 +2997,11 @@ namespace queryosity {
29232997
/**
29242998
* @ingroup api
29252999
* @brief Variations of a lazy action.
2926-
* @details A varied lazy node encapsulates independent nominal and variations
2927-
* of a lazy action.
29283000
* @tparam Action Action to be performed.
3001+
* @details A varied lazy action encapsulates independent nominal and variation
3002+
* instances of of a lazy action, which are implicitly propagated through all
3003+
* downstream actions that it participates in. In other words, a varied node
3004+
* behaves functionally identical to a nominal-only one.
29293005
*/
29303006
template <typename Act>
29313007
class lazy<Act>::varied : public dataflow::node,
@@ -2955,12 +3031,21 @@ class lazy<Act>::varied : public dataflow::node,
29553031
virtual std::set<std::string> get_variation_names() const override;
29563032

29573033
/**
2958-
* Apply a filter.
3034+
* @brief Compound a cut to this selection.
3035+
* @Col (Varied) lazy input column type.
3036+
* @parma[in] col (Varied) lazy input column used as cut decision.
3037+
* @return Varied lazy selection.
29593038
*/
29603039
template <typename Col, typename V = Act,
29613040
std::enable_if_t<queryosity::is_selection_v<V>, bool> = false>
29623041
auto filter(Col const &col) -> typename lazy<selection::node>::varied;
29633042

3043+
/**
3044+
* @brief Compound a weight to this selection.
3045+
* @Col (Varied) lazy input column type.
3046+
* @parma[in] col (Varied) lazy input column used as cut decision.
3047+
* @return Varied lazy selection.
3048+
*/
29643049
template <typename Col, typename V = Act,
29653050
std::enable_if_t<queryosity::is_selection_v<V>, bool> = false>
29663051
auto weight(Col const &col) -> typename lazy<selection::node>::varied;
@@ -3107,8 +3192,8 @@ auto queryosity::lazy<Act>::varied::filter(
31073192
typename todo<selection::applicator<selection::cut,
31083193
column::equation_t<Expr>>>::varied {
31093194

3110-
using varied_type = typename todo<selection::applicator<selection::cut,
3111-
column::equation_t<Expr>>>::varied;
3195+
using varied_type = typename todo<
3196+
selection::applicator<selection::cut, column::equation_t<Expr>>>::varied;
31123197

31133198
auto syst = varied_type(this->nominal().filter(expr));
31143199

@@ -3126,8 +3211,9 @@ auto queryosity::lazy<Act>::varied::weight(
31263211
typename todo<selection::applicator<selection::weight,
31273212
column::equation_t<Expr>>>::varied {
31283213

3129-
using varied_type = typename todo<selection::applicator<selection::weight,
3130-
column::equation_t<Expr>>>::varied;
3214+
using varied_type =
3215+
typename todo<selection::applicator<selection::weight,
3216+
column::equation_t<Expr>>>::varied;
31313217

31323218
auto syst = varied_type(this->nominal().weight(expr));
31333219

@@ -3579,32 +3665,33 @@ auto queryosity::lazy<Action>::weight(
35793665
}
35803666

35813667
template <typename Action>
3582-
template <typename Agg>
3583-
auto queryosity::lazy<Action>::book(Agg &&agg) const {
3668+
template <typename Qry>
3669+
auto queryosity::lazy<Action>::book(Qry &&qry) const {
35843670
static_assert(std::is_base_of_v<selection::node, Action>,
35853671
"book must be called from a selection");
3586-
return agg.at(*this);
3672+
return qry.at(*this);
35873673
}
35883674

35893675
template <typename Action>
3590-
template <typename... Aggs>
3591-
auto queryosity::lazy<Action>::book(Aggs &&...aggs) const {
3676+
template <typename... Qrys>
3677+
auto queryosity::lazy<Action>::book(Qrys &&...qrys) const {
35923678
static_assert(std::is_base_of_v<selection::node, Action>,
35933679
"book must be called from a selection");
3594-
return std::make_tuple((aggs.at(*this), ...));
3680+
return std::make_tuple((qrys.at(*this), ...));
35953681
}
35963682

35973683
template <typename Action>
3598-
template <typename Col, std::enable_if_t<queryosity::is_nominal_v<Col>,bool>>
3684+
template <typename Col, std::enable_if_t<queryosity::is_nominal_v<Col>, bool>>
35993685
auto queryosity::lazy<Action>::get(queryosity::column::series<Col> const &col)
36003686
-> lazy<query::series<typename column::series<Col>::value_type>> {
36013687
return col.make(*this);
36023688
}
36033689

36043690
template <typename Action>
3605-
template <typename Col, std::enable_if_t<queryosity::is_varied_v<Col>,bool>>
3691+
template <typename Col, std::enable_if_t<queryosity::is_varied_v<Col>, bool>>
36063692
auto queryosity::lazy<Action>::get(queryosity::column::series<Col> const &col)
3607-
-> typename lazy<query::series<typename column::series<Col>::value_type>>::varied {
3693+
-> typename lazy<
3694+
query::series<typename column::series<Col>::value_type>>::varied {
36083695
return col.make(*this);
36093696
}
36103697

0 commit comments

Comments
 (0)