Skip to content

Commit

Permalink
Update commandline interface (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofrusek authored Oct 17, 2023
1 parent a0fcb80 commit 47e1b56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $ hatch run test
You can quickly estimate GSD parameters from a command line interface

```shell
python3 -m gsd 0 12 13 4 0
python3 -m gsd -c 1 2 3 4 5
```

GSDParams(psi=Array(2.6272388, dtype=float32), rho=Array(0.9041536, dtype=float32))
psi=3.6667 rho=0.6000
10 changes: 3 additions & 7 deletions src/gsd/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='GSD estimator')

parser.add_argument("response", nargs=5, type=int,
metavar=("num1", "num2", "num3", "num4", "num5"),
help="List of 5 counts")

parser.add_argument("-c", nargs=5, type=int,help="List of 5 counts", required=True)
args = parser.parse_args()

hat,_ = fit_mle(data=jnp.asarray(args.response, dtype=jnp.float32))
print(hat)
hat,_ = fit_mle(data=jnp.asarray(args.o, dtype=jnp.float32))
print(f'psi={hat.psi:.4f} rho={hat.rho:.4f}')

0 comments on commit 47e1b56

Please sign in to comment.