#!/usr/bin/env python
'''
Command line friendly version of read_params_code.py
'''
# %% Imports
import sys
from read_params_code import read_params
import torch

# %%
if len(sys.argv) == 1 or sys.argv[1] == '--help' or sys.argv[1] == '-h':
    sys.exit("""
    # Help
    Extract J and h matrix from paramfile generated by plmc

    python read_params.py <paramfile> <h output> <J output>
    """)

else:
    h, J = read_params(sys.argv[1])

    torch.save(torch.from_numpy(h), sys.argv[2])
    torch.save(torch.from_numpy(J), sys.argv[3])
