Skip to content

Commit

Permalink
Docs for tui version release (#334)
Browse files Browse the repository at this point in the history
* Starting tidying up the website and adding how-to for install and choosing terminal.

* Add first draft of walkthrough.

* Full thread through and text tidy up, add all internal and external links.

* Add textual-dev to dev dependencies.

* Delete test screenshot svgs.

* Testing resoltuion after 300 dpi in photoshop.

* Trying 600 dpi.

* Trying 1200 dpi!

* try with shareX

* Check how things render on macos few figures added.

* Adding screenshots for graphical interface part of walkthrough.

* Adding python API sections to walkthrough.

* First draft of the tutorial complete.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Continue drafting + dark mode datashuttle image.

* Adding pictures to HOW TO.

* Export dark mode datashuttle as artboard.

* Upload halfway through transfer page, need to check.

* Rough draft complete for all sections.

* something went wrong with git.

* finish first draft of all how-tos.

* Rename 'make_folders' to 'create_folders' in docs.

* First draft of docs complete.

* Add notes on taking screenshots.

* Minor formatting changes, improvements during doc writing.

* Remove high dpi screenshots that were slowing down git.

* Fix tests after DataShuttle changed to datashuttle.

* Fix top-level folder widget test.

* Fix errors introduced after API changes.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
JoeZiminski and pre-commit-ci[bot] authored Apr 8, 2024
1 parent 0a9f549 commit 849efa6
Show file tree
Hide file tree
Showing 94 changed files with 2,212 additions and 109 deletions.
4 changes: 2 additions & 2 deletions datashuttle/tui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TuiApp(App):

def compose(self) -> ComposeResult:
yield Container(
Label("DataShuttle", id="mainwindow_banner_label"),
Label("datashuttle", id="mainwindow_banner_label"),
Button(
"Select Existing Project",
id="mainwindow_existing_project_button",
Expand Down Expand Up @@ -118,7 +118,7 @@ def handle_open_filesystem_browser(self, path_: Path) -> None:
)
else:
message = (
"Unexpected error occurred. Please contact the DataShuttle"
"Unexpected error occurred. Please contact the datashuttle"
"development team."
)

Expand Down
4 changes: 2 additions & 2 deletions datashuttle/tui/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,15 @@ def setup_configs_for_a_new_project(self) -> None:
).disabled = False

message = (
"A DataShuttle project has now been created.\n\n "
"A datashuttle project has now been created.\n\n "
"Next, setup the SSH connection. Once complete, navigate to the "
"'Main Menu' and proceed to the project page, where you will be "
"able to create and transfer project folders."
)

else:
message = (
"A DataShuttle project has now been created.\n\n "
"A datashuttle project has now been created.\n\n "
"Next proceed to the project page, where you will be "
"able to create and transfer project folders."
)
Expand Down
2 changes: 1 addition & 1 deletion datashuttle/tui/css/tui_menu.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#mainwindow_banner_label {
border: hkey $primary;
content-align: center middle;
text-style: italic bold;
text-style: bold;
color: $text;
width: 50%;
height: 5;
Expand Down
4 changes: 2 additions & 2 deletions datashuttle/utils/rclone.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ def assert_rclone_check_output_is_as_expected(result, symbol, convert_symbols):
assert symbol in convert_symbols.keys(), "rclone check symbol is unknown."
assert symbol != "!", (
"Could not complete rlcone check. "
"This is unexpected. Please contact DataShuttle "
"devs at our GitHub page."
"This is unexpected. Please contact datashuttle "
"at our GitHub page."
)


Expand Down
12 changes: 5 additions & 7 deletions datashuttle/utils/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,11 @@ def setup_ssh_key(
"""
if not sys.stdin.isatty():
utils.log_and_raise_error(
f"Attempting to run outside of a TTY terminal. "
f"This may happen if attempting to run in an IDE console. "
f"`getpass` (used for ssh password input) cannot run. "
f"Try running using the command-line-interface with "
f"'datashuttle {cfg.project_name} "
f"setup-ssh-connection-to-central-server' "
f"or in a terminal rather than IDE console.",
"Attempting to run outside of a TTY terminal. "
"This may happen if attempting to run in an IDE console. "
"`getpass` (used for ssh password input) cannot run. "
"Try using Python from the operating system "
"terminal to run this function.",
RuntimeError,
)

Expand Down
10 changes: 10 additions & 0 deletions docs/rebuild.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import shutil
import subprocess
from pathlib import Path

build_path = Path(__file__).parent / "build"

if build_path.is_dir():
shutil.rmtree(build_path)

subprocess.run("sphinx-build ./source ./build", shell=True)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ html[data-theme=light] {
height: auto;
margin: 5px auto;
}

.center {
text-align: center;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/ds_nice_test_ong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"strikethrough",
"substitution",
"tasklist",
"attrs_block", # https://stackoverflow.com/questions/78183173/custom-styling-a-header-in-sphinx-website?noredirect=1#comment137843002_78183173
"attrs_inline"
]
# Automatically add anchors to markdown headings
myst_heading_anchors = 3
Expand Down Expand Up @@ -152,6 +154,7 @@
},
"footer_start": ["footer_start"],
"footer_end": ["footer_end"],
"show_prev_next": False,
"show_toc_level": 2, # sidebar levels that are expanded before scrolling
# "secondary_sidebar_items": [],
# "page_sidebar_items": [],
Expand Down
61 changes: 41 additions & 20 deletions docs/source/index.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,69 @@
:html_theme.sidebar_secondary.remove:

# DataShuttle Documentation
{.center}
# **datashuttle**

This website includes the documentation and API documentation for DataShuttle.
<p style="text-align: center; font-size: 22px;">The tool to automate neuroscience project folder creation and transfer.</p>

For additional information, please visit the [GitHub Page](https://github.com/neuroinformatics-unit/datashuttle).

Any feedback is much appreciated, please open at [GitHub Issue](https://github.com/neuroinformatics-unit/datashuttle/issues)
or join our [Zulip chat](https://neuroinformatics.zulipchat.com/#narrow/stream/405999-DataShuttle) if you have any problems or suggestions.

## Explore the Documentation
```{image} _static/datashuttle-overview-light.png
:alt: My Logo
:class: logo, mainlogo, only-light
:align: center
:width: 600px
```
```{image} _static/datashuttle-overview-dark.png
:alt: My Logo
:class: logo, mainlogo, only-dark
:align: center
:width: 600px
```
<br>

::::{grid} 1 2 2 3
:gutter: 3
:gutter: 4

:::{grid-item-card} User Guide
:link: pages/documentation
:::{grid-item-card} Tutorials
:link: pages/tutorials
:link-type: doc

Get started with DataShuttle.
Walkthrough **datashuttle**.
:::

:::{grid-item-card} How To
:link: pages/how_tos
:link-type: doc

Short guides on specific actions.
:::

:::{grid-item-card} Python API
:link: pages/api_index
:link-type: doc

Check out the API reference.
Full Python API reference.
:::
::::

:::{grid-item-card} Command-line interface
:link: pages/cli_index
:link-type: doc
Datashuttle creates and validates projects standardised to the
[NeuroBlueprint](https://neuroblueprint.neuroinformatics.dev)
specification.

Use datashuttle with the CLI.
:::
Dive right into **datashuttle** with our
[Getting Started Tutorial]((tutorial-getting-started)=)
or targeted [How-To Guides](how-tos).

Don't hesitate to get in contact through our
[GitHub Issues](https://github.com/neuroinformatics-unit/datashuttle/issues)
or
[Zulip Chat.](https://neuroinformatics.zulipchat.com/#narrow/stream/405999-DataShuttle)

::::

```{toctree}
:maxdepth: 2
:caption: index
:hidden:
pages/documentation
pages/tutorials
pages/how_tos
pages/api_index
```
76 changes: 3 additions & 73 deletions docs/source/pages/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,79 +399,6 @@ necessary for SSH transfer.
Next, we can start setting up the project by automatically creating standardised
project folder trees.

# Creating *subject* and *session* folders

In a typical neuroscience experiment, data collection sessions begin by
creating the folder for the current *subject* (e.g. mouse, rat) and current *session*.

The command `create-folders` can be used to automatically create standardised
folder trees (see
[NeuroBlueprint](https://neuroblueprint.neuroinformatics.dev/) for details on the standardisation scheme).


An example project directory for the behavioural data for the first *subject*,
first *session* of an experiment may look like:

```
└── my_first_project/
└── rawdata/
└── sub-001/
└── ses-001_date-20230516/
└── behav
```

In Datashuttle, this folder tree can be created with the below command
(assuming today's date is `20230516`):

::::{tab-set}

:::{tab-item} Python API
```{code-block} python
project.create_folders(
sub_names="001",
ses_names="001_@DATE@",
datatype="behav"
)
```
:::

:::{tab-item} CLI (macOS / Linux)
```{code-block} console
datashuttle \
my_first_project \
create-folders -sub 001 -ses 001_@DATE@ -dt behav
```
:::

:::{tab-item} CLI (Windows)
```{code-block} console
datashuttle ^
my_first_project ^
create-folders -sub 001 -ses 001_@DATE@ -dt behav
```
:::

::::

The leading `sub-` or `ses-` in the provided *subject* and *session* names
are optional in the command, these prefixes
will always be added
(i.e. both `-sub 001` and `-sub sub-001` are valid inputs).

It is possible to automatically create date, time or datetime key-value pairs with the tags
`@DATE@`, `@TIME@` or `@DATETIME@` respectively.
A range of *subjects* and *sessions* can be created with the `@TO@` flag.
See the [convenience tags](#convenience-tags) section for more details.


## *Datatype* Folders

*Datatype* folders contain acquired experimental data and must be named either
`behav`, `ephys`, `funcimg` or `anat`. *Datatype* folders must be placed
within a *session* folder.
See the [*datatype*](https://neuroblueprint.neuroinformatics.dev/specification.html#datatype) section
of NeuroBlueprint for details.

# Data Transfer

Datashuttle offers a convenient way of transferring entire project folders or
Expand Down Expand Up @@ -650,6 +577,7 @@ For example, the command:
:::{tab-item} Python API
```{code-block} python
project.create_folders(
top_level_folder="rawdata",
sub_names="sub-001",
ses_names=["001_@DATETIME@", "002_@DATETIME@"],
datatype="behav",
Expand Down Expand Up @@ -1008,6 +936,7 @@ The command:
:::{tab-item} Python API
```{code-block} python
project.create_folders(
top_level_folder="rawdata",
sub_names="001",
ses_names="all",
datatype="all_datatype"
Expand Down Expand Up @@ -1054,6 +983,7 @@ but not the non-*datatype* file `ses-001_extra-file.json`.
:::{tab-item} Python API
```{code-block} python
project.create_folders(
top_level_folder="rawdata",
sub_names="all_non_sub",
ses_names="all",
datatype="all"
Expand Down
72 changes: 72 additions & 0 deletions docs/source/pages/how_tos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
:html_theme.sidebar_secondary.remove:
(how-tos)=
# How To

## Get Started

::::{grid} 1 1 2 2
:gutter: 4

:::{grid-item-card} {fas}`desktop;sd-text-primary` Install
:link: how_tos/install
:link-type: doc

How to install **datashuttle**
:::

:::{grid-item-card} {fas}`desktop;sd-text-primary` Choose a Terminal
:link: how_tos/choose-a-terminal
:link-type: doc

Choose the best terminal to run the graphical interface.
:::

:::{grid-item-card} {fas}`desktop;sd-text-primary` Make a New Project
:link: how_tos/make-a-new-project
:link-type: doc

Full details on setting up a new project.
:::

::::

## Manage your project
::::{grid} 1 1 2 2
:gutter: 4

:::{grid-item-card} {fas}`desktop;sd-text-primary` Create Folders
:link: how_tos/create-folders
:link-type: doc

All you need to know about creating folders.
:::

:::{grid-item-card} {fas}`desktop;sd-text-primary` Transfer Data
:link: how_tos/transfer-data
:link-type: doc

The ultimate guide to data-transfer.
:::

:::{grid-item-card} {fas}`desktop;sd-text-primary` Update Configs
:link: how_tos/update-configs
:link-type: doc

Changing an existing project's configurations.
:::

:::{grid-item-card} {fas}`desktop;sd-text-primary` Read the Logs
:link: how_tos/read-logs
:link-type: doc

How to access full logs of everything **datashuttle** does.
:::

:::{grid-item-card} {fas}`desktop;sd-text-primary` Use Name Templates
:link: how_tos/use-name-templates
:link-type: doc

A handy feature for template subject and session names.
:::

::::
Loading

0 comments on commit 849efa6

Please sign in to comment.