Skip to content

Commit bab0576

Browse files
committed
Final run-through
1 parent 2cb0982 commit bab0576

10 files changed

+344
-208
lines changed

README.md

Lines changed: 6 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,9 @@
1-
# The Carpentries Workbench Template Markdown Lesson
1+
[![Website](https://github.com/ornl-training/julia-intro/actions/workflows/pages/pages-build-deployment/badge.svg)](https://ornl-training.github.io/julia-intro)
22

3-
This lesson is a template lesson that uses [The Carpentries Workbench][workbench].
3+
# Beginner Programming in Julia
44

5-
## Note about lesson life cycle stage
6-
Although the `config.yaml` states the life cycle stage as pre-alpha, **the template is stable and ready to use**. The life cycle stage is preset to `"pre-alpha"` as this setting is appropriate for new lessons initialised using the template.
5+
These lessons target people who already have some experience with (scientific)
6+
programming but are new to Julia.
77

8-
## Create a new repository from this template
9-
10-
To use this template to start a new lesson repository,
11-
make sure you're logged into Github.
12-
Visit https://github.com/carpentries/workbench-template-md/generate
13-
and follow the instructions.
14-
Checking the 'Include all branches' option will save some time waiting for the first website build
15-
when your new repository is initialised.
16-
17-
If you have any questions, contact [@tobyhodges](https://github.com/tobyhodges)
18-
19-
## Configure a new lesson
20-
21-
Follow the steps below to
22-
complete the initial configuration of a new lesson repository built from this template:
23-
24-
1. **Make sure GitHub Pages is activated:**
25-
navigate to _Settings_,
26-
select _Pages_ from the left sidebar,
27-
and make sure that `gh-pages` is selected as the branch to build from.
28-
If no `gh-pages` branch is available, check the _Actions_ tab to see if the first
29-
website build workflows are still running.
30-
If they're not running yet, you may need to manually enable them via the _Actions_ tab.
31-
The branch should become available when those have completed.
32-
1. **Adjust the `config.yaml` file:**
33-
this file contains global parameters for your lesson site.
34-
Individual fields within the file are documented with comments (beginning with `#`)
35-
At minimum, you should adjust all the fields marked 'FIXME':
36-
- `title`
37-
- `created`
38-
- `keywords`
39-
- `life_cycle` (the default, _pre-alpha_, is the appropriate for brand new lessons)
40-
- `contact`
41-
1. **Annotate the repository** with site URL and topic tags:
42-
navigate back to the repository landing page and
43-
click on the gear wheel/cog icon (similar to ⚙️)
44-
at the top-right of the _About_ box.
45-
Check the "Use your GitHub Pages website" option,
46-
and [add some keywords and other annotations to describe your lesson](https://cdh.carpentries.org/the-carpentries-incubator.html#topic-tags)
47-
in the _Topics_ field.
48-
At minimum, these should include:
49-
- `lesson`
50-
- the life cycle of the lesson (e.g. `pre-alpha`)
51-
- the human language the lesson is written in (e.g. `deutsch`)
52-
1. **Adjust the
53-
`CITATION.cff`, `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, and `LICENSE.md` files**
54-
as appropriate for your project.
55-
- `CITATION.cff`:
56-
this file contains information that people can use to cite your lesson,
57-
for example if they publish their own work based on it.
58-
You should [update the CFF][cff-sandpaper-docs] now to include information about your lesson,
59-
and remember to return to it periodically, keeping it updated as your
60-
author list grows and other details become available or need to change.
61-
The [Citation File Format home page][cff-home] gives more information about the format,
62-
and the [`cffinit` webtool][cffinit] can be used to create new and update existing CFF files.
63-
- `CODE_OF_CONDUCT.md`:
64-
if you are using this template for a project outside The Carpentries,
65-
you should adjust this file to describe
66-
who should be contacted with Code of Conduct reports,
67-
and how those reports will be handled.
68-
- `CONTRIBUTING.md`:
69-
depending on the current state and maturity of your project,
70-
the contents of the template Contributing Guide may not be appropriate.
71-
You should adjust the file to help guide contributors on how best
72-
to get involved and make an impact on your lesson.
73-
- `LICENSE.md`:
74-
in line with the terms of the CC-BY license,
75-
you should ensure that the copyright information
76-
provided in the license file is accurate for your project.
77-
1. **Update this README with
78-
[relevant information about your lesson](https://carpentries.github.io/lesson-development-training/collaborating-newcomers.html#readme)**
79-
and delete this section.
80-
81-
[cff-home]: https://citation-file-format.github.io/
82-
[cff-sandpaper-docs]: https://carpentries.github.io/sandpaper-docs/editing.html#making-your-lesson-citable
83-
[cffinit]: https://citation-file-format.github.io/cff-initializer-javascript/
84-
[workbench]: https://carpentries.github.io/sandpaper-docs/
8+
These are largely based on the lessons
9+
[here](https://github.com/carpentries-incubator/julia-novice).

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ keywords: 'julia, programming, software'
2828

2929
# Life cycle stage of the lesson
3030
# possible values: pre-alpha, alpha, beta, stable
31-
life_cycle: 'pre-alpha' # FIXME
31+
life_cycle: 'alpha' # FIXME
3232

3333
# License of the lesson
3434
license: 'CC-BY 4.0'

episodes/01_04_Using_the_package_manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ environments. That is useful for development time convenience packages like
163163
Melissa now returns to her project environment.
164164

165165
```julia
166-
(trebuchet) pkg> activate projects/trebuchet
166+
(@v1.11) pkg> activate projects/trebuchet
167167
```
168168

169169
## Using and importing packages

episodes/02_01_Functions.md

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ those that are not exported. What would the function call look like?
8686
2. `names(Trebuchets, all = true)` <!---correct-->
8787
3. `names(Trebuchets, all)`
8888
4. `names(Trebuchets; all = true)` <!---correct-->
89-
5. Answer 2 and 4 <!---correct-->
89+
5. Both 2 and 4 <!---correct-->
9090

9191
:::::: solution
9292

@@ -220,7 +220,7 @@ Trebuchets.shoot(5, 0.25pi, 500)[2]
220220
114.88494815382731
221221
```
222222

223-
which means the shot traveled approximately 118 m.
223+
which means the shot traveled approximately 115 m.
224224

225225
### Defining functions
226226

@@ -423,7 +423,7 @@ She can also lookup the docstring using the `@doc` macro
423423
See also: length, ndims, eachindex, sizeof.
424424
425425
Examples
426-
≡≡≡≡≡≡≡≡≡≡
426+
≡≡≡≡≡≡≡≡
427427
428428
julia> A = fill(1, (2,3,4));
429429
@@ -437,25 +437,6 @@ She can also lookup the docstring using the `@doc` macro
437437
438438
Return a tuple with the size of the buffer.
439439
440-
size(g, i)
441-
442-
Return the number of vertices in g if i=1 or i=2, or 1 otherwise.
443-
444-
Examples
445-
≡≡≡≡≡≡≡≡≡≡
446-
447-
julia> using Graphs
448-
449-
julia> g = cycle_graph(4);
450-
451-
julia> size(g, 1)
452-
4
453-
454-
julia> size(g, 2)
455-
4
456-
457-
julia> size(g, 3)
458-
1
459440
```
460441

461442
With that information she can now implement this method:
@@ -508,7 +489,7 @@ She looks up the documentation for that function
508489
syntax Type[]. Element values can be specified using Type[a,b,c,...].
509490
510491
Examples
511-
≡≡≡≡≡≡≡≡≡≡
492+
≡≡≡≡≡≡≡≡
512493
513494
julia> Int8[1, 2, 3]
514495
3-element Vector{Int8}:
@@ -525,13 +506,12 @@ She looks up the documentation for that function
525506
getindex(collection, key...)
526507
527508
Retrieve the value(s) stored at the given key or index within a collection.
528-
The syntax a[i,j,...] is converted by the compiler to getindex(a, i, j,
529-
...).
509+
The syntax a[i,j,...] is converted by the compiler to getindex(a, i, j, ...).
530510
531511
See also get, keys, eachindex.
532512
533513
Examples
534-
≡≡≡≡≡≡≡≡≡≡
514+
≡≡≡≡≡≡≡≡
535515
536516
julia> A = Dict("a" => 1, "b" => 2)
537517
Dict{String, Int64} with 2 entries:
@@ -543,12 +523,21 @@ She looks up the documentation for that function
543523
544524
getindex(A, inds...)
545525
546-
Return a subset of array A as specified by inds, where each ind may be, for
547-
example, an Int, an AbstractRange, or a Vector. See the manual section on
548-
array indexing for details.
526+
Return a subset of array A as selected by the indices inds.
527+
528+
Each index may be any supported index type, such as an Integer,
529+
CartesianIndex, range, or array of supported indices. A : may be used to
530+
select all elements along a specific dimension, and a boolean array (e.g. an
531+
Array{Bool} or a BitArray) may be used to filter for elements where the
532+
corresponding index is true.
533+
534+
When inds selects multiple elements, this function returns a newly allocated
535+
array. To index multiple elements without making a copy, use view instead.
536+
537+
See the manual section on array indexing for details.
549538
550539
Examples
551-
≡≡≡≡≡≡≡≡≡≡
540+
≡≡≡≡≡≡≡≡
552541
553542
julia> A = [1 2; 3 4]
554543
2×2 Matrix{Int64}:
@@ -568,14 +557,35 @@ She looks up the documentation for that function
568557
3
569558
2
570559
4
560+
561+
julia> getindex(A, 2, 1)
562+
3
563+
564+
julia> getindex(A, CartesianIndex(2, 1))
565+
3
566+
567+
julia> getindex(A, :, 2)
568+
2-element Vector{Int64}:
569+
2
570+
4
571+
572+
julia> getindex(A, 2, :)
573+
2-element Vector{Int64}:
574+
3
575+
4
576+
577+
julia> getindex(A, A .> 2)
578+
2-element Vector{Int64}:
579+
3
580+
4
571581
572582
getindex(tree::GitTree, target::AbstractString) -> GitObject
573583
574-
Look up target path in the tree, returning a GitObject (a GitBlob in the
575-
case of a file, or another GitTree if looking up a directory).
584+
Look up target path in the tree, returning a GitObject (a GitBlob in the case
585+
of a file, or another GitTree if looking up a directory).
576586
577587
Examples
578-
≡≡≡≡≡≡≡≡≡≡
588+
≡≡≡≡≡≡≡≡
579589
580590
tree = LibGit2.GitTree(repo, "HEAD^{tree}")
581591
readme = tree["README.md"]
@@ -594,13 +604,21 @@ She looks up the documentation for that function
594604
595605
Returns a vector with all elements of array partition A.
596606
607+
getindex(
608+
c::SciMLBase.AbstractClock,
609+
idx
610+
) -> SciMLBase.IndexedClock
611+
612+
613+
Return a SciMLBase.IndexedClock representing the subset of the time points
614+
that the clock ticked indicated by idx.
615+
597616
v = sd[k]
598617
599618
Argument sd is a SortedDict and k is a key. In an expression, this retrieves
600-
the value (v) associated with the key (or KeyError if none). On the
601-
left-hand side of an assignment, this assigns or reassigns the value
602-
associated with the key. (For assigning and reassigning, see also insert!
603-
below.) Time: O(c log n)
619+
the value (v) associated with the key (or KeyError if none). On the left-hand
620+
side of an assignment, this assigns or reassigns the value associated with the
621+
key. (For assigning and reassigning, see also insert! below.) Time: O(c log n)
604622
605623
cb[i]
606624
@@ -612,13 +630,9 @@ She looks up the documentation for that function
612630
613631
getindex(tree, ind)
614632
615-
Gets the key present at index ind of the tree. Indexing is done in
616-
increasing order of key.
617-
618-
g[iter]
633+
Gets the key present at index ind of the tree. Indexing is done in increasing
634+
order of key.
619635
620-
Return the subgraph induced by iter. Equivalent to induced_subgraph(g,
621-
iter)[1].
622636
```
623637

624638
Note that the documentation for all methods gets shown and Melissa needs to look

0 commit comments

Comments
 (0)