Skip to content
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

ENH: Extension chapter - catalog content #917

Merged
merged 8 commits into from
Dec 23, 2022

Conversation

jsheunis
Copy link
Contributor

This PR:

I am unsure about two things:

  • whether it is correct to also commit the code snippets, or should these be excluded and generated by the appveyor build, and then added to the PR manually after that?
  • whether I can depend on jq for easy json formatting in shell outputs, which I currently do. This is fine if I generate the code snippets locally and commit to the PR (which I did), but I'm not sure how this will flow during the automated CI build. It's easy to update these lines of code though, I just need to find an alternative for formatting the outputs.

Copy link
Collaborator

@mih mih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a wonderful addition to the handbook. Thx much!

I left a few comment re fit with the rest of the book and in particular a printed version.

:notes: Let's test the installation and look at the help information

$ datalad catalog --help
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the printed book, this will be multiple (physical) pages of help output. I suspect that it is not needed to include this in full. You could consider adding a :lines: field to pick a meaningful, short snippted (e.g. :lines: 1, 24-50`, numbers are random).

:notes: We can inspect the catalog's content with the tree command

$ tree data-cat
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the output could be trimmed here too (the main aspect is the set of subdirectories, not the files). In addition, consider adding a :linereplace: expression to remove the version numbers that will change all the time.

"type": "file"
"dataset_id": "abcd",
"dataset_version": "1234",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be value in using an ID and version that are structurally identical to the real things (a UUID and a Git SHA). Doesn't add much weight, and would match the actual appearance of a real catalog better. Maybe?

$ cat data-cat/metadata/abcd/1234/217/17d85bd1b1526b7e463279763cdb0.json | jq .

$ cat data-cat/metadata/abcd/1234/10f/7898cf7fc3465f078a67e15124c72.json | jq .
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here it would be nice to trim the output to the essential bits.

``dataset_id`` and ``dataset_version`` by appending them to the URL in the format:

<catalog-url>/#/dataset/<dataset_id>/<dataset_version>.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark up as code?

.. figure:: ../artwork/src/catalog/catalog_step_dataset.png

The is the dataset view, with the subdatasets tab (auto-)selected.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The is the dataset view, with the subdatasets tab (auto-)selected.
This is the dataset view, with the subdatasets tab (auto-)selected.

?

:notes: Get the custom logo

$ wget -O datalad_logo_funky.svg https://raw.githubusercontent.com/datalad/tutorials/5e5fc0a4761248e5cedbc491c357d423d14a2b21/notebooks/catalog_tutorials/test_data/datalad_logo_funky.svg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider add -q. The timestamps and download performance stats will be different on each run.

@mih
Copy link
Collaborator

mih commented Dec 22, 2022

One more note: I think we use American not English throughout the handbook, so it would be great to turn all those s into z and look for potential ous and rs in all the wrong places ;-)

Copy link
Contributor

@adswa adswa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I had fixed a few typos and a bit of formatting locally, but I don't have permission to push into your branch :/ I pushed cc810aa1 into a branch in this repo, though, so if you fetch origin you could cherry-pick it, if you want.

@adswa
Copy link
Contributor

adswa commented Dec 22, 2022

You asked...

whether it is correct to also commit the code snippets, or should these be excluded and generated by the appveyor build, and then added to the PR manually after that?

We haven't quite succeeded in building the advanced part of the book on appveyor - until then, its good that you committed the snippets. Once the beyond basics are build non-locally as well, you still can create the code snippets yourself and commit them, or take them from the appveyor diff and commit them - whichever is easier.

whether I can depend on jq for easy json formatting in shell outputs, which I currently do. This is fine if I generate the code snippets locally and commit to the PR (which I did), but I'm not sure how this will flow during the automated CI build. It's easy to update these lines of code though, I just need to find an alternative for formatting the outputs.

The Appveyor environment installs jq so it should be available for formatting. :)

@jsheunis
Copy link
Contributor Author

Thanks for the reviews!!

@adswa I couldn't find that specific commit, so it's not included. I added you as a collaborator to my forked repo if you want to push there, or otherwise add it after merge?

@adswa
Copy link
Contributor

adswa commented Dec 22, 2022

Whoops sorry its 5db52ec

@jsheunis
Copy link
Contributor Author

I had already fixed some of those in a previous commit and didn't want to deal with conflicts, so just added a new one with the rest of the tweaks. Thanks!

@adswa
Copy link
Contributor

adswa commented Dec 23, 2022

Step one of the merge - let's get it into the extension_chapter branch. Thanks much for your work on this, @jsheunis!

@adswa adswa merged commit f36e030 into datalad-handbook:extension-chapter Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants