Skip to content

Commit

Permalink
fix: enhance environment detection for Google Colab in Environment class
Browse files Browse the repository at this point in the history
  • Loading branch information
dakshpokar committed Dec 18, 2024
1 parent f4a12c7 commit f8950f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion maidr/util/environment.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import os
import sys


class Environment:
Expand All @@ -24,7 +25,12 @@ def is_notebook() -> bool:

return get_ipython() is not None and "ipykernel" in str(get_ipython())
except ImportError:
return False
pass

if "google.colab" in sys.modules:
return True

return False

@staticmethod
def get_renderer() -> str:
Expand Down

0 comments on commit f8950f4

Please sign in to comment.