Coder Social home page Coder Social logo

Comments (4)

jjallaire avatar jjallaire commented on July 23, 2024

Interesting, I was under the impression that __bases__ would provide the entire hierarchy. Looks like that logic needs to be in a loop up to the top level. I'll try to make that change for the next release.

from reticulate.

jjallaire avatar jjallaire commented on July 23, 2024

It looks like inspect.getmro will do the correct traversal: http://stackoverflow.com/questions/1401661/list-all-base-classes-in-a-hierarchy-of-given-class

from reticulate.

jjallaire avatar jjallaire commented on July 23, 2024

@goldingn This PR should address this issue: #31

Could you take a look and let me know if this looks okay to you? (i.e. am I missing any subtleties here)

from reticulate.

goldingn avatar goldingn commented on July 23, 2024

Yeah, that's perfect. I get:

devtools::install_github('rstudio/reticulate@930b283')
library(reticulate)
gp <- import('GPflow')
k1 <- gp$kernels$Constant(1)
k2 <- gp$kernels$Bias(1)
k3 <- gp$kernels$Cosine(1)
class(k1); class(k2); class(k3)
[1] "GPflow.kernels.Constant"    "GPflow.kernels.Static"      "GPflow.kernels.Kern"       
[4] "GPflow.param.Parameterized" "GPflow.param.Parentable"    "python.builtin.object"     
[1] "GPflow.kernels.Bias"        "GPflow.kernels.Constant"    "GPflow.kernels.Static"     
[4] "GPflow.kernels.Kern"        "GPflow.param.Parameterized" "GPflow.param.Parentable"   
[7] "python.builtin.object"     
[1] "GPflow.kernels.Cosine"      "GPflow.kernels.Stationary"  "GPflow.kernels.Kern"       
[4] "GPflow.param.Parameterized" "GPflow.param.Parentable"    "python.builtin.object" 

Thanks!

from reticulate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.