|
| 1 | +from pynxtools_spm.nomad_uploader.uploader import ( |
| 2 | + run_uploader_with, |
| 3 | + NOMADSettings, |
| 4 | + DataProcessingSettings, |
| 5 | +) |
| 6 | +from pathlib import Path |
| 7 | + |
| 8 | +current_dir = Path(__file__).resolve().parent |
| 9 | +project_dir = current_dir.parent |
| 10 | + |
| 11 | +nomad_settings = NOMADSettings( |
| 12 | + url_protocol="https", |
| 13 | + url_domain="nomad-lab.eu", |
| 14 | + url_version="prod/v1/develop/api/v1/", |
| 15 | + url="https://nomad-lab.eu/prod/v1/develop/api/v1/", |
| 16 | + username="", |
| 17 | + password="", |
| 18 | + token="", |
| 19 | + modify_upload_metadata=True, |
| 20 | + publish_to_nomad=False, |
| 21 | +) |
| 22 | +nanonis = project_dir / "tests/data/nanonis" |
| 23 | + |
| 24 | +total_upload = 3 |
| 25 | + |
| 26 | +data_proc_settings = DataProcessingSettings( |
| 27 | + raw_file_exts=( |
| 28 | + ".dat", |
| 29 | + ".sxm", |
| 30 | + ), |
| 31 | + single_batch_processing_time=total_upload * 90, # seconds |
| 32 | + src_dir=nanonis, |
| 33 | + # copy_file_elsewhere=False, |
| 34 | + dst_dir="", |
| 35 | + create_pseudo_file=True, |
| 36 | + pseudo_exts=".done", |
| 37 | + spm_params_obj_l=[], |
| 38 | + sts_eln=nanonis / "sts/version_gen_5e_with_described_nxdata/eln_data.yaml", |
| 39 | + sts_config="", |
| 40 | + stm_eln=nanonis / "stm/version_gen_5_with_described_nxdata/eln_data.yaml", |
| 41 | + stm_config="", |
| 42 | + afm_eln=nanonis / "afm/version_gen_4_with_described_nxdata/eln_data.yaml", |
| 43 | + afm_config="", |
| 44 | + logger_dir=current_dir, |
| 45 | + number_of_uploads=total_upload, |
| 46 | + file_to_convert_data={ |
| 47 | + f"{nanonis / 'stm/version_gen_5_with_described_nxdata/Au_mica_2023_Y_A_diPAMY_195.sxm'}": { |
| 48 | + "eln": "", |
| 49 | + "technique": "stm", |
| 50 | + }, |
| 51 | + f"{nanonis / 'sts/version_gen_5e_with_described_nxdata/STS_nanonis_generic_5e_1.dat'}": { |
| 52 | + "eln": "", |
| 53 | + "technique": "sts", |
| 54 | + }, |
| 55 | + f"{nanonis / 'stm/version_gen_5_with_described_nxdata/Au_mica_2023_Y_A_diPAMY_195.sxm'}": { |
| 56 | + "eln": "", |
| 57 | + "technique": "stm", |
| 58 | + }, |
| 59 | + f"{nanonis / 'sts/version_gen_5e_with_described_nxdata/STS_nanonis_generic_5e_1.dat'}": { |
| 60 | + "eln": "", |
| 61 | + "technique": "sts", |
| 62 | + }, |
| 63 | + f"{nanonis / 'stm/version_gen_5_with_described_nxdata/Au_mica_2023_Y_A_diPAMY_195.sxm'}": { |
| 64 | + "eln": "", |
| 65 | + "technique": "stm", |
| 66 | + }, |
| 67 | + f"{nanonis / 'sts/version_gen_5e_with_described_nxdata/STS_nanonis_generic_5e_1.dat'}": { |
| 68 | + "eln": "", |
| 69 | + "technique": "sts", |
| 70 | + }, |
| 71 | + f"{nanonis / 'stm/version_gen_5_with_described_nxdata/Au_mica_2023_Y_A_diPAMY_195.sxm'}": { |
| 72 | + "eln": "", |
| 73 | + "technique": "stm", |
| 74 | + }, |
| 75 | + f"{nanonis / 'sts/version_gen_5e_with_described_nxdata/STS_nanonis_generic_5e_1.dat'}": { |
| 76 | + "eln": "", |
| 77 | + "technique": "sts", |
| 78 | + }, |
| 79 | + f"{nanonis / 'stm/version_gen_5_with_described_nxdata/Au_mica_2023_Y_A_diPAMY_195.sxm'}": { |
| 80 | + "eln": "", |
| 81 | + "technique": "stm", |
| 82 | + }, |
| 83 | + f"{nanonis / 'sts/version_gen_5e_with_described_nxdata/STS_nanonis_generic_5e_1.dat'}": { |
| 84 | + "eln": "", |
| 85 | + "technique": "sts", |
| 86 | + }, |
| 87 | + f"{nanonis / 'stm/version_gen_5_with_described_nxdata/Au_mica_2023_Y_A_diPAMY_195.sxm'}": { |
| 88 | + "eln": "", |
| 89 | + "technique": "stm", |
| 90 | + }, |
| 91 | + f"{nanonis / 'sts/version_gen_5e_with_described_nxdata/STS_nanonis_generic_5e_1.dat'}": { |
| 92 | + "eln": "", |
| 93 | + "technique": "sts", |
| 94 | + }, |
| 95 | + f"{nanonis / 'stm/version_gen_5_with_described_nxdata/Au_mica_2023_Y_A_diPAMY_195.sxm'}": { |
| 96 | + "eln": "", |
| 97 | + "technique": "stm", |
| 98 | + }, |
| 99 | + f"{nanonis / 'sts/version_gen_5e_with_described_nxdata/STS_nanonis_generic_5e_1.dat'}": { |
| 100 | + "eln": "", |
| 101 | + "technique": "sts", |
| 102 | + }, |
| 103 | + f"{nanonis / 'stm/version_gen_5_with_described_nxdata/Au_mica_2023_Y_A_diPAMY_195.sxm'}": { |
| 104 | + "eln": "", |
| 105 | + "technique": "stm", |
| 106 | + }, |
| 107 | + f"{nanonis / 'sts/version_gen_5e_with_described_nxdata/STS_nanonis_generic_5e_1.dat'}": { |
| 108 | + "eln": "", |
| 109 | + "technique": "sts", |
| 110 | + }, |
| 111 | + }, |
| 112 | + # metadata = { |
| 113 | + # "metadata": { |
| 114 | + # "upload_name": upload_name, |
| 115 | + # "references": ["https://doi.org/xx.xxxx/xxxxxx"], |
| 116 | + # "datasets": dataset_id, |
| 117 | + # "embargo_length": 0, |
| 118 | + # "coauthors": ["coauthor@affiliation.de"], |
| 119 | + # "comment": 'This is a test upload...' |
| 120 | + # }, |
| 121 | + # } |
| 122 | + upload_metadata={ |
| 123 | + "metadata": { |
| 124 | + "coauthors": ["cojaddl@physik.hu-berlin.de"], |
| 125 | + "upload_name": "test_upload", |
| 126 | + } |
| 127 | + }, |
| 128 | +) |
| 129 | + |
| 130 | +if __name__ == "__main__": |
| 131 | + run_uploader_with( |
| 132 | + nomad_settings=nomad_settings, |
| 133 | + data_proc_settings=data_proc_settings, |
| 134 | + ) |
0 commit comments