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

Handle missing libraries more robustly #72

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Conversation

maresb
Copy link
Contributor

@maresb maresb commented Sep 24, 2023

When 'pymc' or 'numba' or 'bridgestan' are missing imports, provide specific installation instructions.

Don't rely on ImportError for missing packages, since that can be triggered downstream even when the respective package is installed.

Have a single compile_X_model function for each X. Each function lazily imports X-related modules and handles missing imports.

Closes #67

When 'pymc' or 'numba' or 'bridgestan' are missing imports,
provide specific installation instructions.

Don't rely on ImportError for missing packages, since that
can be triggered downstream even when the respective
package is installed.

Have a single compile_X_model function for each X. Each function
lazily imports X-related modules and handles missing imports.
@@ -441,7 +470,7 @@ def extract_shared(x, user_data_):
user_data = numba.carray(user_data_, (), record_dtype)

_shared_tuple = shared_tuple
for index in literal_unroll(indices):
for index in numba.literal_unroll(indices):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a numba issue some time ago where literal_unroll only did anything if it was used without the leading numba.. I'm not sure if that is still the case, maybe we should leave it just to be sure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that's crazy!!!

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aseyboldt
Copy link
Member

Looks good.

I'll have to remember this find_spec, seems to be useful :-)

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

Successfully merging this pull request may close these issues.

Uninformative stack traces on import errors
2 participants