Skip to content

Commit

Permalink
rename show_versions
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoGrin committed Feb 5, 2025
1 parent 0feb3c4 commit c0d8535
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ body:
description: |
Please run the following and paste the output below.
```python
import tabpfn; tabpfn.show_versions()
import tabpfn; tabpfn.display_debug_info()
```
validations:
required: false
Expand Down
4 changes: 2 additions & 2 deletions src/tabpfn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from importlib.metadata import version

from tabpfn.classifier import TabPFNClassifier
from tabpfn.debug_versions import show_versions
from tabpfn.debug_versions import display_debug_info
from tabpfn.regressor import TabPFNRegressor

try:
Expand All @@ -13,5 +13,5 @@
"TabPFNClassifier",
"TabPFNRegressor",
"__version__",
"show_versions",
"display_debug_info",
]
21 changes: 13 additions & 8 deletions src/tabpfn/debug_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,15 +661,18 @@ def _get_deps_info():
return deps_info


def show_versions():
def display_debug_info():
"""Print useful debugging information."""
print("Collecting system and dependency information...")
sys_info = _get_env_info()._replace(pip_packages="", conda_packages="")
print(_pretty_str(sys_info).replace(
"Versions of relevant libraries:\n"
"[pip3] No relevant packages\n"
"[conda] No relevant packages\n",
"",
))
print(
_pretty_str(sys_info).replace(
"Versions of relevant libraries:\n"
"[pip3] No relevant packages\n"
"[conda] No relevant packages\n",
"",
)
)

# Print dependency versions in a clear section
print("\nDependency Versions:")
Expand All @@ -692,6 +695,8 @@ def show_versions():
if dumps: # Only proceed if there are dumps
latest = max(dumps, key=lambda p: Path(p).stat().st_ctime)
ctime = Path(latest).stat().st_ctime
crash_time = datetime.datetime.fromtimestamp(ctime).strftime("%Y-%m-%d %H:%M:%S")
crash_time = datetime.datetime.fromtimestamp(ctime).strftime(
"%Y-%m-%d %H:%M:%S"
)
print(f"\nLatest crash dump found from: {crash_time}")
print(f"Location: {latest}")

0 comments on commit c0d8535

Please sign in to comment.