Skip to content

Commit

Permalink
Add known first party packages to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
golmschenk committed Feb 12, 2024
1 parent 31162f9 commit 3611f67
Show file tree
Hide file tree
Showing 28 changed files with 43 additions and 14 deletions.
6 changes: 4 additions & 2 deletions examples/download_spoc_transit_light_curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import numpy as np

from ramjet.data_interface.tess_data_interface import \
get_spoc_tic_id_list_from_mast, download_spoc_light_curves_for_tic_ids
from ramjet.data_interface.tess_data_interface import (
download_spoc_light_curves_for_tic_ids,
get_spoc_tic_id_list_from_mast,
)
from ramjet.data_interface.tess_toi_data_interface import TessToiDataInterface, ToiColumns


Expand Down
2 changes: 1 addition & 1 deletion examples/transit_finite_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from torch.nn import BCELoss
from torchmetrics.classification import BinaryAccuracy

from transit_dataset import get_transit_finite_test_dataset
from qusi.finite_test_session import finite_datasets_test_session, get_device
from qusi.hadryss_model import Hadryss

from transit_dataset import get_transit_finite_test_dataset

def main():
test_light_curve_dataset = get_transit_finite_test_dataset()
Expand Down
2 changes: 1 addition & 1 deletion examples/transit_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from qusi.finite_standard_light_curve_dataset import FiniteStandardLightCurveDataset
from qusi.hadryss_model import Hadryss
from qusi.infer_session import infer_session, get_device
from qusi.infer_session import get_device, infer_session
from qusi.light_curve_collection import LightCurveCollection
from ramjet.photometric_database.tess_two_minute_cadence_light_curve import TessMissionLightCurve

Expand Down
11 changes: 5 additions & 6 deletions examples/transit_infinite_dataset_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from pathlib import Path
from typing import List

import numpy as np
import torch
from torch.nn import Module, BCELoss
from torch.nn import BCELoss, Module
from torch.types import Device
from torch.utils.data import DataLoader
from torchmetrics.classification import BinaryAccuracy
Expand Down Expand Up @@ -59,9 +58,9 @@ def main():
return results


def infinite_datasets_test_session(test_datasets: List[LightCurveDataset], model: Module,
metric_functions: List[Module], batch_size: int, device: Device, steps: int):
test_dataloaders: List[DataLoader] = []
def infinite_datasets_test_session(test_datasets: list[LightCurveDataset], model: Module,
metric_functions: list[Module], batch_size: int, device: Device, steps: int):
test_dataloaders: list[DataLoader] = []
for test_dataset in test_datasets:
test_dataloaders.append(DataLoader(test_dataset, batch_size=batch_size, pin_memory=True))
model.eval()
Expand All @@ -80,7 +79,7 @@ def get_device():
return device


def infinite_dataset_test_phase(dataloader, model: Module, metric_functions: List[Module], device: Device, steps: int):
def infinite_dataset_test_phase(dataloader, model: Module, metric_functions: list[Module], device: Device, steps: int):
batch_count = 0
metric_totals = torch.zeros(size=[len(metric_functions)])
model.eval()
Expand Down
4 changes: 2 additions & 2 deletions examples/transit_train.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from qusi.train_hyperparameter_configuration import TrainHyperparameterConfiguration
from transit_dataset import get_transit_train_dataset, get_transit_validation_dataset
from qusi.hadryss_model import Hadryss
from qusi.train_hyperparameter_configuration import TrainHyperparameterConfiguration
from qusi.train_session import train_session

from transit_dataset import get_transit_train_dataset, get_transit_validation_dataset

def main():
train_light_curve_dataset = get_transit_train_dataset()
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ exclude_lines = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.ruff]
extend-exclude = ["examples"]

[tool.ruff.lint.isort]
known-first-party = ["qusi", "ramjet"]
1 change: 1 addition & 0 deletions tests/analysis/test_convert_column_name_to_display_name.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from ramjet.analysis.convert_column_name_to_display_name import convert_column_name_to_display_name


Expand Down
1 change: 1 addition & 0 deletions tests/analysis/test_lightcurve_visualizer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import patch

import numpy as np

import ramjet
from ramjet.analysis.light_curve_visualizer import create_dual_light_curve_figure

