Открыть боковую панель
nikitronn
sverchok
Коммиты
e767e51d
Не подтверждена
Коммит
e767e51d
создал
Сен 09, 2021
по автору
Dealga McArdle
Зафиксировано автором
GitHub
Сен 09, 2021
Просмотр файлов
tested int casting (#4338)
владелец
f1fe4c12
Изменения
1
Скрыть пробелы
Построчно
Рядом
nodes/number/number_range.py
Просмотр файла @
e767e51d
...
@@ -36,15 +36,14 @@ def range_step_stop(start, stop, step, n_type, out_numpy):
...
@@ -36,15 +36,14 @@ def range_step_stop(start, stop, step, n_type, out_numpy):
def
range_stop_count
(
start
,
stop
,
count
,
n_type
,
out_numpy
):
def
range_stop_count
(
start
,
stop
,
count
,
n_type
,
out_numpy
):
''' Gives count total values in [start,stop] '''
''' Gives count total values in [start,stop] '''
# we are casting to int here because the input can be floats.
# we are casting to int here because the input can be floats.
result
=
np
.
linspace
(
start
,
stop
,
num
=
count
,
dtype
=
n_type
)
result
=
np
.
linspace
(
start
,
stop
,
num
=
int
(
count
)
,
dtype
=
n_type
)
return
result
if
out_numpy
else
result
.
tolist
()
return
result
if
out_numpy
else
result
.
tolist
()
def
range_step_count
(
start
,
step
,
count
,
n_type
,
out_numpy
):
def
range_step_count
(
start
,
step
,
count
,
n_type
,
out_numpy
):
''' Gives count values with step from start'''
''' Gives count values with step from start'''
stop
=
start
+
step
*
(
count
-
1
)
stop
=
start
+
step
*
(
count
-
1
)
result
=
np
.
linspace
(
start
,
stop
,
num
=
count
,
dtype
=
n_type
)
result
=
np
.
linspace
(
start
,
stop
,
num
=
int
(
count
),
dtype
=
n_type
)
return
result
if
out_numpy
else
result
.
tolist
()
return
result
if
out_numpy
else
result
.
tolist
()
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать