mdanalysis icon indicating copy to clipboard operation
mdanalysis copied to clipboard

Make networkx an optional dep?

Open IAlibay opened this issue 1 year ago • 4 comments

Networkx is solely used by a single analysis module (leaflet.py). It may make sense to make this an optional dependency?

IAlibay avatar Sep 09 '22 13:09 IAlibay

Sure.

By now we seem to have settled on a typical pattern for dealing with optional packages: flag availability with HAS_PACKAGE from a try/except ImportError, raise exception inside function/class if not available. Guard tests.

orbeckst avatar Sep 15 '22 23:09 orbeckst

Yes.

On Fri, Sep 16, 2022 at 00:18, Oliver Beckstein @.***> wrote:

Sure.

By now we seem to have settled on a typical pattern for dealing with optional packages: flag availability with HAS_PACKAGE from a try/except ImportError, raise exception inside function/class if not available. Guard tests.

— Reply to this email directly, view it on GitHub https://github.com/MDAnalysis/mdanalysis/issues/3822#issuecomment-1248739769, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGSGB7VPBMKLH7YRE5LWT3V6OVFBANCNFSM6AAAAAAQIVGZLM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

richardjgowers avatar Sep 16 '22 07:09 richardjgowers

Sure.

By now we seem to have settled on a typical pattern for dealing with optional packages: flag availability with HAS_PACKAGE from a try/except ImportError, raise exception inside function/class if not available. Guard tests.

Should we make this official policy in Docs / Userguide/ wiki?

hmacdope avatar Sep 23 '22 01:09 hmacdope

Mmm I don't know just yet, there was plan with some OMSF folks to move this to a separate package that uses importlib creatively. Not sure where that got.

IAlibay avatar Sep 23 '22 03:09 IAlibay

We should have a written policy on optional packages. I'll put a note on agenda for the next meeting.

orbeckst avatar Jun 23 '23 01:06 orbeckst