Expand Down
1 change: 1 addition & 0 deletions tests/analysis/test_roc_calculator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for the RocCalculator class."""
import numpy as np
import pytest

from ramjet.analysis.roc_calculator import RocCalculator


Expand Down
1 change: 1 addition & 0 deletions tests/analysis/test_transit_vetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import numpy as np
import pandas as pd
import pytest

from ramjet.analysis.transit_vetter import TransitVetter
from ramjet.photometric_database.tess_target import TessTarget

Expand Down
1 change: 1 addition & 0 deletions tests/analysis/viewer/test_preloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pandas as pd
import pytest

import ramjet.analysis.viewer.preloader as module
from ramjet.analysis.viewer.preloader import Preloader

Expand Down
1 change: 1 addition & 0 deletions tests/data_interface/test_metadatabase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from uuid import UUID

import pytest

from ramjet.data_interface.metadatabase import dataset_split_from_uuid, metadatabase_uuid


Expand Down
5 changes: 3 additions & 2 deletions tests/data_interface/test_tess_data_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import numpy as np
import pandas as pd
import pytest
import ramjet.data_interface.tess_data_interface
import ramjet.data_interface.tess_data_interface as tess_data_interface_module
from astropy.coordinates import SkyCoord
from astropy.table import Table
from astroquery.utils import TableList

import ramjet.data_interface.tess_data_interface
import ramjet.data_interface.tess_data_interface as tess_data_interface_module
from ramjet.data_interface.tess_data_interface import TessFluxType


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest.mock import Mock, patch

import pytest

import ramjet.data_interface.tess_ffi_light_curve_metadata_manager as module
from ramjet.data_interface.tess_ffi_light_curve_metadata_manager import TessFfiLightCurveMetadataManager

Expand Down
1 change: 1 addition & 0 deletions tests/data_interface/test_tess_toi_data_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pandas as pd
import pytest

import ramjet.data_interface.tess_toi_data_interface as module
from ramjet.data_interface.tess_toi_data_interface import TessToiDataInterface

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import PropertyMock, patch

import pandas as pd

import ramjet.data_interface.tess_transit_metadata_manager as module
from ramjet.data_interface.tess_toi_data_interface import ToiColumns
from ramjet.data_interface.tess_transit_metadata_manager import Disposition, TessTransitMetadataManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest.mock import Mock, patch

import pytest

import ramjet.data_interface.tess_two_minute_cadence_light_curve_metadata_manager as module
from ramjet.data_interface.tess_two_minute_cadence_light_curve_metadata_manager import (
TessTwoMinuteCadenceLightCurveMetadataManger,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import Mock, patch

import numpy as np

import ramjet.photometric_database.derived.self_lensing_binary_synthetic_signals_light_curve_collection as module
from ramjet.photometric_database.derived.self_lensing_binary_synthetic_signals_light_curve_collection import (
SelfLensingBinarySyntheticSignalsLightCurveCollection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from ramjet.photometric_database.derived.toy_light_curve_collection import ToyLightCurve


Expand Down
1 change: 1 addition & 0 deletions tests/photometric_database/test_light_curve.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import pandas as pd
import pytest

from ramjet.photometric_database.light_curve import LightCurve


Expand Down
1 change: 1 addition & 0 deletions tests/photometric_database/test_lightcurve_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import pytest

from ramjet.photometric_database.light_curve_collection import (
LightCurveCollection,
LightCurveCollectionMethodNotImplementedError,
Expand Down
1 change: 1 addition & 0 deletions tests/photometric_database/test_lightcurve_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import numpy as np
import pytest

import ramjet.photometric_database.light_curve_database as module
from ramjet.photometric_database.light_curve_database import LightCurveDatabase

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from ramjet.photometric_database.light_curve_collection import LightCurveCollectionMethodNotImplementedError
from ramjet.photometric_database.sql_metadata_light_curve_collection import SqlMetadataLightCurveCollection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import pytest

import ramjet.photometric_database.standard_and_injected_light_curve_database as database_module
from ramjet.photometric_database.light_curve_collection import LightCurveCollection
from ramjet.photometric_database.light_curve_dataset_manipulations import OutOfBoundsInjectionHandlingMethod
Expand Down
1 change: 1 addition & 0 deletions tests/photometric_database/test_tess_ffi_light_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import pytest

import ramjet.photometric_database.tess_ffi_light_curve as module
from ramjet.photometric_database.tess_ffi_light_curve import TessFfiColumnName, TessFfiLightCurve, TessFfiPickleIndex

Expand Down
1 change: 1 addition & 0 deletions tests/photometric_database/test_tess_light_curve.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from ramjet.photometric_database.tess_light_curve import MissingTicRow, TessLightCurve


Expand Down
1 change: 1 addition & 0 deletions tests/photometric_database/test_tess_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import pytest

import ramjet.photometric_database.tess_target as tess_target_module
from ramjet.photometric_database.tess_target import TessTarget

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numpy as np
import pandas as pd
import pytest

import ramjet.photometric_database.tess_two_minute_cadence_light_curve as module
from ramjet.photometric_database.tess_two_minute_cadence_light_curve import (
TessMissionLightCurve,
Expand Down

0 comments on commit 3611f67

Please sign in to comment.