Skip to content

Have amuse.lab raise original ImportError if code is missing#1228

Open
LourensVeen wants to merge 1 commit intoamusecode:mainfrom
LourensVeen:issue_1192_amuse_lab_installation_message
Open

Have amuse.lab raise original ImportError if code is missing#1228
LourensVeen wants to merge 1 commit intoamusecode:mainfrom
LourensVeen:issue_1192_amuse_lab_installation_message

Conversation

@LourensVeen
Copy link
Member

This updates amuse.lab to try to import the optional codes it likes to import, catch and store the exception it gets from the amuse.community forwarders if it doesn't work, and then raise that exception if the user tries to use the imported class or function.

This way, the user can still do from amuse.lab import * (even if that's bad practice, it's what we've got), and we only have one place where import error messages are generated.

Fixes #1192.

@github-project-automation github-project-automation bot moved this from Backlog to Done in Development Board Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Obsolete installation message when importing via amuse.lab

2 participants