Skip to content

Commit f649f7f

Browse files
authored
Finalized removal of old parameter unpacking (#285)
* Finalized removal of old parameter unpacking * Update to the getting started * Cleanup on the julia by example with unicode
1 parent ce40436 commit f649f7f

File tree

6 files changed

+83
-85
lines changed

6 files changed

+83
-85
lines changed

lectures/Manifest.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.10.0"
44
manifest_format = "2.0"
5-
project_hash = "bbafb0ad34fec16511b07a132895ce6672068cfe"
5+
project_hash = "b611414c063dd94bb220ecc79ddf4aad7f078b5e"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "41c37aa88889c171f1300ceac1313c06e891d245"
@@ -1265,9 +1265,9 @@ version = "1.0.3"
12651265

12661266
[[deps.LoopVectorization]]
12671267
deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"]
1268-
git-tree-sha1 = "fc712dd664097440f19a91a704299cca02134ca0"
1268+
git-tree-sha1 = "0f5648fbae0d015e3abe5867bca2b362f67a5894"
12691269
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
1270-
version = "0.12.168"
1270+
version = "0.12.166"
12711271
weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"]
12721272

12731273
[deps.LoopVectorization.extensions]
@@ -1529,10 +1529,10 @@ uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
15291529
version = "1.6.3"
15301530

15311531
[[deps.OrdinaryDiffEq]]
1532-
deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "IfElse", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "LoopVectorization", "MacroTools", "MuladdMacro", "NonlinearSolve", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"]
1533-
git-tree-sha1 = "e50bc309307871b5f2ec10075c4faf8ca018068f"
1532+
deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "IfElse", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"]
1533+
git-tree-sha1 = "17680b691a3b3f9961db6fc4ece88c4f720d3d8b"
15341534
uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
1535-
version = "6.67.0"
1535+
version = "6.68.0"
15361536

15371537
[[deps.PCRE2_jll]]
15381538
deps = ["Artifacts", "Libdl"]
@@ -1806,10 +1806,10 @@ uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c"
18061806
version = "0.6.12"
18071807

18081808
[[deps.RecursiveArrayTools]]
1809-
deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "Requires", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"]
1810-
git-tree-sha1 = "27ee1c03e732c488ecce1a25f0d7da9b5d936574"
1809+
deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"]
1810+
git-tree-sha1 = "264026749612181b79275685eede9af07c0ee588"
18111811
uuid = "731186ca-8d62-57ce-b412-fbd966d074cd"
1812-
version = "3.3.3"
1812+
version = "3.4.0"
18131813

18141814
[deps.RecursiveArrayTools.extensions]
18151815
RecursiveArrayToolsFastBroadcastExt = "FastBroadcast"
@@ -1937,9 +1937,9 @@ version = "2023.8.2+0"
19371937

19381938
[[deps.SciMLBase]]
19391939
deps = ["ADTypes", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FillArrays", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables", "TruncatedStacktraces"]
1940-
git-tree-sha1 = "09324a0ae70c52a45b91b236c62065f78b099c37"
1940+
git-tree-sha1 = "9a4a0110ca88b459e528b7788617ad69aa65d824"
19411941
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1942-
version = "2.15.2"
1942+
version = "2.16.1"
19431943

19441944
[deps.SciMLBase.extensions]
19451945
SciMLBaseChainRulesCoreExt = "ChainRulesCore"
@@ -2178,9 +2178,9 @@ uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
21782178
version = "7.2.1+1"
21792179

21802180
[[deps.SymbolicIndexingInterface]]
2181-
git-tree-sha1 = "9336430df9a96f7d85268304b6c3b93f92fb7ff2"
2181+
git-tree-sha1 = "74502f408d99fc217a9d7cd901d9ffe45af892b1"
21822182
uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
2183-
version = "0.3.2"
2183+
version = "0.3.3"
21842184

21852185
[[deps.SymbolicUtils]]
21862186
deps = ["AbstractTrees", "Bijections", "ChainRulesCore", "Combinatorics", "ConstructionBase", "DataStructures", "DocStringExtensions", "DynamicPolynomials", "IfElse", "LabelledArrays", "LinearAlgebra", "MultivariatePolynomials", "NaNMath", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "TimerOutputs", "Unityper"]

lectures/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd"
3232
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
3333
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
3434
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
35-
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
3635
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
3736
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
3837
Preconditioners = "af69fa37-3177-5a40-98ee-561f696e4fcd"

lectures/getting_started_julia/fundamental_types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ end
10311031
@show param_gen(; alpha = 0.2)
10321032
```
10331033

1034-
For alternative approches:
1034+
For alternative approaches:
10351035
- An alternative approach, defining a new type using `struct` tends to be more prone to accidental misuse, leads to a great deal of boilerplate code, and requires a julia restart after every update.
10361036
- You can also use the `@with_kw` in the `Parameters.jl` package, which automatically creates a function. e.g., `param_gen = @with_kw (alpha = 0.1, beta = 0.2)` would be roughly equivalent to the above.
10371037

lectures/getting_started_julia/getting_started.md

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ The semi-official installation method for Windows is to use [Juliaup](https://gi
9292
```
9393

9494

95-
1. Download and install Julia following the [Juliaup instructions](https://github.com/JuliaLang/juliaup#installation) or manually installing from [download page](http://julialang.org/downloads/), accepting all default options. That is,
96-
- Easiest method may be executing `winget install julia -s msstore` in a Windows terminal, or
97-
- `curl -fsSL https://install.julialang.org | sh` on a Mac terminal.
98-
- We recommend installing [manually](https://julialang.org/downloads/platform/#linux_and_freebsd) on Linux.
99-
- If you have previously installed Julia manually, you will need to uninstall previous versions before switching to Juliaup.
95+
1. Download and install Julia following the [Juliaup instructions](https://github.com/JuliaLang/juliaup#installation)
96+
- Windows: easiest method is `winget install julia -s msstore` in a Windows terminal
97+
- Linux/Mac: in a terminal use `curl -fsSL https://install.julialang.org | sh`
98+
- If you have previously installed Julia manually, you will need to uninstall previous versions before switching to `juliaup`.
99+
- Alternatively, can manually install from [download page](http://julialang.org/downloads/), accepting all default options
100100

101101
2. Open Julia, by either
102102
- Navigating to Julia through your menus or desktop icons (Windows, Mac), or
103-
- Opening a terminal and type `julia` (Windows; to set this up on macOS, see [here](https://julialang.org/downloads/platform/#macos); to set this up on Linux, see [here](https://julialang.org/downloads/platform/#linux_and_freebsd)).
103+
- Opening a terminal and type `julia` (which should work for all OS if you used `juliaup`. Otherwise see [here](https://julialang.org/downloads/platform/))
104104

105105
You should now be looking at something like this
106106

@@ -188,39 +188,36 @@ Becoming comfortable with VS Code and tools for source code control/software eng
188188

189189
Next, let's install the QuantEcon lecture notes to our machine and run them (for more details on the tools we'll use, see our lecture on {doc}`version control <../software_engineering/version_control>`).
190190

191-
While the lecture notes can be cloned within VS Code directly, we will use the command-line to begin the introduction to source control tools.
191+
With VS Code installed, you can easily clone the lecture notes repository
192192

193-
1. Choose and create if necessary a convenient parent folder where you would like the notebooks directory
193+
1. Open the command palette with `<Ctrl+Shift+P>` and type `> Git: Clone`
194+
2. For the Repository URL, provide enter `https://github.com/quantecon/lecture-julia.notebooks`
195+
Alternatively, if you are already a user of Visual Studio Code, you can clone within VS Code by using the `> Git: Clone` command from the [command palette](command_palette). See the lectures on [tools](../software_engineering/tools_editors.md) and [source code control](../software_engineering/version_control.md) for more details.
196+
3. Choose the location to clone when prompted
194197
- The workflow will be easiest if you clone the repo to the default location relative to the home folder for your user.
195198
- For example, on Windows a good choice might be `c:\Users\YOURUSERNAME\Documents\GitHub` or simply `c:\Users\YOURUSERNAME\Documents`. On linux and macOS, your home directory `~` or `~/GitHub`.
199+
4. Accept the option to open in a new window when prompted
200+
201+
```{admonition} Cloning without VS Code
202+
203+
To use the command-line to begin the introduction to source control tools.
204+
205+
1. Choose and create if necessary a convenient parent folder where you would like the notebooks directory, see above for suggestions.
196206
2. Open a new terminal for your machine and navigate to the parent folder of where you wish to store the notebooks.
197207
- On Windows: if using the [Windows Terminal](https://aka.ms/terminal) you can simply right-click on the directory in the File Explorer and choose to "Open in Microsoft Terminal" or, alternatively "Git Bash Here" to use the terminal provided by Git. On macOS, see [here](https://apple.stackexchange.com/questions/11323/how-can-i-open-a-terminal-window-directly-from-my-current-finder-location) for a discussion of different approaches.
198-
3. Execute the following code in the terminal to download the entire suite of notebooks associated with these lectures.
199-
```{code-block} bash
200-
git clone https://github.com/quantecon/lecture-julia.notebooks
201-
```
208+
3. Execute the following code in the terminal to download the entire suite of notebooks associated with these lectures with `git clone https://github.com/quantecon/lecture-julia.notebooks`
202209
This will download the repository with the notebooks into the directory `lecture-julia.notebooks` within your working directory.
203-
4. Then, `cd` to that location in your terminal
204-
205-
```{code-block} bash
206-
cd lecture-julia.notebooks
207-
```
208-
5. Finally, you can open this directory from your terminal with the following
209-
210-
```{code-block} bash
211-
code .
212-
```
210+
4. Then, `cd` to that location in your terminal with `cd lecture-julia.notebooks`
211+
5. Finally, you can open this directory from your terminal in VS Code with `code .` or manually opening
212+
```
213213

214-
Which should provide a screen such as
214+
If you have opened this in VS Code, it should look something like
215215

216216
```{figure} /_static/figures/vscode_intro_1.png
217217
:width: 100%
218218
```
219219

220220

221-
```{admonition} Cloning Directly from VS Code
222-
Alternatively, if you are already a user of Visual Studio Code, you can clone within VS Code by using the `> Git: Clone` command from the [command palette](command_palette). See the lectures on [tools](../software_engineering/tools_editors.md) and [source code control](../software_engineering/version_control.md) for more details.
223-
```
224221

225222
(install_packages)=
226223
## Installing Packages
@@ -251,7 +248,7 @@ Recall that you can start this directly from the [command palette](command_palet
251248
This process will take several minutes to download and compile all of the files used by the lectures.
252249

253250
```{attention}
254-
If the cursor is instead `(@v1.8) pkg>` then you may not have started the integrated terminal in the correct location, or you used an external REPL. Assuming that you are in the correct location, if you type `activate .` in the package mode, the cursor should change to `(quantecon-notebooks-julia) pkg>` as it activates this project file.
251+
If the cursor is instead `(@v1.10) pkg>` then you may not have started the integrated terminal in the correct location, or you used an external REPL. Assuming that you are in the correct location, if you type `activate .` in the package mode, the cursor should change to `(quantecon-notebooks-julia) pkg>` as it activates this project file.
255252
256253
One benefit of using the integrated REPL is that it will set important options for launching Julia (e.g. the number of threads) and activate the local project files (i.e. the `Project.toml` file in the notebooks directory) automatically. If you use an external REPL, you will need to set these manually. Here you would want to run the REPL with `julia --project --threads auto` to tell Julia to set the number of threads equal to your local machine's number of cores, and to activate the existing project. See [here](repl_main) for more details.
257254
```
@@ -311,13 +308,11 @@ As you work through the notebooks, you may wish to reset these to the most recen
311308

312309
Additionally, if the notebooks themselves are modified as the lecture notes evolve, you can first discard any changes, and then either use `> Git: Pull` command or click on the arrow next to "main" on the bottom left of the screen to download the latest versions. Here "main" refers to the main branch of the repo where the latest versions are hosted.
313310

314-
If the `Project.toml` or `Manifest.toml` files are modified, then after reverting you will want to redo the [instantiation](install_packages) step to ensure you have the correct versions.
315-
311+
If the `Project.toml` or `Manifest.toml` files are modified, then after reverting you will want to redo the step to ensure you have the correct versions. To do this, run the project, enter package management mode with `]`, ensure that `(quantecon-notebooks-julia) pkg>` is displayed, and then type `instantiate` to install the correct versions.
316312

317313
We will explore these sorts of features, and how to use them for your own projects, in the {doc}`source code control <../software_engineering/version_control>` lecture.
318314

319315

320-
321316
(julia_environment)=
322317
## Interacting with Julia
323318

0 commit comments

Comments
 (0)