Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.


## [0.6.1] - 2023-08-02

+ Update DANDI upload funtionality to improve useability


## [0.6.0] - 2023-07-26

+ Update - `prairieviewreader.py` -> `prairie_view_loader.py`
Expand Down
21 changes: 11 additions & 10 deletions element_interface/dandi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def upload_to_dandi(
working_directory: str = None,
api_key: str = None,
sync: bool = False,
existing: str = "refresh",
):
"""Upload NWB files to DANDI Archive

Expand All @@ -25,6 +26,7 @@ def upload_to_dandi(
environmental variable DANDI_API_KEY
sync (str, optional): If True, delete all files in archive that are not present
in the local directory.
existing (str, optional): see full description from `dandi upload --help`
"""

working_directory = working_directory or os.path.curdir
Expand All @@ -36,11 +38,11 @@ def upload_to_dandi(
working_directory, str(dandiset_id)
) # enforce str

download(
f"https://gui-staging.dandiarchive.org/#/dandiset/{dandiset_id}"
if staging
else f"https://dandiarchive.org/dandiset/{dandiset_id}",
output_dir=working_directory,
dandiset_url = f"https://gui-staging.dandiarchive.org/#/dandiset/{dandiset_id}" if staging else f"https://dandiarchive.org/dandiset/{dandiset_id}/draft"

subprocess.run(
["dandi", "download", "--download", "dandiset.yaml", "-o", working_directory, dandiset_url],
shell=True,
)

subprocess.run(
Expand All @@ -52,14 +54,13 @@ def upload_to_dandi(
["dandi", "organize", "-d", dandiset_directory, data_directory], shell=True
)

print(
f"work_dir: {working_directory}\ndata_dir: {data_directory}\n"
+ f"dand_dir: {dandiset_directory}"
subprocess.run(
["dandi", "validate", dandiset_directory], shell=True
)

upload(
[dandiset_directory],
# dandiset_path=dandiset_directory, # dandi.upload has no such arg
paths=[dandiset_directory],
dandi_instance="dandi-staging" if staging else "dandi",
existing=existing,
sync=sync,
)
2 changes: 1 addition & 1 deletion element_interface/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package metadata"""

__version__ = "0.6.0"
__version__ = "0.6.1"