[ 
https://issues.apache.org/jira/browse/SYSTEMML-671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mike Dusenberry updated SYSTEMML-671:
-------------------------------------
    Description: 
Currently, the PyDML {{range(...)}} function requires {{start}}, {{stop}}, and 
{{step}} arguments.  In Python [1], {{range(...)}} comes in two forms: one form 
only has a {{stop}} parameter, as in {{range(stop)}}, and the other form has 
both the {{start}} and {{stop}} parameters, with an optional {{step}} 
parameter.  It is quite common to simply use an upper {{stop}} argument, i.e. 
{{range(10)}}, to create a list from 0 up to, but not including, {{stop}}.

We should improve the PyDML {{range(...)}} function to be more inline with that 
of Python, as described above.

**Note**: The upper bound {{stop}} should also be exclusive, as noted above, 
i.e., {{range(4)}} should return a vector {{[0,1,2,3]}}, rather than 
{{[0,1,2,3,4]}}.

**Note #2**: This should also be applicable when used with {{for}} expressions, 
i.e.:
{code}
for i in range(12):
  print(i)
{code}

  was:
Currently, the PyDML {{range(...)}} function requires {{start}}, {{stop}}, and 
{{step}} arguments.  In Python [1], {{range(...)}} comes in two forms: one form 
only has a {{stop}} parameter, as in {{range(stop)}}, and the other form has 
both the {{start}} and {{stop}} parameters, with an optional {{step}} 
parameter.  It is quite common to simply use an upper {{stop}} argument, i.e. 
{{range(10)}}, to create a list from 0 up to, but not including, {{stop}}.

We should improve the PyDML {{range(...)}} function to be more inline with that 
of Python, as described above.

**Note**: This should also be applicable when used with {{for}} expressions, 
i.e.:
{code}
for i in range(12):
  print(i)
{code}


> Improve PyDML `range(...)` Function
> -----------------------------------
>
>                 Key: SYSTEMML-671
>                 URL: https://issues.apache.org/jira/browse/SYSTEMML-671
>             Project: SystemML
>          Issue Type: Improvement
>          Components: Parser, PyDML
>            Reporter: Mike Dusenberry
>
> Currently, the PyDML {{range(...)}} function requires {{start}}, {{stop}}, 
> and {{step}} arguments.  In Python [1], {{range(...)}} comes in two forms: 
> one form only has a {{stop}} parameter, as in {{range(stop)}}, and the other 
> form has both the {{start}} and {{stop}} parameters, with an optional 
> {{step}} parameter.  It is quite common to simply use an upper {{stop}} 
> argument, i.e. {{range(10)}}, to create a list from 0 up to, but not 
> including, {{stop}}.
> We should improve the PyDML {{range(...)}} function to be more inline with 
> that of Python, as described above.
> **Note**: The upper bound {{stop}} should also be exclusive, as noted above, 
> i.e., {{range(4)}} should return a vector {{[0,1,2,3]}}, rather than 
> {{[0,1,2,3,4]}}.
> **Note #2**: This should also be applicable when used with {{for}} 
> expressions, i.e.:
> {code}
> for i in range(12):
>   print(i)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to