Package: jlab-aiidatree
jlab_aiidatree [IN-DEVELOPMENT]A JupyterLab extension for exploringAiiDAdatabases.
This is extension is intended to provide similar functionality for exploring graphs as the VS CodeAiiDA Explorer extension:View ProcessesFilter by process stateExpand processes with their incoming/outgoing nodesView node attributes stored on the databaseVisualise node graphs (with D3 Graph)VisualiseStructureData(the ThreeJS)This extension is composed of a Python package namedjlab_aiidatreefor the server extension and a NPM package namedjlab_aiidatreefor the frontend extension.InstallTo install the extension, execute:pipinstalljlab_aiidatreeor also with aiida-core:pipinstalljlab_aiidatree[aiida]reentryscanUsageConnecting to AiiDAYou can connect to an AiiDA instance in one of two ways:Directly usingaiida-core, installed in the same environment asjupyterlab(the default).Through an AiiDA instance serving the AiiDA REST API.To start an AiiDA REST server, firstlyaiida-coremust be installed with therestextra dependencies:pipinstallaiida-core[rest]~=1.6
reentryscanIt is best to install this into a separate environment than you have your jupyterlab installation, to avoid dependency clashes.Then you can start the REST server:$verdirestapi-H127.0.0.5-P6789* REST API running on http://127.0.0.5:6789/api/v4To connect to this server, simply change therest_urlsetting to this URL::::{seealso}https://aiida.readthedocs.io/projects/aiida-core/en/latest/howto/share_data.html?highlight=REST#launching-the-rest-api::::::{important}
The URL is connected to from the server side of JupyterLab, i.e. where you are hosting it and not necessarily on your local machine.
:::UninstallTo remove the extension, execute:pipuninstalljlab_aiidatreeRequirementsJupyterLab >= 3.0TroubleshootIf you are seeing the frontend extension, but it is not working, check
that the server extension is enabled:jupyterserverextensionlistIf the server extension is installed and enabled, but you are not seeing
the frontend extension, check the frontend extension is installed:jupyterlabextensionlistComing FeaturesView Computers and attached codesView Groups and attached nodesContributingDevelopment installNote: You will need NodeJS to build the extension package, e.g.condacreate-njupyterlab-ext--override-channels--strict-channel-priority-cconda-forge-canacondajupyterlab=3nodejsjupyter-packagingaiida-core~=1.6
condaactivatejupyterlab-ext
reentryscanThejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the jlab_aiidatree directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Server extension must be manually installed in develop modejupyterserverextensionenablejlab_aiidatree# Rebuild extension Typescript source after making changesjlpmrunbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmrunwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm run buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseDevelopment uninstall# Server extension must be manually disabled in develop modejupyterserverextensiondisablejlab_aiidatree
pipuninstalljlab_aiidatreeIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedjlab_aiidatreewithin that folder.DeployingSeehttps://jupyterlab.readthedocs.io/en/stable/extension/extension_tutorial.html#packaging-your-extension:Update thepackage.jsonversion keyRebuild the package:jlpm run buildEnsure all linting and tests passBuild the distributionpipinstallbuild
rm-rfdist
python-mbuild-s
python-mbuildUpload to PyPI usingtwinepipinstalltwine
twineupload--skip-existingdist/*