def uploadfamily(*args): """ Upload a new PSF-pseudopotential family. Returns the numbers of files found and the number of nodes uploaded. Call without parameters to get some help. """ print(args) if not len(args) == 3 and not len(args) == 4: print(("Usage:"), file=sys.stderr) print(("./uploadfamily.py FOLDER_NAME <group_name> <group_description> " "[OPTIONAL: --stop-if-existing]\n"), file=sys.stderr) sys.exit(1) folder = args[0] group_name = args[1] group_description = args[2] stop_if_existing = False if len(args) == 4: if args[3] == "--stop-if-existing": stop_if_existing = True else: print('Unknown directive: ' + args[3], file=sys.stderr) sys.exit(1) if (not os.path.isdir(folder)): print('Cannot find directory: ' + folder, file=sys.stderr) sys.exit(1) files_found, files_uploaded = psf.upload_psf_family( folder, group_name, group_description, stop_if_existing) print("PSF files found: {}. New files uploaded: {}".format( files_found, files_uploaded))
def psf_uploadfamily(folder, group_label, group_description, stop_if_existing): """ Create a new PSF family from a folder of PSF files. THIS COMMAND IS DEPRECATED AND WILL BE REMOVED IN aiida-siesta v2.0. Use `aiida-pseudo install` instead. Returns the numbers of files found and the number of nodes uploaded. Call without parameters to get some help. """ from aiida_siesta.data.psf import upload_psf_family files_found, files_uploaded = upload_psf_family(folder, group_label, group_description, stop_if_existing) echo.echo_success('PSF files found: {}. New files uploaded: {}'.format(files_found, files_uploaded))
def psf_uploadfamily(folder, group_label, group_description, stop_if_existing): """ Create a new PSF family from a folder of PSF files. Returns the numbers of files found and the number of nodes uploaded. Call without parameters to get some help. """ from aiida_siesta.data.psf import upload_psf_family files_found, files_uploaded = upload_psf_family(folder, group_label, group_description, stop_if_existing) echo.echo_success('PSF files found: {}. New files uploaded: {}'.format( files_found, files_uploaded))
def uploadfamily(name, description, stop_if_existing, directory): """ Upload a collection of *.psf files from specified directory to a new pseudopotential family. Returns the numbers of files found and the number of nodes uploaded. """ from aiida import is_dbenv_loaded, load_dbenv if not is_dbenv_loaded(): load_dbenv() import aiida_siesta.data.psf as psf files_found, files_uploaded = psf.upload_psf_family( directory, name, description, stop_if_existing) click.echo("PSF files found: {}. New files uploaded: {}".format( files_found, files_uploaded))
# default basis basis = ParameterData( dict={ # 'pao-energy-shift': '100 meV', # '%block pao-basis-sizes': """ # Si DZP """, '%block pao-basis': block_pao_basis_content, }) max_iterations = Int(5) # upload pseudos folder = './siesta-files' pseudo_family = 'example-siesta-pps' pseudo_family_desc = "Siesta Pseudopotentials for example structures" files_found, files_uploaded = psf.upload_psf_family(folder, pseudo_family, pseudo_family_desc, stop_if_existing=False) pseudo_family = Str('example-siesta-pps') print("PSF files found: {}. New files uploaded: {}").format( files_found, files_uploaded) # kwargs kwargs = {} for name in ('pseudo_family', 'parameters', 'settings', 'basis'): kwargs[name] = locals()[name]