Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type checking for model_list in CombinedGaussianTransitionModel #1013

Closed
narykov opened this issue May 10, 2024 · 0 comments
Closed

Type checking for model_list in CombinedGaussianTransitionModel #1013

narykov opened this issue May 10, 2024 · 0 comments

Comments

@narykov
Copy link

narykov commented May 10, 2024

I've just spent an hour debugging a piece of code that uses CombinedGaussianTransitionModel. The issue was in how I passed the models in:

transition_model = CombinedGaussianTransitionModel(ModelA(), ModelB())

I forgot to organise them as a Sequence of some kind, while the correct way is to use a tuple or a list, e.g.,

transition_model = CombinedGaussianTransitionModel([ModelA(), ModelB()])

I am surprised this has not been caught by the internal check, and instead I've been receiving this rather unhelpful message:

Traceback (most recent call last):
File "_mt19937.pyx", line 178, in numpy.random._mt19937.MT19937._legacy_seeding
TypeError: 'ModelB' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "_mt19937.pyx", line 186, in numpy.random._mt19937.MT19937._legacy_seeding
TypeError: Cannot cast scalar from dtype('O') to dtype('int64') according to the rule 'safe'
Exception ignored in: <module 'threading' from '/Users/alexeynarykov/miniconda3/envs/godot_devel/lib/python3.10/threading.py'>
Traceback (most recent call last):
File "/Users/alexeynarykov/miniconda3/envs/godot_devel/lib/python3.10/threading.py", line 1567, in _shutdown
lock.acquire()
KeyboardInterrupt:
Process finished with exit code 1

Perhaps, this could be accounted for? Talking to @A-acuto revealed that he, too, stepped on the same rake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant