def schema(): """view the validation schema""" if not is_dbenv_loaded(): load_dbenv() from aiida.orm import DataFactory schema = DataFactory('crystal17.structsettings').data_schema edict.pprint(schema, depth=None, print_func=click.echo)
def show(pk, symmetries): """show the contents of a symmetryData""" node = load_node(pk) if not isinstance(node, DataFactory("crystal17.symmetry")): click.echo("The node was not of type 'crystal17.symmetry'", err=True) elif symmetries: edict.pprint(node.data, print_func=click.echo, round_floats=5) else: edict.pprint(node.attributes, print_func=click.echo)
def show(pk, content): """show the contents of a basis set""" if not is_dbenv_loaded(): load_dbenv() from aiida.orm import load_node node = load_node(pk) if not isinstance(node, get_data_class('crystal17.basisset')): click.echo("The node was not of type 'crystal17.basisset'", err=True) else: edict.pprint(node.metadata, depth=None, print_func=click.echo) if content: click.echo("---") click.echo(node.content)
def show(pk, symmetries): """show the contents of a StructSettingsData""" if not is_dbenv_loaded(): load_dbenv() from aiida.orm import load_node from aiida.orm import DataFactory node = load_node(pk) if not isinstance(node, DataFactory('crystal17.structsettings')): click.echo("The node was not of type 'crystal17.structsettings'", err=True) elif symmetries: edict.pprint(node.data, print_func=click.echo, round_floats=5) else: edict.pprint(dict(node.iterattrs()), print_func=click.echo)
def potential_list(entry_point, schema_depth): """Display a list of all available plugins.""" entry_point_group = "gulp.potentials" if entry_point: try: plugin = load_entry_point(entry_point_group, entry_point) except EntryPointError as exception: echo.echo_critical(str(exception)) else: try: echo.echo(str(plugin.get_description()), bold=True) except (AttributeError, TypeError): echo.echo_error( "No description available for {}".format(entry_point)) try: schema = plugin.get_schema() echo.echo("Data Schema:") edict.pprint(schema, depth=schema_depth, print_func=echo.echo, keycolor="blue") except (AttributeError, TypeError): echo.echo_error("No validation schema available for {}".format( entry_point)) else: entry_points = get_entry_point_names(entry_point_group) if entry_points: echo.echo( "Registered entry points for {}:".format(entry_point_group)) for registered_entry_point in entry_points: echo.echo("* {}".format(registered_entry_point)) echo.echo("") echo.echo_info( "Pass the entry point as an argument to display detailed information" ) else: echo.echo_error( "No plugins found for group {}".format(entry_point_group))
def show(node, content): """Show the contents of a basis set node.""" edict.pprint(node.metadata, depth=None, print_func=click.echo) if content: click.echo("---") click.echo(node.content)
def schema(): """view the validation schema""" schema = DataFactory("crystal17.symmetry").data_schema edict.pprint(schema, depth=None, print_func=click.echo)