JuliaStats / Distributions.jl

A Julia package for probability distributions and associated functions.
Other
1.11k stars 414 forks source link

params conflicts with Flux #1237

Open cossio opened 3 years ago

cossio commented 3 years ago

When using both Distributions and Flux, one gets the following conflict with params:

WARNING: both Distributions and Flux export "params"; uses of it in module Main must be qualified.

Is there a way to resolve this? Perhaps by renaming params, either in Flux or Distributions?

devmotion commented 3 years ago

Distributions just reexports StatsBase.params: https://github.com/JuliaStats/Distributions.jl/blob/dadf4363486c42eee55283c65260c8aa0c85fd05/src/Distributions.jl#L20-L22

Maybe Flux could implement StatsBase.params instead of defining its own version?

anandijain commented 1 year ago

BenchmarkTools also exports params!

devmotion commented 1 year ago

I guess it's unavoidable that multiple packages define and possibly also export functions with common names. Probably the best solution is to avoid using PackageX, PackageY but use more fine-grained import statements. See, e.g., also https://github.com/JuliaLang/julia/pull/42080.