Skip to content

Commit

Permalink
RFC: avoid importing enum as a namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Jan 9, 2025
1 parent fbe1799 commit a3c5346
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/gpgi/_data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from __future__ import annotations

import enum
import sys
import warnings
from contextlib import AbstractContextManager, nullcontext
from copy import deepcopy
from enum import Enum, auto
from functools import cached_property, partial, reduce
from textwrap import indent
from threading import Lock
Expand Down Expand Up @@ -53,10 +53,10 @@
BoundarySpec = tuple[tuple[str, str, str], ...]


class DepositionMethod(enum.Enum):
NEAREST_GRID_POINT = enum.auto()
CLOUD_IN_CELL = enum.auto()
TRIANGULAR_SHAPED_CLOUD = enum.auto()
class DepositionMethod(Enum):
NEAREST_GRID_POINT = auto()
CLOUD_IN_CELL = auto()
TRIANGULAR_SHAPED_CLOUD = auto()


_deposition_method_names: dict[str, DepositionMethod] = {
Expand Down
14 changes: 7 additions & 7 deletions src/gpgi/_spatial_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import enum
import math
from dataclasses import dataclass
from enum import StrEnum, auto
from itertools import chain
from typing import Any, Protocol, TypeVar, assert_never, final

Expand All @@ -10,12 +10,12 @@
from gpgi._typing import FieldMap, Name, Real


class Geometry(enum.StrEnum):
CARTESIAN = enum.auto()
POLAR = enum.auto()
CYLINDRICAL = enum.auto()
SPHERICAL = enum.auto()
EQUATORIAL = enum.auto()
class Geometry(StrEnum):
CARTESIAN = auto()
POLAR = auto()
CYLINDRICAL = auto()
SPHERICAL = auto()
EQUATORIAL = auto()


_AXES_LIMITS: dict[Name, tuple[float, float]] = {
Expand Down

0 comments on commit a3c5346

Please sign in to comment.