Skip to content

Suggesting a minor enhancement in mpdist.py:: _mpdist_vect #1082

Open
@NimaSarajpoor

Description

@NimaSarajpoor

I think we can replace

https://github.com/TDAmeritrade/stumpy/blob/423c679fdfcdd547744d2b9a2aed7565124fd6e1/stumpy/mpdist.py#L100-L106

with

P_ABBA = np.empty(2 * j, dtype=np.float64) 
  
 if k is None: 
     percentage = np.clip(percentage, 0.0, 1.0) 
     k = math.ceil(percentage * (2 * Q.shape[0]))    # BECAUSE `P_ABBA.shape[0] == 2 * j`, see the first line 
  
 k = min(int(k), P_ABBA.shape[0] - 1) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions