This adds a slide with examples of git-annex info to the dataset consumption module (just after git-annex whereis). The info subcommand would repeat some of the information discovered previously with lookupkey and whereis, but also add things like file size and annexed file count. Closes #10
233 lines
6.2 KiB
HTML
233 lines
6.2 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<title>Working with datasets</title>
|
||
<meta name="description" content="FILLIN">
|
||
<meta name="author" content="FILLIN">
|
||
|
||
<meta charset="utf-8">
|
||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
|
||
<!-- Original reveal JS stylesheets-->
|
||
<link rel="stylesheet" href="../reveal.js/dist/reset.css">
|
||
<link rel="stylesheet" href="../reveal.js/dist/reveal.css">
|
||
<link rel="stylesheet" href="../reveal.js/dist/theme/beige.css">
|
||
<!-- custom styles, e.g., imgcredit -->
|
||
<link rel="stylesheet" href="../custom/css/main-no-copy.css" id="theme">
|
||
<script src="../custom/js/printpdf.js"></script>
|
||
</head>
|
||
<body>
|
||
|
||
<div class="reveal">
|
||
<div class="slides">
|
||
|
||
<section>
|
||
<section data-markdown data-transition="none"><script type="text/template">
|
||
# Working with datasets
|
||
|
||
We obtain an existing DataLad dataset, explore what it contains,
|
||
and perform all necessary steps to download the contained data.
|
||
</script></section>
|
||
|
||
<section style="text-align:left" data-markdown data-transition="none"><script type="text/template">
|
||
## Terminal time!<!-- .element: style="text-align:center" -->
|
||
|
||
We will be using the datalad command line interface in a terminal
|
||
on your machine.
|
||
|
||
Make sure to activate your DataLad installation:
|
||
|
||
Mac/Linux:
|
||
|
||
```console
|
||
source $(uv tool dir)/datalad/bin/activate
|
||
```
|
||
|
||
Windows (`cmd.exe`):
|
||
|
||
```console
|
||
AppData\Roaming\uv\tools\datalad\Scripts\activate.bat
|
||
```
|
||
</script></section>
|
||
|
||
|
||
<section style="text-align:left" data-markdown data-transition="none"><script type="text/template">
|
||
## Clone a dataset<!-- .element: style="text-align:center" -->
|
||
|
||
Open a terminal and run the following command
|
||
```console
|
||
datalad clone https://hub.datalad.org/edu/penguins.git
|
||
```
|
||
<!-- .element: style="font-size:75%" -->
|
||
|
||
On success, you should see something like
|
||
|
||
```
|
||
install(ok): ... (dataset)
|
||
```
|
||
|
||
What did you get as a result?
|
||
</script></section>
|
||
|
||
|
||
<section style="text-align:left" data-markdown data-transition="none"><script type="text/template">
|
||
## Explore the dataset<!-- .element: style="text-align:center" -->
|
||
|
||
You can use a file manager or the terminal for this.
|
||
|
||
- Notice the `.datalad` directory. What information does it have?
|
||
|
||
- Compare the files in root of the dataset (e.g., `README.md`) with
|
||
the files in `examples`. What do you notice?
|
||
|
||
- Notice the `.git` and `.git/annex` directories
|
||
|
||
- Notice the total size of the dataset
|
||
</script></section>
|
||
|
||
<section style="text-align:left" data-markdown data-transition="none"><script type="text/template">
|
||
## Obtain data<!-- .element: style="text-align:center" -->
|
||
|
||
- Run the following command in the root of the dataset (`cd penguins`).
|
||
|
||
```
|
||
datalad get examples/adelie.jpg
|
||
```
|
||
|
||
- Take a look at the file. What has changed?
|
||
|
||
- Take a look at the `.git/annex` directory again. Notice
|
||
the `objects` directory that appeared. What information
|
||
does it contain?
|
||
</script></section>
|
||
|
||
<section style="text-align:left" data-markdown data-transition="none"><script type="text/template">
|
||
## Availability metadata<!-- .element: style="text-align:center" -->
|
||
|
||
`git-annex` manages information on where file content is available.
|
||
`git-annex` also manages the transport of file content from (and to)
|
||
those remote sources.
|
||
|
||
Look up the file content identifier associated with a file at a path
|
||
```
|
||
git annex lookupkey examples/adelie.jpg
|
||
```
|
||
|
||
Look up file availability
|
||
|
||
```
|
||
git annex whereis examples/adelie.jpg
|
||
```
|
||
|
||
Compare with
|
||
|
||
```
|
||
git annex whereis examples/gentoo.jpg
|
||
```
|
||
</script></section>
|
||
|
||
<section style="text-align:left" data-markdown data-transition="none"><script type="text/template">
|
||
## Dataset statistics and other information<!-- .element: style="text-align:center" -->
|
||
|
||
`git-annex` also has another useful command to display the information
|
||
it manages: `git annex info`.
|
||
|
||
Look up information for a file
|
||
|
||
```text
|
||
git annex info examples/adelie.jpg
|
||
```
|
||
|
||
Compare with
|
||
|
||
```text
|
||
git annex info examples/gentoo.jpg
|
||
```
|
||
|
||
Look up dataset-level information
|
||
|
||
```text
|
||
git annex info
|
||
```
|
||
|
||
(you can also ask about a directory or a remote)
|
||
|
||
</script></section>
|
||
|
||
<section style="text-align:left" data-markdown data-transition="none"><script type="text/template">
|
||
## Drop data<!-- .element: style="text-align:center" -->
|
||
|
||
`drop` reverses a `get` operation and frees disk space.
|
||
|
||
`drop` is safe, and does not drop file content that is not known
|
||
to be available from another source.
|
||
|
||
Try it
|
||
|
||
```
|
||
datalad drop examples/adelie.jpg
|
||
```
|
||
|
||
Now check what happened to the file.
|
||
|
||
Drop a different file
|
||
|
||
```
|
||
datalad drop README.md
|
||
```
|
||
|
||
Why did "nothing" happen?
|
||
</script></section>
|
||
</section>
|
||
|
||
</div> <!-- /.slides -->
|
||
</div> <!-- /.reveal -->
|
||
|
||
<script src="../reveal.js/dist/reveal.js"></script>
|
||
<script src="../reveal.js/plugin/notes/notes.js"></script>
|
||
<script src="../reveal.js/plugin/markdown/markdown.js"></script>
|
||
<script src="../reveal.js/plugin/highlight/highlight.js"></script>
|
||
<script src="../custom/js/copy-code.js"></script>
|
||
<script>
|
||
// Full list of configuration options available at:
|
||
// https://github.com/hakimel/reveal.js#configuration
|
||
Reveal.initialize({
|
||
// The "normal" size of the presentation, aspect ratio will be preserved
|
||
// when the presentation is scaled to fit different resolutions. Can be
|
||
// specified using percentage units.
|
||
width: 1280,
|
||
height: 960,
|
||
|
||
// Factor of the display size that should remain empty around the content
|
||
margin: 0.1,
|
||
|
||
// Bounds for smallest/largest possible scale to apply to content
|
||
minScale: 0.2,
|
||
maxScale: 1.0,
|
||
|
||
controls: true,
|
||
progress: true,
|
||
history: true,
|
||
center: true,
|
||
|
||
transition: 'slide', // none/fade/slide/convex/concave/zoom
|
||
|
||
// Optional reveal.js plugins
|
||
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
|
||
|
||
});
|
||
</script>
|
||
|
||
<!-- A footer with a "1" and "home" button to get back to the first slide and the index page
|
||
<div id="hidden" style="display:none;">
|
||
<div id="header">
|
||
<div id="footer-left"><a href="#0">1️⃣</a></div>
|
||
<div id="footer-right"><a href="../index.html">🏠</a></div>
|
||
</div>
|
||
</div> -->
|
||
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
|
||
<script src="../custom/js/headerandfooter.js"></script>
|
||
|
||
</body>
|
||
</html>
|