LorenFrankLab / non_local_detector

MIT License
1 stars 1 forks source link

Error during predicting `NonLocalSortedSpikesDetector` #2

Closed khl02007 closed 2 months ago

khl02007 commented 2 months ago

Got the following error. Seems like it's because _predict returns six things

acausal_posterior,
acausal_state_probabilities,
marginal_likelihood,
causal_state_probabilities,
predictive_state_probabilities,
log_likelihoods

but the code only expects five.

Adding an extra _ seems to fix this.

File ~/repos/non_local_detector/src/non_local_detector/models/base.py:2208, in SortedSpikesDetector.predict(self, spike_times, time, position, position_time, is_missing, discrete_transition_covariate_data, cache_likelihood, n_chunks)
   2201 if discrete_transition_covariate_data is not None:
   2202     self.discrete_state_transitions_ = predict_discrete_state_transitions(
   2203         self.discrete_transition_design_matrix_,
   2204         self.discrete_transition_coefficients_,
   2205         discrete_transition_covariate_data,
   2206     )
-> 2208 (
   2209     acausal_posterior,
   2210     acausal_state_probabilities,
   2211     marginal_log_likelihood,
   2212     _,
   2213     _,
   2214 ) = self._predict(
   2215     time=time,
   2216     log_likelihood_args=(
   2217         position_time,
   2218         position,
   2219         spike_times,
   2220     ),
   2221     is_missing=is_missing,
   2222     cache_likelihood=cache_likelihood,
   2223     n_chunks=n_chunks,
   2224 )
   2226 return self._convert_results_to_xarray(
   2227     time,
   2228     acausal_posterior,
   2229     acausal_state_probabilities,
   2230     marginal_log_likelihood,
   2231 )

ValueError: too many values to unpack (expected 5)