garrettwrong / cuTWED

Linear memory CUDA Time Warp Edit Distance
GNU General Public License v3.0
28 stars 4 forks source link

Q: is this a typo in the doc? #30

Closed mw66 closed 2 years ago

mw66 commented 2 years ago

https://github.com/garrettwrong/cuTWED/blob/master/cuTWED/cuTWED.py#L216

    AA, BA  : Numpy C Arrays of time series values.
              size, (nAA,nA,dim) and (nBB,nA,dim)

should it be:

              size, (nAA,nA,dim) and (nBB,*nB*,dim)

i.e. nA may not == nB

because in https://github.com/garrettwrong/cuTWED/blob/master/cuTWED/cuTWED.py#L263

    ret_code = func(caster(AA), nA, caster(TAA),
                    caster(BB), nB, caster(TBB),
                    nu, lamb, degree, dim,
                    nAA, nBB, caster(RRes), _get_tri_opt(tri))

nA, and nB are passed separately into func (i.e. lib.twed_batch)

If the requirement is that nA == nB, can we add a special note to the doc string to stress this fact? and also add an assertion on https://github.com/garrettwrong/cuTWED/blob/master/cuTWED/cuTWED.py#L240

    assert(nA == nB)   # to make this requirement more clear

and also on https://github.com/garrettwrong/cuTWED/blob/master/cuTWED/cuTWED.py#L263 , pass only nA twice to the func both on line AA and line BB to enforce this requirement.

Thanks.

garrettwrong commented 2 years ago

Hi, if I recall, for the batch mode nA does not need to equal nB. Actually I think one of the unit tests confirms they may be different (L21-27) in https://github.com/garrettwrong/cuTWED/blob/master/tests/test_batch.py .

I think this was just a typo in the docstring. I will update it in the source, but I may not be able to make another release right away.

Can I ask how you are using this software? I'm glad people are using it. It would be helpful to understand so I know how much time I should make for maintaining it. Thanks