Skip to content

Commit efaa04e

Browse files
committed
bugfix
1 parent ac13697 commit efaa04e

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
project = "LeanDojo"
1414
copyright = "2023, LeanDojo Team"
1515
author = "Kaiyu Yang"
16-
release = "2.1.3"
16+
release = "2.2.0"
1717

1818
# -- General configuration ---------------------------------------------------
1919
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exclude = [
1212

1313
[project]
1414
name = "lean-dojo"
15-
version = "2.1.3"
15+
version = "2.2.0"
1616
authors = [
1717
{ name="Kaiyu Yang", email="kaiyuy@meta.com" },
1818
]

src/lean_dojo/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
load_dotenv()
1616

17-
__version__ = "2.1.3"
17+
__version__ = "2.2.0"
1818

1919
logger.remove()
2020
if "VERBOSE" in os.environ or "DEBUG" in os.environ:
@@ -44,7 +44,7 @@
4444
MAX_NUM_PROCS = 32
4545

4646
NUM_PROCS = int(os.getenv("NUM_PROCS", min(multiprocessing.cpu_count(), MAX_NUM_PROCS)))
47-
"""Number of threads to use
47+
"""Number of processes to use
4848
"""
4949

5050
NUM_WORKERS = NUM_PROCS - 1

src/lean_dojo/data_extraction/lean.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ def convert_pos(self, byte_idx: int) -> Pos:
353353
n = 0
354354
for i, num_bytes in enumerate(self.num_bytes, start=1):
355355
n += num_bytes
356+
if n == byte_idx and i == self.num_lines:
357+
byte_idx -= 1
356358
if n > byte_idx:
357359
line_byte_idx = byte_idx - (n - num_bytes)
358360
if line_byte_idx == 0:

0 commit comments

Comments
 (0)