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

Cannot run make_chiEFTint outside the project directory #27

Closed
mdavezac opened this issue Aug 28, 2022 · 0 comments
Closed

Cannot run make_chiEFTint outside the project directory #27

mdavezac opened this issue Aug 28, 2022 · 0 comments

Comments

@mdavezac
Copy link

Running NuclearToolkit outside its repo is likely a standard approach.
However, this is currently not possible because of the default value of inpf in read_LECs! and of the path manipulation therein (to make the tests work).

Since the code does not run currently run as advertised (i.e. as a package rather than a repo), resolving this issue is necessary for openjournals/joss-reviews#4694.

One approach would be to modify the code as follows:

function read_LECs!(LECs,idxLECs,dLECs;initialize=false,inpf="LECs.jl")  
    if initialize
        isfile(inpf) || (inpf = joinpath(@__DIR__, inpf))

    ...
end


function get_fn_LECs(pottype)
    if pottype =="em500n3lo"
        "LECs.jl"
    elseif pottype == "emn500n3lo"
        "LECs_EMN500N3LO.jl"
    elseif pottype == "emn500n4lo"
        "LECs_EMN500N4LO.jl"
    else
        @error "Unknown potential type" pottype
    end
end

Note that using include inside a function is a bit surprising. In general, a function like get_fn_LECs would likely return a data-structure (namedtuple?) rather than a path. It would also either call specialized functions directly for each potential or be itself implemented using multiple dispatch over pottype (assuming pottypes is not a string).

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

No branches or pull requests

1 participant