Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Apr 27, 2024
1 parent dc3bbe1 commit ff83a32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tests/tests_pytorch/__init__.py
Expand Up @@ -17,10 +17,10 @@

import pytest

_TEST_ROOT = Path(__file__).parent
_PROJECT_ROOT = _TEST_ROOT.parent.parent
_TEST_ROOT = Path(__file__).parent.parent
_PROJECT_ROOT = _TEST_ROOT.parent
_PATH_DATASETS = _PROJECT_ROOT / "Datasets"
_PATH_LEGACY = _PROJECT_ROOT / "legacy"
_PATH_LEGACY = _TEST_ROOT / "legacy"

# todo: this setting `PYTHONPATH` may not be used by other evns like Conda for import packages
if str(_PROJECT_ROOT) not in os.getenv("PYTHONPATH", ""):
Expand Down
6 changes: 1 addition & 5 deletions tests/tests_pytorch/helpers/utils.py
Expand Up @@ -18,23 +18,19 @@
from lightning.pytorch.demos.boring_classes import BoringModel
from lightning.pytorch.loggers import TensorBoardLogger

from tests_pytorch import _TEMP_PATH


def get_default_logger(save_dir, version=None):
# set up logger object without actually saving logs
return TensorBoardLogger(save_dir, name="lightning_logs", version=version)


def get_data_path(expt_logger, path_dir=None):
def get_data_path(expt_logger, path_dir):
# some calls contain only experiment not complete logger

# each logger has to have these attributes
name, version = expt_logger.name, expt_logger.version

# the other experiments...
if not path_dir:
path_dir = expt_logger.save_dir if hasattr(expt_logger, "save_dir") and expt_logger.save_dir else _TEMP_PATH
path_expt = os.path.join(path_dir, name, "version_%s" % version)

# try if the new sub-folder exists, typical case for test-tube
Expand Down

0 comments on commit ff83a32

Please sign in to comment.