Package: neural-compressor-ext-lab
Neural-Compressor-EXT-LABRequirementsJupyterLab >= 3.0InstallPython BackendTo install the Python source code, execute:pythonsetup.pyinstallNote: After the extension is published to the PyPI or conda-forge repositories, you can easily install the extension using pip or conda, such as:pipinstallneural-compressor-ext-labJavascript/Typescript Front-endInstall lab extension from source code with:jupyterlabextensioninstall--pyneural-compressor-ext-labNote: After the extension is published to the NPM repositories, you can easily install the extension from jupyter lab extension market and don't need to execute the above command manually.DebuggingCheck if the package has been added into the extension list:jupyterlabextensionlist
jupyterserverextensionlistIf the neural-compressor-ext-lab is not inserverextensionlist, try to enable the package to become a server extension:jupyterserverextensionenable--pyneural-compressor-ext-labdebugging tip：if the enable fails, try running:jupyterlab--ServerAPP.jpserver_extension="{'neural-compressor-ext-lab':True}"--debugUninstallTo remove the extension, execute:pipuninstallneural-compressor-ext-labAccess jupyter lab remotely using SSHLaunch the jupyter lab service on the remote server:jupyterlab--no-browser--port=8889Start SSH in a local terminal:ssh-N-f-Llocalhost:8888:localhost:8889username@serverIPContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand 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 Neural_Coder directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Rebuild extension Typescript source after making changesjlpmbuildYou 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 neededjlpmwatch# 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 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 uninstallpipuninstallneural-compressor-ext-labIn 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 namedNeural_Coderwithin that folder.Testing the extensionFrontend testsThis extension is usingJestfor JavaScript code testing.To execute them, execute:jlpm
jlpmtestIntegration testsThis extension usesPlaywrightfor the integration tests (aka user level tests).
More precisely, the JupyterLab helperGalatais used to handle testing the extension in JupyterLab.More information are provided within theui-testsREADME.Packaging the extensionSeeRELEASE