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

Remove numpy #132

Merged
merged 4 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ smartredis>=0.1.1
redis==3.5.3
redis-py-cluster==2.1.3
sphinx==3.1.1
numpy>=1.18.2
tqdm>=4.50.2
psutil>=5.7.2
tabulate>=0.8.9
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ tabulate>=0.8.9
smartredis>=0.1.1
redis==3.5.3
redis-py-cluster==2.1.3
numpy>=1.18.2
tqdm>=4.50.2
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def has_ext_modules(_placeholder):
"tabulate>=0.8.9",
"redis-py-cluster==2.1.3",
"redis==3.5.3",
"numpy>=1.18.2",
"tqdm>=4.50.2"
]

Expand Down
4 changes: 2 additions & 2 deletions smartsim/_core/launcher/step/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import os.path as osp
import time

import numpy as np
from ...utils.helpers import get_base_36_repr


class Step:
Expand All @@ -41,7 +41,7 @@ def get_launch_cmd(self):
raise NotImplementedError

def _create_unique_name(self, entity_name):
step_name = entity_name + "-" + str(np.base_repr(time.time_ns(), 36))
step_name = entity_name + "-" + get_base_36_repr(time.time_ns())
return step_name

def get_output_files(self):
Expand Down
18 changes: 18 additions & 0 deletions smartsim/_core/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@
import psutil


def get_base_36_repr(positive_int):
"""Converts a positive integer to its base 36 representation
:param positive_int: the positive integer to convert
:type positive_int: int
:return: base 36 representation of the given positive int
:rtype: str
"""
digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
result = []

while positive_int:
next_digit = digits[positive_int % 36]
result.append(next_digit)
positive_int //= 36

return "".join(reversed(result))


def get_ip_from_host(host):
"""Return the IP address for the interconnect.

Expand Down