npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tree-sitter-turbowave

v1.7.1

Published

turbowave input file language

Readme

TurboWAVE Parser

This package provides a parser for turboWAVE input files. It enables the following:

  • Language services for certain editors
  • Python chemistry codes that want to utilize the SPARC database
  • Python tools for turboWAVE that need to parse the input file
  • Eventually the native turboWAVE parser may be replaced by tree-sitter parsing

While our emphasis is C++ and Python, the parser can be called from several languages. Details can be found in the tree sitter documentation.

Parsing with Python

Build the library

  1. Clone the tree-sitter-turbowave repository

  2. Activate your Python environment and run pip install tree-sitter

  3. Enter your project directory and run the following Python program

from tree_sitter import Language
Language.build_library('languages.so',['path/to/tree-sitter-turbowave'])

Once you have languages.so you can delete the local tree-sitter-turbowave repository if you wish.

Sample Python Parsing Script

The following code takes an input file path as the argument, and prints the top level node types. Note this code assumes languages.so is in the working directory.

import sys
from tree_sitter import Language, Parser

if len(sys.argv)!=2:
	raise ValueError('Please provide one argument, the file to parse.')

twlang = Language('languages.so','turbowave')
parser = Parser()
parser.set_language(twlang)

with open(sys.argv[1]) as f:
	code = f.read()

tree = parser.parse(bytes(code,"utf8"))

for child in tree.root_node.children:
	print(child.type)

Sample turboWAVE Input File

This is a SPARC database file with bare bones argon plasma chemistry.

new chemical e
{
	charge = -1.0
	mass = 1.0
	cv = 1.5
}

new group heavies
{
	new chemical Ar
	{
		charge = 0.0
		mass = 73440
		cv = 1.5
		thermometric conductivity = %1cm2s
	}
	new chemical Ar[+]
	{
		charge = 1.0
		mass = 73439
		cv = 1.5
		thermometric conductivity = %1cm2s
	}
	new chemical Ar2[+]
	{
		charge = 1.0
		mass = 146879
		cv = 2.5
		thermometric conductivity = %1cm2s
	}
	mobile = true
}

new collision = e <-> Ar[+] , coulomb
new collision = e <-> Ar , cross section = 1e-16 // appropriate for 1 eV
new collision = e <-> Ar2[+] , coulomb

// detailed balanced impact ionization and 3-body recombination
new reaction = { Ar -> Ar[+] : e -> e + e - 15.76 } rate = 5.33e-5 -3.0 15.76 e(:)
new reaction = { Ar[+] + e + e -> Ar + e + 15.76 } rate = 8.75e-27 -4.5 0.0 e(:)

// radiative recombination, photon is assumed to leave system
new reaction = { Ar[+] + e -> Ar } rate = 2.7e-13 -0.5 0.0 e(:)

// molecular argon
new reaction = { Ar[+] + Ar + Ar -> Ar2[+] + Ar + 2.61 } rate = 2.55e-31 0.0 0.0 e(:)
new reaction = { Ar2[+] + e -> Ar + Ar + 13.15 } rate = 5.4e-8 -0.667 0.0 e(:)