GithubHelp home page GithubHelp logo

Python dependencies about acefit.jl HOT 7 CLOSED

acesuit avatar acesuit commented on September 28, 2024
Python dependencies

from acefit.jl.

Comments (7)

cortner avatar cortner commented on September 28, 2024

@tjjarvinen and @wcwitt -- I just ran into this again. Have you used @require before? James Gardner once showed me how to use it to load some Julia code only if some package has been imported elsewhere already. Or at least I think that's how it works.

I wonder whether to bring this to ACEfit so that anything PyCall related will only be loaded if PyCall has already been loaded outside? What do you think?

from acefit.jl.

wcwitt avatar wcwitt commented on September 28, 2024

I'm trying to understand the precise issue. Is it that ACEfit has PyCall as a dependency in its Project.toml? And this is a problem because someone without Python would have trouble installing PyCall?

Looking at Requires.jl, I could imagine us putting a @require in front of all the functions that use sklearn. But what does that achieve exactly ... wouldn't ACEfit still need to depend on PyCall?

https://github.com/JuliaPackaging/Requires.jl

I might be missing the point still.

from acefit.jl.

tjjarvinen avatar tjjarvinen commented on September 28, 2024

I have used Requires.jl.

In short you can use it, by adding __init__() to main file of the package. Here is an example that I used.

function __init__()
    @require CUDA="052768ef-5323-5732-b1bb-66c8b64840ba" include("cuda_additions.jl")
end

TensorOperations.jl has a more complicated example.

You need to explicitly load the package before for it to trigger @require. In this case it would be (e.g.)

using PyCall
using ACEfit  # now triggers @require

from acefit.jl.

wcwitt avatar wcwitt commented on September 28, 2024

I think I understand that - and if it will solve @cortner's problem, great - but what confuses me is that TensorOperations.jl still has CUDA in its Project.toml dependencies.

So if we did that, wouldn't

]add ACEfit

still trigger installation of PyCall?

from acefit.jl.

wcwitt avatar wcwitt commented on September 28, 2024

Okay, from the Requires.jl readme:

@required packages can be added to the test environment of a Julia project for integration tests, or directly to the project to document compatible versions in the [compat] section of Project.toml.

which seems to imply that we wouldn't actually need PyCall in the ACEfit dependencies (although we could have it if we wanted to).

So this does seem like it would solve the issue.

from acefit.jl.

wcwitt avatar wcwitt commented on September 28, 2024

I hope this will be addressed by 558adeb.

from acefit.jl.

cortner avatar cortner commented on September 28, 2024

I think this is addressed by the PythonCall and MLJ extensions.

from acefit.jl.

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.