-
Notifications
You must be signed in to change notification settings - Fork 20
Reorganize folders of DataScienceTutorials.jl #218
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
183bad0
Delete project_old.toml
EssamWisam 0b4e318
Delete useless figures
EssamWisam d8beab2
Drop prefixes in favor of nesting folders
EssamWisam a314c02
Minor fix. to collapse-script after reorg
EssamWisam f41e64c
Group info pages under an info folder and route
EssamWisam 57f8c9c
Centralize routes.json (navigation bar data) at the top level
EssamWisam b0c62c7
Update README
EssamWisam 77aeee5
Further improvements for the README
EssamWisam e5361c7
Update README.md
EssamWisam d4de844
Update README.md
EssamWisam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ This repository contains the source code for a [set of tutorials](https://juliaa | |
|
||
You can read the tutorials [online](https://juliaai.github.io/DataScienceTutorials.jl/). | ||
|
||
You can find a runnable script for each tutorial at the top of each tutorial page along with a `Project.toml` and a `Manifest.toml` you can use to re-create the exact environment that was used to run the tutorial. | ||
You can find a runnable script for each tutorial linked at the top of each tutorial page along with a `Project.toml` and a `Manifest.toml` you can use to re-create the exact environment that was used to run the tutorial. | ||
|
||
To do so, save both files in an appropriate folder, start Julia, `cd` to the folder and | ||
|
||
|
@@ -23,57 +23,85 @@ Pkg.instantiate() | |
The rest of these instructions assume that you've cloned the package and have `cd` to it. | ||
|
||
### Structure | ||
|
||
All tutorials correspond to a Literate script that's in `_literate/`. | ||
The following are the folders relevant to pages on the website: | ||
``` | ||
├── _literate | ||
│ ├── data # has "Data Basics" tutorials | ||
│ ├── getting-started # has "Getting Started" tutorials | ||
│ ├── isl # has "Introduction to Statistical Learning" tutorials | ||
│ ├── end-to-end # has "End-to-End" tutorials | ||
│ └── advanced # has "Advanced" tutorials | ||
├── data # This and the four folders below import content from "_literate" to the website | ||
├── getting-started | ||
├── isl | ||
├── end-to-end | ||
├── advanced | ||
├── info # has markdown files corresponding to info pages | ||
├── index.md # has markdown for the landing page | ||
├── search.md # has markdown for the search page | ||
├── routes.json # has all the navigation bar data | ||
├── collapse-script.jl # script that adds dropdowns to tutorials | ||
├── deploy.jl # deployment script | ||
├── Manifest.toml | ||
└── Project.toml # Project's environment | ||
``` | ||
To understand the rest of the structure which could help you change styles with CSS or add interaction with JavaScript read the relevant page on [Franklin's documentation](https://franklinjl.org/workflow/) | ||
|
||
### Fixing an existing tutorial | ||
|
||
Find the corresponding script, fix it in a PR. | ||
Find the corresponding Julia script in `_literate` and fix it in a PR. | ||
|
||
### Add a new tutorial | ||
|
||
* Duplicate the folder `EX-wine`. | ||
* Change its name: | ||
* `EX-somename` for an "end-to-end" tutorial `somename` | ||
* `A-somename` for a "getting started" tutorial `somename` | ||
* `D0-somename` for a "data" tutorial `somename` | ||
* `ISL-lab-x` for an "Introduction to Statistical Learning" tutorial | ||
* Go to the appropriate folder inside `_literate` depending on the category of the tutorial as described above | ||
* Duplicate one of the tutorials as a starting point. | ||
* Remove `Manifest.toml` and `Project.toml` | ||
* Activate that folder and add the packages that you'll need (MLJ, ...) | ||
* Create and activate an environment in that folder and add the packages that you'll need (MLJ, ...) | ||
* Write your tutorial following the blueprint | ||
* Run `julia collapse-script.jl` to add necessary Franklin syntax to your tutorial to make sections in it collapsible like other tutorials | ||
|
||
**Note**: your tutorial **must** "just work" otherwise it will be ignored, in other words, any Julia user should be able to just copy the folder containing your `.jl` and `.toml` files, and run it without having to do anything special. | ||
|
||
**Note**: your tutorial **must** "just work" otherwise it will be ignored, in other words, we should be able to just copy the folder containing your `.jl` and `.toml` files, and run it without having to do anything special. | ||
Once all that's done, the remaining things to do are to create the HTML page and a link in the appropriate location. Let's assume you wanted to add an E2E tutorial "Dinosaurs" then this implies that `_literate/end-to-end/dinosaurs.jl` exists and you would: | ||
|
||
Once all that's done, the remaining things to do are to create the HTML page and a link in the appropriate location. Let's assume you wanted to add an E2E tutorial "Dinosaurs" then in the previous step you'd have `EX-dinosaurs` and you would | ||
* Create a file `dinosaurs.md` in the top-level folder `end-to-end/` by duplicating the `end-to-end/wine.md` and changing the reference in it to `\tutorial{end-to-end/dinosaurs}` | ||
* Add a link pointing to that tutorial in `routing.json` following the template so your tutorial shows in the navigation bar | ||
* Ensure your tutorials renders correctly by running the following: | ||
```julia | ||
cd("path/to/DataScienceTutorials") | ||
|
||
* create a file `dinosaurs.md` in `end-to-end/` by duplicating the `end-to-end/wine.md` and changing the reference in it to `\tutorial{EX-dinosaurs}` | ||
* add a link pointing to that tutorial in `_libs/nav/head.js` following the template so your tutorial shows in the navigation bar | ||
* lastly, to make sections in your tutorial collapsible like other tutorials run the `collapse-script.jl` file via `julia collapse-script.jl` | ||
using Pkg | ||
Pkg.activate(".") | ||
Pkg.instantiate() | ||
|
||
using Franklin | ||
serve() # serve the website locally | ||
``` | ||
This may generate some files under `__site`. Don't push them in your PR. | ||
|
||
### Publishing updates | ||
|
||
**Assumptions**: | ||
|
||
* you have a PR with changes, someone has reviewed them and they got merged into the main branch | ||
* you have a PR with changes, someone has reviewed them and they got merged into the master branch | ||
|
||
* Be sure the version of Julia declared near the top of `index.md` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This refers to the old |
||
* Be sure the version of Julia declared [here](https://juliaai.github.io/DataScienceTutorials.jl/how-to-run-code/) | ||
matches the version used to generate the web-site (which should | ||
match the version declared in each tutorial's Manifest.toml file) | ||
|
||
|
||
**Once the changes are in the main branch**: | ||
|
||
* run `cd("path/to/DataScienceTutorials"); using Franklin` to launch Franklin | ||
* run `serve(single=true, verb=true)` to ensure no issues generating the relevant html pages with code block evaluations, and then run `serve()` (after restarting) to serve the pages live on a local browser for viewing | ||
* run `include("deploy.jl")` to re-generate the LUNR index and push the changes to GitHub. | ||
**Once the changes are in the master branch:** | ||
|
||
The second step requires you have `lunr` and `cheerio` installed, if not: | ||
|
||
``` | ||
* Run `cd("path/to/DataScienceTutorials"); using Franklin` to launch Franklin | ||
* In case you don't have `lunr` and `cheerio` installed already, also do: | ||
```julia | ||
using NodeJS | ||
run(`sudo $(npm_cmd()) i lunr cheerio`) | ||
``` | ||
* Run `serve(single=true, verb=true)` to ensure no issues generating the relevant html pages with code block evaluations | ||
* Run `serve()` (after restarting) to serve the pages live on a local browser for viewing | ||
* run `include("deploy.jl")` which re-generates the LUNR index and automatically pushes the changes to GitHub. | ||
|
||
|
||
This should take ≤ 15 seconds to complete. | ||
|
||
|
@@ -139,9 +167,9 @@ serve(; eval_all=true) | |
|
||
note that this will take a while. | ||
|
||
#### Merge conflicts | ||
#### Merge conflicts or Missing Styles | ||
|
||
If you get merge conflicts, do | ||
If you get merge conflicts or have styles that seem to be missing after `serve()`, do | ||
|
||
```julia | ||
cleanpull() | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Ensemble models 3 (learning networks) | ||
|
||
\tutorial{ADV-ensembles-3} | ||
\tutorial{advanced/ensembles-3} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Handling categorical data | ||
|
||
\tutorial{D0-categorical} | ||
\tutorial{data/categorical} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
# Manipulating a DataFrame | ||
|
||
\tutorial{D0-dataframe} | ||
\tutorial{data/dataframe} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Loading and elementary processing of data | ||
|
||
\tutorial{D0-loading} | ||
\tutorial{data/loading} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Further data processing | ||
|
||
\tutorial{D0-processing} | ||
\tutorial{data/processing} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Data interpretation: Scientific Types | ||
|
||
\tutorial{D0-scitype} | ||
\tutorial{data/scitype} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# AMES | ||
|
||
\tutorial{EX-AMES} | ||
\tutorial{end-to-end/AMES} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
|
||
# House King County | ||
|
||
\tutorial{EX-housekingcounty} | ||
\tutorial{end-to-end/housekingcounty} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Airfoil | ||
|
||
\tutorial{EX-airfoil} | ||
\tutorial{end-to-end/airfoil} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Boston with Flux | ||
|
||
\tutorial{EX-boston-flux} | ||
\tutorial{end-to-end/boston-flux} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Boston with LightGBM | ||
|
||
\tutorial{EX-boston-lgbm} | ||
\tutorial{end-to-end/boston-lgbm} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Breast Cancer Wisconsin(Diagnostic) | ||
|
||
\tutorial{EX-breastcancer} | ||
\tutorial{end-to-end/breastcancer} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Crabs with XGBoost | ||
|
||
\tutorial{EX-crabs-xgb} | ||
\tutorial{end-to-end/crabs-xgb} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Credit Card Fraud | ||
|
||
\tutorial{EX-creditfraud} | ||
\tutorial{end-to-end/creditfraud} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
# Using GLM.jl | ||
|
||
\tutorial{EX-GLM} | ||
\tutorial{end-to-end/GLM} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# Horse colic data | ||
|
||
\tutorial{EX-horse} | ||
\tutorial{end-to-end/horse} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
# Power Generation | ||
|
||
\tutorial{EX-powergen} | ||
\tutorial{end-to-end/powergen} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.