diff --git a/docs/source/conf.py b/docs/source/conf.py index eb0a759..671eb7c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,7 +13,7 @@ project = "LeanDojo" copyright = "2023, LeanDojo Team" author = "Kaiyu Yang" -release = "2.1.3" +release = "2.2.0" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index fe7a7a4..bc28cf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ exclude = [ [project] name = "lean-dojo" -version = "2.1.3" +version = "2.2.0" authors = [ { name="Kaiyu Yang", email="kaiyuy@meta.com" }, ] diff --git a/src/lean_dojo/constants.py b/src/lean_dojo/constants.py index 4ba703b..421e95c 100644 --- a/src/lean_dojo/constants.py +++ b/src/lean_dojo/constants.py @@ -14,7 +14,7 @@ load_dotenv() -__version__ = "2.1.3" +__version__ = "2.2.0" logger.remove() if "VERBOSE" in os.environ or "DEBUG" in os.environ: @@ -44,7 +44,7 @@ MAX_NUM_PROCS = 32 NUM_PROCS = int(os.getenv("NUM_PROCS", min(multiprocessing.cpu_count(), MAX_NUM_PROCS))) -"""Number of threads to use +"""Number of processes to use """ NUM_WORKERS = NUM_PROCS - 1 diff --git a/src/lean_dojo/data_extraction/lean.py b/src/lean_dojo/data_extraction/lean.py index 35b256d..9f8ac51 100644 --- a/src/lean_dojo/data_extraction/lean.py +++ b/src/lean_dojo/data_extraction/lean.py @@ -353,6 +353,8 @@ def convert_pos(self, byte_idx: int) -> Pos: n = 0 for i, num_bytes in enumerate(self.num_bytes, start=1): n += num_bytes + if n == byte_idx and i == self.num_lines: + byte_idx -= 1 if n > byte_idx: line_byte_idx = byte_idx - (n - num_bytes) if line_byte_idx == 0: