QuantEcon / lecture-julia.myst

Lecture source for "Quantitative Economics with Julia"
https://julia.quantecon.org/intro.html
52 stars 43 forks source link

first_few_lecture_edits #259

Closed Jonah-Heyl closed 1 year ago

Jonah-Heyl commented 1 year ago

ISSUE 250

github-actions[bot] commented 1 year ago

🚀 Deployed on https://64b5d9aeeb4b5f1fa466438b--vibrant-allen-f39ec9.netlify.app

jlperla commented 1 year ago

Good start. I made a few changes here to make the formatter happy, and changed a setting for the way it aligns functions. May swap back at another time, but prefer it this way for now.

There was an update on the formatting package so you should do an ] up JuliaFormatter on your main environment first.

So you will want to tweak the .md files and then rerun the formatting. But lets do something first. I added in a function to do some conversions of Unicode, which will make things a little easier for undergrads. They seem to have trouble with unicode character names.

To fix that, notice there is the

    replacements = Dict("α" => "alpha", "β" => "beta", "γ" => "gamma", "≤" => "<=",
                        "≥" => ">=")

Which is incomplete. What I want to do on many lectures is repalce the unicode variable names to be easier to type, and you can add in thigns to this list to automatically replace. In this lecture I notice the Σ character, so maybe change the replacements to be:

    replacements = Dict("α" => "alpha", "β" => "beta", "γ" => "gamma", "≤" => "<=",
                        "≥" => ">=", "Σ" => "Sigma", "" => "Sigma", "σ" => "sigma")

and run it with the extra repalcements. To call the script with extra repalcements you should do:

julia format_myst.jl lectures/getting_started_julia/julia_essentials.md true

Where the "true" triggers the extra ones. We want to bre careful with this, as it may require more manual checking. So functions in other packages use unicode symbols, so we will need to be careful to ensure we don't accidentally replace those - and will need to doublecheck results. Also note that the "regression test" code doesn't have the transformations applied to them, so you may need to do a little manual replacements there.