Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Both Plots and LightGraphs export "grid" #1574

Closed
tfburns opened this issue Jul 6, 2021 · 3 comments
Closed

Both Plots and LightGraphs export "grid" #1574

tfburns opened this issue Jul 6, 2021 · 3 comments

Comments

@tfburns
Copy link

tfburns commented Jul 6, 2021

Version 1.5.2 (2020-09-23)

julia> using LightGraphs

julia> using Plots

julia> grid
WARNING: both Plots and LightGraphs export "grid"; uses of it in module Main must be qualified
ERROR: UndefVarError: grid not defined

With Julia version 1.5.2 (2020-09-23) and the following packages.

(v1.5) pkg> status LightGraphs Plots
Status G:\G_Documents\.julia\environments\v1.5\Project.toml
[093fc24a] LightGraphs v1.3.5
[91a5bcdd] Plots v1.9.1

Not sure how to get around this safely. Sidenote: I think most of the graph constructors could probably get more descriptive function names, e.g. construct_grid_graph.

@sbromberger
Copy link
Owner

sbromberger commented Jul 6, 2021

This is a common(ish) situation for lots of packages. The message is just a warning, and it only appears when you call the unqualified function.

To use LG's grid function, just qualify it: LightGraphs.grid(...). To use Plots, use Plots.grid(...).

We will not be renaming functions to accommodate other packages.

@juliohm
Copy link
Contributor

juliohm commented Jul 6, 2021

Yes, and I can say that Plots.jl is the offender here. It currently exports a bunch of names it shouldn't such as Point, grid, ...

I would suggest opening an issue in Plots.jl asking them to stop reexporting these names. A plotting package should only export the minimum amount of names for the plotting commands, not the types used internally to implement these commands.

@tfburns
Copy link
Author

tfburns commented Jul 7, 2021

Gotcha, thanks for the practical advice (using LightGraphs.grid and Plots.grid) and information that this is common situation for lots of packages (and particularly over-exportation in Plots.jl).

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

No branches or pull requests

3 participants