Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion datashuttle/datashuttle_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,17 @@ def make_config_file(
ds_logger.close_log_filehandler()

def update_config_file(self, **kwargs) -> None:
"""Update the configuration file."""
"""Update the configuration file.

Parameters
----------
**kwargs
A dictionary of key-value pairs containing the config
settings to update. For example,
``{"connection_method": "local_filesystem", "central_path": "/my/local/path"}``
will update the ``connection_method`` and ``central_path`` settings.

"""
if not self.cfg:
utils.log_and_raise_error(
"Must have a config loaded before updating configs.",
Expand Down
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.
Binary file modified docs/source/_static/screenshots/tutorial-1-make-screen-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/screenshots/tutorial-1-make-screen-light.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.
Binary file modified docs/source/_static/screenshots/tutorial-validation-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/screenshots/tutorial-validation-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/screenshots/updating-configs-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/screenshots/updating-configs-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions docs/source/pages/get_started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ We need to set the:

``datashuttle`` supports connecting to the central storage machine
either as a mounted drive or through SHH. \
See [Set up configs for transfer(set-up-a-project-for-transfer)
See [Set up configs for transfer](set-up-a-project-for-transfer)
for detailed instructions for
connecting a mounted drive or by using SSH.

Expand Down Expand Up @@ -198,7 +198,7 @@ from datashuttle import DataShuttle
project = DataShuttle("my_first_project")
```

Next, we will use the `make_config_file()` method set the
Next, we will use the [](make_config_file()) method set the
configurations ('configs') for our project.


Expand All @@ -220,7 +220,7 @@ project.make_config_file(
)
```

If you want to change any config in the future, use the `update_config_file()` method
If you want to change any config in the future, use the [](update_config_file()) method

```python
project.update_config_file(
Expand Down Expand Up @@ -315,20 +315,20 @@ we only create `behav` and `ephys` folders.
```{image} /_static/screenshots/tutorial-1-create-datatype-dark.png
:align: center
:class: only-dark
:width: 400px
:width: 375px
```
```{image} /_static/screenshots/tutorial-1-create-datatype-light.png
:align: center
:class: only-light
:width: 400px
:width: 375px
```
<br>

Finally, click `Create Folders` to create the project folders.
:::
:::{tab-item} Python API
:sync: python
We will create project folders with the `create_folders()` method.
We will create project folders with the [](create_folders()) method.

Following the [NeuroBlueprint](https://neuroblueprint.neuroinformatics.dev/)
style we will call the first subject `sub-001`. Additional key-value pairs
Expand Down Expand Up @@ -360,8 +360,8 @@ An error will be raised if names break with the specification and
the folders will not be created.
```

Two useful methods to automate folder creation are `get_next_sub()` and
`get_next_ses()`. These can be used to automatically get the next subject
Two useful methods to automate folder creation are [](get_next_sub()) and
[](get_next_ses()). These can be used to automatically get the next subject
and session names in a project.

To get the next subject in this project (`sub-002`) and the next
Expand Down Expand Up @@ -450,7 +450,7 @@ Finally, hover the mouse over the `Directory Tree` and press `CTRL+R` to refresh
:::{tab-item} Python API
:sync: python

`create_folders()` returns the full filepaths of created datatype folders.
[](create_folders()) returns the full filepaths of created datatype folders.

These can be used in acquisition scripts to save data to these folders:

Expand Down Expand Up @@ -543,7 +543,7 @@ Next, we will use `Custom` transfers to move only a subset of the dataset.
:::{tab-item} Python API
:sync: python

`upload_entire_project()` is a high level method that uploads all files
[](upload_entire_project()) is a high level method that uploads all files
in the project.
This includes both the `rawdata` and `derivatives` top-level folders—see the
[NeuroBlueprint specification](https://neuroblueprint.neuroinformatics.dev/latest/specification.html)
Expand All @@ -560,7 +560,7 @@ All files will be uploaded from the local version of the project to central stor
Navigating to the `central_path` in your systems file browser, the newly transferred data
will have appeared.

Other methods (e.g. `upload_rawdata()` and `upload_custom()`) provide customisable
Other methods (e.g. [](upload_rawdata()) and [](upload_custom())) provide customisable
transfers (and every `upload` method has an equivalent `download` method).

See the [How to Transfer Data](how-to-transfer-data) page for full details
Expand Down Expand Up @@ -683,8 +683,8 @@ of files will now be available in the **local path**.
:::{tab-item} Python API
:sync: python

We will use the `download_custom()` method (the download equivalent method of
the `upload_custom()`).
We will use the [](download_custom()) method (the download equivalent method of
the [](upload_custom())).

Convenience tags can be used to make downloading subsets of data easier:

Expand Down
20 changes: 11 additions & 9 deletions docs/source/pages/get_started/set-up-a-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Enter the name of your project, the path to your project folder and
select `No connection (local only)` (note that the `Central Path` option
will be disabled).

```{image} /_static/screenshots/how-to-make-local-project-configs-dark.png
```{image} /_static/screenshots/tutorial-1-make-screen-dark.png
:align: center
:class: only-dark
:width: 900px
```
```{image} /_static/screenshots/how-to-make-local-project-configs-light.png
```{image} /_static/screenshots/tutorial-1-make-screen-light.png
:align: center
:class: only-light
:width: 900px
Expand Down Expand Up @@ -74,11 +74,13 @@ project.make_config_file(

```
\
The project is now ready for use, and in future can be instantiated
with the line ``project = DataShuttle("my_project_name")`` (i.e. you will not
have to set the `local_path` again).
The project is now ready for use, and in future can be instantiated with the line:
```python
project = DataShuttle("my_project_name")
```
(i.e. you will not have to set the `local_path` again).

If you wish to change the project settings at a later time, use ``project.update_config_file()``.
If you wish to change the project settings at a later time, use [](update_config_file()).

:::
::::
Expand Down Expand Up @@ -159,12 +161,12 @@ First, click the `Make New Project` button from the launch page.

The `Make New Project` screen will be displayed:

```{image} /_static/screenshots/tutorial-1-make-screen-dark.png
```{image} /_static/screenshots/tutorial-1-make-screen-local-filesystem-dark.png
:align: center
:class: only-dark
:width: 900px
```
```{image} /_static/screenshots/tutorial-1-make-screen-light.png
```{image} /_static/screenshots/tutorial-1-make-screen-local-filesystem-light.png
:align: center
:class: only-light
:width: 900px
Expand Down Expand Up @@ -201,7 +203,7 @@ project = DataShuttle("my_first_project")

```

Next, the `make_config_file()` method can be used to set up a new
Next, the [](make_config_file()) method can be used to set up a new
project with the desired **local path**, **central path** and
**connection method**.

Expand Down
7 changes: 3 additions & 4 deletions docs/source/pages/user_guides/create-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ any alphanumeric character, rather than restricted to integers.
:::{tab-item} Python API
:sync: python

The `create_folders()` method is used for folder creation.
The [](create_folders()) method is used for folder creation.

We simply need to provide the subject, session and datatypes to create:

Expand All @@ -178,9 +178,8 @@ created_folders = project.create_folders(
)
```

The method outputs `created_folders`, which contains the
`Path`s to created datatype folders. See the below section for
details on the `@DATE@` and other convenience tags.
`created_folders` is a list containing `Path`s to created datatype folders.
See the below section for details on the `@DATE@` and other convenience tags.

By default, an error will be raised if the folder names break
with [Neuroblueprint](https://neuroblueprint.neuroinformatics.dev/)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/pages/user_guides/read-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Clicking `Open Most Recent` will open the most recently saved logs.
:sync: python

The path where logs are stored can be accessed by running
`get_logging_path()`:
[](get_logging_path()):

```python
logs_path = project.get_logging_path()
Expand Down
4 changes: 2 additions & 2 deletions docs/source/pages/user_guides/transfer-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Click `Transfer` to begin.
:::{tab-item} Python API
:sync: python

The `upload_rawdata()`, `upload_derivatives()` and `download_rawdata()`, `download_derivatives()`
The [](upload_rawdata()), [](upload_derivatives()) and [](download_rawdata()), [](download_derivatives())
methods target transfer to a particular top-level folder.

The below example will upload `rawdata` then download `derivatives`.
Expand Down Expand Up @@ -221,7 +221,7 @@ Finally, click `Transfer` to begin.
:::{tab-item} Python API
:sync: python

The `upload_custom()` and `download_custom()` methods can be used for custom
The [](upload_custom()) and [](download_custom()) methods can be used for custom
data transfers. For example, to perform a custom upload:

```python
Expand Down
14 changes: 5 additions & 9 deletions docs/source/pages/user_guides/update-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ The project configs can be updated at any time following the initial set up.
```{image} /_static/screenshots/updating-configs-dark.png
:align: center
:class: only-dark
:width: 900px
:width: 1100px
```
```{image} /_static/screenshots/updating-configs-light.png
:align: center
:class: only-light
:width: 900px
:width: 1100px
```
<br>

Expand All @@ -35,7 +35,7 @@ If SSH configs are changed the connection may need to be
:sync: python

The project configs on the local machine can be selectively
updated with the `update_config_file()` method.
updated with the [](update_config_file()) method.

For example, to change the `local_path` and `central_path`:

Expand All @@ -46,12 +46,8 @@ project.update_config_file(
)
```

If SSH configs are changed the connection may need to be
[set up again](new-project-ssh) with:

```python
project.setup_ssh_connection()
```
If SSH, AWS or Google Drive configs are changed the connection
may need to be [set up again](new-project-ssh).

:::
::::
4 changes: 2 additions & 2 deletions docs/source/pages/user_guides/use-name-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ will be automatically saved. These settings will persist across
:::{tab-item} Python API
:sync: python

The `set_name_templates()` and `get_name_templates()` can be used
The [](set_name_templates()) and [](get_name_templates()) can be used
to set and get current name template settings.

`set_name_templates` takes as input the `name_template` dictionary,
[](set_name_templates()) takes as input the `name_template` dictionary,
which is formatted as below:

```
Expand Down
6 changes: 3 additions & 3 deletions docs/source/pages/user_guides/validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ for details on the options.
```{image} /_static/screenshots/tutorial-validation-light.png
:align: center
:class: only-light
:width: 600px
:width: 800px
```

```{image} /_static/screenshots/tutorial-validation-dark.png
:align: center
:class: only-dark
:width: 600px
:width: 800px
```

:::
Expand All @@ -53,7 +53,7 @@ for details on the options.
:sync: python


Project validation can be run with the [](datashuttle.DataShuttle.validate_project) function.
Project validation can be run with the [](validate_project) function.

Violations of the [NeuroBlueprint](https://neuroblueprint.neuroinformatics.dev/latest/index.html) can be set to raise an error, be displayed as warnings or printed as output.
They are also returned in a list of strings.
Expand Down
Loading