-
Notifications
You must be signed in to change notification settings - Fork 36
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
PR for #67: Julia extension #68
Conversation
@jc-cisneros I think we will need to update the |
@snairdesai I updated the instructions to fetch the correct submodule. The additional error you were getting regarding the packages (e.g. |
Thanks @jc-cisneros! I'll proceed with the review then. |
@jc-cisneros Seems like this is closer to running. I'm getting the following errors, the first of which originates when I attempt to instantiate our objects in the interactive Julia terminal, and the second (which I believe follows directly from the first) is called when I execute (1)(2) |
Thanks @snairdesai ! I rebuilt the |
@jc-cisneros still no luck - here's the new error messages from the |
@snairdesai I changed the process to build the Julia environment using a script instead of the .toml files. The |
@jc-cisneros No luck - errors seem a bit more severe. I've attached some screenshots below: |
@snairdesai I have not encountered this error on my end, but my current best guess is that it might be related to the Python distribution the Julia environment is pointing to. The error message states that it is indeed using the Python distribution in the Conda package, but it might be using a Python distribution you have on your |
@snairdesai building the Conda environment + Julia environment setup has been tricky (trickier than writing the wrapper). I have completed a full run on a Docker Debian container (8b1c26b) and on my local Mac OS afterwards (4863c67). The Conda.jl package should be capable of dealing with the Python path issue. Let me know if it works on your end. |
@jc-cisneros Flagging I have the same errors as in the comment above. |
Thanks @snairdesai! Let me explain the latest changes:
|
@jc-cisneros We're very close here - the plots are compiling now. Small issue, I had another terminal window open on my local computer when the Julia script ran, which I had to manually exit out of for the code to finish compiling. Ideally we would want this to automatically exit for the user. A screenshot of the outputs are below: |
@jc-cisneros Post your latest commit |
julia_conda_env.jl
Outdated
|
||
using Pkg | ||
|
||
Pkg.add(["DataFrames", "CSV", "StatsPlots", "Plots", "GR"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jc-cisneros For a future PR (perhaps not this one), we probably want to:
- specify versions of these packages explicitly, to maintain the transition to this format across R and Python
- in our
check_setup
script, notify the user if they have not properly installed the correct Julia packages.
Just tagging this here.
yearly_plot(df) | ||
|
||
# Close gksqt plot backend program | ||
run(`killall -9 gksqt`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting way to kill the terminal plot environment, agree it's the best we have for now.
setup/conda_env.yaml
Outdated
- linearmodels | ||
- julia #=1.8.2 | ||
# - pip=19 | ||
# - pip: # if there is a package available via pip but not with conda, can import like this: | ||
# - EXAMPLE_PACKAGE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want to track developments made by the conda-forge
team such that when they have implemented the proper fixes, we migrate the calls to Julia and package installer directly to this conda_env.yaml
file, rather than our separate julia_conda_env.jl
script (much like we do for pip
in R.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment on the conda_env.yaml
package versions, but otherwise this looks good! Hopefully the conda-forge
developments coming down the pipeline will make this process easier.
@snairdesai thanks for the careful review! In the latest commit 8f0cec7, I added the versions of all packages used (as in master). I also commented out all the Julia-related lines, so that the default behavior in master is not installing Julia and producing the test plot. Throughout all these tests, the If everything looks good, I will proceed to merge the development branches of this PR and the PR on gslab_make to their respective |
Hey @jc-cisneros @snairdesai ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jc-cisneros! The revisions look good to me - I'm approving this PR, and simultaneously the one for #54 on gslab_make
.
Thanks again for the review, @snairdesai! I will close the issues with a summary and merge this branch to master. |
This pull request closes gslab-econ/gslab_make#54 and #67. This
template
branch is currently pulling the 54-create-run_julia branch of thegslab_make
submodule, so gslab_make PR for 54 should be closed first.The proposed steps to test the new Julia wrapper are the following:
template
and switch to67-julia-extension
branchtemplate_julia
conda environment (i.e., runconda env create -f setup/conda_env.yaml
from root)git switch 54-create-run_julia
(we are testing the54-create-run_julia
branch of gslab_make). After that, rungit branch
. The current branch of the submodule should be54-create-run_julia
.template_julia
environment. Runcheck_setup.py
from thesetup
module.julia julia_conda_env.jl
from root to install the Julia packages in the conda environment (these are managed by Julia's built-in Pkg). Following the same logic of the conda_env.yaml file, thejulia_conda_env.jl
file installs the latest versions of the packages and has the versions used in the last working run commented out.run_all.py
from root. A Julia script will be called on the analysis module. The filejulia_scatter.png
should be created and saved inanalysis/output
Once the tests are successful, we can proceed to merge the
54-create-run_julia
branch of gslab_make tomaster
(through gslab_make PR for 54), point the submodule tomaster
and run the entire repo again.cc. @gentzkow @snairdesai @Houdanait @meyer-carl