#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Command line friendly version of read_couplings_code.py
'''
# %% Imports
import sys
from read_couplings_code import read_couplings
import torch

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

    python read_couplings.py <couplingsfile> <output>
    """)

else:
    couplings = read_couplings(sys.argv[1])
    torch.save(torch.from_numpy(couplings), sys.argv[2])
