Skip to content

Commit

Permalink
Fix type mismatch error in MatrixMarket (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkkim1005 committed Dec 22, 2023
1 parent d068b23 commit 6a8312f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions buffalo/data/mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ def get_max_column_length(fname):
# if not given, assume id as is
if uid_path:
with open(uid_path) as fin:
idmap["rows"][:] = np.loadtxt(fin, dtype=f"S{uid_max_col}")
idmap["rows"][:] = np.loadtxt(fin, dtype=h5py.string_dtype("utf-8", length=uid_max_col))
else:
idmap["rows"][:] = np.array([str(i) for i in range(1, num_users + 1)],
dtype=f"S{uid_max_col}")
dtype=h5py.string_dtype("utf-8", length=uid_max_col))
pbar.update(1)
if iid_path:
with open(iid_path) as fin:
idmap["cols"][:] = np.loadtxt(fin, dtype=f"S{iid_max_col}")
idmap["cols"][:] = np.loadtxt(fin, dtype=h5py.string_dtype("utf-8", length=iid_max_col))
else:
idmap["cols"][:] = np.array([str(i) for i in range(1, num_items + 1)],
dtype=f"S{iid_max_col}")
dtype=h5py.string_dtype("utf-8", length=iid_max_col))
pbar.update(1)
num_header_lines = 0
with open(main_path) as fin:
Expand Down Expand Up @@ -252,8 +252,8 @@ def create(self) -> h5py.File:
self.logger.debug("Building meta part...")
db, num_header_lines = self._create(data_path,
{"main_path": mm_main_path,
"uid_path": mm_uid_path,
"iid_path": mm_iid_path},
"uid_path": mm_uid_path,
"iid_path": mm_iid_path},
header)
try:
num_header_lines += 1 # add metaline
Expand Down

0 comments on commit 6a8312f

Please sign in to comment.