Skip to content

Commit

Permalink
Merge pull request #373 from shihchengli/fix_field_size
Browse files Browse the repository at this point in the history
Avoid OverflowError when setting field size to sys.maxsize
  • Loading branch information
oscarwumit committed Mar 10, 2023
2 parents 6454342 + a029917 commit 44af7b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chemprop/data/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections import OrderedDict, defaultdict
import sys
import csv
import ctypes
from logging import Logger
import pickle
from random import Random
Expand All @@ -19,8 +20,8 @@
from chemprop.features import load_features, load_valid_atom_or_bond_features, is_mol
from chemprop.rdkit import make_mol

# Increase maximum size of field in the csv processing
csv.field_size_limit(sys.maxsize)
# Increase maximum size of field in the csv processing for the current architecture
csv.field_size_limit(int(ctypes.c_ulong(-1).value // 2))

def get_header(path: str) -> List[str]:
"""
Expand Down

0 comments on commit 44af7b1

Please sign in to comment.