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

Julia 1.11 update #300

Merged
merged 4 commits into from
Oct 29, 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
2 changes: 1 addition & 1 deletion .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Julia
uses: julia-actions/setup-julia@v2
with:
version: 1.10.0
version: 1.11.1
- name: Install IJulia and Setup Project
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Set up Julia
uses: julia-actions/setup-julia@v2
with:
version: 1.10.0
version: 1.11.1
- name: Install IJulia and Setup Project
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Julia
uses: julia-actions/setup-julia@v2
with:
version: 1.10.0
version: 1.11.1

- name: Install JuliaFormatter.jl
run: julia -e 'import Pkg; Pkg.add("JuliaFormatter")'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Set up Julia
uses: julia-actions/setup-julia@v2
with:
version: 1.10.0
version: 1.11.1
- name: Install IJulia and Setup Project
shell: bash
run: |
Expand Down
52 changes: 24 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ On this website hit `.` to enter into the web editor. From this, you can submit

## Local Development

It is straightforward to install the Jupyter Book and Julia software necessary for more significant changes.
It is straightforward to install the Jupyter Book and Julia software necessary for more significant changes. For Windows support, it is best to use WSL. See `[WSL Setup Instructions](./wsl.md)` for more details.

### Setup

1. [Install Julia, Conda, and VS Code](https://quantecon.github.io/lecture-julia.myst/getting_started_julia/getting_started.html) following the documentation for using these notes.
2. Modify [VS Code settings](https://quantecon.github.io/lecture-julia.myst/software_engineering/tools_editors.html#optional-extensions-and-settings) and consider [additional extensions](https://quantecon.github.io/lecture-julia.myst/software_engineering/tools_editors.html#optional-extensions). Some others to consider are the [MyST-Markdown](https://github.com/executablebooks/myst-vs-code) and [Spell Checking](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) extensions.
2. Modify [VS Code settings](https://quantecon.github.io/lecture-julia.myst/software_engineering/tools_editors.html#optional-extensions-and-settings) and consider [additional extensions](https://quantecon.github.io/lecture-julia.myst/software_engineering/tools_editors.html#optional-extensions). Some others to consider are the [MyST-Markdown](https://github.com/executablebooks/myst-vs-code) and [Spell Checking](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) extensions. You will also likely want the Python and Jupyter extensions installed
3. Ensure that [Git](https://quantecon.github.io/lecture-julia.myst/software_engineering/version_control.html#setup) is set up correctly. In particular, this ensures that Windows users use the Linux end-of-line characters.
4. Clone this repository (in VS Code, you can use `<Ctrl+Shift+P>` then `Clone` then `Clone from GitHub` then choose the repo as `https://github.com/QuantEcon/lecture-julia.myst`).

Expand All @@ -44,30 +44,6 @@ It is straightforward to install the Jupyter Book and Julia software necessary f
julia --project=lectures --threads auto -e 'using Pkg; Pkg.instantiate();'
```

On Windows, run the following instead:

```bash
julia --project=lectures --threads auto -e "using Pkg; Pkg.instantiate();"
```

## Formatting code
Julia code blocks in the myst `.md` files can be formatted using a script in this folder. To manually do so, insure you have the `] add JuliaFormatter` within your default julia environment, then call on the commandline like

```bash
julia format_myst.jl lectures/getting_started_julia/getting_started.md
```

As a helper, you can call a shell script to do it for an entire folder

```bash
bash format_all_directory.sh lectures/dynamic_programming
```

or to also do the unicode substitutions

```bash
bash format_all_directory.sh lectures/dynamic_programming true
```

**(Optional) REPL Integration**
With [MyST-Markdown](https://github.com/executablebooks/myst-vs-code) and [Julia](https://marketplace.visualstudio.com/items?itemName=julialang.language-julia) installed, you can ensure that pressing `<Ctrl-Enter>` on lines of code are sent to a Julia REPL.
Expand Down Expand Up @@ -100,7 +76,7 @@ jb build lectures
```

This will take a while. But it will populate your cache, so future iteration is faster.

<!--
It is suggested to use WSL on Windows On Windows, if you get the following error:

```
Expand All @@ -110,6 +86,7 @@ ImportError: DLL load failed while importing win32api: The specified procedure c
then run `conda install pywin32` and build the lectures again.

If you have [Live Preview](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server) installed, then go to `_build/html/index.html` in the explorer, and right-click to choose `Live Preview: Show Preview`.
-->

### Cleaning Lectures
To clean up (i.e., delete the build)
Expand All @@ -133,4 +110,23 @@ jb clean lectures --all

After execution, you can find the generated `.ipynb` and `.jl` files in `_build/jupyter_execute` for each lecture.
- To see errors, you can open these in JupyterLab, the Jupyter support within VS Code, etc.
- If using the Julia REPL in VS Code, make sure to do `] activate lectures` prior to testing to ensure the packages are activated. This is not necessary when opening in Jupyter.
- If using the Julia REPL in VS Code, make sure to do `] activate lectures` prior to testing to ensure the packages are activated. This is not necessary when opening in Jupyter.

## Formatting code
Julia code blocks in the myst `.md` files can be formatted using a script in this folder. To manually do so, insure you have the `] add JuliaFormatter` within your default julia environment, then call on the commandline like

```bash
julia format_myst.jl lectures/getting_started_julia/getting_started.md
```

As a helper, you can call a shell script to do it for an entire folder

```bash
bash format_all_directory.sh lectures/dynamic_programming
```

or to also do the unicode substitutions

```bash
bash format_all_directory.sh lectures/dynamic_programming true
```
Loading
Loading