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

DVGeometryCST import fails silently due to dependency not described in the docs #176

Closed
bbrelje opened this issue Jan 24, 2023 · 2 comments · Fixed by #180
Closed

DVGeometryCST import fails silently due to dependency not described in the docs #176

bbrelje opened this issue Jan 24, 2023 · 2 comments · Fixed by #180
Assignees
Labels
bug Something isn't working documentation This is related to documentation good first issue Good for newcomers

Comments

@bbrelje
Copy link
Collaborator

bbrelje commented Jan 24, 2023

Description

If a user does not have prefoil installed, importing DVGeometryCST at pygeo init will fail silently and produce a "ImportError: cannot import name 'DVGeometryCST' from 'pygeo'" error message when the module is actually used. This hides the underlying cause, which is that prefoil is not installed. The prefoil dependency is not described, as far as I can tell, anywhere in the docs or installation instructions.

Steps to reproduce issue

Install pygeo 1.12.2 on ubuntu-like system
Try to use DVGeometryCST (e.g. from cmplxfoil)

Current behavior

Error message hides reason for import error

Expected behavior

Error message ought to describe the missing dependency
Docs ought to describe prefoil depedency

Code versions

  • Operating System: Ubuntu 20
  • Python: 3.8.5
  • OpenMPI: n/a
  • CGNS: n/a
  • PETSc: n/a
  • Compiler: n/a
  • This repository: 1.12.2
@bbrelje bbrelje added good first issue Good for newcomers bug Something isn't working documentation This is related to documentation labels Jan 24, 2023
@sseraj
Copy link
Collaborator

sseraj commented Jan 24, 2023

I think @lamkina was planning on addressing a similar issue related to silent import errors

@lamkina
Copy link
Contributor

lamkina commented Jan 24, 2023

Yes I have been working on a fix for this issue. Typically the import error is thrown properly with a descriptive message at the lowest level where it's used, but then as we propogate the import statements up through the layers it gets silenced. My plan is to pass specific error codes that tell downstream import statements when to throw/not throw certain errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation This is related to documentation good first issue Good for newcomers
Projects
None yet
3 participants