Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Format
on:
push:
paths:
- 'utils/**'
- 'CollaborativeCoding/**'
pull_request:
paths:
- 'utils/**'
- 'CollaborativeCoding/**'

jobs:
format:
Expand All @@ -28,8 +28,8 @@ jobs:

- name: Run Ruff check
run: |
ruff check utils/
ruff check CollaborativeCoding/

- name: Run isort check
run: |
isort --check-only utils/
isort --check-only CollaborativeCoding/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MetricWrapper(nn.Module):
Resets the state of all metric computations.
Examples
--------
>>> from utils import MetricWrapperProposed
>>> from CollaborativeCoding import MetricWrapperProposed
>>> metrics = MetricWrapperProposed(2, "entropy", "f1", "precision")
>>> y_true = [0, 1, 0, 1]
>>> y_pred = [0, 1, 1, 0]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]

# search this directory for Python files
autoapi_dirs = ["../utils"]
autoapi_dirs = ["../CollaborativeCoding"]

myst_enable_extensions = [
"colon_fence", # ::: can be used instead of ``` for better rendering
Expand Down
9 changes: 7 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
from torch.utils.data import DataLoader
from torchvision import transforms
from tqdm import tqdm
from wandb_api import WANDB_API

from utils import MetricWrapper, createfolders, get_args, load_data, load_model
from CollaborativeCoding import (
MetricWrapper,
createfolders,
get_args,
load_data,
load_model,
)


def main():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_createfolders.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from utils import createfolders
from CollaborativeCoding import createfolders


def test_createfolders():
Expand Down
8 changes: 6 additions & 2 deletions tests/test_dataloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
from PIL import Image
from torchvision import transforms

from utils.dataloaders import MNISTDataset0_3, USPSDataset0_6, USPSH5_Digit_7_9_Dataset
from utils.load_data import load_data
from CollaborativeCoding.dataloaders import (
MNISTDataset0_3,
USPSDataset0_6,
USPSH5_Digit_7_9_Dataset,
)
from CollaborativeCoding.load_data import load_data


@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import pytest

from utils.load_metric import MetricWrapper
from utils.metrics import Accuracy, F1Score, Precision, Recall
from CollaborativeCoding.load_metric import MetricWrapper
from CollaborativeCoding.metrics import Accuracy, F1Score, Precision, Recall


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import torch

from utils.models import ChristianModel, JanModel, MagnusModel, SolveigModel
from CollaborativeCoding.models import ChristianModel, JanModel, MagnusModel


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_wrappers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from utils import load_data, load_metric, load_model
from CollaborativeCoding import load_data, load_metric, load_model

# def test_load_model():
# import torch as th
Expand Down
Loading