Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address DeprecationWarning in Bonsai #260

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions forest/bonsai/simulate_gps_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def gen_basic_traj(location_start: Tuple[float, float],
time_end = time_start
while traveled < distance:
random_speed = np.random.uniform(speed_range[0], speed_range[1], 1)[0]
random_time = int(np.around(np.random.uniform(30, 120, 1), 0))
random_time = int(np.around(np.random.uniform(30, 120), 0))
mov = random_speed * random_time
if (
traveled + mov > distance
Expand Down Expand Up @@ -800,7 +800,7 @@ def gen_basic_pause(location_start: Tuple[float, float], time_start: float,
if len(t_diff_range) == 2:
random_time = int(
np.around(
np.random.uniform(t_diff_range[0], t_diff_range[1], 1), 0
np.random.uniform(t_diff_range[0], t_diff_range[1]), 0
)
)
else:
Expand All @@ -809,7 +809,7 @@ def gen_basic_pause(location_start: Tuple[float, float], time_start: float,
if len(t_e_range) == 2:
random_time = int(
np.around(
np.random.uniform(t_e_range[0], t_e_range[1], 1), 0
np.random.uniform(t_e_range[0], t_e_range[1]), 0
) - time_start
)
else:
Expand Down Expand Up @@ -1036,7 +1036,7 @@ def remove_data(
sample_dur = int(np.around(60 * cycle * (1 - percentage), 0))
index_all: np.ndarray = np.array([])
for i in range(day):
start = int(np.around(np.random.uniform(0, 60 * cycle, 1), 0))
start = int(np.around(np.random.uniform(0, 60 * cycle), 0))
start += 86400 * i
index_cycle = np.arange(start, start + sample_dur)
if i == 0:
Expand Down
Loading