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

Update to Julia 1.10; dump pluto precompilation jazz #60

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 0 additions & 75 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,78 +40,3 @@ jobs:
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
JULIA_NUM_THREADS: 2
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia -e '
function set_environment_variable(name::AbstractString, value::AbstractString)
github_env = ENV["GITHUB_ENV"]
touch(github_env)
open(github_env, "a") do io
println(io, "$(name)=$(value)")
end
end
event_name = "${{ github.event_name }}"
if event_name == "pull_request"
base_ref = "${{ github.base_ref }}"
head_ref = "${{ github.head_ref }}"
base_repository = "${{ github.repository }}"
head_repository = "${{ github.event.pull_request.head.repo.full_name }}"
build_docs = (base_ref == "master") && (head_ref == "dev") && (base_repository == head_repository)
elseif event_name == "push"
ref = "${{ github.ref }}"
build_docs = (ref == "refs/heads/master") || (startswith(ref, "refs/tags/"))
elseif event_name == "schedule"
build_docs = ref == "refs/heads/master"
elseif event_name == "workflow_dispatch"
build_docs = ref == "refs/heads/master"
else
build_docs = false
end
if build_docs
@info("We will build the docs")
set_environment_variable("BUILD_DOCS", "true")
else
@info("We will NOT build the docs")
set_environment_variable("BUILD_DOCS", "false")
end'
- run: |
julia --project=docs -e '
if ENV["BUILD_DOCS"] == "true"
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
end'
- run: |
julia --project=docs -e '
if ENV["BUILD_DOCS"] == "true"
using Documenter: doctest
using MLJBase
@info "attempting to run the doctests"
doctest(MLJBase)
else
@info "skipping the doctests"
end'
- run: julia --project=docs -e '
if ENV["BUILD_DOCS"] == "true"
@info "attempting to build the docs"
run(`julia --project=docs docs/make.jl`)
@info "successfully built the docs"
else
@info "skipping the docs build"
end'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
14 changes: 6 additions & 8 deletions DEVELOPER_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ generated won't run properly.

## Generating the notebooks

To generate notebooks do `include(/src/generate_all.jl)`. For some
tutorials, a notebook may not be generated, because of some known
issue. A warning will be issued and you'll need to generate the
relevant notebook by hand. (At time of writing a pre-executed Jupiter
notebook needs to be generated for
`notebooks/01_getting_started/`. After generating the notebooks, copy
`notebook.unexecuted.ipynb` to `notebook.ipynb`; execute the latter
file and save.)
To generate notebooks do `include("path/to/HelloJulia/src/generate_all.jl")`. For some tutorials, a notebook
may not be generated, because of some known issue. A warning will be issued and you'll
need to generate the relevant notebook by hand.

For example, to generate an executed python notebook for `notebooks/01_first_steps/`, copy
`notebook.unexecuted.ipynb` to `notebook.ipynb`; execute the latter file and save.

To generate notebooks for just one tutorial, `include` the file called
`generate.jl` within the notebook's folder.
Expand Down
2 changes: 1 addition & 1 deletion FIRST_STEPS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Installing Julia

**Important** When following the following **four steps**, be sure the version
of Julia you install is **version 1.9.x**, where **x** is any integer.
of Julia you install is **version 1.10.x**, where **x** is any integer.

While Julia can be run in the cloud (see e.g.,
[here](https://juliahub.com/ui/Home)) we recommend installing Julia on
Expand Down
84 changes: 30 additions & 54 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
# Demos and Tutorials

For a quick static view of the demo and tutorial notebooks, click on a
link in the first column.
Quick, static views of the demo and tutorial notebooks:

To run a notebook without installing anything, click on the binder
link. These notebooks are ephemeral, and can be very slow to load, and
are therefore not recommended for in-depth study. Rather, complete
[Setup](#setup) and choose one of the options that follow.


Juptyer | binder
--------|---------
[Mandelbrot set demo](notebooks/mandelbrot/notebook.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ablaom/HelloJulia.jl/dev?labpath=notebooks%2Fmandelbrot%2Fnotebook.ipynb)
[Julia's secret sauce](notebooks/secret_sauce/notebook.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ablaom/HelloJulia.jl/dev?labpath=notebooks%2Fsecret_sauce%2Fnotebook.ipynb)
[Package composability](notebooks/pkg_composability/notebook.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ablaom/HelloJulia.jl/dev?labpath=notebooks%2Fpkg_composability%2Fnotebook.ipynb)
[01 - First_steps](notebooks/01_first_steps/notebook.unexecuted.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ablaom/HelloJulia.jl/dev?labpath=notebooks%2F01_first_steps%2Fnotebook.unexecuted.ipynb)
[02 - DataFrames](notebooks/02_dataframes/notebook.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ablaom/HelloJulia.jl/dev?labpath=notebooks%2F02_dataframes%2Fnotebook.ipynb)
[03 - Machine learning](notebooks/03_machine_learning/notebook.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ablaom/HelloJulia.jl/dev?labpath=notebooks%2F03_machine_learning%2Fnotebook.ipynb)
|Notebook |
|:-------:|
|[Mandelbrot set demo](notebooks/mandelbrot/notebook.ipynb) |
[Julia's secret sauce](notebooks/secret_sauce/notebook.ipynb) |
[Package composability](notebooks/pkg_composability/notebook.ipynb) |
[01 - First_steps](notebooks/01_first_steps/notebook.unexecuted.ipynb) |
[02 - DataFrames](notebooks/02_dataframes/notebook.ipynb) |
[03 - Machine learning](notebooks/03_machine_learning/notebook.ipynb) |

## Setup

The following instructions only need to be executed successfully once:

- [Install a correct version of the Julia compiler](FIRST_STEPS.md).

- **In a new Julia session** type the following at the `julia>` prompt:
Expand All @@ -35,60 +30,41 @@ Pkg.build("Conda")
Pkg.build("IJulia")
ENV["JULIA_PKG_PRECOMPILE_AUTO"]=1

using HelloJulia

using Pkg
Pkg.test("HelloJulia")
exit()
```

## Option 1: To run as Jupyter notebooks

- Enter `go()` at the `julia>` prompt

- In the browser window that should appear, navigate to the folder of
interest

- Choose the file called `notebook.unexecuted.ipynb` (or
`notebook.ipynb` to see pre-executed version)
## Running the demos and tutorials

!!! Note

## Option 2: To run as Pluto notebooks
Running notebooks for the first time may involve delays due to
precompilation of newly installed packages.

- When running for the first time, enter (immediately after
[Setup](#setup)):
After starting a new Julia session, do this:

```julia
julia> setup()
julia> using Pkg; Pkg.activate(joinpath(Pkg.devdir(), "HelloJulia"))
julia> using HelloJulia
```

ignoring any "ld: warning" you get. This will take several minutes but
speeds up using the notebooks. (It creates a Julia system image
tailored to the notebook content.)
Then:

- Quit Julia with `control-D` and restart.
### Option 1: To run as Pluto notebooks

- Run the following commands each time you want to run the notebooks:
- Enter `pluto()` at the `julia>` prompt.

```julia
using Pkg; Pkg.activate(joinpath(Pkg.devdir(), "HelloJulia"))
using HelloJulia
pluto()
### Option 2: To run as Jupyter notebooks

```
- Enter `juptyer()` at the `julia>` prompt.

If you encounter problems with running `setup()` or `pluto()` you can try launching the notebooks directly (without creating a system image) by restarting Julia and trying:

```julia
using Pkg; Pkg.activate(joinpath(Pkg.devdir(), "HelloJulia"))
Pkg.build("Conda") # only need to do this very first time
Pkg.build("IJulia") # only need to do this very first time
using HelloJulia
pluto_now()
```

The only difference here is that notebooks may take a while to load, at least the first
time they are launched.
- In the browser window that should appear, navigate to the folder of interest

- Choose the file called `notebook.unexecuted.ipynb` (or
`notebook.ipynb` to see pre-executed version)

## Option 3: To run as script in your editor
### Option 3: To run as script in your editor

For more experienced users and instructors.

Expand Down
Loading
Loading