Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
yangky11 committed Dec 8, 2024
1 parent ac13697 commit efaa04e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exclude = [

[project]
name = "lean-dojo"
version = "2.1.3"
version = "2.2.0"
authors = [
{ name="Kaiyu Yang", email="[email protected]" },
]
Expand Down
4 changes: 2 additions & 2 deletions src/lean_dojo/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/lean_dojo/data_extraction/lean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit efaa04e

Please sign in to comment.