https://github.com/augustunderground/psfclj

Read PSF Traces in Clojure/Java

https://github.com/augustunderground/psfclj

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 2 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.9%) to scientific vocabulary

Keywords

bnf clojure csv java psf psf-data
Last synced: 5 months ago · JSON representation

Repository

Read PSF Traces in Clojure/Java

Basic Info
  • Host: GitHub
  • Owner: AugustUnderground
  • License: mit
  • Language: Clojure
  • Default Branch: master
  • Homepage:
  • Size: 464 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
bnf clojure csv java psf psf-data
Created about 5 years ago · Last pushed about 5 years ago
Metadata Files
Readme Changelog License

README.md

psfclj

PSF parser for JVM written in clojure.

Building

Requires Leiningen to run, see their docs for more information.

Build and Install as MAVEN dependency for Java InterOp

bash $ lein pom && lein install

Build JAR/UBERJAR

bash $ lein jar $ lein uberjar

Build Standalone Executable

Simply run make and the Makefile will take care of it. The executable will be ./target/psfconvert.

Usage

After building with lein you can run:

bash $ java -jar psfclj-0.1.0-standalone.jar [options] <psf-file>

The standalone executable can be run like so:

bash $ psfconvert [options] <psf-file>

Depending on the option, this will produce output to STDOUT. This can be redirected to a file, or processed further with something like jq or gron. If no <psf-file> is specified, it will try to read from STDIN.

Options

  • -g <grammar> Specify path to alternative <grammar>.
  • -j JSON output (default).
  • -c CSV output (values only).
  • -h or --help for a short help.

Exit States

  • 0: Success!
  • -1: Failed with parse error, usually caused by wrong sytnax.
  • -2: Erronious command line arguments.
  • -3: No output format specified.

Example

```bash

Read ./noise2.noise, pipe json output in gron,

grep for "fn.xf2" of "I0.M0.m1" and inspect with bat

$ ./target/psfconvert -j ./noise2.noise | gron | grep "I0.M0.m1" | grep "fn.xf2" | bat

Pipe json ouput into fzf for interactive search

$ ./target/psfconvert -j ./noise2.noise | gron | fzf

Read from stdin and redirect output into file

$ cat ./noise2.noise | ./target/psfconvert -c > noise2.csv ```

PSF BNF

The default grammar can be found in resources/psf.bnf:

```bnf =

*

= HEADER * | TYPE * | SWEEP * | TRACE * | VALUE * | END

= [] [] | | []

= " * "

= " * "

values = | ( * )

= #'\S+' | " * "

= | *

= FLOAT | DOUBLE | COMPLEX

= PROP( * )

= STRUCT( * ) ```

Java API Reference

After installing with

bash $ lein pom && lein install

the psfclj*.jar should be in your local repository and classpath.

Example

```java import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import clojure.lang.APersistentMap; import psfclj.PSFParser.Parser;

public class PSFParserExample {

public static void main(String[] args) throws IOException {

Parser parser = new Parser();

String psfContent = FileUtils.readFileToString(
    new File("./noise2.noise"));

APersistentMap map = parser.parsePSF(psfContent);

} } ```

TODO

  • [X] CSV Output
  • [ ] Comment Code
  • [ ] Read PSF with <unit> in VALUE section.
  • [ ] Implemented tests
  • [ ] XML Output

License

Copyright © 2020 Yannick Uhlmann

This program and the accompanying materials are made available under the terms of the the beer-ware license (Revision 42): As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

Owner

  • Name: ynk
  • Login: AugustUnderground
  • Kind: user
  • Location: Innsmouth
  • Company: @electronics-and-drives

PhD Student at Reutlingen University

GitHub Events

Total
Last Year

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 28
  • Total Committers: 2
  • Avg Commits per committer: 14.0
  • Development Distribution Score (DDS): 0.036
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Yannick Uhlmann y****n@r****e 27
Matthias Schweikardt m****t@r****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

project.clj clojars
  • instaparse 1.4.10
  • org.clojure/clojure 1.10.0
  • org.clojure/data.json 1.0.0
  • org.clojure/tools.cli 1.0.194