Skip to content

Commit

Permalink
Initial cleanup of core.py -- could essentially remove as decoupled f…
Browse files Browse the repository at this point in the history
…rom notebook
  • Loading branch information
Mjboothaus committed May 15, 2023
1 parent 72c78bf commit c5dbc82
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/core.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/nbs/00_core.ipynb (unless otherwise specified).

__all__ = ['in_notebook', 'ipython_info', 'get_project_root']

# Cell
from pathlib import Path
import sys

# Cell

def in_notebook() -> bool:
"""
Expand All @@ -16,9 +10,6 @@ def in_notebook() -> bool:
return "ipykernel" in sys.modules


# later I found out this:


def ipython_info():
ip = False
if "ipykernel" in sys.modules:
Expand All @@ -28,15 +19,5 @@ def ipython_info():
return ip


# Cell
def get_project_root() -> Path:
if not in_notebook():
return Path(__file__).parent
else:
return Path.cwd().parent



# Cell

get_project_root()
return Path.cwd().parent if in_notebook() else Path(__file__).parent

0 comments on commit c5dbc82

Please sign in to comment.