Package: benten
BentenThis is alanguage serverforCommon Workflow Languagedocuments.Features(Click for feature screenshot gallery)Syntax highlighting (CWL and JS)Evaluate expression on hoverFile path autocomplete for linked files inrunfieldPort completion for workflowNavigate to linked sub-workflows and includes (Jump to definition)Outline view (Symbols) + Step symbolsType validationsPort validationsDisplay language documentation on hoverBentenis written using Python3 and developed against VS Code. The language
server component will work with any editor/IDE that offers language server
support. Syntax highlighting is currently only available for the VS Code
extension. The VS Code extension is written in Typescript.Install VS Code extensionSearch for
"Benten"
in the marketplace. The name of the client extension is Rabix/benten. Follow the
usual method to install the extension.If you have not installed the Benten server separately (see below) then the
client will attempt to find and download a matching server version from the
github releases page.Server installationBenten requiresPython 3.7 or laterIf you will be installing from source you will needgiton your systemUsing pipxA neat way to installbentenin a virtual env (isolating it from your
system python) and still be able to call it as a regular executable is
to usepipxpip3 install pipx  # in case you don't have pipx
pipx ensurepath # ensures CLI application directory is on your $PATHNow you can install Benten withpipx install bentenIf you already have Benten installed you can upgrade itpipx upgrade bentenIf your base python install is earlier than 3.7 you can tellpipxto use 3.7 for Bentenpipx install benten --python python3.7Notes:pipxinstalls the executables in$HOME/.local/bin(%HOMEPATH%\.local\binfor Windows). This needs to be added to your
PATH env variable.pipx ensurepathdoes this for youpipx installcan be done from within another virtual environment.
This is helpful when you have an incompatible global version of
Python which you wish to keep but still want to install Benten. You
can create a virtual env with Python > 3.7 and invoke the
installation commands from there.If you are using VS Code, if you install the server after loading a CWL file
you will have to restart VS Code.Special instructions for Ubuntu Linuxsudo apt install python3-pip python3-venvNote for WindowsIf you are trying to reinstall or updating the server on windows with
the server running (e.g. because you have VS Code running), you will
have to shutdown the server (e.g. by exiting VS Code) before updating.Installing versions directly from githubTo install from the master branchpipx install git+https://github.com/rabix/benten.gitTo install from develop branch (or some other branch):pipx install git+https://github.com/rabix/benten.git@developOr, if you have cloned the repository and want to play with the server
code itself:pipx install -e benten  # benten is the name of the directory with the cloned codeUsing with VI/VimSeethis pageplease.Expression evaluations on hoverHovering over an expression will display the result of the evaluation or
any errors that are encountered. Benten auto-generates sample process
inputs, outputs and intermediate outputs (if the process is a workflow).
Note that these are all randomly generated sample data meant for quick
sanity checking of expressions.Over-riding auto-generated sample dataThe sample data is auto-generated on demand when an evaluation is
requested. The generated sample data is also stored in a scratch file.
This scratch file can be accessed by clicking "go to definition" when
over any expression. Normally this file is just overwritten each time
with fresh, randomly generated data.If you wish to customize some of the sample data (for example you have
specific test cases you want to check as you code the workflow) if you
add the string (exactly)#customto the first line of the sample data file, Benten will stop overwriting
the file and use the contents of this customized file instead.Once you add this line to the sample data file, Benten will no longer
overwrite this file. If you want the test data to be regenerated (e.g.
you've changed the input schema of the CWL) you need to remove this
first sentinel line and Benten will regenerate the input.Other tips and TricksBenten attaches onto your regular text editor and offers help by
way of auto-completions and document validations, so most of its
functionality is exposed naturally via the editor's regular UI, and a
specialized tutorial is not necessary, but some helpfultips and tricksare listed in this page.For developersSee thedevelopment documentationLicenseApache 2.0AcknowledgmentsPeter Amstutzfor the PyInstaller formula and the
auto-downloading feature on the VS Code extension.Peter van Heusdenfor the
Benten Condadistribution.The low level client-server communicationcodeis taken fromSourcegraph's
(now defunct) Python Language Serveras is the VS Code client code (which
was based originally off Microsoft's example code). The CWL preview usesvis.jsWhat's in a name?Saraswatiis the Hindu goddess of learning and knowledge and a long time ago
she visited Japan, where she is known asBenzaiten(Bentenfor short) and
her sitar has morphed into a Japanesebiwabut she has kept some of her many arms.Benzaiten is the goddess of everything that flows: water, time, words, speech,
eloquence, music and by extension, knowledge. ThereforeBentenis an
appropriate goddess for scientific workflow developers.ReferencesWikipedia pageBenzaiten (Benten): Japan’s Goddess of Reason- a much more detailed history(c) 2019-2021 Seven Bridges Genomics. Rabix is a registered trademark of Seven Bridges Genomics