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

Use package-local wrapper type instead of extending Base (or other packages') methods on DataFrame #67

Closed
tkelman opened this issue Jul 25, 2017 · 3 comments · Fixed by #132

Comments

@tkelman
Copy link
Contributor

tkelman commented Jul 25, 2017

Since https://github.com/sisl/BayesNets.jl/blob/5febf756d38194712cfb8c0c2294252931611afa/src/DiscreteBayesNet/tables.jl does a const Table = DataFrame, all method extensions on Table are global and change the behavior of other unrelated code that uses DataFrames, just from importing BayesNets whether or not it's using this package. This is discouraged.

If Table were instead a wrapper struct that delegated the relevant operations to a single DataFrame field, then you could define methods on BayesNets.Table however you like and not be at risk of changing any other code's behavior.

Same issue with

Base.names(a::Assignment) = collect(keys(a))
and
Base.convert(::Type{NodeNames}, name::NodeName) = [name]
as well

and 3cd56dc#commitcomment-22494521 should probably be submitted upstream in DataFrames?

@tawheeler
Copy link
Contributor

@mykelk - maybe this can be delegated to another SISLer?

@mykelk
Copy link
Member

mykelk commented Jul 25, 2017

@hamzaelsaawy said he can handle these issues.

@tkelman
Copy link
Contributor Author

tkelman commented Jul 25, 2017

Yep these have all come up in past discussions, probably easier to track all in one place though rather than a bit scattered

tkelman referenced this issue Aug 25, 2017
dwijenchawra added a commit to dwijenchawra/BayesNets.jl that referenced this issue Jun 27, 2021
dwijenchawra added a commit to dwijenchawra/BayesNets.jl that referenced this issue Jun 27, 2021
mykelk added a commit that referenced this issue Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants