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 🙏

© 2024 – Pkg Stats / Ryan Hefner

simput-kemsu

v0.0.2-semantically-release

Published

Provide a simple way to write input simulation files.

Downloads

3

Readme

Simput

Goal

To provide a simple way to write input simpulation files.

Installation

$ npm install -g simput

Usage

After installing the package you will get one executable Simput with the following set of options:

$ Simput

  Usage: Simput [options]

  Options:

    -h, --help                    output usage information
    -V, --version                 output the version number

    -i, --input [file|directory]  Input file or directory
    -o, --output [directory]      Output directory to output to
    -t, --type [type]             Type of input

    --no-gui                      Just generate output
    -s, --silent                  Do not open the browser

    -c, --compile [directory]     Directory to compile files
    -m, --minify                  Minify compiled file
    -a, --add [file]              Add model to list of available inputs
    -l, --list                    List model types of available as inputs
    -r, --remove [type]           Remove model to list of available inputs

Examples

$ Simput -t pyfr -o ~/pyfr/example

Starts a server and opens your web browser, an empty PyFR model is loaded which you can modify. The Save button will export a pyfr.json file (model) which you can then be loaded later on. The Convert button will export a pyfr.ini file for PyFR execution.

As no initial model was provided, the boundary names will be autogenerated. In order to pre-define those boundary names, you can either edit the generated model (pyfr.json) or start with an empty model you've created like the following one.

my-pyfr-model.json

{
    "type": "pyfr",
    "data": {},
    "external": {
        "boundary-names": {
            "User friendly name": "value-expected-by-code",
            "Inlet": "inlet",
            "Outlet": "outlet",
            "External walls": "external-wall"
        }
    }
}

Then loading it back for further edits can be performed with the following command line:

$ Simput -i my-pyfr-model.json -o ~/pyfr/example

Demos

There are a few supplied demos in the folder types, each have their own README.

Development

$ git clone --recursive https://github.com/Kitware/simput.git
$ cd simput
$ npm install
$ npm run build
$ npm link
$ Simput

  Usage: Simput [options]

  Options:

    -h, --help                    output usage information
    -V, --version                 output the version number

    -i, --input [file|directory]  Input file or directory
    -o, --output [directory]      Output directory to output to
    -t, --type [type]             Type of input

    --no-gui                      Just generate output
    -s, --silent                  Do not open the browser

    -c, --compile [directory]     Directory to compile files
    -m, --minify                  Minify compiled file
    -a, --add [file]              Add model to list of available inputs
    -l, --list                    List model types of available as inputs
    -r, --remove [type]           Remove model to list of available inputs

Then to compile pyfr and publish it:

$ Simput -mc types/pyfr/src/ -t pyfr -o dist/types/

Degbugging

A recent version Firefox is preferred for debugging. Errors in Chrome do not always point to the exact line where the error is happening.

Creating a new simulation type

In a separate location create a folder for your type:

mkdir mytype
cd mytype
git init

Create the folder and file structure:

  • /src
    • /lang
      • /[language] e.g. "en", "fr"
        • label.json, attribute and property labels.
        • /help, help dialogs, recommended, not required
          • /[folders for each attribute]
            • [file for each property, contents are html]
    • /templates
      • [template file and helpers]
    • model.json, primary data structure.
    • convert.js, converts the model into the simulation deck format.
    • parse.js, converts a complete input file to the simput model; recommended, not required.
  • /samples, empty or partially full sample datasets; recommended, not required.
  • /versions, an output folder for your compiled type; recommended, not required.
  • README.md, a description of your type; recommended, not required.

For examples of each take a look at types/demo

Optional: Add the type as a submodule to this repository

It's critical that these are executed in order

git checkout -b type-[mytype] #replace 'mytype' with the name of the new type
git commit -m "initial commit"
git remote add origin https://github.com/Kitware/simput.git
git push origin [mytype-branch] # where 'mytype-branch' is the current branch name
cd [your simput repo]
git submodule add -b [mytype-branch] https://github.com/kitware/simput types/[mytype]
git add .gitmodules types/
git commit -m "added [mytype]"
git push

Licensing

Simput is licensed under BSD Clause 3.

Getting Involved

Fork our repository and do great things. At Kitware, we've been contributing to open-source software for 15 years and counting, and want to make Simput useful to as many people as possible.