Skip to content

Commit eca81c7

Browse files
committed
Add metadata to upload.
1 parent 302fb1b commit eca81c7

File tree

2 files changed

+105
-81
lines changed

2 files changed

+105
-81
lines changed

src/pynxtools_spm/nomad_uploader/example_upload_script.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
username="Mozumder",
1616
password="",
1717
token="",
18-
modify_upload_metadata=False,
18+
modify_upload_metadata=True,
1919
publish_to_nomad=False,
2020
)
2121
local_src_dir = Path(
2222
"/home/rubel/NOMAD-FAIRmat/nomad-distro-dev-RM/packages/pynxtools-spm/tests/data/nanonis"
2323
)
24-
total_upload = 3
25-
data_processing_settings = DataProcessingSettings(
24+
total_upload = 1
25+
data_proc_settings = DataProcessingSettings(
2626
raw_file_exts=(
2727
".dat",
2828
".sxm",
2929
),
3030
single_batch_processing_time=total_upload * 90, # seconds
31-
src_dir=Path("/home/rubel/NOMAD-FAIRmat/SPMfolder/DataFilesForUpload"),
31+
src_dir=local_src_dir, # Path("/home/rubel/NOMAD-FAIRmat/SPMfolder/DataFilesForUpload"),
3232
# copy_file_elsewhere=False,
3333
dst_dir="",
3434
create_pseudo_file=True,
@@ -42,10 +42,27 @@
4242
afm_config="",
4343
logger_dir=current_dir,
4444
number_of_uploads=total_upload,
45+
file_specific_eln={"raw_file_name": "eln_file_path"},
46+
# metadata = {
47+
# "metadata": {
48+
# "upload_name": upload_name,
49+
# "references": ["https://doi.org/xx.xxxx/xxxxxx"],
50+
# "datasets": dataset_id,
51+
# "embargo_length": 0,
52+
# "coauthors": ["coauthor@affiliation.de"],
53+
# "comment": 'This is a test upload...'
54+
# },
55+
# }
56+
uplad_metadata={
57+
"metadata": {
58+
"coauthors": ["cojaddl@physik.hu-berlin.de"],
59+
"upload_name": "test_upload",
60+
}
61+
},
4562
)
4663

4764
if __name__ == "__main__":
4865
run_uploader_with(
49-
data_settings=nomad_settings,
50-
data_processing_settings=data_processing_settings,
66+
nomad_settings=nomad_settings,
67+
data_proc_settings=data_proc_settings,
5168
)

0 commit comments

Comments
 (0)