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

Support scoping within Dataverse datasets #273

Merged
merged 3 commits into from
Mar 17, 2023
Merged

Support scoping within Dataverse datasets #273

merged 3 commits into from
Mar 17, 2023

Conversation

mih
Copy link
Member

@mih mih commented Mar 17, 2023

As a replacement of dedicated support for recursive deposition,
add_sibling_dataverse now supports a root_path option (None by
default) that enables users to identify a root directoryLabel for a
particular DataLad dataset inside a Dataverse dataset. This option is
mirrored as rootpath= for the special remote. add_sibling_dataverse
merely passes it through.

It is implemented as a front-end to mangle_path() within
OnlineDataverseDataset and limits all path-based operations to be
within a given root.

This now makes it possible to represent any number of DataLad datasets
in a single Dataverse dataset. This approachs matches the requirement to
create Dataverse datasets manually, and does not constrain automation of
data deposition with large DataLad dataset hierarchies. Providing
a root_path rather than --recursive enables users to choose their own
organization of subdatasets within the Dataverse dataset, rather than
imposing a select few. Recursive operation could be done by users via
for_each_dataset.

A test is included that documents the ability to deposit nested dataset
hierarchies and re-clone them recursively.

Closes #271

mih added 2 commits March 17, 2023 08:40
This brings it to:

```
❯ git annex initremote dv type=external externaltype=dataverse  -w
readonly
        enable readonly mode
        (true or false)
chunk
        size of chunks (eg, 1MiB)
encryption
        how to encrypt data stored in the special remote
        (hybrid or none or pubkey or shared or sharedpubkey)
embedcreds
        embed credentials into git repository
        (yes or no)
mac
        how to encrypt filenames used on the remote
        (HMACSHA1 or HMACSHA224 or HMACSHA256 or HMACSHA384 or HMACSHA512)
keyid
        gpg key id
keyid+
        add additional gpg key
keyid-
        remove gpg key
credential
        name of a DataLad credential with a Dataverse API token to use
doi
        DOI-style persistent identifier of the Dataverse dataset
url
        URL of the Dataverse site
```
As a replacement of dedicated support for recursive deposition,
`add_sibling_dataverse` now supports a `root_path` option (`None` by
default) that enables users to identify a root `directoryLabel` for a
particular DataLad dataset inside a Dataverse dataset. This option is
mirrored as `rootpath=` for the special remote. `add_sibling_dataverse`
merely passes it through.

It is implemented as a front-end to `mangle_path()` within
`OnlineDataverseDataset` and limits all path-based operations to be
within a given root.

This now makes it possible to represent any number of DataLad datasets
in a single Dataverse dataset. This approachs matches the requirement to
create Dataverse datasets manually, and does not constrain automation of
data deposition with large DataLad dataset hierarchies.  Providing
a `root_path` rather than `--recursive` enables users to choose their own
organization of subdatasets within the Dataverse dataset, rather than
imposing a select few. Recursive operation could be done by users via
`for_each_dataset`.

A test is included that documents the ability to deposit nested dataset
hierarchies and re-clone them recursively.

Closes datalad#271
@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.21 🎉

Comparison is base (3b785ba) 93.39% compared to head (dbbdb1b) 93.61%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #273      +/-   ##
==========================================
+ Coverage   93.39%   93.61%   +0.21%     
==========================================
  Files          17       17              
  Lines         909      939      +30     
==========================================
+ Hits          849      879      +30     
  Misses         60       60              
Impacted Files Coverage Δ
datalad_dataverse/__init__.py 100.00% <ø> (ø)
datalad_dataverse/add_sibling_dataverse.py 81.94% <100.00%> (+1.34%) ⬆️
datalad_dataverse/baseremote.py 90.99% <100.00%> (+0.16%) ⬆️
datalad_dataverse/dataset.py 93.52% <100.00%> (+0.24%) ⬆️
...alad_dataverse/tests/test_add_sibling_dataverse.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mih mih merged commit 85392c0 into datalad:main Mar 17, 2023
@mih mih deleted the norec branch March 17, 2023 11:21
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.

Implement "prefix" support
3 participants