diff --git a/yt/data_objects/data_containers.py b/yt/data_objects/data_containers.py index 69b3ccf1673..fd76f63fe63 100644 --- a/yt/data_objects/data_containers.py +++ b/yt/data_objects/data_containers.py @@ -2,7 +2,7 @@ import weakref from collections import defaultdict from contextlib import contextmanager -from typing import TYPE_CHECKING, List, Tuple +from typing import TYPE_CHECKING, List, Optional, Tuple import numpy as np @@ -76,7 +76,7 @@ class YTDataContainer(abc.ABC): _index = None _key_fields: List[str] - def __init__(self, ds, field_parameters): + def __init__(self, ds: Optional["Dataset"], field_parameters) -> None: """ Typically this is never called directly, but only due to inheritance. It associates a :class:`~yt.data_objects.static_output.Dataset` with the class, diff --git a/yt/data_objects/static_output.py b/yt/data_objects/static_output.py index 4b126ba1908..795864435e9 100644 --- a/yt/data_objects/static_output.py +++ b/yt/data_objects/static_output.py @@ -28,7 +28,7 @@ import numpy as np from more_itertools import unzip from sympy import Symbol -from unyt import Unit, unyt_quantity +from unyt import Unit, UnitSystem, unyt_quantity from unyt.exceptions import UnitConversionError, UnitParseError from yt._maintenance.deprecation import issue_deprecation_warning @@ -1263,7 +1263,7 @@ def _assign_unit_system( self._unit_system_name: str = unit_system - self.unit_system = us + self.unit_system: UnitSystem = us self.unit_registry.unit_system = self.unit_system @property