From 2b284fb8ea428d31e52543679e4c7a99adf0a44c Mon Sep 17 00:00:00 2001 From: Julian Geiger Date: Sat, 23 Mar 2024 16:24:43 +0100 Subject: [PATCH] Updated text boxes --- .../source/intro/_cheatsheet/cheatsheet_h.svg | 5526 +++++++++-------- docs/source/intro/cheatsheet.rst | 8 +- 2 files changed, 3087 insertions(+), 2447 deletions(-) diff --git a/docs/source/intro/_cheatsheet/cheatsheet_h.svg b/docs/source/intro/_cheatsheet/cheatsheet_h.svg index 8ea3f3c92d..86af3ce34b 100644 --- a/docs/source/intro/_cheatsheet/cheatsheet_h.svg +++ b/docs/source/intro/_cheatsheet/cheatsheet_h.svg @@ -16462,8 +16462,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.9045864" - inkscape:cx="2758.3416" - inkscape:cy="232.85895" + inkscape:cx="1646.0267" + inkscape:cy="855.56633" inkscape:document-units="px" inkscape:current-layer="layer3" showgrid="false" @@ -17074,34 +17074,34 @@ style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:12px;line-height:1.25;font-family:'Helvetica Neue';-inkscape-font-specification:'Helvetica Neue Light';font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:0px;word-spacing:0px;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;white-space:pre;shape-inside:url(#rect506);display:inline;fill:#001427;fill-opacity:1;stroke:none;stroke-width:1.067;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1">aiida-project aiida-project aiida-shell aiida-shell aiida-submission-controller aiida-submission-controller aiida-resource-registry aiida-resource-registry aiida-plugin-cutter aiida-plugin-cutter aiidalabaiidalab  from aiida.orm import QueryBuilder  qb = QueryBuilder() qb.append(Node, tag="nodes", project="*")   qb.append(Group, with_node="nodes", filters={"label": "tutorial"})   qb.all()         from aiida.orm import QueryBuilder  qb = QueryBuilder() qb.append(Node, tag="nodes", project="*")   qb.append(Group, with_node="nodes", filters={"label": "tutorial"})   qb.all()       Main attributes and methodsMain attributes and methods**Get all key/valuesReplace all key/valuesverdi tips and tricks$ verdi calcjob dump <pk>$ verdi process dump <pk>$ verdi workchain dump <pk>$ verdi calcjob dump <pk>verdi command-line API**Not exhaustive*Most options also implement show/list/delete*Most options also implement show/list/deleteTools of the tradeImport aiida-core Node classes from aiida.orm:from aiida.orm import Dict, CalcJobNodeLoad Nodes via pk, UUID, or label:from aiida.orm import load_nodemy_node = load_node(<identifier>)Import Data classes via the DataFactory:(Note: Prefix AiiDA core types with core)my_kpts = DataFactory("core.array.kpoints")Import CalcJob classes via the CalculationFactory:my_calcjob = CalculationFactory( "quantumespresso.pw")Import WorkChain classes via the WorkflowFactory.my_workflow = WorkflowFactory( "quantumespresso.pw.bands")Thecheat sheetverdicomputerdataprocesscodenodecalcjobshellworkchaingroupcreateexportcleanworkdirgotocomputer[input/output]catconfiguresetupcore.arraycore.dictcore.structuregraphrepo[add/move/remove]-nodesplayreportstatuscleanworkdirdumpTools of the tradeImport aiida-core Node classes from aiida.orm:from aiida.orm import Dict, CalcJobNodeImport Nodes via pk, UUID, or label:my_node = load_node(<identifier>)Import Data classes via the DataFactory:(Note: Prefix AiiDA core types with core)my_kpts = DataFactory("core.array.kpoints")Import CalcJob classes via the CalculationFactory:my_calcjob = CalculationFactory( "quantumespresso.pw")Import WorkChain classes via the WorkflowFactory.my_workflow = WorkflowFactory( "quantumespresso.pw.bands")Thecheat sheetv2.5.1v2.5.1Fetch all nodes of group "tutorial"Print the smearing energy calculated for BaO3Ti if it is smaller than 10Materials Science example → Smearing energy for BaO3Ti if smaller than 10-4 eV aetheWorkflowNodeWorkChainNodeaNodeNode IDShort labelUnique IDCreation timeModification timeGet inputGet outputAll inputs generatorAll outputs generatorQueryable attributesAttribute 'k'Queryable extrasExtra 'k'Set extra k = vAll commentsAdd comment with content <c>Save node in DBpklabeluuidctimemtimeget_incoming()get_outgoing()inputsoutputsattributesget_attribute(k)extrasget_extra(<k>)set_extra( <k>,<v>) get_comments()add_comment(<c>) store()store()KpointsDataset_kpoints(<k>)  get_kpoints() set_kpoints_mesh( <m>)get_kpoints_mesh()  Set an explicit list ofkpoints 'k' (optionallywith weights)Get explicit list of kpts(if stored explicitly)Set an implicit mesh(e.g. 'm'=3x2x5)Get the implicit mesh(if stored implicitly)qb = QueryBuilder()qb.append( StructureData, filters={"extras.formula":"BaO3Ti"}, project=["extras.formula"], tag="structure"StructureDataqb.append(Lattice vectors CalcJobNode,Atomic sites tag="calculation",Species with masses, with_incoming="structure"symbols, ...Periodic bound. cond.qb.append(along each axis Dict,Chemical formula tag="results",Compute cell volume filters={"attributes.energy_smearing":Convert to ASE, {"<=":-0.0001}},pymatgen, ... project=[Set lattice vectors "attributes.energy_smearing",Create cell from ASE "attributes.energy_smearing_units"Create cell from ],pymatgen with_incoming="calculation"Add atom of type<symb>qb.all()Nodeproject = "*"Groupfilters = {"label": "tutorial"}at position <p>with_nodeCodeload_code(<id>) get_builder() Load code using pk,UUID, or labelReturn new builderusing this codeGet value for key 'k'Get all keys generatorGet all key/valuesReplace all key/valuesdict.<k>keys()get_dict()set_dict(<dict>)NodeNode IDShort labelUnique IDCreation timeModification timeGet inputGet outputAll inputs generatorAll outputs generatorQueryable attributesAttribute 'k'Queryable extrasExtra 'k'Set extra k = vAll commentsAdd comment with content <c>Save node in DBpklabeluuidctimemtimeget_incoming()get_outgoing()inputsoutputsattributesget_attribute(k)extrasget_extra(<k>)set_extra( <k>,<v>) get_comments()add_comment(<c>) store()cellsiteskinds pbc get_formula()get_cell_volume()convert(<fmt>) set_cell(<c>)set_ase(<a>)set_pymatgen(<p>)get_incoming() get_outgoing()append_atom(-> Move to CalcJobNode? symbols=<symb>, position=<p>)KpointsDataset_kpoints(<k>)  get_kpoints() set_kpoints_mesh( <m>)get_kpoints_mesh()  CalcJobNode -> ProcessNode???Set an explicit list ofCalc. process stateExit status or int codeHas calc. finished?Has calc. failed?Computer where it isrunningCode used to runScheduler job IDGet # machines, MPIprocs per machine, ...Value of parsed output 'k'process_stateexit_statuskpoints 'k' (optionallyis_finishedwith weights)is_failedGet explicit list of kptscomputer(if stored explicitly) Set an implicit meshinputs.code(e.g. 'm'=3x2x5)get_job_id()Get the implicit meshget_options()(if stored implicitly) res.<k>qb = QueryBuilder()qb.append( StructureData, project=["extras.formula"], filters={"extras.formula":"BaO3Ti"}, tag="structure") qb.append( CalcJobNode, tag="calculation", with_incoming="structure") qb.append( Dict, tag="results", filters={"attributes.energy_smearing":Node properties and operations {"<=":-0.0001}},Short label project=[Verbose description "attributes.energy_smearing",Node ID "attributes.energy_smearing_units"Unique ID ],Creation time with_incoming="calculation")Modification time Node typeqb.all()Nodeproject = "*"Groupfilters = {"label": "tutorial"}Store node in dbwith_nodeCodeload_code(<id>) get_builder() labeldescriptionpkuuidctimemtimenode_typestore()Accessed via node.base.Load code using pk,UUID, or labelattributesReturn new builderattributes.allusing this codeattributes.get()Get value for key 'k'attributes.set()Get all keys generatorextrasGet all key/valuesrepositoryReplace all key/valueslinksdict.<k>Get NodeAttributeskeys()Attributes as dictget_dict()Get attributeset_dict(<dict>)Set attributeLike the attributesGet NodeRepositoryGet the NodeLinksCalcJobNodeStructureDataCalc. process stateLattice vectorsExit status or int codeAtomic sitesHas calc. finished?Species with masses,Has calc. failed?symbols, ...Computer where it isPeriodic bound. cond.runningalong each axisCode used to runChemical formulaScheduler job IDCompute cell volumeConvert to ASE,pymatgen, ...Set lattice vectorsCreate cell from ASECreate cell frompymatgenAdd atom of type<symb>at position <p>cellsiteskindsGet # machines, MPI procs per machine, ...pbcValue of parsed output 'k' process_stateget_formula()exit_statusget_cell_volume()is_finishedconvert(<fmt>)is_failed computerset_cell(<c>) set_ase(<a>)inputs.codeset_pymatgen(<p>)get_job_id() get_options()append_atom(  symbols=<symb>,res.<k> position=<p>)** Properties implement getter/setter methods** Inheritance from Node ensures provenanceNodeStructureData (Data)Node IDShort labelLattice vectorsUnique IDGet lattice vectorsCreation timeSet lattice vectorsModification timeCompute cell volumeGet inputPeriodic bound. cond.Get outputalong each axisAll inputs generatorAtomic sitesAll outputs generatorSpecies with masses,Queryable attributessymbols, ...Attribute 'k'Chemical formulaQueryable extrasCreate from ASEExtra 'k'Create from pymatgenSet extra k = vConvert to ASE,pymatgen, ...All commentsGet as CifDataAdd comment with Add atom of typecontent <c><symb>Save node in DBat position <p>pkcelllabelget_cell()uuidset_cell(<c>)ctimeget_cell_volume()mtimepbcget_incoming()get_outgoing()sitesinputskindsoutputs attributesget_formula()get_attribute(k)set_ase(<a>)extrasset_pymatgen(<p>)get_extra(<k>)convert(<fmt>)set_extra( <k>,<v>) get_cif() get_comments()append_atom(add_comment(<c>) symbols=<symb>, position=<p>store()get_incoming()get_outgoing()-> Move to CalcJobNode?)CalcJobNode (ProcessNode)CalcJob inputsCalcJob outputsExecuted CodeExecution ComputerRemote directoryCalcJob optionsGet ResultManagerResults as dictinputsoutputsinputs.codecomputerget_remote_\ workdir()get_options()resres.get_results()WorkChain (Process)WorkChain specificationWorkChain inputsWorkChain outputsWorkChain outlineWorkChain exit codesContext → Data containerof the WorkChainAdd data to the contextspecspec.inputsspec.outputsspec.outlinespec.exit_codectxto_contextProcessNode (Node)Process exit statusParent process that called this processDirectly called child processesfinished / finished_ok / failed / stored / etc.?class / label / state / status / typeGet a prepopulated builder for restartingexit_statuscallercalledis_<property>process_<property>get_builder_restart()KpointsData (Data)Set explicit list of kptsGet explicit list of kptsGet the reciprocal cellset_kpoints(<k)get_kpoints()reciprocal_cellverdicomputerdataprocessnodeshellgroupCalcJobNode -> ProcessNode???createCalc. process stateExit status or int codeHas calc. finished?Has calc. failed?Computer where it isrunningCode used to runScheduler job IDGet # machines, MPIprocs per machine, ...Value of parsed output 'k'exportcleanworkdirgotocomputer(input|output)catconfiguresetupcore.arraycore.dictcore.structuregraphrepo(add|move|remove)-nodesplayreportstatuscodecalcjobarchiveprocess_stateexit_statusis_finishedis_failedcomputer inputs.codeget_job_id()get_options() res.<k>Node properties and operationsShort labelVerbose descriptionNode IDUnique IDCreation timeModification timeAll inputs generatorAll outputs generatorNode typeStore node in dblabeldescriptionpkuuidctimemtimeinputsoutputsnode_typestore()createimportinfoAccessed via node.baseattributesattributes.allattributes.get(<k>)attributes.set( <k>, v>)→ Same behavior for node extrasNodeAttributesAttributes as dictGet attribute kSet attribute k=vGroupfilters = {"label": "tutorial"}StructureDatafilters = { 'extras.formula': 'BaO3Ti'}project = ['extras.formula']tag = 'structure'`.