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

easier access to ace_fit.jl #48

Open
gelzinyte opened this issue Aug 11, 2022 · 4 comments
Open

easier access to ace_fit.jl #48

gelzinyte opened this issue Aug 11, 2022 · 4 comments

Comments

@gelzinyte
Copy link
Collaborator

Currently, to access the command line fitting script, users would have to execute

julia $HOME/.julia/packages/ACE1pack/ChRvA/scripts/ace_fit.jl -p params.yml

But afaik users shouldn't need to fiddle with the package directories and there might be multiple corresponding to multiple versions of the package.

Is there a way to make ace_fit.jl more visible or accessible?

Python has "console scripts" where you can give a name to an executable which is a short-hand for executing a script. For example instead of

python $HOME/workflow/wfl/cli/cli.py --help

can just do wfl --help.

I couldn't find a Julia equivalent?

Alternatively, maybe there's a way to, when adding ACE1pack, export the path to scripts directory somehow? So that julia ace_fit.jl -p params.yml works?

There's PackageCompiler, which might be useful so that users-only don't even need to install julia & packages, but for this simple problem it seems an overkill.

@wcwitt
Copy link
Collaborator

wcwitt commented Aug 11, 2022

This is a good point, and relevant for distributed fitting where one is forced to use the command line (e.g., mpirun -np 10 mpi_ace_fit.jl).

@gelzinyte
Copy link
Collaborator Author

@bernstei pointed out that we can just add #!/usr/bin/env julia at the top of the script. That's of little help if we can't make the script into an executable and add to PATH at the time of package installation. Though maybe if we add these instructions to the documentation telling people to do this once as they install ACE1pack, it would be somewhat more convenient, because it would be possible to just call ace_fit.jl (rename to ace_fit?) without worrying about the full path. Though that'd need to be updated with every package update...

@wcwitt
Copy link
Collaborator

wcwitt commented Aug 12, 2022

Not the most elegant, but is it possible something like julia -e "using ACE1pack; acefit()" --extra_params would work with a little reconfiguring?

@wcwitt
Copy link
Collaborator

wcwitt commented Aug 12, 2022

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

2 participants