Skip to content

Commit

Permalink
Rename merlin.graph to merlin.dag (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhigley authored Feb 24, 2022
1 parent eb24f97 commit b1a3594
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 30 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions merlin/graph/base_operator.py → merlin/dag/base_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from typing import Any, List, Union

import merlin
from merlin.graph.selector import ColumnSelector
from merlin.dag.selector import ColumnSelector
from merlin.schema import ColumnSchema, Schema


Expand Down Expand Up @@ -248,7 +248,7 @@ def label(self) -> str:
return self.__class__.__name__

def create_node(self, selector):
return merlin.graph.Node(selector)
return merlin.dag.Node(selector)

@property
def supports(self) -> Supports:
Expand Down
2 changes: 1 addition & 1 deletion merlin/graph/graph.py → merlin/dag/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import logging
from collections import deque

from merlin.graph.node import (
from merlin.dag.node import (
Node,
_combine_schemas,
iter_nodes,
Expand Down
6 changes: 3 additions & 3 deletions merlin/graph/node.py → merlin/dag/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#
import collections.abc

from merlin.graph.base_operator import BaseOperator
from merlin.graph.ops import ConcatColumns, SelectionOp, SubsetColumns, SubtractionOp
from merlin.graph.selector import ColumnSelector
from merlin.dag.base_operator import BaseOperator
from merlin.dag.ops import ConcatColumns, SelectionOp, SubsetColumns, SubtractionOp
from merlin.dag.selector import ColumnSelector
from merlin.schema import Schema


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#

from merlin.core.dispatch import DataFrameType
from merlin.graph.base_operator import BaseOperator
from merlin.graph.selector import ColumnSelector
from merlin.dag.base_operator import BaseOperator
from merlin.dag.selector import ColumnSelector
from merlin.schema import Schema


Expand Down
4 changes: 2 additions & 2 deletions merlin/graph/ops/identity.py → merlin/dag/ops/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#

from merlin.core.dispatch import DataFrameType
from merlin.graph.base_operator import BaseOperator
from merlin.graph.selector import ColumnSelector
from merlin.dag.base_operator import BaseOperator
from merlin.dag.selector import ColumnSelector


class Identity(BaseOperator):
Expand Down
4 changes: 2 additions & 2 deletions merlin/graph/ops/selection.py → merlin/dag/ops/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import logging

from merlin.core.dispatch import DataFrameType
from merlin.graph.base_operator import BaseOperator
from merlin.graph.selector import ColumnSelector
from merlin.dag.base_operator import BaseOperator
from merlin.dag.selector import ColumnSelector
from merlin.schema import Schema

LOG = logging.getLogger("SelectionOp")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#

from merlin.core.dispatch import DataFrameType
from merlin.graph.base_operator import BaseOperator
from merlin.graph.selector import ColumnSelector
from merlin.dag.base_operator import BaseOperator
from merlin.dag.selector import ColumnSelector
from merlin.schema import Schema


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from __future__ import annotations

from merlin.core.dispatch import DataFrameType
from merlin.graph.base_operator import BaseOperator
from merlin.graph.selector import ColumnSelector
from merlin.dag.base_operator import BaseOperator
from merlin.dag.selector import ColumnSelector
from merlin.schema import Schema


Expand Down
8 changes: 4 additions & 4 deletions merlin/graph/selector.py → merlin/dag/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
self._tags = tags if tags is not None else []
self.subgroups = subgroups if subgroups is not None else []

if isinstance(self._names, merlin.graph.Node):
if isinstance(self._names, merlin.dag.Node):
raise TypeError("ColumnSelectors can not contain Nodes")

if isinstance(self._names, str):
Expand All @@ -59,7 +59,7 @@ def __init__(
for name in self._names:
if isinstance(name, str):
plain_names.append(name)
elif isinstance(name, merlin.graph.Node):
elif isinstance(name, merlin.dag.Node):
raise ValueError("ColumnSelectors can not contain Nodes")
elif isinstance(name, ColumnSelector):
self.subgroups.append(name)
Expand Down Expand Up @@ -101,7 +101,7 @@ def _nested_check(self, nests=0):
def __add__(self, other):
if other is None:
return self
elif isinstance(other, merlin.graph.Node):
elif isinstance(other, merlin.dag.Node):
return other + self
elif isinstance(other, ColumnSelector):

Expand All @@ -121,7 +121,7 @@ def __radd__(self, other):
return self + other

def __rshift__(self, operator):
if isinstance(operator, type) and issubclass(operator, merlin.graph.BaseOperator):
if isinstance(operator, type) and issubclass(operator, merlin.dag.BaseOperator):
# handle case where an operator class is passed
operator = operator()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#
import pytest

from merlin.graph import ColumnSelector
from merlin.graph.ops.selection import SelectionOp
from merlin.dag import ColumnSelector
from merlin.dag.ops.selection import SelectionOp
from merlin.schema import ColumnSchema, Schema


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#
import pytest

from merlin.graph.base_operator import BaseOperator as Operator
from merlin.graph.graph import Graph
from merlin.graph.selector import ColumnSelector
from merlin.dag.base_operator import BaseOperator as Operator
from merlin.dag.graph import Graph
from merlin.dag.selector import ColumnSelector
from merlin.schema import Schema


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import numpy
import pytest

from merlin.graph.selector import ColumnSelector
from merlin.dag.selector import ColumnSelector
from merlin.schema import ColumnSchema, Schema
from merlin.schema.io.tensorflow_metadata import TensorflowMetadata
from merlin.schema.tags import Tags, TagSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
import pytest

from merlin.graph import BaseOperator
from merlin.graph.node import Node
from merlin.graph.ops.selection import SelectionOp
from merlin.graph.selector import ColumnSelector
from merlin.dag import BaseOperator
from merlin.dag.node import Node
from merlin.dag.ops.selection import SelectionOp
from merlin.dag.selector import ColumnSelector
from merlin.schema.tags import Tags


Expand Down
File renamed without changes.

0 comments on commit b1a3594

Please sign in to comment.