Skip to content

Commit

Permalink
Rename types to gtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-koch committed Nov 22, 2023
1 parent c4bcbea commit ab599bc
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions guppy/ast_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Any, TypeVar, Generic, Union, Optional, TYPE_CHECKING

if TYPE_CHECKING:
from guppy.types import GuppyType
from guppy.gtypes import GuppyType

AstNode = Union[
ast.AST,
Expand Down Expand Up @@ -179,7 +179,7 @@ def with_type(ty: "GuppyType", node: A) -> A:

def get_type_opt(node: AstNode) -> Optional["GuppyType"]:
"""Tries to retrieve a type annotation from an AST node."""
from guppy.types import GuppyType
from guppy.gtypes import GuppyType

try:
ty = getattr(node, "type")
Expand Down
2 changes: 1 addition & 1 deletion guppy/cfg/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from guppy.cfg.cfg import CFG
from guppy.checker.core import Globals
from guppy.error import GuppyError, InternalGuppyError
from guppy.types import NoneType
from guppy.gtypes import NoneType
from guppy.nodes import NestedFunctionDef

# In order to build expressions, need an endless stream of unique temporary variables
Expand Down
2 changes: 1 addition & 1 deletion guppy/checker/cfg_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from guppy.checker.expr_checker import ExprSynthesizer, to_bool
from guppy.checker.stmt_checker import StmtChecker
from guppy.error import GuppyError
from guppy.types import GuppyType
from guppy.gtypes import GuppyType


VarRow = Sequence[Variable]
Expand Down
2 changes: 1 addition & 1 deletion guppy/checker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import NamedTuple, Optional, Union

from guppy.ast_util import AstNode
from guppy.types import (
from guppy.gtypes import (
GuppyType,
FunctionType,
TupleType,
Expand Down
2 changes: 1 addition & 1 deletion guppy/checker/expr_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from guppy.ast_util import AstVisitor, with_loc, AstNode, with_type, get_type_opt
from guppy.checker.core import Context, CallableVariable, Globals
from guppy.error import GuppyError, GuppyTypeError, InternalGuppyError
from guppy.types import GuppyType, TupleType, FunctionType, BoolType
from guppy.gtypes import GuppyType, TupleType, FunctionType, BoolType
from guppy.nodes import LocalName, GlobalName, LocalCall

# Mapping from unary AST op to dunder method and display name
Expand Down
2 changes: 1 addition & 1 deletion guppy/checker/func_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from guppy.checker.cfg_checker import check_cfg, CheckedCFG
from guppy.checker.expr_checker import synthesize_call, check_call
from guppy.error import GuppyError
from guppy.types import FunctionType, type_from_ast, NoneType, GuppyType
from guppy.gtypes import FunctionType, type_from_ast, NoneType, GuppyType
from guppy.nodes import GlobalCall, CheckedNestedFunctionDef, NestedFunctionDef


Expand Down
2 changes: 1 addition & 1 deletion guppy/checker/stmt_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from guppy.checker.core import Variable, Context
from guppy.checker.expr_checker import ExprSynthesizer, ExprChecker
from guppy.error import GuppyError, GuppyTypeError, InternalGuppyError
from guppy.types import GuppyType, TupleType, type_from_ast, NoneType
from guppy.gtypes import GuppyType, TupleType, type_from_ast, NoneType
from guppy.nodes import NestedFunctionDef


Expand Down
2 changes: 1 addition & 1 deletion guppy/compiler/cfg_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)
from guppy.compiler.expr_compiler import ExprCompiler
from guppy.compiler.stmt_compiler import StmtCompiler
from guppy.types import TupleType, SumType, type_to_row
from guppy.gtypes import TupleType, SumType, type_to_row
from guppy.hugr.hugr import Hugr, Node, CFNode, OutPortV


Expand Down
2 changes: 1 addition & 1 deletion guppy/compiler/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from guppy.ast_util import AstNode
from guppy.checker.core import Variable, CallableVariable
from guppy.types import FunctionType
from guppy.gtypes import FunctionType
from guppy.hugr.hugr import OutPortV, DFContainingNode, Hugr


Expand Down
2 changes: 1 addition & 1 deletion guppy/compiler/expr_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from guppy.ast_util import AstVisitor, get_type
from guppy.compiler.core import CompilerBase, DFContainer, CompiledFunction
from guppy.error import InternalGuppyError
from guppy.types import FunctionType, type_to_row, BoolType
from guppy.gtypes import FunctionType, type_to_row, BoolType
from guppy.hugr import ops, val
from guppy.hugr.hugr import OutPortV
from guppy.nodes import LocalName, GlobalName, GlobalCall, LocalCall
Expand Down
2 changes: 1 addition & 1 deletion guppy/compiler/func_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
DFContainer,
PortVariable,
)
from guppy.types import type_to_row, FunctionType
from guppy.gtypes import type_to_row, FunctionType
from guppy.hugr.hugr import Hugr, OutPortV, DFContainingVNode
from guppy.nodes import CheckedNestedFunctionDef

Expand Down
2 changes: 1 addition & 1 deletion guppy/compiler/stmt_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)
from guppy.compiler.expr_compiler import ExprCompiler
from guppy.error import InternalGuppyError
from guppy.types import TupleType
from guppy.gtypes import TupleType
from guppy.hugr.hugr import Hugr, OutPortV
from guppy.nodes import CheckedNestedFunctionDef

Expand Down
2 changes: 1 addition & 1 deletion guppy/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
UnknownFunctionType,
GuppyTypeError,
)
from guppy.types import GuppyType, FunctionType, type_to_row, TupleType
from guppy.gtypes import GuppyType, FunctionType, type_to_row, TupleType
from guppy.hugr import ops
from guppy.hugr.hugr import OutPortV, Hugr, Node, DFContainingVNode
from guppy.nodes import GlobalCall
Expand Down
2 changes: 1 addition & 1 deletion guppy/declared.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from guppy.checker.func_checker import check_signature
from guppy.compiler.core import CompiledFunction, DFContainer, CompiledGlobals
from guppy.error import GuppyError
from guppy.types import type_to_row, GuppyType
from guppy.gtypes import type_to_row, GuppyType
from guppy.hugr.hugr import VNode, Hugr, Node, OutPortV
from guppy.nodes import GlobalCall

Expand Down
2 changes: 1 addition & 1 deletion guppy/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
DefaultCallCompiler,
)
from guppy.error import GuppyError, pretty_errors
from guppy.types import GuppyType
from guppy.gtypes import GuppyType
from guppy.hugr import tys, ops
from guppy.hugr.hugr import Hugr
from guppy.module import GuppyModule, PyFunc, parse_py_func
Expand Down
2 changes: 1 addition & 1 deletion guppy/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Optional, Any, Sequence, Callable, TypeVar, cast

from guppy.ast_util import AstNode, get_line_offset, get_file, get_source
from guppy.types import GuppyType, FunctionType
from guppy.gtypes import GuppyType, FunctionType
from guppy.hugr.hugr import OutPortV, Node


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion guppy/hugr/hugr.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import guppy.hugr.ops as ops
import guppy.hugr.raw as raw
from guppy.types import (
from guppy.gtypes import (
GuppyType,
TupleType,
FunctionType,
Expand Down
2 changes: 1 addition & 1 deletion guppy/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from guppy.custom import CustomFunction
from guppy.declared import DeclaredFunction
from guppy.error import GuppyError, pretty_errors
from guppy.types import GuppyType
from guppy.gtypes import GuppyType
from guppy.hugr.hugr import Hugr

PyFunc = Callable[..., Any]
Expand Down
2 changes: 1 addition & 1 deletion guppy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ast
from typing import TYPE_CHECKING, Any, Mapping

from guppy.types import FunctionType
from guppy.gtypes import FunctionType

if TYPE_CHECKING:
from guppy.cfg.cfg import CFG
Expand Down
2 changes: 1 addition & 1 deletion guppy/prelude/_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
CustomCallCompiler,
)
from guppy.error import GuppyTypeError, GuppyError
from guppy.types import GuppyType, FunctionType, BoolType
from guppy.gtypes import GuppyType, FunctionType, BoolType
from guppy.hugr import ops, tys, val
from guppy.hugr.hugr import OutPortV
from guppy.nodes import GlobalCall
Expand Down
2 changes: 1 addition & 1 deletion guppy/prelude/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from guppy.custom import NoopCompiler, DefaultCallChecker
from guppy.decorator import guppy
from guppy.types import BoolType
from guppy.gtypes import BoolType
from guppy.hugr import tys, ops
from guppy.module import GuppyModule
from guppy.prelude._internal import (
Expand Down
2 changes: 1 addition & 1 deletion tests/hugr/test_dummy_nodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from guppy.types import FunctionType, BoolType, TupleType
from guppy.gtypes import FunctionType, BoolType, TupleType
from guppy.hugr import ops
from guppy.hugr.hugr import Hugr

Expand Down
2 changes: 1 addition & 1 deletion tests/hugr/test_ports.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from guppy.error import UndefinedPort, InternalGuppyError
from guppy.types import BoolType
from guppy.gtypes import BoolType


def test_undefined_port():
Expand Down

0 comments on commit ab599bc

Please sign in to comment.