Skip to content

Commit

Permalink
Run check lint outside of the container
Browse files Browse the repository at this point in the history
  • Loading branch information
sarda-devesh committed Nov 2, 2023
1 parent 3d1da35 commit 17bfc39
Show file tree
Hide file tree
Showing 39 changed files with 76 additions and 38 deletions.
3 changes: 2 additions & 1 deletion examples/python/custom_lp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from pathlib import Path

from omegaconf import OmegaConf

import marius as m
from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import LinkPredictionDataset
from marius.tools.preprocess.utils import download_url, extract_file
from omegaconf import OmegaConf

import torch # isort:skip

Expand Down
5 changes: 3 additions & 2 deletions examples/python/custom_nc_graphsage.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from pathlib import Path

import marius as m
import numpy as np
import pandas as pd
from omegaconf import OmegaConf

import marius as m
from marius.tools.configuration.constants import PathConstants
from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import NodeClassificationDataset
from marius.tools.preprocess.datasets.dataset_helpers import remap_nodes
from marius.tools.preprocess.utils import download_url, extract_file
from omegaconf import OmegaConf

import torch # isort:skip

Expand Down
3 changes: 2 additions & 1 deletion examples/python/fb15k_237.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path

from omegaconf import OmegaConf

import marius as m
from marius.tools.preprocess.datasets.fb15k_237 import FB15K237
from omegaconf import OmegaConf

import torch # isort:skip

Expand Down
3 changes: 2 additions & 1 deletion examples/python/fb15k_237_gpu.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path

from omegaconf import OmegaConf

import marius as m
from marius.tools.preprocess.datasets.fb15k_237 import FB15K237
from omegaconf import OmegaConf

import torch # isort:skip

Expand Down
3 changes: 2 additions & 1 deletion examples/python/ogbn_arxiv_nc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path

from omegaconf import OmegaConf

import marius as m
from marius.tools.preprocess.datasets.ogbn_arxiv import OGBNArxiv
from omegaconf import OmegaConf

