diff --git a/src/py21cmemu/config.py b/src/py21cmemu/config.py index de55195..c021509 100644 --- a/src/py21cmemu/config.py +++ b/src/py21cmemu/config.py @@ -80,15 +80,15 @@ def __str__(self) -> str: """Get the string representation of the config file.""" return str(self.config) - def keys(self) -> Generator[str, None, None]: + def keys(self) -> Generator[str]: """Yield the keys in the config file.""" yield from self.config.keys() - def values(self) -> Generator[Any, None, None]: + def values(self) -> Generator[Any]: """Yield the values in the config file.""" yield from self.config.values() - def items(self) -> Generator[tuple[str, Any], None, None]: + def items(self) -> Generator[tuple[str, Any]]: """Yield the keys and values of the main data products, like a dict.""" yield from self.config.items() @@ -98,7 +98,7 @@ def update(self, **kw) -> None: self.config_file.write_text(toml.dumps(self.config)) @contextmanager - def use(self, **kw) -> Generator[None, None, None]: + def use(self, **kw) -> Generator[None]: """Use configuration values temporarily.""" old = {k: self[k] for k in kw} self.update(**kw) diff --git a/src/py21cmemu/outputs.py b/src/py21cmemu/outputs.py index 4856f10..aa51049 100644 --- a/src/py21cmemu/outputs.py +++ b/src/py21cmemu/outputs.py @@ -16,12 +16,12 @@ class EmulatorOutput: """A simple class that makes it easier to access the corrected emulator output.""" - def keys(self) -> Generator[str, None, None]: + def keys(self) -> Generator[str]: """Yield the keys of the main data products.""" for k in dc.fields(self): yield k.name - def items(self) -> Generator[tuple[str, np.ndarray], None, None]: + def items(self) -> Generator[tuple[str, np.ndarray]]: """Yield the keys and values of the main data products, like a dict.""" for k in self.keys(): yield k, getattr(self, k)