import numpy as np
from numba import njit

@njit
def unstack_txt(txt):
    inVc=txt[...,0:2]
    outVc=txt[...,2:4]
    inmhjdfx=txt[...,4:10]
    outmhjdfx=txt[...,10:16]
    dVcdt=txt[...,16:18]
    return inVc,outVc,inmhjdfx,outmhjdfx,dVcdt
@njit
def stack_txt(inVc,outVc,inmhjdfx,outmhjdfx,dVcdt):
    txt=np.stack((
        inVc[...,0],
        inVc[...,1],
        outVc[...,0],
        outVc[...,1],
        inmhjdfx[...,0],
        inmhjdfx[...,1],
        inmhjdfx[...,2],
        inmhjdfx[...,3],
        inmhjdfx[...,4],
        inmhjdfx[...,5],
        outmhjdfx[...,0],
        outmhjdfx[...,1],
        outmhjdfx[...,2],
        outmhjdfx[...,3],
        outmhjdfx[...,4],
        outmhjdfx[...,5],
        dVcdt[...,0],
        dVcdt[...,1]
    )).T
    return txt

# @njit
def stack_pxl(inVc,outVc,inmhjdfx,outmhjdfx,dVcdt):
    '''not efficient.  returns txt_val as numpy array'''
    txt_val=np.stack((
        inVc[0],
        inVc[1],
        outVc[0],
        outVc[1],
        inmhjdfx[0],
        inmhjdfx[1],
        inmhjdfx[2],
        inmhjdfx[3],
        inmhjdfx[4],
        inmhjdfx[5],
        outmhjdfx[0],
        outmhjdfx[1],
        outmhjdfx[2],
        outmhjdfx[3],
        outmhjdfx[4],
        outmhjdfx[5],
        dVcdt[0],
        dVcdt[1]
    )).T
    return txt_val

56ed9cdf4c7bbbb1b9649be9670dc36ff5a6685e
<mask token>


@njit
def unstack_txt(txt):
    inVc = txt[..., 0:2]
    outVc = txt[..., 2:4]
    inmhjdfx = txt[..., 4:10]
    outmhjdfx = txt[..., 10:16]
    dVcdt = txt[..., 16:18]
    return inVc, outVc, inmhjdfx, outmhjdfx, dVcdt


<mask token>

<mask token>


@njit
def unstack_txt(txt):
    inVc = txt[..., 0:2]
    outVc = txt[..., 2:4]
    inmhjdfx = txt[..., 4:10]
    outmhjdfx = txt[..., 10:16]
    dVcdt = txt[..., 16:18]
    return inVc, outVc, inmhjdfx, outmhjdfx, dVcdt


<mask token>


def stack_pxl(inVc, outVc, inmhjdfx, outmhjdfx, dVcdt):
    """not efficient.  returns txt_val as numpy array"""
    txt_val = np.stack((inVc[0], inVc[1], outVc[0], outVc[1], inmhjdfx[0],
        inmhjdfx[1], inmhjdfx[2], inmhjdfx[3], inmhjdfx[4], inmhjdfx[5],
        outmhjdfx[0], outmhjdfx[1], outmhjdfx[2], outmhjdfx[3], outmhjdfx[4
        ], outmhjdfx[5], dVcdt[0], dVcdt[1])).T
    return txt_val

<mask token>


@njit
def unstack_txt(txt):
    inVc = txt[..., 0:2]
    outVc = txt[..., 2:4]
    inmhjdfx = txt[..., 4:10]
    outmhjdfx = txt[..., 10:16]
    dVcdt = txt[..., 16:18]
    return inVc, outVc, inmhjdfx, outmhjdfx, dVcdt


@njit
def stack_txt(inVc, outVc, inmhjdfx, outmhjdfx, dVcdt):
    txt = np.stack((inVc[..., 0], inVc[..., 1], outVc[..., 0], outVc[..., 1
        ], inmhjdfx[..., 0], inmhjdfx[..., 1], inmhjdfx[..., 2], inmhjdfx[
        ..., 3], inmhjdfx[..., 4], inmhjdfx[..., 5], outmhjdfx[..., 0],
        outmhjdfx[..., 1], outmhjdfx[..., 2], outmhjdfx[..., 3], outmhjdfx[
        ..., 4], outmhjdfx[..., 5], dVcdt[..., 0], dVcdt[..., 1])).T
    return txt


