Skip to content

Commit

Permalink
Merge pull request #4277 from neutrinoceros/typ_warnings
Browse files Browse the repository at this point in the history
TYP: fix mypy warnings about unchecked hints
  • Loading branch information
matthewturk authored Dec 30, 2022
2 parents 5d08a39 + 63e29db commit 9725a7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions yt/data_objects/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions yt/data_objects/static_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9725a7d

Please sign in to comment.