|
798 | 798 | guesses::Union{AbstractVector,AbstractVector{<:AbstractVector}}, |
799 | 799 | datasets::Vector{D}, |
800 | 800 | options::AbstractOptions, |
| 801 | +) where {T,L,N,P<:AbstractPopMember{T,L,N},D<:Dataset{T,L}} |
| 802 | + return _parse_guesses_impl(P, guesses, datasets, options) |
| 803 | +end |
| 804 | + |
| 805 | +# Deal with non-concrete PopMember types |
| 806 | +@unstable function parse_guesses( |
| 807 | + ::Type{P}, |
| 808 | + guesses::Union{AbstractVector,AbstractVector{<:AbstractVector}}, |
| 809 | + datasets::Vector{D}, |
| 810 | + options::AbstractOptions, |
| 811 | +) where {T,L,P<:AbstractPopMember{T,L},D<:Dataset{T,L}} |
| 812 | + NodeType = with_type_parameters(options.node_type, T) |
| 813 | + N = Base.promote_op(create_expression, NodeType, typeof(options), D) |
| 814 | + N in (Any, Union{}) && error("Failed to infer expression type") |
| 815 | + ConcreteP = with_expression_type(P, N) |
| 816 | + return _parse_guesses_impl(ConcreteP, guesses, datasets, options) |
| 817 | +end |
| 818 | + |
| 819 | +@inline function _parse_guesses_impl( |
| 820 | + ::Type{P}, |
| 821 | + guesses::Union{AbstractVector,AbstractVector{<:AbstractVector}}, |
| 822 | + datasets::Vector{D}, |
| 823 | + options::AbstractOptions, |
801 | 824 | ) where {T,L,N,P<:AbstractPopMember{T,L,N},D<:Dataset{T,L}} |
802 | 825 | nout = length(datasets) |
803 | 826 | out = [P[] for _ in 1:nout] |
|
827 | 850 | return out |
828 | 851 | end |
829 | 852 |
|
830 | | -# Deal with non-concrete PopMember types |
831 | | -@unstable function parse_guesses( |
832 | | - ::Type{P}, |
833 | | - guesses::Union{AbstractVector,AbstractVector{<:AbstractVector}}, |
834 | | - datasets::Vector{D}, |
835 | | - options::AbstractOptions, |
836 | | -) where {T,L,P<:AbstractPopMember{T,L},D<:Dataset{T,L}} |
837 | | - NodeType = with_type_parameters(options.node_type, T) |
838 | | - N = Base.promote_op(create_expression, NodeType, typeof(options), D) |
839 | | - N === Any && error("Failed to infer expression type") |
840 | | - ConcreteP = with_expression_type(P, N) |
841 | | - return parse_guesses(ConcreteP, guesses, datasets, options) |
842 | | -end |
843 | | - |
844 | 853 | function _make_vector_vector(guesses, nout) |
845 | 854 | if nout == 1 |
846 | 855 | if guesses isa AbstractVector{<:AbstractVector} |
|
0 commit comments