def stack_pxl(inVc, outVc, inmhjdfx, outmhjdfx, dVcdt):
    """not efficient.  returns txt_val as numpy array"""
    txt_val = np.stack((inVc[0], inVc[1], outVc[0], outVc[1], inmhjdfx[0],
        inmhjdfx[1], inmhjdfx[2], inmhjdfx[3], inmhjdfx[4], inmhjdfx[5],
        outmhjdfx[0], outmhjdfx[1], outmhjdfx[2], outmhjdfx[3], outmhjdfx[4
        ], outmhjdfx[5], dVcdt[0], dVcdt[1])).T
    return txt_val

import numpy as np
from numba import njit


@njit
def unstack_txt(txt):
    inVc = txt[..., 0:2]
    outVc = txt[..., 2:4]
    inmhjdfx = txt[..., 4:10]
    outmhjdfx = txt[..., 10:16]
    dVcdt = txt[..., 16:18]
    return inVc, outVc, inmhjdfx, outmhjdfx, dVcdt


@njit
def stack_txt(inVc, outVc, inmhjdfx, outmhjdfx, dVcdt):
    txt = np.stack((inVc[..., 0], inVc[..., 1], outVc[..., 0], outVc[..., 1
        ], inmhjdfx[..., 0], inmhjdfx[..., 1], inmhjdfx[..., 2], inmhjdfx[
        ..., 3], inmhjdfx[..., 4], inmhjdfx[..., 5], outmhjdfx[..., 0],
        outmhjdfx[..., 1], outmhjdfx[..., 2], outmhjdfx[..., 3], outmhjdfx[
        ..., 4], outmhjdfx[..., 5], dVcdt[..., 0], dVcdt[..., 1])).T
    return txt


def stack_pxl(inVc, outVc, inmhjdfx, outmhjdfx, dVcdt):
    """not efficient.  returns txt_val as numpy array"""
    txt_val = np.stack((inVc[0], inVc[1], outVc[0], outVc[1], inmhjdfx[0],
        inmhjdfx[1], inmhjdfx[2], inmhjdfx[3], inmhjdfx[4], inmhjdfx[5],
        outmhjdfx[0], outmhjdfx[1], outmhjdfx[2], outmhjdfx[3], outmhjdfx[4
        ], outmhjdfx[5], dVcdt[0], dVcdt[1])).T
    return txt_val

import numpy as np
from numba import njit

@njit
def unstack_txt(txt):
    inVc=txt[...,0:2]
    outVc=txt[...,2:4]
    inmhjdfx=txt[...,4:10]
    outmhjdfx=txt[...,10:16]
    dVcdt=txt[...,16:18]
    return inVc,outVc,inmhjdfx,outmhjdfx,dVcdt
@njit
def stack_txt(inVc,outVc,inmhjdfx,outmhjdfx,dVcdt):
    txt=np.stack((
        inVc[...,0],
        inVc[...,1],
        outVc[...,0],
        outVc[...,1],
        inmhjdfx[...,0],
        inmhjdfx[...,1],
        inmhjdfx[...,2],
        inmhjdfx[...,3],
        inmhjdfx[...,4],
        inmhjdfx[...,5],
        outmhjdfx[...,0],
        outmhjdfx[...,1],
        outmhjdfx[...,2],
        outmhjdfx[...,3],
        outmhjdfx[...,4],
        outmhjdfx[...,5],
        dVcdt[...,0],
        dVcdt[...,1]
    )).T
    return txt

# @njit
def stack_pxl(inVc,outVc,inmhjdfx,outmhjdfx,dVcdt):
    '''not efficient.  returns txt_val as numpy array'''
    txt_val=np.stack((
        inVc[0],
        inVc[1],
        outVc[0],
        outVc[1],
        inmhjdfx[0],
        inmhjdfx[1],
        inmhjdfx[2],
        inmhjdfx[3],
        inmhjdfx[4],
        inmhjdfx[5],
        outmhjdfx[0],
        outmhjdfx[1],
        outmhjdfx[2],
        outmhjdfx[3],
        outmhjdfx[4],
        outmhjdfx[5],
        dVcdt[0],
        dVcdt[1]
    )).T
    return txt_val
