Skip to content
This repository was archived by the owner on Jul 18, 2022. It is now read-only.

Commit 0ce0509

Browse files
committed
Fix mypy type checking errors
These are due to the bug at python/mypy#4975.
1 parent ac9ee12 commit 0ce0509

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎phantomsetup/eos.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The type ignore comments are due to the following bug:
2+
# https://github.com/python/mypy/issues/4975
3+
14
from typing import Any, Dict
25

36
from . import defaults
@@ -59,16 +62,16 @@ def __init__(self, ieos: int = None, **kwargs) -> None:
5962
key: None for key in ('polyk', 'gamma', 'qfacdisc')
6063
}
6164

62-
for parameter in self._parameters:
63-
if ieos in ieos_has[parameter]:
65+
for parameter in self._parameters.keys():
66+
if ieos in ieos_has[parameter]: # type: ignore
6467
if parameter == 'polyk':
6568
self._parameters[parameter] = 2 / 3 * defaults.header['RK2']
6669
else:
6770
self._parameters[parameter] = defaults.header[parameter]
6871

6972
for parameter in self._parameters:
7073
if parameter in kwargs:
71-
if ieos not in ieos_has[parameter]:
74+
if ieos not in ieos_has[parameter]: # type: ignore
7275
raise ValueError(f'Cannot set {parameter} for ieos={ieos}')
7376
else:
7477
self._parameters[parameter] = kwargs[parameter]
@@ -98,7 +101,7 @@ def gamma(self) -> float:
98101

99102
@gamma.setter
100103
def gamma(self, value: float) -> None:
101-
if self.ieos not in ieos_has['gamma']:
104+
if self.ieos not in ieos_has['gamma']: # type: ignore
102105
raise ValueError(f'ieos={self.ieos} not compatible with setting gamma')
103106
self._gamma = value
104107

@@ -113,6 +116,6 @@ def qfacdisc(self) -> float:
113116

114117
@qfacdisc.setter
115118
def qfacdisc(self, value: float) -> None:
116-
if self.ieos not in ieos_has['qfacdisc']:
119+
if self.ieos not in ieos_has['qfacdisc']: # type: ignore
117120
raise ValueError(f'ieos={self.ieos} not compatible with setting qfacdisc')
118121
self._qfacdisc = value

0 commit comments

Comments
 (0)