import torch # isort:skip

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/src/data/samplers/neighbor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ std::tuple<torch::Tensor, torch::Tensor> sample_uniform_cpu(torch::Tensor edges,

if (num_columns == 3) {
#pragma omp parallel default(none) shared(tid_seeds, local_offsets_accessor, local_offsets, global_offsets_accessor, global_offsets, num_neighbors_accessor, \
num_neighbors, max_neighbors, sorted_list_ptr, edges, ret_neighbor_id_edges_mem, ret_neighbor_id_edges)
num_neighbors, max_neighbors, sorted_list_ptr, edges, ret_neighbor_id_edges_mem, ret_neighbor_id_edges)
{
#ifdef MARIUS_OMP
unsigned int seed = tid_seeds[omp_get_thread_num()];
Expand Down Expand Up @@ -193,7 +193,7 @@ std::tuple<torch::Tensor, torch::Tensor> sample_uniform_cpu(torch::Tensor edges,
}
} else {
#pragma omp parallel default(none) shared(tid_seeds, local_offsets_accessor, local_offsets, global_offsets_accessor, global_offsets, num_neighbors_accessor, \
num_neighbors, max_neighbors, sorted_list_ptr, edges, ret_neighbor_id_edges_mem, ret_neighbor_id_edges)
num_neighbors, max_neighbors, sorted_list_ptr, edges, ret_neighbor_id_edges_mem, ret_neighbor_id_edges)
{
#ifdef MARIUS_OMP
unsigned int seed = tid_seeds[omp_get_thread_num()];
Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/configuration/marius_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from pathlib import Path
from typing import List

from omegaconf import MISSING, DictConfig, OmegaConf

from marius.tools.configuration.constants import PathConstants
from marius.tools.configuration.datatypes import (
AdagradOptions,
Expand Down Expand Up @@ -40,7 +42,6 @@
validate_dataset_config,
validate_storage_config,
)
from omegaconf import MISSING, DictConfig, OmegaConf


def get_model_dir_path(dataset_dir):
Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/marius_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import pathlib
from argparse import RawDescriptionHelpFormatter

import marius as m
import numpy as np
import pandas as pd

import marius as m
from marius.tools.configuration.constants import PathConstants
from marius.tools.prediction.link_prediction import infer_lp
from marius.tools.prediction.node_classification import infer_nc
Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/postprocess/in_memory_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

import numpy as np
import pandas as pd
from marius.tools.configuration.constants import PathConstants
from omegaconf import OmegaConf

from marius.tools.configuration.constants import PathConstants

import torch # isort:skip

SUPPORTED_FORMATS = ["CSV", "PARQUET", "BINARY", "BIN"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import math

from pyspark.sql.dataframe import DataFrame
from pyspark.sql.functions import floor

from marius.tools.preprocess.converters.partitioners.partitioner import Partitioner
from marius.tools.preprocess.converters.spark_constants import DST_EDGE_BUCKET_COL, INDEX_COL, SRC_EDGE_BUCKET_COL
from marius.tools.preprocess.utils import get_df_count
from pyspark.sql.dataframe import DataFrame
from pyspark.sql.functions import floor


def get_partition_size(nodes, num_partitions):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from marius.tools.preprocess.converters.partitioners.partitioner import Partitioner

import torch # isort:skip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path

import pandas as pd

from marius.tools.preprocess.converters.readers.reader import Reader


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from pathlib import Path

from marius.tools.preprocess.converters.readers.reader import Reader
from pyspark.sql import SparkSession
from pyspark.sql.dataframe import DataFrame

from marius.tools.preprocess.converters.readers.reader import Reader


class SparkDelimitedFileReader(Reader):
def __init__(
Expand Down
7 changes: 4 additions & 3 deletions src/python/tools/preprocess/converters/spark_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import os
from pathlib import Path

from pyspark.sql import SparkSession
from pyspark.sql.functions import col, monotonically_increasing_id, rand, row_number
from pyspark.sql.window import Window

from marius.tools.preprocess.converters.partitioners.spark_partitioner import SparkPartitioner
from marius.tools.preprocess.converters.readers.spark_readers import SparkDelimitedFileReader
from marius.tools.preprocess.converters.spark_constants import (
Expand All @@ -17,9 +21,6 @@
TMP_DATA_DIRECTORY,
)
from marius.tools.preprocess.converters.writers.spark_writer import SparkWriter
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, monotonically_increasing_id, rand, row_number
from pyspark.sql.window import Window

SUPPORTED_DELIM_FORMATS = ["CSV", "TSV", "TXT", "DELIM", "DELIMITED"]
SUPPORTED_NON_DELIM_FILE_FORMATS = ["PARQUET"]
Expand Down
1 change: 1 addition & 0 deletions src/python/tools/preprocess/converters/torch_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import pandas as pd

from marius.tools.configuration.constants import PathConstants
from marius.tools.preprocess.converters.partitioners.torch_partitioner import TorchPartitioner
from marius.tools.preprocess.converters.readers.pandas_readers import PandasDelimitedFileReader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import numpy as np
import pandas as pd
from omegaconf import OmegaConf

from marius.tools.configuration.constants import PathConstants
from marius.tools.configuration.marius_config import DatasetConfig
from marius.tools.preprocess.converters.spark_constants import (
Expand All @@ -18,7 +20,6 @@
TMP_DATA_DIRECTORY,
)
from marius.tools.preprocess.utils import get_df_count
from omegaconf import OmegaConf


# TODO can this be made faster? Pandas is pretty slow and not parallel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path

from omegaconf import OmegaConf

from marius.tools.configuration.constants import PathConstants
from marius.tools.configuration.marius_config import DatasetConfig
from omegaconf import OmegaConf


class TorchWriter(object):
Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/preprocess/custom.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import importlib
from pathlib import Path

from marius.tools.preprocess.dataset import LinkPredictionDataset
from preprocess.converters.torch_converter import TorchEdgeListConverter

from marius.tools.preprocess.dataset import LinkPredictionDataset

pyspark_loader = importlib.find_loader("pyspark")
pyspark_found = pyspark_loader is not None

Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/preprocess/datasets/ogb_mag240m.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
from pathlib import Path

import numpy as np
from omegaconf import OmegaConf

from marius.tools.configuration.constants import PathConstants
from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import NodeClassificationDataset
from marius.tools.preprocess.datasets.dataset_helpers import remap_nodes
from marius.tools.preprocess.utils import download_url, extract_file
from omegaconf import OmegaConf

import torch # isort:skip

Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/preprocess/datasets/ogb_wikikg90mv2.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from pathlib import Path

import numpy as np
from omegaconf import OmegaConf

from marius.tools.configuration.constants import PathConstants
from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import LinkPredictionDataset
from marius.tools.preprocess.utils import download_url, extract_file
from omegaconf import OmegaConf


class OGBWikiKG90Mv2(LinkPredictionDataset):
Expand Down
1 change: 1 addition & 0 deletions src/python/tools/preprocess/datasets/ogbl_citation2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path

import numpy as np

from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import LinkPredictionDataset
from marius.tools.preprocess.utils import download_url, extract_file
Expand Down
1 change: 1 addition & 0 deletions src/python/tools/preprocess/datasets/ogbl_collab.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

from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import LinkPredictionDataset
from marius.tools.preprocess.utils import download_url, extract_file
Expand Down
1 change: 1 addition & 0 deletions src/python/tools/preprocess/datasets/ogbl_wikikg2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path

import numpy as np

from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import LinkPredictionDataset
from marius.tools.preprocess.utils import download_url, extract_file
Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/preprocess/datasets/ogbn_arxiv.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from pathlib import Path

import numpy as np
from omegaconf import OmegaConf

from marius.tools.configuration.constants import PathConstants
from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import NodeClassificationDataset
from marius.tools.preprocess.datasets.dataset_helpers import remap_nodes
from marius.tools.preprocess.utils import download_url, extract_file
from omegaconf import OmegaConf


class OGBNArxiv(NodeClassificationDataset):
Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/preprocess/datasets/ogbn_papers100m.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from pathlib import Path

import numpy as np
from omegaconf import OmegaConf

from marius.tools.configuration.constants import PathConstants
from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import NodeClassificationDataset
from marius.tools.preprocess.datasets.dataset_helpers import remap_nodes
from marius.tools.preprocess.utils import download_url, extract_file
from omegaconf import OmegaConf

import torch # isort:skip

Expand Down
3 changes: 2 additions & 1 deletion src/python/tools/preprocess/datasets/ogbn_products.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from pathlib import Path

import numpy as np
from omegaconf import OmegaConf

from marius.tools.configuration.constants import PathConstants
from marius.tools.preprocess.converters.torch_converter import TorchEdgeListConverter
from marius.tools.preprocess.dataset import NodeClassificationDataset
from marius.tools.preprocess.datasets.dataset_helpers import remap_nodes
from marius.tools.preprocess.utils import download_url, extract_file
from omegaconf import OmegaConf


class OGBNProducts(NodeClassificationDataset):
Expand Down
3 changes: 2 additions & 1 deletion test/python/bindings/end_to_end/test_lp_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from test.test_configs.generate_test_configs import generate_configs_for_dataset
from test.test_data.generate import generate_random_dataset

import marius as m
import pytest

import marius as m


def run_configs(directory, partitioned_eval=False):
for filename in os.listdir(directory):
Expand Down
3 changes: 2 additions & 1 deletion test/python/bindings/end_to_end/test_lp_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from test.test_configs.generate_test_configs import generate_configs_for_dataset
from test.test_data.generate import generate_random_dataset

import marius as m
import pytest

import marius as m


def run_configs(directory, partitioned_eval=False):
for filename in os.listdir(directory):
Expand Down
3 changes: 2 additions & 1 deletion test/python/bindings/end_to_end/test_lp_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from test.test_configs.generate_test_configs import generate_configs_for_dataset
from test.test_data.generate import generate_random_dataset

import marius as m
import pytest

import marius as m


def run_configs(directory, partitioned_eval=False):
for filename in os.listdir(directory):
Expand Down
3 changes: 2 additions & 1 deletion test/python/bindings/end_to_end/test_model_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from test.test_configs.generate_test_configs import generate_configs_for_dataset
from test.test_data.generate import generate_random_dataset

import marius as m
import pytest

import marius as m


def run_configs(directory, model_dir=None, partitioned_eval=False, sequential_train_nodes=False):
for filename in os.listdir(directory):
Expand Down
3 changes: 2 additions & 1 deletion test/python/bindings/end_to_end/test_nc_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from test.test_configs.generate_test_configs import generate_configs_for_dataset
from test.test_data.generate import generate_random_dataset

import marius as m
import pytest

import marius as m


def run_configs(directory, partitioned_eval=False):
for filename in os.listdir(directory):
Expand Down
Loading

0 comments on commit 17bfc39

Please sign in to comment.